From db8e01a37dd516bb8b26b02d8a160f1bce9ea132 Mon Sep 17 00:00:00 2001 From: chrizmc Date: Thu, 23 May 2024 14:35:51 +0200 Subject: [PATCH 01/48] Add basis directory structure with readme files Signed-off-by: chrizmc --- cdsp/information-layer/README.md | 1 + cdsp/information-layer/db-router/README.md | 1 + cdsp/information-layer/iotdb/README.md | 1 + cdsp/information-layer/realmdb/README.md | 1 + cdsp/knowledge-layer/README.md | 1 + cdsp/knowledge-layer/knowledge-connector/README.md | 1 + .../knowledge-connector/json-rdf-convertor/README.md | 1 + .../knowledge-connector/json-rdf-convertor/json-writer/README.md | 1 + .../knowledge-connector/json-rdf-convertor/rdf-writer/README.md | 1 + .../knowledge-connector/json-rdf-convertor/utils/README.md | 1 + .../knowledge-connector/websocket-client/README.md | 1 + cdsp/knowledge-layer/numeric-analyzer/README.md | 1 + cdsp/knowledge-layer/symbolic-reasoner/README.md | 1 + cdsp/knowledge-layer/symbolic-reasoner/examples/README.md | 1 + cdsp/knowledge-layer/symbolic-reasoner/pellet/README.md | 1 + .../symbolic-reasoner/pellet/pellet-adapter/README.md | 1 + .../symbolic-reasoner/pellet/pellet-lib/README.md | 1 + cdsp/knowledge-layer/symbolic-reasoner/rdfox/README.md | 1 + .../symbolic-reasoner/rdfox/rdfox-adapter/README.md | 1 + cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-lib/README.md | 1 + 20 files changed, 20 insertions(+) create mode 100644 cdsp/information-layer/README.md create mode 100644 cdsp/information-layer/db-router/README.md create mode 100644 cdsp/information-layer/iotdb/README.md create mode 100644 cdsp/information-layer/realmdb/README.md create mode 100644 cdsp/knowledge-layer/README.md create mode 100644 cdsp/knowledge-layer/knowledge-connector/README.md create mode 100644 cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/README.md create mode 100644 cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/json-writer/README.md create mode 100644 cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/rdf-writer/README.md create mode 100644 cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/utils/README.md create mode 100644 cdsp/knowledge-layer/knowledge-connector/websocket-client/README.md create mode 100644 cdsp/knowledge-layer/numeric-analyzer/README.md create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/README.md create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/examples/README.md create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/pellet/README.md create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/pellet/pellet-adapter/README.md create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/pellet/pellet-lib/README.md create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/rdfox/README.md create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-adapter/README.md create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-lib/README.md diff --git a/cdsp/information-layer/README.md b/cdsp/information-layer/README.md new file mode 100644 index 0000000..fd9e641 --- /dev/null +++ b/cdsp/information-layer/README.md @@ -0,0 +1 @@ +tbd \ No newline at end of file diff --git a/cdsp/information-layer/db-router/README.md b/cdsp/information-layer/db-router/README.md new file mode 100644 index 0000000..fd9e641 --- /dev/null +++ b/cdsp/information-layer/db-router/README.md @@ -0,0 +1 @@ +tbd \ No newline at end of file diff --git a/cdsp/information-layer/iotdb/README.md b/cdsp/information-layer/iotdb/README.md new file mode 100644 index 0000000..fd9e641 --- /dev/null +++ b/cdsp/information-layer/iotdb/README.md @@ -0,0 +1 @@ +tbd \ No newline at end of file diff --git a/cdsp/information-layer/realmdb/README.md b/cdsp/information-layer/realmdb/README.md new file mode 100644 index 0000000..fd9e641 --- /dev/null +++ b/cdsp/information-layer/realmdb/README.md @@ -0,0 +1 @@ +tbd \ No newline at end of file diff --git a/cdsp/knowledge-layer/README.md b/cdsp/knowledge-layer/README.md new file mode 100644 index 0000000..fd9e641 --- /dev/null +++ b/cdsp/knowledge-layer/README.md @@ -0,0 +1 @@ +tbd \ No newline at end of file diff --git a/cdsp/knowledge-layer/knowledge-connector/README.md b/cdsp/knowledge-layer/knowledge-connector/README.md new file mode 100644 index 0000000..fd9e641 --- /dev/null +++ b/cdsp/knowledge-layer/knowledge-connector/README.md @@ -0,0 +1 @@ +tbd \ No newline at end of file diff --git a/cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/README.md b/cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/README.md new file mode 100644 index 0000000..fd9e641 --- /dev/null +++ b/cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/README.md @@ -0,0 +1 @@ +tbd \ No newline at end of file diff --git a/cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/json-writer/README.md b/cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/json-writer/README.md new file mode 100644 index 0000000..fd9e641 --- /dev/null +++ b/cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/json-writer/README.md @@ -0,0 +1 @@ +tbd \ No newline at end of file diff --git a/cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/rdf-writer/README.md b/cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/rdf-writer/README.md new file mode 100644 index 0000000..fd9e641 --- /dev/null +++ b/cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/rdf-writer/README.md @@ -0,0 +1 @@ +tbd \ No newline at end of file diff --git a/cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/utils/README.md b/cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/utils/README.md new file mode 100644 index 0000000..fd9e641 --- /dev/null +++ b/cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/utils/README.md @@ -0,0 +1 @@ +tbd \ No newline at end of file diff --git a/cdsp/knowledge-layer/knowledge-connector/websocket-client/README.md b/cdsp/knowledge-layer/knowledge-connector/websocket-client/README.md new file mode 100644 index 0000000..fd9e641 --- /dev/null +++ b/cdsp/knowledge-layer/knowledge-connector/websocket-client/README.md @@ -0,0 +1 @@ +tbd \ No newline at end of file diff --git a/cdsp/knowledge-layer/numeric-analyzer/README.md b/cdsp/knowledge-layer/numeric-analyzer/README.md new file mode 100644 index 0000000..fd9e641 --- /dev/null +++ b/cdsp/knowledge-layer/numeric-analyzer/README.md @@ -0,0 +1 @@ +tbd \ No newline at end of file diff --git a/cdsp/knowledge-layer/symbolic-reasoner/README.md b/cdsp/knowledge-layer/symbolic-reasoner/README.md new file mode 100644 index 0000000..fd9e641 --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/README.md @@ -0,0 +1 @@ +tbd \ No newline at end of file diff --git a/cdsp/knowledge-layer/symbolic-reasoner/examples/README.md b/cdsp/knowledge-layer/symbolic-reasoner/examples/README.md new file mode 100644 index 0000000..fd9e641 --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/examples/README.md @@ -0,0 +1 @@ +tbd \ No newline at end of file diff --git a/cdsp/knowledge-layer/symbolic-reasoner/pellet/README.md b/cdsp/knowledge-layer/symbolic-reasoner/pellet/README.md new file mode 100644 index 0000000..fd9e641 --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/pellet/README.md @@ -0,0 +1 @@ +tbd \ No newline at end of file diff --git a/cdsp/knowledge-layer/symbolic-reasoner/pellet/pellet-adapter/README.md b/cdsp/knowledge-layer/symbolic-reasoner/pellet/pellet-adapter/README.md new file mode 100644 index 0000000..fd9e641 --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/pellet/pellet-adapter/README.md @@ -0,0 +1 @@ +tbd \ No newline at end of file diff --git a/cdsp/knowledge-layer/symbolic-reasoner/pellet/pellet-lib/README.md b/cdsp/knowledge-layer/symbolic-reasoner/pellet/pellet-lib/README.md new file mode 100644 index 0000000..fd9e641 --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/pellet/pellet-lib/README.md @@ -0,0 +1 @@ +tbd \ No newline at end of file diff --git a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/README.md b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/README.md new file mode 100644 index 0000000..fd9e641 --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/README.md @@ -0,0 +1 @@ +tbd \ No newline at end of file diff --git a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-adapter/README.md b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-adapter/README.md new file mode 100644 index 0000000..fd9e641 --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-adapter/README.md @@ -0,0 +1 @@ +tbd \ No newline at end of file diff --git a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-lib/README.md b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-lib/README.md new file mode 100644 index 0000000..fd9e641 --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-lib/README.md @@ -0,0 +1 @@ +tbd \ No newline at end of file From 64e06ecb5f9445958b76a5bf9a4cd407850c7aab Mon Sep 17 00:00:00 2001 From: Christian Muehlbauer Date: Wed, 29 May 2024 15:33:03 +0200 Subject: [PATCH 02/48] add basic setup of informationlayer containing basic dbrouter and realmdb-handler including some resdme updates Signed-off-by: Christian Muehlbauer --- cdsp/information-layer/README.md | 53 +++++++++++- cdsp/information-layer/db-router/.gitignore | 9 ++ cdsp/information-layer/db-router/README.md | 8 +- cdsp/information-layer/db-router/package.json | 12 +++ .../db-router/src/websocket-server.js | 28 +++++++ cdsp/information-layer/realmdb/.gitignore | 12 +++ cdsp/information-layer/realmdb/README.md | 35 +++++++- .../realmdb/config/vehicle-config.js | 3 + cdsp/information-layer/realmdb/package.json | 10 +++ .../realmdb/src/realm-handler.js | 84 +++++++++++++++++++ 10 files changed, 251 insertions(+), 3 deletions(-) create mode 100644 cdsp/information-layer/db-router/.gitignore create mode 100644 cdsp/information-layer/db-router/package.json create mode 100644 cdsp/information-layer/db-router/src/websocket-server.js create mode 100644 cdsp/information-layer/realmdb/.gitignore create mode 100644 cdsp/information-layer/realmdb/config/vehicle-config.js create mode 100644 cdsp/information-layer/realmdb/package.json create mode 100644 cdsp/information-layer/realmdb/src/realm-handler.js diff --git a/cdsp/information-layer/README.md b/cdsp/information-layer/README.md index fd9e641..8fca8d8 100644 --- a/cdsp/information-layer/README.md +++ b/cdsp/information-layer/README.md @@ -1 +1,52 @@ -tbd \ No newline at end of file +This directory contains files related to the [Information Layer](https://en.wikipedia.org/wiki/DIKW_pyramid) of the Central Data Service Playground. + +## 1. Information Layer Playground components +- Database-Handlers + - [RealmDB-Handler](realmdb/README.md) + - [IotDB-Handler](iotdb/README.md) +- [Database-Router](db-router/README.md) + + +## 2. Setting up a CDSP Information Layer +Setting up an information layer in the CDSP involves running a [Database-Router](db-router/README.md), which is technically a configurable Websocket server that enables northbound connections for WebSocket clients, such as a [Knowledge Layer Connector](../knowledge-layer/README.md), to read, subscribe, and write data. The WebSocket server is connected to a database, which can be selected before starting the web server. Southbound feeders write data to the database in a predefined semantic format, such as [VSS](https://github.com/COVESA/vehicle_signal_specification). + +### 2.1 Installation of Database-Handler + +Install and configure your database of choice, like described here for [RealmDB](realmdb/README.md) or for [IotDB](iotdb/README.md) + +### 2.2 Installation of Database-Router + +- Install and configure [Database-Router](db-router/README.md) + +## 3. Running "Hello World" example +The Hello World example in our case is quite simple. We feed an updated value for the HVAC ambient air temperature into the database and we check afterwards in the logs if the DB-router creates a Websocket update message for it. +### 3.1 Choose and prepare your Data Feedeer + +Case 1: You choosed Realm as Database: + +- Ensure that in your [ATLAS cloud](https://cloud.mongodb.com/) app there is a vehicle document with an _id: 1234567 in a collection named Vehicles. +- Ensure that this document as well contains VSS data. At the moment only 1 data point is supported, namely Vehicle.Cabin.HVAC.AmbientAirTemperature. Here you can see how the vehicle document within theVehicles should like in ATLAS: +
+_id: 1234567 (Int64)
+Vehicle_Cabin_HVAC_AmbientAirTemperature: 6 (Double)
+
+ +Case 2: You choosed IoTDB as Database: + +- Not yet supported + +### 3.2 Start the Database Router +Start DB-Router by executing in db-router/src directory the command + + + node websocket-server.js + + +### 3.3 Look out for the Websocket Server message in the console +Now you can changed the value of Vehicle_Cabin_HVAC_AmbientAirTemperature in ATLAS cloud to let's say 23. After changing you should immediately see this line in console + + * the value of "Vehicle_Cabin_HVAC_AmbientAirTemperature" changed to 23 + + +### 3.4 Connect your own Websocket Client +Connect your own websocket client by connecting to ws://localhost:8080 \ No newline at end of file diff --git a/cdsp/information-layer/db-router/.gitignore b/cdsp/information-layer/db-router/.gitignore new file mode 100644 index 0000000..eec8018 --- /dev/null +++ b/cdsp/information-layer/db-router/.gitignore @@ -0,0 +1,9 @@ +# MongoDB Realm +mongodb-realm/ + +# Node.js +node_modules/ +package-lock.json + +# MAC +**/.DS_Store \ No newline at end of file diff --git a/cdsp/information-layer/db-router/README.md b/cdsp/information-layer/db-router/README.md index fd9e641..0c249bd 100644 --- a/cdsp/information-layer/db-router/README.md +++ b/cdsp/information-layer/db-router/README.md @@ -1 +1,7 @@ -tbd \ No newline at end of file +With [Database-Router](db-router/README.md) one can configure which database it shall connect to (As this configuration capability is not yet implemented you can skip the configuration step, it's always choosen RealmDB for now) . + +### Installation of DB-Router + +Execute within db-router directory + + npm install \ No newline at end of file diff --git a/cdsp/information-layer/db-router/package.json b/cdsp/information-layer/db-router/package.json new file mode 100644 index 0000000..81e3e89 --- /dev/null +++ b/cdsp/information-layer/db-router/package.json @@ -0,0 +1,12 @@ +{ + "name": "websocket-server", + "version": "1.0.0", + "description": "WebSocket server", + "main": "websocket-server.js", + "scripts": { + "start": "node websocket-server.js" + }, + "dependencies": { + "ws": "^7.4.6" + } +} \ No newline at end of file diff --git a/cdsp/information-layer/db-router/src/websocket-server.js b/cdsp/information-layer/db-router/src/websocket-server.js new file mode 100644 index 0000000..4941238 --- /dev/null +++ b/cdsp/information-layer/db-router/src/websocket-server.js @@ -0,0 +1,28 @@ +const WebSocket = require('ws'); +const { authenticateAndConnectToRealm, onMediaElementChange } = require('../../realmdb/src/realm-handler'); + + +const server = new WebSocket.Server({ port: 8080 }); + +// Define clients array globally +let clients = []; + +server.on('connection', ws => { + console.log('Client connected'); + clients.push(ws); // Add client to the array + + ws.on('close', () => { + console.log('Client disconnected'); + // Remove disconnected client from the array + clients = clients.filter(client => client !== ws); + }); +}); + +const sendMessageToClients = (message) => { + clients.forEach(client => { + client.send(JSON.stringify(message)); + }); +}; + +console.log('Starting authentication and connection to Realm...'); +authenticateAndConnectToRealm(sendMessageToClients, onMediaElementChange); diff --git a/cdsp/information-layer/realmdb/.gitignore b/cdsp/information-layer/realmdb/.gitignore new file mode 100644 index 0000000..4fed37d --- /dev/null +++ b/cdsp/information-layer/realmdb/.gitignore @@ -0,0 +1,12 @@ +# MongoDB Realm +mongodb-realm/ + +# Node.js +node_modules/ +package-lock.json + +# Credentials Config File +config.js + +# MAC +**/.DS_Store \ No newline at end of file diff --git a/cdsp/information-layer/realmdb/README.md b/cdsp/information-layer/realmdb/README.md index fd9e641..d24e906 100644 --- a/cdsp/information-layer/realmdb/README.md +++ b/cdsp/information-layer/realmdb/README.md @@ -1 +1,34 @@ -tbd \ No newline at end of file +This directory contains the RealmDB Handler as Node.js application. As [RealmDB](https://www.mongodb.com/docs/atlas/device-sdks/sdk/node/) is an embedded database, the RealmDB Handler directly embedds the RealmSDK which creates the [RealmDB database](https://github.com/realm/realm-js) file(s) automatically in the working directory during runtime of RealmDB Handler. + +## 1 Installation of RealmDB-Handler + +Execute within realmdb/src directory + + npm install + +## 2 Configuring RealmDB +Before the Database-Router can start the RealmDB Handler without any errors you need to configure the RealmSDK before. + +### 2.1 Create ATLAS Cloud instance +To get APIKey and AppID you need to setup a [ATLAS cloud](https://cloud.mongodb.com/) instance and App Services. There is a free Tier solution (Status as of May 29, 2024) and you will find a lot of documentation in the internet how to set up everything. + +### 2.2 Configuration of RealmDB Handler + +Create a file config.js in the existing realmdb/config directory and add this content: + + + module.exports = {
+ realmAppId: 'your-realm-AppId',
+ realmApiKey: 'your-realm-ApiKey'
+ }; +
+ +> **_IMPORTANT:_** Do not commit this file to github! + + +### 2.3 Configuration of example vehicle +In the already existing file vehicle-config.js you can change the VIN (Vehicle Identification Number) of the example vehicle. The default VIN is 1234567. If you do not want to change it ensure, that in your ATLAS cloud instance there is a vehicle document with an _id: 1234567 in a collection named Vehicles. More infos how to run an example together with ATLAS cloud you can find [here](../readme.md#case-1-you-choosed-realm-as-database). + +## 3 Starting RealmDB-Handler +You do not need to start RealmDB Handler manually. It is started by the DB-Router like described [here](../readme.md#22-installation-of-database-router). + diff --git a/cdsp/information-layer/realmdb/config/vehicle-config.js b/cdsp/information-layer/realmdb/config/vehicle-config.js new file mode 100644 index 0000000..a7777ed --- /dev/null +++ b/cdsp/information-layer/realmdb/config/vehicle-config.js @@ -0,0 +1,3 @@ +module.exports = { + Vin: 1234567 + }; \ No newline at end of file diff --git a/cdsp/information-layer/realmdb/package.json b/cdsp/information-layer/realmdb/package.json new file mode 100644 index 0000000..fb5c9ee --- /dev/null +++ b/cdsp/information-layer/realmdb/package.json @@ -0,0 +1,10 @@ +{ + "name": "realm-handler", + "version": "1.0.0", + "description": "Realm database handler", + "main": "realm-handler.js", + "dependencies": { + "realm": "^12.9.0", + "uuid": "^9.0.1" + } +} diff --git a/cdsp/information-layer/realmdb/src/realm-handler.js b/cdsp/information-layer/realmdb/src/realm-handler.js new file mode 100644 index 0000000..2ebd550 --- /dev/null +++ b/cdsp/information-layer/realmdb/src/realm-handler.js @@ -0,0 +1,84 @@ +const Realm = require('realm'); +const config = require('../config/config'); +const vehicleConfig = require('../config/vehicle-config'); // Import vehicle config file +const { v4: uuidv4 } = require('uuid'); // Importing UUID generator + +const MediaElementSchema = { + primaryKey: '_id', + name: 'Vehicles', + properties: { + _id: 'int', + Vehicle_Cabin_HVAC_AmbientAirTemperature: 'double' + } +}; + +const app = new Realm.App({ id: config.realmAppId }); +const credentials = Realm.Credentials.apiKey(config.realmApiKey); + +const realmConfig = { + schema: [MediaElementSchema], + path: 'myrealm12.realm', + sync: { + user: null, // will be assigned after authentication + flexible: true, + error: error => { + console.error('Realm sync error:', error); + } + } +}; + +const authenticateAndConnectToRealm = async (sendMessageToClients, onMediaElementChange) => { + try { + const user = await app.logIn(credentials); + console.log('Successfully authenticated with Realm'); + + realmConfig.sync.user = user; + const realm = await Realm.open(realmConfig); + console.log('Realm connection established successfully'); + + const MediaElements = realm.objects('Vehicles').subscribe(); + console.log(MediaElements); + + const objectId = vehicleConfig.Vin; // Retrieve objectId from config file + const mediaElement = realm.objectForPrimaryKey('Vehicles', objectId); + console.log(mediaElement); + + // Set WebSocket server ID as the same objectId + const websocketId = String(objectId); + + mediaElement.addListener((mediaElement, changes) => onMediaElementChange(mediaElement, changes, sendMessageToClients, websocketId)); + } catch (error) { + console.error('Failed to authenticate with Realm:', error); + } +}; + +const onMediaElementChange = (mediaElement, changes, sendMessageToClients, websocketId) => { + if (changes.deleted) { + console.log(`MediaElement is deleted: ${changes.deleted}`); + } else { + changes.changedProperties.forEach(prop => { + console.log(`* the value of "${prop}" changed to ${mediaElement[prop]}`); + + // Generate a meaningful UUID for WebSocket response + const uuid = uuidv4(); + + const message = { + type: 'update', + tree: 'VSS', + id: websocketId, // Use the WebSocket server ID + uuid: uuid, // Use generated UUID + dateTime: new Date().toISOString(), + node: { + name: prop, // Sending the property name as node name + value: mediaElement[prop] // Sending the property value as node value + } + }; + sendMessageToClients(message); + }); + } +}; + +module.exports = { + authenticateAndConnectToRealm, + onMediaElementChange +}; From 5ee12fda7408a3bbe522d7cc5337b57cde06e427 Mon Sep 17 00:00:00 2001 From: haonan-qiu Date: Fri, 31 May 2024 12:33:12 +0200 Subject: [PATCH 03/48] add files Signed-off-by: haonan-qiu --- .../json-rdf-convertor/utils/data_structs.h | 74 +++++++++++++++ .../json-rdf-convertor/utils/utils.h | 89 +++++++++++++++++++ 2 files changed, 163 insertions(+) create mode 100644 cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/utils/data_structs.h create mode 100644 cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/utils/utils.h diff --git a/cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/utils/data_structs.h b/cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/utils/data_structs.h new file mode 100644 index 0000000..eb3eeec --- /dev/null +++ b/cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/utils/data_structs.h @@ -0,0 +1,74 @@ +/// +/// @file +/// @copyright Copyright (C) 2017-2023, Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +/// + +#ifndef DATA_STRUCTS_DATA_STRUCTS_H +#define DATA_STRUCTS_DATA_STRUCTS_H + +#include +#include +#include + +struct MessageHeader +{ + std::string id; + std::string type; + std::string tree; + std::string date_time; + std::string timestamp; + std::chrono::duration time_stamp; +}; + +struct Node +{ + std::string name; + std::string date_time; + std::string timestamp; + std::vector values; + std::chrono::duration time_stamp; +}; + +struct Data +{ + MessageHeader header; + std::vector nodes; +}; + +struct DataPoint +{ + std::string name; + std::string value; +}; + +struct InferredResult +{ + std::string entity_id; + std::vector data; +}; + +struct ProgramOptions +{ + std::string map; + std::string output_ttl; + std::string persist_data; + std::string entity_id; + + bool enable_message_log; + bool test_rules; + bool dummy_server; +}; + +struct QueryData +{ + std::string name_one; + std::string name_two; + std::string has_statement; + std::string data_type; + std::string prefix_name_one; + std::string prefix_name_two; + std::string prefix_data_type; + std::string prefix_has_statement; +}; + +#endif // DATA_STRUCTS_DATA_STRUCTS_H diff --git a/cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/utils/utils.h b/cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/utils/utils.h new file mode 100644 index 0000000..f163215 --- /dev/null +++ b/cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/utils/utils.h @@ -0,0 +1,89 @@ +/// +/// @file +/// @copyright Copyright (C) 2017-2023, Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +/// + +#ifndef UTILS_UTILS_H +#define UTILS_UTILS_H + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "data_structs.h" + +namespace utils +{ +namespace parser +{ +Data GetVehicleFeatureDataFromString(const std::string& string_feature); + +void RemoveChars(const char chars_to_remove[], std::string& string); + +void RemoveSubstring(const std::string& to_erase, std::string& string_feature); + +void SubstituteCharacter(std::string& input, char a, char b); + +Json::Value ParseJsonFromStream(const std::string& input_json); + +Json::Value ParseJsonFromString(const std::string& input_json); + +std::string FindDataTypesInJsonStream(const Json::Value& json_value, + const std::string& name_structure, + std::unordered_map& data_types_map); + +std::chrono::duration GetChronoTimeFromDateTime(const std::string& date_time_string); + +std::chrono::duration> GetChronoTimeInMinutesFromTime(const std::string& time_string); + +std::string GetHourPartFromDateTime(const std::string& date_time); + +std::string GetHourPartFromDateTimeAndSum(const std::string& start_time, const std::string& end_time); + +std::vector ParseWhenMultiNode(const Json::Value& nodes); + +Node ParseWhenSingleNode(const Json::Value& node); + +} // namespace parser + +void WriteStringToFile(const std::string& string_to_write); + +std::vector GetCurrentInferenceResultInJsonFormat(const std::vector& result, + const std::string& type, + const std::string& tree, + const std::string& id, + const bool is_test); + +std::vector ConvertCurrentInferenceResultToJson(const std::vector& result, + const std::string& type, + const std::string& tree, + const std::string& id); + +Json::Value GroupMessages(const Json::Value& message_1, const Json::Value& message2); + + +std::string GetIntials(const std::string input_string); + + +template +std::string to_string_with_precision(const T a_value, const int n = 15) +{ + std::ostringstream out; + out.precision(n); + out << std::fixed << a_value; + return out.str(); +} +} // namespace utils + +#endif From 75c0eb34c71df6fa44aabc4368ec40d0e286e1d9 Mon Sep 17 00:00:00 2001 From: Sebastian Schleemilch Date: Thu, 6 Jun 2024 09:15:35 +0200 Subject: [PATCH 04/48] Fixed readme format of config.js Signed-off-by: Sebastian Schleemilch --- cdsp/information-layer/realmdb/README.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/cdsp/information-layer/realmdb/README.md b/cdsp/information-layer/realmdb/README.md index d24e906..7e298c8 100644 --- a/cdsp/information-layer/realmdb/README.md +++ b/cdsp/information-layer/realmdb/README.md @@ -16,13 +16,12 @@ To get APIKey and AppID you need to setup a [ATLAS cloud](https://cloud.mongodb. Create a file config.js in the existing realmdb/config directory and add this content: - - module.exports = {
- realmAppId: 'your-realm-AppId',
- realmApiKey: 'your-realm-ApiKey'
- }; -
- +```js +module.exports = { + realmAppId: 'your-realm-AppId', + realmApiKey: 'your-realm-ApiKey' +}; +``` > **_IMPORTANT:_** Do not commit this file to github! From a77d8a3de2861e87e363eff8d4777c4d2aa21d76 Mon Sep 17 00:00:00 2001 From: Sebastian Schleemilch Date: Thu, 6 Jun 2024 09:24:04 +0200 Subject: [PATCH 05/48] Renamed knowledge-connector -> connector Signed-off-by: Sebastian Schleemilch --- cdsp/knowledge-layer/{knowledge-connector => connector}/README.md | 0 .../json-rdf-convertor/README.md | 0 .../json-rdf-convertor/json-writer/README.md | 0 .../json-rdf-convertor/rdf-writer/README.md | 0 .../json-rdf-convertor/utils/README.md | 0 .../json-rdf-convertor/utils/data_structs.h | 0 .../json-rdf-convertor/utils/utils.h | 0 .../{knowledge-connector => connector}/websocket-client/README.md | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename cdsp/knowledge-layer/{knowledge-connector => connector}/README.md (100%) rename cdsp/knowledge-layer/{knowledge-connector => connector}/json-rdf-convertor/README.md (100%) rename cdsp/knowledge-layer/{knowledge-connector => connector}/json-rdf-convertor/json-writer/README.md (100%) rename cdsp/knowledge-layer/{knowledge-connector => connector}/json-rdf-convertor/rdf-writer/README.md (100%) rename cdsp/knowledge-layer/{knowledge-connector => connector}/json-rdf-convertor/utils/README.md (100%) rename cdsp/knowledge-layer/{knowledge-connector => connector}/json-rdf-convertor/utils/data_structs.h (100%) rename cdsp/knowledge-layer/{knowledge-connector => connector}/json-rdf-convertor/utils/utils.h (100%) rename cdsp/knowledge-layer/{knowledge-connector => connector}/websocket-client/README.md (100%) diff --git a/cdsp/knowledge-layer/knowledge-connector/README.md b/cdsp/knowledge-layer/connector/README.md similarity index 100% rename from cdsp/knowledge-layer/knowledge-connector/README.md rename to cdsp/knowledge-layer/connector/README.md diff --git a/cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/README.md b/cdsp/knowledge-layer/connector/json-rdf-convertor/README.md similarity index 100% rename from cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/README.md rename to cdsp/knowledge-layer/connector/json-rdf-convertor/README.md diff --git a/cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/json-writer/README.md b/cdsp/knowledge-layer/connector/json-rdf-convertor/json-writer/README.md similarity index 100% rename from cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/json-writer/README.md rename to cdsp/knowledge-layer/connector/json-rdf-convertor/json-writer/README.md diff --git a/cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/rdf-writer/README.md b/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/README.md similarity index 100% rename from cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/rdf-writer/README.md rename to cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/README.md diff --git a/cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/utils/README.md b/cdsp/knowledge-layer/connector/json-rdf-convertor/utils/README.md similarity index 100% rename from cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/utils/README.md rename to cdsp/knowledge-layer/connector/json-rdf-convertor/utils/README.md diff --git a/cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/utils/data_structs.h b/cdsp/knowledge-layer/connector/json-rdf-convertor/utils/data_structs.h similarity index 100% rename from cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/utils/data_structs.h rename to cdsp/knowledge-layer/connector/json-rdf-convertor/utils/data_structs.h diff --git a/cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/utils/utils.h b/cdsp/knowledge-layer/connector/json-rdf-convertor/utils/utils.h similarity index 100% rename from cdsp/knowledge-layer/knowledge-connector/json-rdf-convertor/utils/utils.h rename to cdsp/knowledge-layer/connector/json-rdf-convertor/utils/utils.h diff --git a/cdsp/knowledge-layer/knowledge-connector/websocket-client/README.md b/cdsp/knowledge-layer/connector/websocket-client/README.md similarity index 100% rename from cdsp/knowledge-layer/knowledge-connector/websocket-client/README.md rename to cdsp/knowledge-layer/connector/websocket-client/README.md From 327db86851762e4a361f7a61b1f84fc168778c6d Mon Sep 17 00:00:00 2001 From: Sebastian Schleemilch Date: Thu, 6 Jun 2024 09:27:59 +0200 Subject: [PATCH 06/48] Removed dead README link Signed-off-by: Sebastian Schleemilch --- cdsp/information-layer/db-router/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cdsp/information-layer/db-router/README.md b/cdsp/information-layer/db-router/README.md index 0c249bd..048bc17 100644 --- a/cdsp/information-layer/db-router/README.md +++ b/cdsp/information-layer/db-router/README.md @@ -1,7 +1,7 @@ -With [Database-Router](db-router/README.md) one can configure which database it shall connect to (As this configuration capability is not yet implemented you can skip the configuration step, it's always choosen RealmDB for now) . +With this component one can configure which database it shall connect to (As this configuration capability is not yet implemented you can skip the configuration step, it's always choosen RealmDB for now) . ### Installation of DB-Router Execute within db-router directory - npm install \ No newline at end of file + npm install From 69da82d63e7aa60a18d29908e773762f7a01ac9b Mon Sep 17 00:00:00 2001 From: Sebastian Schleemilch Date: Thu, 6 Jun 2024 10:55:30 +0200 Subject: [PATCH 07/48] Fixed README formatting and fixed typos Signed-off-by: Sebastian Schleemilch --- cdsp/information-layer/README.md | 64 ++++++++++++++++---------------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/cdsp/information-layer/README.md b/cdsp/information-layer/README.md index 8fca8d8..e52dfb7 100644 --- a/cdsp/information-layer/README.md +++ b/cdsp/information-layer/README.md @@ -1,52 +1,50 @@ This directory contains files related to the [Information Layer](https://en.wikipedia.org/wiki/DIKW_pyramid) of the Central Data Service Playground. -## 1. Information Layer Playground components -- Database-Handlers - - [RealmDB-Handler](realmdb/README.md) - - [IotDB-Handler](iotdb/README.md) -- [Database-Router](db-router/README.md) +# Information Layer Playground components + - Database-Handlers + - [RealmDB-Handler](realmdb/README.md) + - [IotDB-Handler](iotdb/README.md) + - [Database-Router](db-router/README.md) - -## 2. Setting up a CDSP Information Layer +# Setting up a CDSP Information Layer Setting up an information layer in the CDSP involves running a [Database-Router](db-router/README.md), which is technically a configurable Websocket server that enables northbound connections for WebSocket clients, such as a [Knowledge Layer Connector](../knowledge-layer/README.md), to read, subscribe, and write data. The WebSocket server is connected to a database, which can be selected before starting the web server. Southbound feeders write data to the database in a predefined semantic format, such as [VSS](https://github.com/COVESA/vehicle_signal_specification). -### 2.1 Installation of Database-Handler - +## Installation of Database-Handler Install and configure your database of choice, like described here for [RealmDB](realmdb/README.md) or for [IotDB](iotdb/README.md) - -### 2.2 Installation of Database-Router + +## [Installation of Database-Router](./db-router/README.md) -- Install and configure [Database-Router](db-router/README.md) +# Running "Hello World" example -## 3. Running "Hello World" example The Hello World example in our case is quite simple. We feed an updated value for the HVAC ambient air temperature into the database and we check afterwards in the logs if the DB-router creates a Websocket update message for it. -### 3.1 Choose and prepare your Data Feedeer -Case 1: You choosed Realm as Database: +## Choose and prepare your Database -- Ensure that in your [ATLAS cloud](https://cloud.mongodb.com/) app there is a vehicle document with an _id: 1234567 in a collection named Vehicles. -- Ensure that this document as well contains VSS data. At the moment only 1 data point is supported, namely Vehicle.Cabin.HVAC.AmbientAirTemperature. Here you can see how the vehicle document within theVehicles should like in ATLAS: -
-_id: 1234567 (Int64)
-Vehicle_Cabin_HVAC_AmbientAirTemperature: 6 (Double)
-
+### Realm +- Ensure that in your [ATLAS cloud](https://cloud.mongodb.com/) app there is a vehicle *document* with an `_id: 1234567` in a collection named *Vehicles*. +- Ensure that this document as well contains VSS data. At the moment only 1 data point is supported, namely `Vehicle.Cabin.HVAC.AmbientAirTemperature`. Here you can see how the vehicle document within the *Vehicles* should look like in ATLAS: -Case 2: You choosed IoTDB as Database: + ``` + _id: 1234567 (Int64) + Vehicle_Cabin_HVAC_AmbientAirTemperature: 6 (Double) + ``` +### IoTDB - Not yet supported -### 3.2 Start the Database Router -Start DB-Router by executing in db-router/src directory the command - - - node websocket-server.js - +## Start the Database Router +Start DB-Router by executing in `db-router/src` directory the command -### 3.3 Look out for the Websocket Server message in the console -Now you can changed the value of Vehicle_Cabin_HVAC_AmbientAirTemperature in ATLAS cloud to let's say 23. After changing you should immediately see this line in console +```bash +node websocket-server.js +``` - * the value of "Vehicle_Cabin_HVAC_AmbientAirTemperature" changed to 23 +## Look out for the Websocket Server message in the console +Now you can changed the value of *Vehicle_Cabin_HVAC_AmbientAirTemperature* in ATLAS cloud to let's say `23`. After changing you should immediately see this line in console: +``` +the value of "Vehicle_Cabin_HVAC_AmbientAirTemperature" changed to 23 +``` -### 3.4 Connect your own Websocket Client -Connect your own websocket client by connecting to ws://localhost:8080 \ No newline at end of file +## Connect your own Websocket Client +Connect your own websocket client by connecting to `ws://localhost:8080` From 9bb7dc48bc9cf164c9415f2650cf714edef556f9 Mon Sep 17 00:00:00 2001 From: Sebastian Schleemilch Date: Thu, 6 Jun 2024 11:19:18 +0200 Subject: [PATCH 08/48] Updated docs, added config.js Signed-off-by: Sebastian Schleemilch --- cdsp/information-layer/db-router/README.md | 10 +++-- cdsp/information-layer/db-router/package.json | 2 +- .../db-router/src/websocket-server.js | 24 ++++++------ cdsp/information-layer/realmdb/.gitignore | 2 +- cdsp/information-layer/realmdb/README.md | 38 +++++++++++-------- .../realmdb/config/vehicle-config.js | 5 ++- 6 files changed, 47 insertions(+), 34 deletions(-) diff --git a/cdsp/information-layer/db-router/README.md b/cdsp/information-layer/db-router/README.md index 048bc17..8571f68 100644 --- a/cdsp/information-layer/db-router/README.md +++ b/cdsp/information-layer/db-router/README.md @@ -1,7 +1,9 @@ -With this component one can configure which database it shall connect to (As this configuration capability is not yet implemented you can skip the configuration step, it's always choosen RealmDB for now) . +With this component one can configure which database it shall connect to *(As this configuration capability is not yet implemented you can skip the configuration step, it's always choosen RealmDB for now)*. -### Installation of DB-Router +# Installation -Execute within db-router directory +Execute within `db-router` directory: - npm install +```bash +npm install +``` diff --git a/cdsp/information-layer/db-router/package.json b/cdsp/information-layer/db-router/package.json index 81e3e89..7fbc984 100644 --- a/cdsp/information-layer/db-router/package.json +++ b/cdsp/information-layer/db-router/package.json @@ -9,4 +9,4 @@ "dependencies": { "ws": "^7.4.6" } -} \ No newline at end of file +} diff --git a/cdsp/information-layer/db-router/src/websocket-server.js b/cdsp/information-layer/db-router/src/websocket-server.js index 4941238..d9794b8 100644 --- a/cdsp/information-layer/db-router/src/websocket-server.js +++ b/cdsp/information-layer/db-router/src/websocket-server.js @@ -1,28 +1,30 @@ -const WebSocket = require('ws'); -const { authenticateAndConnectToRealm, onMediaElementChange } = require('../../realmdb/src/realm-handler'); - +const WebSocket = require("ws"); +const { + authenticateAndConnectToRealm, + onMediaElementChange, +} = require("../../realmdb/src/realm-handler"); const server = new WebSocket.Server({ port: 8080 }); // Define clients array globally let clients = []; -server.on('connection', ws => { - console.log('Client connected'); +server.on("connection", (ws) => { + console.log("Client connected"); clients.push(ws); // Add client to the array - - ws.on('close', () => { - console.log('Client disconnected'); + + ws.on("close", () => { + console.log("Client disconnected"); // Remove disconnected client from the array - clients = clients.filter(client => client !== ws); + clients = clients.filter((client) => client !== ws); }); }); const sendMessageToClients = (message) => { - clients.forEach(client => { + clients.forEach((client) => { client.send(JSON.stringify(message)); }); }; -console.log('Starting authentication and connection to Realm...'); +console.log("Starting authentication and connection to Realm..."); authenticateAndConnectToRealm(sendMessageToClients, onMediaElementChange); diff --git a/cdsp/information-layer/realmdb/.gitignore b/cdsp/information-layer/realmdb/.gitignore index 4fed37d..7652e67 100644 --- a/cdsp/information-layer/realmdb/.gitignore +++ b/cdsp/information-layer/realmdb/.gitignore @@ -9,4 +9,4 @@ package-lock.json config.js # MAC -**/.DS_Store \ No newline at end of file +**/.DS_Store diff --git a/cdsp/information-layer/realmdb/README.md b/cdsp/information-layer/realmdb/README.md index 7e298c8..733c2bc 100644 --- a/cdsp/information-layer/realmdb/README.md +++ b/cdsp/information-layer/realmdb/README.md @@ -1,33 +1,41 @@ This directory contains the RealmDB Handler as Node.js application. As [RealmDB](https://www.mongodb.com/docs/atlas/device-sdks/sdk/node/) is an embedded database, the RealmDB Handler directly embedds the RealmSDK which creates the [RealmDB database](https://github.com/realm/realm-js) file(s) automatically in the working directory during runtime of RealmDB Handler. -## 1 Installation of RealmDB-Handler +# Installation -Execute within realmdb/src directory +Execute within `realmdb` directory - npm install +```bash +npm install +``` + +# Configure RealmDB + +Before the Database-Router can start the RealmDB Handler without any errors you need to configure the RealmSDK before. -## 2 Configuring RealmDB -Before the Database-Router can start the RealmDB Handler without any errors you need to configure the RealmSDK before. +## Create a ATLAS Cloud instance -### 2.1 Create ATLAS Cloud instance To get APIKey and AppID you need to setup a [ATLAS cloud](https://cloud.mongodb.com/) instance and App Services. There is a free Tier solution (Status as of May 29, 2024) and you will find a lot of documentation in the internet how to set up everything. -### 2.2 Configuration of RealmDB Handler +## Configure of a RealmDB Handler -Create a file config.js in the existing realmdb/config directory and add this content: +Create `config/config.js` with the following format, replacing the app id and the api key with yours. ```js module.exports = { - realmAppId: 'your-realm-AppId', - realmApiKey: 'your-realm-ApiKey' + realmAppId: "your-realm-AppId", + realmApiKey: "your-realm-ApiKey", }; ``` -> **_IMPORTANT:_** Do not commit this file to github! +> **_IMPORTANT:_** Do not commit this file to github! -### 2.3 Configuration of example vehicle -In the already existing file vehicle-config.js you can change the VIN (Vehicle Identification Number) of the example vehicle. The default VIN is 1234567. If you do not want to change it ensure, that in your ATLAS cloud instance there is a vehicle document with an _id: 1234567 in a collection named Vehicles. More infos how to run an example together with ATLAS cloud you can find [here](../readme.md#case-1-you-choosed-realm-as-database). +## Configure an example vehicle -## 3 Starting RealmDB-Handler -You do not need to start RealmDB Handler manually. It is started by the DB-Router like described [here](../readme.md#22-installation-of-database-router). +Change the VIN (Vehicle Identification Number) of the example vehicle in [vehicle-config](./config/vehicle-config.js). +The default VIN is `1234567`. +If you do not want to change it ensure, that in your ATLAS cloud instance there is a vehicle _document_ with an `_id: 1234567` in a collection named `Vehicles`. +More infos how to run an example together with ATLAS cloud you can find [here](../readme.md#case-1-you-choosed-realm-as-database). + +## Starting the RealmDB handler +You do not need to start RealmDB Handler manually. It is started by the DB-Router like described [here](../readme.md#22-installation-of-database-router). diff --git a/cdsp/information-layer/realmdb/config/vehicle-config.js b/cdsp/information-layer/realmdb/config/vehicle-config.js index a7777ed..c469fca 100644 --- a/cdsp/information-layer/realmdb/config/vehicle-config.js +++ b/cdsp/information-layer/realmdb/config/vehicle-config.js @@ -1,3 +1,4 @@ module.exports = { - Vin: 1234567 - }; \ No newline at end of file + Vin: 1234567, +}; + From e0d7aa66025649d2fd3b08e6b5d87509ed55f7c4 Mon Sep 17 00:00:00 2001 From: Sebastian Schleemilch Date: Thu, 6 Jun 2024 12:45:03 +0200 Subject: [PATCH 09/48] Added handlers layer Signed-off-by: Sebastian Schleemilch --- cdsp/information-layer/README.md | 15 +++++++-------- cdsp/information-layer/handlers/README.md | 4 ++++ .../{ => handlers}/iotdb/README.md | 0 .../{ => handlers}/realmdb/.gitignore | 0 .../{ => handlers}/realmdb/README.md | 0 .../realmdb/config/vehicle-config.js | 0 .../{ => handlers}/realmdb/package.json | 0 .../{ => handlers}/realmdb/src/realm-handler.js | 0 .../{db-router => router}/.gitignore | 0 .../{db-router => router}/README.md | 2 +- .../{db-router => router}/package.json | 0 .../{db-router => router}/src/websocket-server.js | 0 12 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 cdsp/information-layer/handlers/README.md rename cdsp/information-layer/{ => handlers}/iotdb/README.md (100%) rename cdsp/information-layer/{ => handlers}/realmdb/.gitignore (100%) rename cdsp/information-layer/{ => handlers}/realmdb/README.md (100%) rename cdsp/information-layer/{ => handlers}/realmdb/config/vehicle-config.js (100%) rename cdsp/information-layer/{ => handlers}/realmdb/package.json (100%) rename cdsp/information-layer/{ => handlers}/realmdb/src/realm-handler.js (100%) rename cdsp/information-layer/{db-router => router}/.gitignore (100%) rename cdsp/information-layer/{db-router => router}/README.md (86%) rename cdsp/information-layer/{db-router => router}/package.json (100%) rename cdsp/information-layer/{db-router => router}/src/websocket-server.js (100%) diff --git a/cdsp/information-layer/README.md b/cdsp/information-layer/README.md index e52dfb7..3a78868 100644 --- a/cdsp/information-layer/README.md +++ b/cdsp/information-layer/README.md @@ -1,18 +1,17 @@ This directory contains files related to the [Information Layer](https://en.wikipedia.org/wiki/DIKW_pyramid) of the Central Data Service Playground. # Information Layer Playground components - - Database-Handlers - - [RealmDB-Handler](realmdb/README.md) - - [IotDB-Handler](iotdb/README.md) - - [Database-Router](db-router/README.md) + - [Database-Handlers](./handlers) + - [Database-Router](./router) # Setting up a CDSP Information Layer -Setting up an information layer in the CDSP involves running a [Database-Router](db-router/README.md), which is technically a configurable Websocket server that enables northbound connections for WebSocket clients, such as a [Knowledge Layer Connector](../knowledge-layer/README.md), to read, subscribe, and write data. The WebSocket server is connected to a database, which can be selected before starting the web server. Southbound feeders write data to the database in a predefined semantic format, such as [VSS](https://github.com/COVESA/vehicle_signal_specification). +Setting up an information layer in the CDSP involves running a [Database-Router](./router), which is technically a configurable Websocket server that enables northbound connections for WebSocket clients, such as a [Knowledge Layer Connector](../knowledge-layer/README.md), to read, subscribe, and write data. The WebSocket server is connected to a database, which can be selected before starting the web server. Southbound feeders write data to the database in a predefined semantic format, such as [VSS](https://github.com/COVESA/vehicle_signal_specification). ## Installation of Database-Handler -Install and configure your database of choice, like described here for [RealmDB](realmdb/README.md) or for [IotDB](iotdb/README.md) + +Please follow installation instructions of the chosen [handler](./handlers/) -## [Installation of Database-Router](./db-router/README.md) +## [Installation of Database-Router](./router) # Running "Hello World" example @@ -33,7 +32,7 @@ The Hello World example in our case is quite simple. We feed an updated value fo - Not yet supported ## Start the Database Router -Start DB-Router by executing in `db-router/src` directory the command +Start router by executing in [router src](./router/src/) directory the command: ```bash node websocket-server.js diff --git a/cdsp/information-layer/handlers/README.md b/cdsp/information-layer/handlers/README.md new file mode 100644 index 0000000..cb4711b --- /dev/null +++ b/cdsp/information-layer/handlers/README.md @@ -0,0 +1,4 @@ +# Handlers + +- [IotDB](./iotdb) +- [RealmDB](./realmdb) diff --git a/cdsp/information-layer/iotdb/README.md b/cdsp/information-layer/handlers/iotdb/README.md similarity index 100% rename from cdsp/information-layer/iotdb/README.md rename to cdsp/information-layer/handlers/iotdb/README.md diff --git a/cdsp/information-layer/realmdb/.gitignore b/cdsp/information-layer/handlers/realmdb/.gitignore similarity index 100% rename from cdsp/information-layer/realmdb/.gitignore rename to cdsp/information-layer/handlers/realmdb/.gitignore diff --git a/cdsp/information-layer/realmdb/README.md b/cdsp/information-layer/handlers/realmdb/README.md similarity index 100% rename from cdsp/information-layer/realmdb/README.md rename to cdsp/information-layer/handlers/realmdb/README.md diff --git a/cdsp/information-layer/realmdb/config/vehicle-config.js b/cdsp/information-layer/handlers/realmdb/config/vehicle-config.js similarity index 100% rename from cdsp/information-layer/realmdb/config/vehicle-config.js rename to cdsp/information-layer/handlers/realmdb/config/vehicle-config.js diff --git a/cdsp/information-layer/realmdb/package.json b/cdsp/information-layer/handlers/realmdb/package.json similarity index 100% rename from cdsp/information-layer/realmdb/package.json rename to cdsp/information-layer/handlers/realmdb/package.json diff --git a/cdsp/information-layer/realmdb/src/realm-handler.js b/cdsp/information-layer/handlers/realmdb/src/realm-handler.js similarity index 100% rename from cdsp/information-layer/realmdb/src/realm-handler.js rename to cdsp/information-layer/handlers/realmdb/src/realm-handler.js diff --git a/cdsp/information-layer/db-router/.gitignore b/cdsp/information-layer/router/.gitignore similarity index 100% rename from cdsp/information-layer/db-router/.gitignore rename to cdsp/information-layer/router/.gitignore diff --git a/cdsp/information-layer/db-router/README.md b/cdsp/information-layer/router/README.md similarity index 86% rename from cdsp/information-layer/db-router/README.md rename to cdsp/information-layer/router/README.md index 8571f68..bc06681 100644 --- a/cdsp/information-layer/db-router/README.md +++ b/cdsp/information-layer/router/README.md @@ -2,7 +2,7 @@ With this component one can configure which database it shall connect to *(As th # Installation -Execute within `db-router` directory: +Execute in this directory: ```bash npm install diff --git a/cdsp/information-layer/db-router/package.json b/cdsp/information-layer/router/package.json similarity index 100% rename from cdsp/information-layer/db-router/package.json rename to cdsp/information-layer/router/package.json diff --git a/cdsp/information-layer/db-router/src/websocket-server.js b/cdsp/information-layer/router/src/websocket-server.js similarity index 100% rename from cdsp/information-layer/db-router/src/websocket-server.js rename to cdsp/information-layer/router/src/websocket-server.js From 9722e2b07ff290ee8e76df66b82897f780b7b2cb Mon Sep 17 00:00:00 2001 From: Sebastian Schleemilch Date: Thu, 6 Jun 2024 13:00:28 +0200 Subject: [PATCH 10/48] Hint for hard coded realmdb and js formatting Signed-off-by: Sebastian Schleemilch --- cdsp/information-layer/README.md | 11 +-- .../handlers/realmdb/src/realm-handler.js | 73 +++++++++++-------- cdsp/information-layer/router/README.md | 15 +++- 3 files changed, 60 insertions(+), 39 deletions(-) diff --git a/cdsp/information-layer/README.md b/cdsp/information-layer/README.md index 3a78868..fa1677a 100644 --- a/cdsp/information-layer/README.md +++ b/cdsp/information-layer/README.md @@ -11,7 +11,7 @@ Setting up an information layer in the CDSP involves running a [Database-Router] Please follow installation instructions of the chosen [handler](./handlers/) -## [Installation of Database-Router](./router) +## [Installation of Database-Router](./router/README.md#Install) # Running "Hello World" example @@ -31,15 +31,10 @@ The Hello World example in our case is quite simple. We feed an updated value fo ### IoTDB - Not yet supported -## Start the Database Router -Start router by executing in [router src](./router/src/) directory the command: - -```bash -node websocket-server.js -``` +## [Start](./router/README.md#Run) the Database Router ## Look out for the Websocket Server message in the console -Now you can changed the value of *Vehicle_Cabin_HVAC_AmbientAirTemperature* in ATLAS cloud to let's say `23`. After changing you should immediately see this line in console: +Now you can changed the value of `Vehicle_Cabin_HVAC_AmbientAirTemperature` in ATLAS cloud to let's say `23`. After changing you should immediately see this line in console: ``` the value of "Vehicle_Cabin_HVAC_AmbientAirTemperature" changed to 23 diff --git a/cdsp/information-layer/handlers/realmdb/src/realm-handler.js b/cdsp/information-layer/handlers/realmdb/src/realm-handler.js index 2ebd550..b4c41d5 100644 --- a/cdsp/information-layer/handlers/realmdb/src/realm-handler.js +++ b/cdsp/information-layer/handlers/realmdb/src/realm-handler.js @@ -1,15 +1,15 @@ -const Realm = require('realm'); -const config = require('../config/config'); -const vehicleConfig = require('../config/vehicle-config'); // Import vehicle config file -const { v4: uuidv4 } = require('uuid'); // Importing UUID generator +const Realm = require("realm"); +const config = require("../config/config"); +const vehicleConfig = require("../config/vehicle-config"); // Import vehicle config file +const { v4: uuidv4 } = require("uuid"); // Importing UUID generator const MediaElementSchema = { - primaryKey: '_id', - name: 'Vehicles', + primaryKey: "_id", + name: "Vehicles", properties: { - _id: 'int', - Vehicle_Cabin_HVAC_AmbientAirTemperature: 'double' - } + _id: "int", + Vehicle_Cabin_HVAC_AmbientAirTemperature: "double", + }, }; const app = new Realm.App({ id: config.realmAppId }); @@ -17,61 +17,76 @@ const credentials = Realm.Credentials.apiKey(config.realmApiKey); const realmConfig = { schema: [MediaElementSchema], - path: 'myrealm12.realm', + path: "myrealm12.realm", sync: { user: null, // will be assigned after authentication flexible: true, - error: error => { - console.error('Realm sync error:', error); - } - } + error: (error) => { + console.error("Realm sync error:", error); + }, + }, }; -const authenticateAndConnectToRealm = async (sendMessageToClients, onMediaElementChange) => { +const authenticateAndConnectToRealm = async ( + sendMessageToClients, + onMediaElementChange, +) => { try { const user = await app.logIn(credentials); - console.log('Successfully authenticated with Realm'); + console.log("Successfully authenticated with Realm"); realmConfig.sync.user = user; const realm = await Realm.open(realmConfig); - console.log('Realm connection established successfully'); + console.log("Realm connection established successfully"); - const MediaElements = realm.objects('Vehicles').subscribe(); + const MediaElements = realm.objects("Vehicles").subscribe(); console.log(MediaElements); const objectId = vehicleConfig.Vin; // Retrieve objectId from config file - const mediaElement = realm.objectForPrimaryKey('Vehicles', objectId); + const mediaElement = realm.objectForPrimaryKey("Vehicles", objectId); console.log(mediaElement); // Set WebSocket server ID as the same objectId const websocketId = String(objectId); - mediaElement.addListener((mediaElement, changes) => onMediaElementChange(mediaElement, changes, sendMessageToClients, websocketId)); + mediaElement.addListener((mediaElement, changes) => + onMediaElementChange( + mediaElement, + changes, + sendMessageToClients, + websocketId, + ), + ); } catch (error) { - console.error('Failed to authenticate with Realm:', error); + console.error("Failed to authenticate with Realm:", error); } }; -const onMediaElementChange = (mediaElement, changes, sendMessageToClients, websocketId) => { +const onMediaElementChange = ( + mediaElement, + changes, + sendMessageToClients, + websocketId, +) => { if (changes.deleted) { console.log(`MediaElement is deleted: ${changes.deleted}`); } else { - changes.changedProperties.forEach(prop => { + changes.changedProperties.forEach((prop) => { console.log(`* the value of "${prop}" changed to ${mediaElement[prop]}`); - + // Generate a meaningful UUID for WebSocket response const uuid = uuidv4(); const message = { - type: 'update', - tree: 'VSS', + type: "update", + tree: "VSS", id: websocketId, // Use the WebSocket server ID uuid: uuid, // Use generated UUID dateTime: new Date().toISOString(), node: { name: prop, // Sending the property name as node name - value: mediaElement[prop] // Sending the property value as node value - } + value: mediaElement[prop], // Sending the property value as node value + }, }; sendMessageToClients(message); }); @@ -80,5 +95,5 @@ const onMediaElementChange = (mediaElement, changes, sendMessageToClients, webso module.exports = { authenticateAndConnectToRealm, - onMediaElementChange + onMediaElementChange, }; diff --git a/cdsp/information-layer/router/README.md b/cdsp/information-layer/router/README.md index bc06681..d9b9032 100644 --- a/cdsp/information-layer/router/README.md +++ b/cdsp/information-layer/router/README.md @@ -1,9 +1,20 @@ -With this component one can configure which database it shall connect to *(As this configuration capability is not yet implemented you can skip the configuration step, it's always choosen RealmDB for now)*. +With this component one can configure which database it shall connect to. -# Installation +> [!WARNING] +> As the configuration capability is not yet implemented, RealmDB is hard coded as a database! + +# Install Execute in this directory: ```bash npm install ``` + +# Run + +Start router by executing in [src](./src/) directory the command: + +```bash +node websocket-server.js +``` From dbbed43444d2b0b268983a76db153f34ff3eb9d9 Mon Sep 17 00:00:00 2001 From: Sebastian Schleemilch Date: Thu, 6 Jun 2024 14:32:38 +0200 Subject: [PATCH 11/48] Fixed require path for new structure Signed-off-by: Sebastian Schleemilch --- cdsp/information-layer/router/src/websocket-server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdsp/information-layer/router/src/websocket-server.js b/cdsp/information-layer/router/src/websocket-server.js index d9794b8..db057d8 100644 --- a/cdsp/information-layer/router/src/websocket-server.js +++ b/cdsp/information-layer/router/src/websocket-server.js @@ -2,7 +2,7 @@ const WebSocket = require("ws"); const { authenticateAndConnectToRealm, onMediaElementChange, -} = require("../../realmdb/src/realm-handler"); +} = require("../../handlers/realmdb/src/realm-handler"); const server = new WebSocket.Server({ port: 8080 }); From f98ef6f4d5530b7162c9ef8377a854952d580644 Mon Sep 17 00:00:00 2001 From: Christian Muehlbauer Date: Tue, 18 Jun 2024 09:17:43 +0200 Subject: [PATCH 12/48] Added missing dot in readme Signed-off-by: Christian Muehlbauer --- cdsp/information-layer/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdsp/information-layer/README.md b/cdsp/information-layer/README.md index fa1677a..6b146bc 100644 --- a/cdsp/information-layer/README.md +++ b/cdsp/information-layer/README.md @@ -9,7 +9,7 @@ Setting up an information layer in the CDSP involves running a [Database-Router] ## Installation of Database-Handler -Please follow installation instructions of the chosen [handler](./handlers/) +Please follow installation instructions of the chosen [handler](./handlers/). ## [Installation of Database-Router](./router/README.md#Install) From 0da163a4d0f20f8b9d1226a8b61adf386637f3eb Mon Sep 17 00:00:00 2001 From: Christian Muehlbauer Date: Tue, 18 Jun 2024 15:59:28 +0200 Subject: [PATCH 13/48] Fixed wrong readme link Signed-off-by: Christian Muehlbauer --- cdsp/information-layer/handlers/realmdb/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdsp/information-layer/handlers/realmdb/README.md b/cdsp/information-layer/handlers/realmdb/README.md index 733c2bc..07e1a4a 100644 --- a/cdsp/information-layer/handlers/realmdb/README.md +++ b/cdsp/information-layer/handlers/realmdb/README.md @@ -38,4 +38,4 @@ More infos how to run an example together with ATLAS cloud you can find [here](. ## Starting the RealmDB handler -You do not need to start RealmDB Handler manually. It is started by the DB-Router like described [here](../readme.md#22-installation-of-database-router). +You do not need to start RealmDB Handler manually. It is started by the DB-Router like described [here](../../router/README.md#Install). From 0c83de4b601f0d3827da32f4e7c2856d1b29a69f Mon Sep 17 00:00:00 2001 From: Christian Muehlbauer Date: Mon, 8 Jul 2024 10:10:02 +0200 Subject: [PATCH 14/48] add basic router parts Signed-off-by: Christian Muehlbauer --- cdsp/information-layer/handlers/handler.js | 35 +++++ .../handlers/iotdb/src/iotdb-handler.js | 1 + .../handlers/realmdb/package.json | 4 +- .../handlers/realmdb/src/realm-handler.js | 99 ------------- .../handlers/realmdb/src/realmdb_handler.js | 132 ++++++++++++++++++ cdsp/information-layer/router/.gitignore | 1 + .../information-layer/router/config/config.js | 14 ++ .../router/src/websocket-server.js | 46 ++++-- .../router/utils/message_validator.js | 14 ++ 9 files changed, 235 insertions(+), 111 deletions(-) create mode 100644 cdsp/information-layer/handlers/handler.js create mode 100644 cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js delete mode 100644 cdsp/information-layer/handlers/realmdb/src/realm-handler.js create mode 100644 cdsp/information-layer/handlers/realmdb/src/realmdb_handler.js create mode 100644 cdsp/information-layer/router/config/config.js create mode 100644 cdsp/information-layer/router/utils/message_validator.js diff --git a/cdsp/information-layer/handlers/handler.js b/cdsp/information-layer/handlers/handler.js new file mode 100644 index 0000000..f66eaed --- /dev/null +++ b/cdsp/information-layer/handlers/handler.js @@ -0,0 +1,35 @@ +class Handler { + authenticateAndConnect(sendMessageToClients) { + throw new Error("Method 'authenticateAndConnect' must be implemented."); + } + + handleMessage(message, ws) { + switch (message.type) { + case 'read': + this.read(message, ws); + break; + case 'write': + this.write(message, ws); + break; + case 'subscribe': + this.subscribe(message, ws); + break; + default: + ws.send(JSON.stringify({ error: 'Unknown message type'})) + } + } + + read(message, ws) { + throw new Error('Read method not implemented, yet!') + } + + write(message, ws) { + throw new Error('Write method not implemented, yet!') + } + + subscribe(message, ws) { + throw new Error('Subscribe method not implemented, yet!') + } +} + +module.exports = Handler; \ No newline at end of file diff --git a/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js b/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js new file mode 100644 index 0000000..dad4fef --- /dev/null +++ b/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js @@ -0,0 +1 @@ +// TODO: STUB implementation of subscribe, write and read interface methods.g \ No newline at end of file diff --git a/cdsp/information-layer/handlers/realmdb/package.json b/cdsp/information-layer/handlers/realmdb/package.json index fb5c9ee..aac0f2c 100644 --- a/cdsp/information-layer/handlers/realmdb/package.json +++ b/cdsp/information-layer/handlers/realmdb/package.json @@ -1,8 +1,8 @@ { - "name": "realm-handler", + "name": "realmdb_handler", "version": "1.0.0", "description": "Realm database handler", - "main": "realm-handler.js", + "main": "realmdb_handler.js", "dependencies": { "realm": "^12.9.0", "uuid": "^9.0.1" diff --git a/cdsp/information-layer/handlers/realmdb/src/realm-handler.js b/cdsp/information-layer/handlers/realmdb/src/realm-handler.js deleted file mode 100644 index b4c41d5..0000000 --- a/cdsp/information-layer/handlers/realmdb/src/realm-handler.js +++ /dev/null @@ -1,99 +0,0 @@ -const Realm = require("realm"); -const config = require("../config/config"); -const vehicleConfig = require("../config/vehicle-config"); // Import vehicle config file -const { v4: uuidv4 } = require("uuid"); // Importing UUID generator - -const MediaElementSchema = { - primaryKey: "_id", - name: "Vehicles", - properties: { - _id: "int", - Vehicle_Cabin_HVAC_AmbientAirTemperature: "double", - }, -}; - -const app = new Realm.App({ id: config.realmAppId }); -const credentials = Realm.Credentials.apiKey(config.realmApiKey); - -const realmConfig = { - schema: [MediaElementSchema], - path: "myrealm12.realm", - sync: { - user: null, // will be assigned after authentication - flexible: true, - error: (error) => { - console.error("Realm sync error:", error); - }, - }, -}; - -const authenticateAndConnectToRealm = async ( - sendMessageToClients, - onMediaElementChange, -) => { - try { - const user = await app.logIn(credentials); - console.log("Successfully authenticated with Realm"); - - realmConfig.sync.user = user; - const realm = await Realm.open(realmConfig); - console.log("Realm connection established successfully"); - - const MediaElements = realm.objects("Vehicles").subscribe(); - console.log(MediaElements); - - const objectId = vehicleConfig.Vin; // Retrieve objectId from config file - const mediaElement = realm.objectForPrimaryKey("Vehicles", objectId); - console.log(mediaElement); - - // Set WebSocket server ID as the same objectId - const websocketId = String(objectId); - - mediaElement.addListener((mediaElement, changes) => - onMediaElementChange( - mediaElement, - changes, - sendMessageToClients, - websocketId, - ), - ); - } catch (error) { - console.error("Failed to authenticate with Realm:", error); - } -}; - -const onMediaElementChange = ( - mediaElement, - changes, - sendMessageToClients, - websocketId, -) => { - if (changes.deleted) { - console.log(`MediaElement is deleted: ${changes.deleted}`); - } else { - changes.changedProperties.forEach((prop) => { - console.log(`* the value of "${prop}" changed to ${mediaElement[prop]}`); - - // Generate a meaningful UUID for WebSocket response - const uuid = uuidv4(); - - const message = { - type: "update", - tree: "VSS", - id: websocketId, // Use the WebSocket server ID - uuid: uuid, // Use generated UUID - dateTime: new Date().toISOString(), - node: { - name: prop, // Sending the property name as node name - value: mediaElement[prop], // Sending the property value as node value - }, - }; - sendMessageToClients(message); - }); - } -}; - -module.exports = { - authenticateAndConnectToRealm, - onMediaElementChange, -}; diff --git a/cdsp/information-layer/handlers/realmdb/src/realmdb_handler.js b/cdsp/information-layer/handlers/realmdb/src/realmdb_handler.js new file mode 100644 index 0000000..2c1a82f --- /dev/null +++ b/cdsp/information-layer/handlers/realmdb/src/realmdb_handler.js @@ -0,0 +1,132 @@ +const Realm = require("realm"); +const Handler = require('../../handler') +const config = require("../config/config"); +//const vehicleConfig = require("../config/vehicle-config"); // Import vehicle config file +const { v4: uuidv4 } = require("uuid"); // Importing UUID generator + +const MediaElementSchema = { + primaryKey: "_id", + name: "Vehicles", + properties: { + _id: "int", + Vehicle_Cabin_HVAC_AmbientAirTemperature: "double", + }, +}; + +const app = new Realm.App({ id: config.realmAppId }); +const credentials = Realm.Credentials.apiKey(config.realmApiKey); + +const realmConfig = { + schema: [MediaElementSchema], + path: "myrealm12.realm", + sync: { + user: null, // will be assigned after authentication + flexible: true, + error: (error) => { + console.error("Realm sync error:", error); + }, + }, +}; + +class RealmDBHandler extends Handler { + constructor() { + super(); + this.realm = null; + this.sendMessageToClients = null; + } + + async authenticateAndConnect(sendMessageToClients) { + try { + this.sendMessageToClients = sendMessageToClients; + const user = await app.logIn(credentials); + console.log("Successfully authenticated with Realm"); + + realmConfig.sync.user = user; + this.realm = await Realm.open(realmConfig); + console.log("Realm connection established successfully"); + + const MediaElements = this.realm.objects("Vehicles").subscribe(); + console.log(MediaElements); // TODO: Is it necessary to log this? + } catch (error) { + console.error("Failed to authenticate with Realm:", error); + } + } + + async read(message, ws) { + try{ + const objectId = message.data.Vin; // Retrieve objectId from config file + const mediaElement = this.realm.objectForPrimaryKey("Vehicles", objectId); + console.log(mediaElement); + if (mediaElement) { + const response = { + type: "read_response", + data: mediaElement, + }; + ws.send(JSON.stringify(response)); + } else { + ws.send(JSON.stringify({ error: 'Object not found' })); + } + } catch (error) { + console.error("Error reading object from Realm:", error); + ws.send(JSON.stringify({ error: 'Error reading object' })); + } + } + + async write(message, ws) { + // Implement write logic for RealmDB + } + + async subscribe(message, ws) { + const sendMessageToClient = (message) => { + ws.send(JSON.stringify(message)); + }; + + try { + const objectId = message.data.Vin; + console.log(`Subscribing element: ${objectId}`) + const mediaElement = await this.realm.objectForPrimaryKey("Vehicles", objectId); + console.log(mediaElement); + + if (mediaElement) { + const websocketId = String(objectId); + mediaElement.addListener((mediaElement, changes) => + this.onMediaElementChange(mediaElement, changes, websocketId) + ); + sendMessageToClient({ success: `Subscribed to changes for object ID ${objectId}` }) + } else { + sendMessageToClient({ error: "Vehicles collection not found for subscription"}); + } + } catch (error) { + console.error("Error subscribing to object changes in Realm:", error); + sendMessageToClient({ error: 'Error subscribing to object changes' }); + } + } + + onMediaElementChange(mediaElement, changes, websocketId) { + if (changes.deleted) { + console.log(`MediaElement is deleted: ${changes.deleted}`); + } else { + changes.changedProperties.forEach((prop) => { + console.log(`* the value of "${prop}" changed to ${mediaElement[prop]}`); + + // Generate a meaningful UUID for WebSocket response + const uuid = uuidv4(); + + const message = { + type: "update", + tree: "VSS", + id: websocketId, // Use the WebSocket server ID + uuid: uuid, // Use generated UUID + dateTime: new Date().toISOString(), + node: { + name: prop, // Sending the property name as node name + value: mediaElement[prop], // Sending the property value as node value + }, + }; + this.sendMessageToClients(message); + }); + } + } +} + +module.exports = RealmDBHandler; \ No newline at end of file diff --git a/cdsp/information-layer/router/.gitignore b/cdsp/information-layer/router/.gitignore index eec8018..5154f7a 100644 --- a/cdsp/information-layer/router/.gitignore +++ b/cdsp/information-layer/router/.gitignore @@ -4,6 +4,7 @@ mongodb-realm/ # Node.js node_modules/ package-lock.json +.env # MAC **/.DS_Store \ No newline at end of file diff --git a/cdsp/information-layer/router/config/config.js b/cdsp/information-layer/router/config/config.js new file mode 100644 index 0000000..2aaa80f --- /dev/null +++ b/cdsp/information-layer/router/config/config.js @@ -0,0 +1,14 @@ +const dotenv = require('dotenv'); +dotenv.config(); + +const getHandlerType = () => { + const handlerType = process.env.HANDLER_TYPE; + if (!handlerType) { + throw new Error('Handler type must be specified as an ENV variable.'); + } + return handlerType.toLowerCase(); +}; + +module.exports = { + getHandlerType, +}; diff --git a/cdsp/information-layer/router/src/websocket-server.js b/cdsp/information-layer/router/src/websocket-server.js index db057d8..6853c78 100644 --- a/cdsp/information-layer/router/src/websocket-server.js +++ b/cdsp/information-layer/router/src/websocket-server.js @@ -1,20 +1,44 @@ -const WebSocket = require("ws"); -const { - authenticateAndConnectToRealm, - onMediaElementChange, -} = require("../../handlers/realmdb/src/realm-handler"); +const WebSocket = require('ws'); +const RealmDBHandler = require('../../handlers/realmdb/src/realmdb_handler'); +const { getHandlerType } = require('../config/config'); +const { validateMessage } = require('../utils/message_validator'); + +const handlerType = getHandlerType(); +let handler; + +switch (handlerType) { + case 'realmdb': + handler = new RealmDBHandler(); + break; + case 'iotdb': + // TODO: new IoTDBHandler() + console.error('IoTDB Handler is not implemented, yet!') + break; + default: + throw new Error('Unsupported handler type'); +} const server = new WebSocket.Server({ port: 8080 }); // Define clients array globally let clients = []; -server.on("connection", (ws) => { +server.on('connection', (ws) => { console.log("Client connected"); clients.push(ws); // Add client to the array - ws.on("close", () => { - console.log("Client disconnected"); + ws.on('message', (message) => { + console.log(`Message received: ${message}`); + const validatedMessage = validateMessage(message); + if (validatedMessage) { + handler.handleMessage(validatedMessage, ws); + } else { + ws.send(JSON.stringify({ error: 'Invalid message format' })); + } + }); + + ws.on('close', () => { + console.log('Client disconnected'); // Remove disconnected client from the array clients = clients.filter((client) => client !== ws); }); @@ -26,5 +50,7 @@ const sendMessageToClients = (message) => { }); }; -console.log("Starting authentication and connection to Realm..."); -authenticateAndConnectToRealm(sendMessageToClients, onMediaElementChange); +console.log(`Starting authentication and connection to ${handlerType} ...`); +handler.authenticateAndConnect(sendMessageToClients); + +console.log(`WebSocket server started on ws://localhost:8080 using ${handlerType} handler`); diff --git a/cdsp/information-layer/router/utils/message_validator.js b/cdsp/information-layer/router/utils/message_validator.js new file mode 100644 index 0000000..93d655c --- /dev/null +++ b/cdsp/information-layer/router/utils/message_validator.js @@ -0,0 +1,14 @@ +const validateMessage = (message) => { + try { + const parsedMessage = JSON.parse(message); + // TODO: Implement validation logic here + return parsedMessage; + } catch (error) { + return null; + } + }; + + module.exports = { + validateMessage, + }; + \ No newline at end of file From 3e36432513b5f9b72b1fdd4714187ba83b10a31c Mon Sep 17 00:00:00 2001 From: Christian Muehlbauer Date: Tue, 9 Jul 2024 15:51:16 +0200 Subject: [PATCH 15/48] Add environment variable functionallity and update README files. Use dotenv package to laod environment variables from a .env file into the process.env Rename files and update code Remove unused file Signed-off-by: Christian Muehlbauer --- .../handlers/iotdb/src/iotdb-handler.js | 2 +- .../handlers/realmdb/README.md | 43 +++++++++++--- .../handlers/realmdb/config/vehicle-config.js | 4 -- .../handlers/realmdb/package.json | 4 +- ...{realmdb_handler.js => realmdb-handler.js} | 57 +++++++++---------- cdsp/information-layer/router/.gitignore | 1 - cdsp/information-layer/router/README.md | 12 +++- cdsp/information-layer/router/package.json | 1 + cdsp/information-layer/router/src/.env | 1 + .../router/src/websocket-server.js | 6 +- ...sage_validator.js => message-validator.js} | 0 11 files changed, 81 insertions(+), 50 deletions(-) delete mode 100644 cdsp/information-layer/handlers/realmdb/config/vehicle-config.js rename cdsp/information-layer/handlers/realmdb/src/{realmdb_handler.js => realmdb-handler.js} (66%) create mode 100644 cdsp/information-layer/router/src/.env rename cdsp/information-layer/router/utils/{message_validator.js => message-validator.js} (100%) diff --git a/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js b/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js index dad4fef..09cbb2e 100644 --- a/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js +++ b/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js @@ -1 +1 @@ -// TODO: STUB implementation of subscribe, write and read interface methods.g \ No newline at end of file +// tdb \ No newline at end of file diff --git a/cdsp/information-layer/handlers/realmdb/README.md b/cdsp/information-layer/handlers/realmdb/README.md index 07e1a4a..0166ebf 100644 --- a/cdsp/information-layer/handlers/realmdb/README.md +++ b/cdsp/information-layer/handlers/realmdb/README.md @@ -1,4 +1,10 @@ This directory contains the RealmDB Handler as Node.js application. As [RealmDB](https://www.mongodb.com/docs/atlas/device-sdks/sdk/node/) is an embedded database, the RealmDB Handler directly embedds the RealmSDK which creates the [RealmDB database](https://github.com/realm/realm-js) file(s) automatically in the working directory during runtime of RealmDB Handler. +# Features + +- **Authentication**: Authenticates with MongoDB Realm using an API key. +- **Read Data**: Retrieves data from the Realm database using a primary key. +- **Subscribe to Changes**: Listens to changes in specific data objects and sends updates to WebSocket clients. +- **Error Handling**: Logs and handles errors during database operations and synchronization. # Installation @@ -29,13 +35,36 @@ module.exports = { > **_IMPORTANT:_** Do not commit this file to github! -## Configure an example vehicle +## Starting the RealmDB handler -Change the VIN (Vehicle Identification Number) of the example vehicle in [vehicle-config](./config/vehicle-config.js). -The default VIN is `1234567`. -If you do not want to change it ensure, that in your ATLAS cloud instance there is a vehicle _document_ with an `_id: 1234567` in a collection named `Vehicles`. -More infos how to run an example together with ATLAS cloud you can find [here](../readme.md#case-1-you-choosed-realm-as-database). +You do not need to start RealmDB Handler manually. It is started by the DB-Router like described [here](../../router/README.md#Run). -## Starting the RealmDB handler +## Usage + +The examples use the VIN (Vehicle Identification Number) `1234567` as object identifier. + +### Reading Data + +To read data from the Realm database, send a message with the type of request and object ID: -You do not need to start RealmDB Handler manually. It is started by the DB-Router like described [here](../../router/README.md#Install). +```json +{ + "type": "read", + "data": { + "Vin": 1234567 + } +} +``` + +### Subscribing to Changes + +To subscribe to changes in a specific object, send a message with the type of request and object ID: + +```json +{ + "type": "subscribe", + "data": { + "Vin": 1234567 + } +} +``` diff --git a/cdsp/information-layer/handlers/realmdb/config/vehicle-config.js b/cdsp/information-layer/handlers/realmdb/config/vehicle-config.js deleted file mode 100644 index c469fca..0000000 --- a/cdsp/information-layer/handlers/realmdb/config/vehicle-config.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - Vin: 1234567, -}; - diff --git a/cdsp/information-layer/handlers/realmdb/package.json b/cdsp/information-layer/handlers/realmdb/package.json index aac0f2c..45c1a6e 100644 --- a/cdsp/information-layer/handlers/realmdb/package.json +++ b/cdsp/information-layer/handlers/realmdb/package.json @@ -1,8 +1,8 @@ { - "name": "realmdb_handler", + "name": "realmdb-handler", "version": "1.0.0", "description": "Realm database handler", - "main": "realmdb_handler.js", + "main": "realmdb-handler.js", "dependencies": { "realm": "^12.9.0", "uuid": "^9.0.1" diff --git a/cdsp/information-layer/handlers/realmdb/src/realmdb_handler.js b/cdsp/information-layer/handlers/realmdb/src/realmdb-handler.js similarity index 66% rename from cdsp/information-layer/handlers/realmdb/src/realmdb_handler.js rename to cdsp/information-layer/handlers/realmdb/src/realmdb-handler.js index 2c1a82f..7ef679d 100644 --- a/cdsp/information-layer/handlers/realmdb/src/realmdb_handler.js +++ b/cdsp/information-layer/handlers/realmdb/src/realmdb-handler.js @@ -1,7 +1,6 @@ const Realm = require("realm"); const Handler = require('../../handler') const config = require("../config/config"); -//const vehicleConfig = require("../config/vehicle-config"); // Import vehicle config file const { v4: uuidv4 } = require("uuid"); // Importing UUID generator const MediaElementSchema = { @@ -28,6 +27,10 @@ const realmConfig = { }, }; +const sendMessageToClient = (ws, message) => { + ws.send(JSON.stringify(message)); +}; + class RealmDBHandler extends Handler { constructor() { super(); @@ -45,8 +48,12 @@ class RealmDBHandler extends Handler { this.realm = await Realm.open(realmConfig); console.log("Realm connection established successfully"); - const MediaElements = this.realm.objects("Vehicles").subscribe(); - console.log(MediaElements); // TODO: Is it necessary to log this? + const MediaElements = this.realm.objects("Vehicles").subscribe(); // TODO: Is it necessary to log this, extra function? + if (MediaElements) { + console.log(MediaElements); + } else { + this.sendMessageToClients({ error: "Vehicles collection not found for subscription"}); + } } catch (error) { console.error("Failed to authenticate with Realm:", error); } @@ -55,59 +62,49 @@ class RealmDBHandler extends Handler { async read(message, ws) { try{ const objectId = message.data.Vin; // Retrieve objectId from config file - const mediaElement = this.realm.objectForPrimaryKey("Vehicles", objectId); - console.log(mediaElement); - if (mediaElement) { + const MediaElement = this.realm.objectForPrimaryKey("Vehicles", objectId); + if (MediaElement) { const response = { type: "read_response", - data: mediaElement, + data: MediaElement, }; - ws.send(JSON.stringify(response)); + sendMessageToClient(ws, JSON.stringify(response)); } else { - ws.send(JSON.stringify({ error: 'Object not found' })); + sendMessageToClient(ws, JSON.stringify({ error: 'Object not found' })); } } catch (error) { console.error("Error reading object from Realm:", error); - ws.send(JSON.stringify({ error: 'Error reading object' })); + sendMessageToClient(ws, JSON.stringify({ error: 'Error reading object' })); } } - async write(message, ws) { - // Implement write logic for RealmDB - } - - async subscribe(message, ws) { - const sendMessageToClient = (message) => { - ws.send(JSON.stringify(message)); - }; - + async subscribe(message, ws) { try { const objectId = message.data.Vin; console.log(`Subscribing element: ${objectId}`) - const mediaElement = await this.realm.objectForPrimaryKey("Vehicles", objectId); - console.log(mediaElement); + const MediaElement = await this.realm.objectForPrimaryKey("Vehicles", objectId); - if (mediaElement) { + if (MediaElement) { const websocketId = String(objectId); - mediaElement.addListener((mediaElement, changes) => - this.onMediaElementChange(mediaElement, changes, websocketId) + MediaElement.addListener((MediaElement, changes) => + this.onMediaElementChange(MediaElement, changes, websocketId) ); - sendMessageToClient({ success: `Subscribed to changes for object ID ${objectId}` }) + sendMessageToClient(ws, { success: `Subscribed to changes for object ID ${objectId}` }) } else { - sendMessageToClient({ error: "Vehicles collection not found for subscription"}); + sendMessageToClient(ws, JSON.stringify({ error: 'Object not found' })); } } catch (error) { console.error("Error subscribing to object changes in Realm:", error); - sendMessageToClient({ error: 'Error subscribing to object changes' }); + sendMessageToClient(ws, { error: 'Error subscribing to object changes' }); } } - onMediaElementChange(mediaElement, changes, websocketId) { + onMediaElementChange(MediaElement, changes, websocketId) { if (changes.deleted) { console.log(`MediaElement is deleted: ${changes.deleted}`); } else { changes.changedProperties.forEach((prop) => { - console.log(`* the value of "${prop}" changed to ${mediaElement[prop]}`); + console.log(`* the value of "${prop}" changed to ${MediaElement[prop]}`); // Generate a meaningful UUID for WebSocket response const uuid = uuidv4(); @@ -120,7 +117,7 @@ class RealmDBHandler extends Handler { dateTime: new Date().toISOString(), node: { name: prop, // Sending the property name as node name - value: mediaElement[prop], // Sending the property value as node value + value: MediaElement[prop], // Sending the property value as node value }, }; this.sendMessageToClients(message); diff --git a/cdsp/information-layer/router/.gitignore b/cdsp/information-layer/router/.gitignore index 5154f7a..eec8018 100644 --- a/cdsp/information-layer/router/.gitignore +++ b/cdsp/information-layer/router/.gitignore @@ -4,7 +4,6 @@ mongodb-realm/ # Node.js node_modules/ package-lock.json -.env # MAC **/.DS_Store \ No newline at end of file diff --git a/cdsp/information-layer/router/README.md b/cdsp/information-layer/router/README.md index d9b9032..deb0030 100644 --- a/cdsp/information-layer/router/README.md +++ b/cdsp/information-layer/router/README.md @@ -1,7 +1,7 @@ -With this component one can configure which database it shall connect to. +With this component, you can configure which database it connects to. > [!WARNING] -> As the configuration capability is not yet implemented, RealmDB is hard coded as a database! +> While configuring Docker for environment variable definition, the `dotenv` package is used to load environment variables from an `.env` file into `process.env`. # Install @@ -9,10 +9,18 @@ Execute in this directory: ```bash npm install +npm install dotenv ``` # Run +In the `.env` file are defined the environment variables: + +- **HANDLER_TYPE**: Configure `realmdb` to start the RealmDB Handler or `iotdb` to start the IoTDB Handler. + +> [!WARNING] +> Create a `.env` file in the same directory as your `docker-compose.yml`. If it doesn't exist, create it in the same directory as `websocket-server.js`. + Start router by executing in [src](./src/) directory the command: ```bash diff --git a/cdsp/information-layer/router/package.json b/cdsp/information-layer/router/package.json index 7fbc984..51da3e1 100644 --- a/cdsp/information-layer/router/package.json +++ b/cdsp/information-layer/router/package.json @@ -7,6 +7,7 @@ "start": "node websocket-server.js" }, "dependencies": { + "dotenv": "^16.4.5", "ws": "^7.4.6" } } diff --git a/cdsp/information-layer/router/src/.env b/cdsp/information-layer/router/src/.env new file mode 100644 index 0000000..16ac659 --- /dev/null +++ b/cdsp/information-layer/router/src/.env @@ -0,0 +1 @@ +HANDLER_TYPE=realmdb \ No newline at end of file diff --git a/cdsp/information-layer/router/src/websocket-server.js b/cdsp/information-layer/router/src/websocket-server.js index 6853c78..06727c5 100644 --- a/cdsp/information-layer/router/src/websocket-server.js +++ b/cdsp/information-layer/router/src/websocket-server.js @@ -1,17 +1,17 @@ const WebSocket = require('ws'); -const RealmDBHandler = require('../../handlers/realmdb/src/realmdb_handler'); +const RealmDBHandler = require('../../handlers/realmdb/src/realmdb-handler'); const { getHandlerType } = require('../config/config'); -const { validateMessage } = require('../utils/message_validator'); +const { validateMessage } = require('../utils/message-validator'); const handlerType = getHandlerType(); let handler; +console.log(`this is the handler type: ${handlerType}`) switch (handlerType) { case 'realmdb': handler = new RealmDBHandler(); break; case 'iotdb': - // TODO: new IoTDBHandler() console.error('IoTDB Handler is not implemented, yet!') break; default: diff --git a/cdsp/information-layer/router/utils/message_validator.js b/cdsp/information-layer/router/utils/message-validator.js similarity index 100% rename from cdsp/information-layer/router/utils/message_validator.js rename to cdsp/information-layer/router/utils/message-validator.js From 72ab98b09a7ac7f8794476ae63a48275b70223ed Mon Sep 17 00:00:00 2001 From: Christian Muehlbauer Date: Wed, 24 Jul 2024 12:23:30 +0200 Subject: [PATCH 16/48] Update link URL and create a IoTDB connection using the IoTDB Handler Signed-off-by: Christian Muehlbauer --- .../handlers/iotdb/.gitignore | 9 + .../handlers/iotdb/README.md | 39 +- .../iotdb/gen-nodejs/IClientRPCService.js | 13044 ++++++++++++++++ .../handlers/iotdb/gen-nodejs/client_types.js | 7961 ++++++++++ .../handlers/iotdb/gen-nodejs/common_types.js | 2627 ++++ .../handlers/iotdb/package.json | 10 + .../handlers/iotdb/src/iotdb-handler.js | 71 +- cdsp/information-layer/router/src/.env | 2 +- .../router/src/websocket-server.js | 33 +- 9 files changed, 23778 insertions(+), 18 deletions(-) create mode 100644 cdsp/information-layer/handlers/iotdb/.gitignore create mode 100644 cdsp/information-layer/handlers/iotdb/gen-nodejs/IClientRPCService.js create mode 100644 cdsp/information-layer/handlers/iotdb/gen-nodejs/client_types.js create mode 100644 cdsp/information-layer/handlers/iotdb/gen-nodejs/common_types.js create mode 100644 cdsp/information-layer/handlers/iotdb/package.json diff --git a/cdsp/information-layer/handlers/iotdb/.gitignore b/cdsp/information-layer/handlers/iotdb/.gitignore new file mode 100644 index 0000000..9b7b860 --- /dev/null +++ b/cdsp/information-layer/handlers/iotdb/.gitignore @@ -0,0 +1,9 @@ +# Node.js +node_modules/ +package-lock.json + +# Credentials Config File +config.js + +# MAC +**/.DS_Store diff --git a/cdsp/information-layer/handlers/iotdb/README.md b/cdsp/information-layer/handlers/iotdb/README.md index fd9e641..68380ed 100644 --- a/cdsp/information-layer/handlers/iotdb/README.md +++ b/cdsp/information-layer/handlers/iotdb/README.md @@ -1 +1,38 @@ -tbd \ No newline at end of file +This directory contains the IoTDB Handler as a Node.js application. As [Apache IoTDB](https://iotdb.apache.org/) is a time-series database, the IoTDB Handler connects to an existing IoTDB instance using the Thrift protocol. The handler utilizes the [IoTDB Thrift API](https://github.com/apache/thrift) to communicate with the database and perform operations. Configuration details, such as the IoTDB host, port, user credentials, and time zone, are specified in the handler's configuration file. The IoTDB Handler is designed to manage sessions, execute queries, and interact with the IoTDB instance efficiently during runtime. + +# Features + +- **Authentication**: Authenticates with IoTDB using the IoTDB host, port, user credentials, and time zone. +- **Error Handling**: Logs and handles errors during database operations and synchronization. + +# Installation + +Execute within `iotdb` directory + +```bash +npm install +``` + +# Configure IoTDB + +Before the Database-Router can start the IoTDB Handler without any errors you need to start and run Docker containers defined in a [Docker Compose file](/docker/). + +## Configure of a IoTDB Handler + +Create `config/config.js` with the following format, replacing the app id and the api key with yours. + +```js +module.exports = { + iotdbHost: "your-iotdb-host", // Default "localhost" + iotdbPort: 6667, // Set this to the appropriate IotDB Port + iotdbUser: "your-iotdb-user", // Default "root" + iotdbPassword: "your-iotdb-password", // Default "root" + timeZone: "UTC+2", // Set this to the appropriate time zone +}; +``` + +> **_IMPORTANT:_** Do not commit this file to github! + +## Starting the IoTDB handler + +You do not need to start IotDB Handler manually. It is started by the DB-Router like described [here](../../router/README.md#Run). \ No newline at end of file diff --git a/cdsp/information-layer/handlers/iotdb/gen-nodejs/IClientRPCService.js b/cdsp/information-layer/handlers/iotdb/gen-nodejs/IClientRPCService.js new file mode 100644 index 0000000..b7deb43 --- /dev/null +++ b/cdsp/information-layer/handlers/iotdb/gen-nodejs/IClientRPCService.js @@ -0,0 +1,13044 @@ +// +// Autogenerated by Thrift Compiler (0.14.1) +// +// 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 Int64 = require('node-int64'); + +var common_ttypes = require('./common_types'); + + +var ttypes = require('./client_types'); +//HELPER FUNCTIONS AND STRUCTURES + +var IClientRPCService_executeQueryStatementV2_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSExecuteStatementReq(args.req); + } + } +}; +IClientRPCService_executeQueryStatementV2_args.prototype = {}; +IClientRPCService_executeQueryStatementV2_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSExecuteStatementReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeQueryStatementV2_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeQueryStatementV2_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeQueryStatementV2_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSExecuteStatementResp(args.success); + } + } +}; +IClientRPCService_executeQueryStatementV2_result.prototype = {}; +IClientRPCService_executeQueryStatementV2_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSExecuteStatementResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeQueryStatementV2_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeQueryStatementV2_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeUpdateStatementV2_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSExecuteStatementReq(args.req); + } + } +}; +IClientRPCService_executeUpdateStatementV2_args.prototype = {}; +IClientRPCService_executeUpdateStatementV2_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSExecuteStatementReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeUpdateStatementV2_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeUpdateStatementV2_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeUpdateStatementV2_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSExecuteStatementResp(args.success); + } + } +}; +IClientRPCService_executeUpdateStatementV2_result.prototype = {}; +IClientRPCService_executeUpdateStatementV2_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSExecuteStatementResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeUpdateStatementV2_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeUpdateStatementV2_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeStatementV2_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSExecuteStatementReq(args.req); + } + } +}; +IClientRPCService_executeStatementV2_args.prototype = {}; +IClientRPCService_executeStatementV2_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSExecuteStatementReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeStatementV2_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeStatementV2_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeStatementV2_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSExecuteStatementResp(args.success); + } + } +}; +IClientRPCService_executeStatementV2_result.prototype = {}; +IClientRPCService_executeStatementV2_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSExecuteStatementResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeStatementV2_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeStatementV2_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeRawDataQueryV2_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSRawDataQueryReq(args.req); + } + } +}; +IClientRPCService_executeRawDataQueryV2_args.prototype = {}; +IClientRPCService_executeRawDataQueryV2_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSRawDataQueryReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeRawDataQueryV2_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeRawDataQueryV2_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeRawDataQueryV2_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSExecuteStatementResp(args.success); + } + } +}; +IClientRPCService_executeRawDataQueryV2_result.prototype = {}; +IClientRPCService_executeRawDataQueryV2_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSExecuteStatementResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeRawDataQueryV2_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeRawDataQueryV2_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeLastDataQueryV2_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSLastDataQueryReq(args.req); + } + } +}; +IClientRPCService_executeLastDataQueryV2_args.prototype = {}; +IClientRPCService_executeLastDataQueryV2_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSLastDataQueryReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeLastDataQueryV2_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeLastDataQueryV2_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeLastDataQueryV2_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSExecuteStatementResp(args.success); + } + } +}; +IClientRPCService_executeLastDataQueryV2_result.prototype = {}; +IClientRPCService_executeLastDataQueryV2_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSExecuteStatementResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeLastDataQueryV2_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeLastDataQueryV2_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeFastLastDataQueryForOneDeviceV2_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSFastLastDataQueryForOneDeviceReq(args.req); + } + } +}; +IClientRPCService_executeFastLastDataQueryForOneDeviceV2_args.prototype = {}; +IClientRPCService_executeFastLastDataQueryForOneDeviceV2_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSFastLastDataQueryForOneDeviceReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeFastLastDataQueryForOneDeviceV2_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeFastLastDataQueryForOneDeviceV2_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeFastLastDataQueryForOneDeviceV2_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSExecuteStatementResp(args.success); + } + } +}; +IClientRPCService_executeFastLastDataQueryForOneDeviceV2_result.prototype = {}; +IClientRPCService_executeFastLastDataQueryForOneDeviceV2_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSExecuteStatementResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeFastLastDataQueryForOneDeviceV2_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeFastLastDataQueryForOneDeviceV2_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeAggregationQueryV2_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSAggregationQueryReq(args.req); + } + } +}; +IClientRPCService_executeAggregationQueryV2_args.prototype = {}; +IClientRPCService_executeAggregationQueryV2_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSAggregationQueryReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeAggregationQueryV2_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeAggregationQueryV2_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeAggregationQueryV2_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSExecuteStatementResp(args.success); + } + } +}; +IClientRPCService_executeAggregationQueryV2_result.prototype = {}; +IClientRPCService_executeAggregationQueryV2_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSExecuteStatementResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeAggregationQueryV2_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeAggregationQueryV2_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeGroupByQueryIntervalQuery_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSGroupByQueryIntervalReq(args.req); + } + } +}; +IClientRPCService_executeGroupByQueryIntervalQuery_args.prototype = {}; +IClientRPCService_executeGroupByQueryIntervalQuery_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSGroupByQueryIntervalReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeGroupByQueryIntervalQuery_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeGroupByQueryIntervalQuery_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeGroupByQueryIntervalQuery_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSExecuteStatementResp(args.success); + } + } +}; +IClientRPCService_executeGroupByQueryIntervalQuery_result.prototype = {}; +IClientRPCService_executeGroupByQueryIntervalQuery_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSExecuteStatementResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeGroupByQueryIntervalQuery_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeGroupByQueryIntervalQuery_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_fetchResultsV2_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSFetchResultsReq(args.req); + } + } +}; +IClientRPCService_fetchResultsV2_args.prototype = {}; +IClientRPCService_fetchResultsV2_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSFetchResultsReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_fetchResultsV2_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_fetchResultsV2_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_fetchResultsV2_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSFetchResultsResp(args.success); + } + } +}; +IClientRPCService_fetchResultsV2_result.prototype = {}; +IClientRPCService_fetchResultsV2_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSFetchResultsResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_fetchResultsV2_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_fetchResultsV2_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_openSession_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSOpenSessionReq(args.req); + } + } +}; +IClientRPCService_openSession_args.prototype = {}; +IClientRPCService_openSession_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSOpenSessionReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_openSession_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_openSession_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_openSession_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSOpenSessionResp(args.success); + } + } +}; +IClientRPCService_openSession_result.prototype = {}; +IClientRPCService_openSession_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSOpenSessionResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_openSession_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_openSession_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_closeSession_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSCloseSessionReq(args.req); + } + } +}; +IClientRPCService_closeSession_args.prototype = {}; +IClientRPCService_closeSession_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSCloseSessionReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_closeSession_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_closeSession_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_closeSession_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_closeSession_result.prototype = {}; +IClientRPCService_closeSession_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_closeSession_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_closeSession_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeStatement_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSExecuteStatementReq(args.req); + } + } +}; +IClientRPCService_executeStatement_args.prototype = {}; +IClientRPCService_executeStatement_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSExecuteStatementReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeStatement_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeStatement_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeStatement_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSExecuteStatementResp(args.success); + } + } +}; +IClientRPCService_executeStatement_result.prototype = {}; +IClientRPCService_executeStatement_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSExecuteStatementResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeStatement_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeStatement_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeBatchStatement_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSExecuteBatchStatementReq(args.req); + } + } +}; +IClientRPCService_executeBatchStatement_args.prototype = {}; +IClientRPCService_executeBatchStatement_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSExecuteBatchStatementReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeBatchStatement_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeBatchStatement_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeBatchStatement_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_executeBatchStatement_result.prototype = {}; +IClientRPCService_executeBatchStatement_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeBatchStatement_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeBatchStatement_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeQueryStatement_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSExecuteStatementReq(args.req); + } + } +}; +IClientRPCService_executeQueryStatement_args.prototype = {}; +IClientRPCService_executeQueryStatement_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSExecuteStatementReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeQueryStatement_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeQueryStatement_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeQueryStatement_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSExecuteStatementResp(args.success); + } + } +}; +IClientRPCService_executeQueryStatement_result.prototype = {}; +IClientRPCService_executeQueryStatement_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSExecuteStatementResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeQueryStatement_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeQueryStatement_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeUpdateStatement_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSExecuteStatementReq(args.req); + } + } +}; +IClientRPCService_executeUpdateStatement_args.prototype = {}; +IClientRPCService_executeUpdateStatement_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSExecuteStatementReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeUpdateStatement_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeUpdateStatement_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeUpdateStatement_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSExecuteStatementResp(args.success); + } + } +}; +IClientRPCService_executeUpdateStatement_result.prototype = {}; +IClientRPCService_executeUpdateStatement_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSExecuteStatementResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeUpdateStatement_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeUpdateStatement_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_fetchResults_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSFetchResultsReq(args.req); + } + } +}; +IClientRPCService_fetchResults_args.prototype = {}; +IClientRPCService_fetchResults_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSFetchResultsReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_fetchResults_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_fetchResults_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_fetchResults_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSFetchResultsResp(args.success); + } + } +}; +IClientRPCService_fetchResults_result.prototype = {}; +IClientRPCService_fetchResults_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSFetchResultsResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_fetchResults_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_fetchResults_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_fetchMetadata_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSFetchMetadataReq(args.req); + } + } +}; +IClientRPCService_fetchMetadata_args.prototype = {}; +IClientRPCService_fetchMetadata_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSFetchMetadataReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_fetchMetadata_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_fetchMetadata_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_fetchMetadata_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSFetchMetadataResp(args.success); + } + } +}; +IClientRPCService_fetchMetadata_result.prototype = {}; +IClientRPCService_fetchMetadata_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSFetchMetadataResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_fetchMetadata_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_fetchMetadata_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_cancelOperation_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSCancelOperationReq(args.req); + } + } +}; +IClientRPCService_cancelOperation_args.prototype = {}; +IClientRPCService_cancelOperation_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSCancelOperationReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_cancelOperation_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_cancelOperation_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_cancelOperation_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_cancelOperation_result.prototype = {}; +IClientRPCService_cancelOperation_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_cancelOperation_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_cancelOperation_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_closeOperation_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSCloseOperationReq(args.req); + } + } +}; +IClientRPCService_closeOperation_args.prototype = {}; +IClientRPCService_closeOperation_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSCloseOperationReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_closeOperation_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_closeOperation_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_closeOperation_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_closeOperation_result.prototype = {}; +IClientRPCService_closeOperation_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_closeOperation_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_closeOperation_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_getTimeZone_args = function(args) { + this.sessionId = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } + } +}; +IClientRPCService_getTimeZone_args.prototype = {}; +IClientRPCService_getTimeZone_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_getTimeZone_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_getTimeZone_args'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_getTimeZone_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSGetTimeZoneResp(args.success); + } + } +}; +IClientRPCService_getTimeZone_result.prototype = {}; +IClientRPCService_getTimeZone_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSGetTimeZoneResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_getTimeZone_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_getTimeZone_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_setTimeZone_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSSetTimeZoneReq(args.req); + } + } +}; +IClientRPCService_setTimeZone_args.prototype = {}; +IClientRPCService_setTimeZone_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSSetTimeZoneReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_setTimeZone_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_setTimeZone_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_setTimeZone_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_setTimeZone_result.prototype = {}; +IClientRPCService_setTimeZone_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_setTimeZone_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_setTimeZone_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_getProperties_args = function(args) { +}; +IClientRPCService_getProperties_args.prototype = {}; +IClientRPCService_getProperties_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + if (ftype == Thrift.Type.STOP) { + break; + } + input.skip(ftype); + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_getProperties_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_getProperties_args'); + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_getProperties_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.ServerProperties(args.success); + } + } +}; +IClientRPCService_getProperties_result.prototype = {}; +IClientRPCService_getProperties_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.ServerProperties(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_getProperties_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_getProperties_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_setStorageGroup_args = function(args) { + this.sessionId = null; + this.storageGroup = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } + if (args.storageGroup !== undefined && args.storageGroup !== null) { + this.storageGroup = args.storageGroup; + } + } +}; +IClientRPCService_setStorageGroup_args.prototype = {}; +IClientRPCService_setStorageGroup_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.storageGroup = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_setStorageGroup_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_setStorageGroup_args'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.storageGroup !== null && this.storageGroup !== undefined) { + output.writeFieldBegin('storageGroup', Thrift.Type.STRING, 2); + output.writeString(this.storageGroup); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_setStorageGroup_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_setStorageGroup_result.prototype = {}; +IClientRPCService_setStorageGroup_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_setStorageGroup_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_setStorageGroup_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_createTimeseries_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSCreateTimeseriesReq(args.req); + } + } +}; +IClientRPCService_createTimeseries_args.prototype = {}; +IClientRPCService_createTimeseries_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSCreateTimeseriesReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_createTimeseries_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_createTimeseries_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_createTimeseries_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_createTimeseries_result.prototype = {}; +IClientRPCService_createTimeseries_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_createTimeseries_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_createTimeseries_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_createAlignedTimeseries_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSCreateAlignedTimeseriesReq(args.req); + } + } +}; +IClientRPCService_createAlignedTimeseries_args.prototype = {}; +IClientRPCService_createAlignedTimeseries_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSCreateAlignedTimeseriesReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_createAlignedTimeseries_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_createAlignedTimeseries_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_createAlignedTimeseries_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_createAlignedTimeseries_result.prototype = {}; +IClientRPCService_createAlignedTimeseries_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_createAlignedTimeseries_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_createAlignedTimeseries_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_createMultiTimeseries_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSCreateMultiTimeseriesReq(args.req); + } + } +}; +IClientRPCService_createMultiTimeseries_args.prototype = {}; +IClientRPCService_createMultiTimeseries_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSCreateMultiTimeseriesReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_createMultiTimeseries_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_createMultiTimeseries_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_createMultiTimeseries_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_createMultiTimeseries_result.prototype = {}; +IClientRPCService_createMultiTimeseries_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_createMultiTimeseries_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_createMultiTimeseries_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_deleteTimeseries_args = function(args) { + this.sessionId = null; + this.path = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } + if (args.path !== undefined && args.path !== null) { + this.path = Thrift.copyList(args.path, [null]); + } + } +}; +IClientRPCService_deleteTimeseries_args.prototype = {}; +IClientRPCService_deleteTimeseries_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.path = []; + var _rtmp3463 = input.readListBegin(); + var _size462 = _rtmp3463.size || 0; + for (var _i464 = 0; _i464 < _size462; ++_i464) { + var elem465 = null; + elem465 = input.readString(); + this.path.push(elem465); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_deleteTimeseries_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_deleteTimeseries_args'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.path !== null && this.path !== undefined) { + output.writeFieldBegin('path', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.path.length); + for (var iter466 in this.path) { + if (this.path.hasOwnProperty(iter466)) { + iter466 = this.path[iter466]; + output.writeString(iter466); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_deleteTimeseries_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_deleteTimeseries_result.prototype = {}; +IClientRPCService_deleteTimeseries_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_deleteTimeseries_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_deleteTimeseries_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_deleteStorageGroups_args = function(args) { + this.sessionId = null; + this.storageGroup = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } + if (args.storageGroup !== undefined && args.storageGroup !== null) { + this.storageGroup = Thrift.copyList(args.storageGroup, [null]); + } + } +}; +IClientRPCService_deleteStorageGroups_args.prototype = {}; +IClientRPCService_deleteStorageGroups_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.storageGroup = []; + var _rtmp3468 = input.readListBegin(); + var _size467 = _rtmp3468.size || 0; + for (var _i469 = 0; _i469 < _size467; ++_i469) { + var elem470 = null; + elem470 = input.readString(); + this.storageGroup.push(elem470); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_deleteStorageGroups_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_deleteStorageGroups_args'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.storageGroup !== null && this.storageGroup !== undefined) { + output.writeFieldBegin('storageGroup', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.storageGroup.length); + for (var iter471 in this.storageGroup) { + if (this.storageGroup.hasOwnProperty(iter471)) { + iter471 = this.storageGroup[iter471]; + output.writeString(iter471); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_deleteStorageGroups_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_deleteStorageGroups_result.prototype = {}; +IClientRPCService_deleteStorageGroups_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_deleteStorageGroups_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_deleteStorageGroups_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertRecord_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertRecordReq(args.req); + } + } +}; +IClientRPCService_insertRecord_args.prototype = {}; +IClientRPCService_insertRecord_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertRecordReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertRecord_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertRecord_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertRecord_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_insertRecord_result.prototype = {}; +IClientRPCService_insertRecord_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertRecord_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertRecord_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertStringRecord_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertStringRecordReq(args.req); + } + } +}; +IClientRPCService_insertStringRecord_args.prototype = {}; +IClientRPCService_insertStringRecord_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertStringRecordReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertStringRecord_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertStringRecord_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertStringRecord_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_insertStringRecord_result.prototype = {}; +IClientRPCService_insertStringRecord_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertStringRecord_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertStringRecord_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertTablet_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertTabletReq(args.req); + } + } +}; +IClientRPCService_insertTablet_args.prototype = {}; +IClientRPCService_insertTablet_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertTabletReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertTablet_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertTablet_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertTablet_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_insertTablet_result.prototype = {}; +IClientRPCService_insertTablet_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertTablet_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertTablet_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertTablets_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertTabletsReq(args.req); + } + } +}; +IClientRPCService_insertTablets_args.prototype = {}; +IClientRPCService_insertTablets_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertTabletsReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertTablets_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertTablets_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertTablets_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_insertTablets_result.prototype = {}; +IClientRPCService_insertTablets_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertTablets_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertTablets_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertRecords_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertRecordsReq(args.req); + } + } +}; +IClientRPCService_insertRecords_args.prototype = {}; +IClientRPCService_insertRecords_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertRecordsReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertRecords_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertRecords_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertRecords_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_insertRecords_result.prototype = {}; +IClientRPCService_insertRecords_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertRecords_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertRecords_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertRecordsOfOneDevice_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertRecordsOfOneDeviceReq(args.req); + } + } +}; +IClientRPCService_insertRecordsOfOneDevice_args.prototype = {}; +IClientRPCService_insertRecordsOfOneDevice_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertRecordsOfOneDeviceReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertRecordsOfOneDevice_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertRecordsOfOneDevice_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertRecordsOfOneDevice_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_insertRecordsOfOneDevice_result.prototype = {}; +IClientRPCService_insertRecordsOfOneDevice_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertRecordsOfOneDevice_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertRecordsOfOneDevice_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertStringRecordsOfOneDevice_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertStringRecordsOfOneDeviceReq(args.req); + } + } +}; +IClientRPCService_insertStringRecordsOfOneDevice_args.prototype = {}; +IClientRPCService_insertStringRecordsOfOneDevice_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertStringRecordsOfOneDeviceReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertStringRecordsOfOneDevice_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertStringRecordsOfOneDevice_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertStringRecordsOfOneDevice_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_insertStringRecordsOfOneDevice_result.prototype = {}; +IClientRPCService_insertStringRecordsOfOneDevice_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertStringRecordsOfOneDevice_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertStringRecordsOfOneDevice_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertStringRecords_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertStringRecordsReq(args.req); + } + } +}; +IClientRPCService_insertStringRecords_args.prototype = {}; +IClientRPCService_insertStringRecords_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertStringRecordsReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertStringRecords_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertStringRecords_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertStringRecords_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_insertStringRecords_result.prototype = {}; +IClientRPCService_insertStringRecords_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertStringRecords_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertStringRecords_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testInsertTablet_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertTabletReq(args.req); + } + } +}; +IClientRPCService_testInsertTablet_args.prototype = {}; +IClientRPCService_testInsertTablet_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertTabletReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testInsertTablet_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testInsertTablet_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testInsertTablet_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_testInsertTablet_result.prototype = {}; +IClientRPCService_testInsertTablet_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testInsertTablet_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testInsertTablet_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testInsertTablets_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertTabletsReq(args.req); + } + } +}; +IClientRPCService_testInsertTablets_args.prototype = {}; +IClientRPCService_testInsertTablets_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertTabletsReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testInsertTablets_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testInsertTablets_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testInsertTablets_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_testInsertTablets_result.prototype = {}; +IClientRPCService_testInsertTablets_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testInsertTablets_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testInsertTablets_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testInsertRecord_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertRecordReq(args.req); + } + } +}; +IClientRPCService_testInsertRecord_args.prototype = {}; +IClientRPCService_testInsertRecord_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertRecordReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testInsertRecord_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testInsertRecord_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testInsertRecord_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_testInsertRecord_result.prototype = {}; +IClientRPCService_testInsertRecord_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testInsertRecord_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testInsertRecord_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testInsertStringRecord_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertStringRecordReq(args.req); + } + } +}; +IClientRPCService_testInsertStringRecord_args.prototype = {}; +IClientRPCService_testInsertStringRecord_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertStringRecordReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testInsertStringRecord_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testInsertStringRecord_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testInsertStringRecord_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_testInsertStringRecord_result.prototype = {}; +IClientRPCService_testInsertStringRecord_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testInsertStringRecord_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testInsertStringRecord_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testInsertRecords_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertRecordsReq(args.req); + } + } +}; +IClientRPCService_testInsertRecords_args.prototype = {}; +IClientRPCService_testInsertRecords_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertRecordsReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testInsertRecords_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testInsertRecords_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testInsertRecords_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_testInsertRecords_result.prototype = {}; +IClientRPCService_testInsertRecords_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testInsertRecords_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testInsertRecords_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testInsertRecordsOfOneDevice_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertRecordsOfOneDeviceReq(args.req); + } + } +}; +IClientRPCService_testInsertRecordsOfOneDevice_args.prototype = {}; +IClientRPCService_testInsertRecordsOfOneDevice_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertRecordsOfOneDeviceReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testInsertRecordsOfOneDevice_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testInsertRecordsOfOneDevice_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testInsertRecordsOfOneDevice_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_testInsertRecordsOfOneDevice_result.prototype = {}; +IClientRPCService_testInsertRecordsOfOneDevice_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testInsertRecordsOfOneDevice_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testInsertRecordsOfOneDevice_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testInsertStringRecords_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertStringRecordsReq(args.req); + } + } +}; +IClientRPCService_testInsertStringRecords_args.prototype = {}; +IClientRPCService_testInsertStringRecords_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertStringRecordsReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testInsertStringRecords_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testInsertStringRecords_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testInsertStringRecords_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_testInsertStringRecords_result.prototype = {}; +IClientRPCService_testInsertStringRecords_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testInsertStringRecords_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testInsertStringRecords_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_deleteData_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSDeleteDataReq(args.req); + } + } +}; +IClientRPCService_deleteData_args.prototype = {}; +IClientRPCService_deleteData_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSDeleteDataReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_deleteData_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_deleteData_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_deleteData_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_deleteData_result.prototype = {}; +IClientRPCService_deleteData_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_deleteData_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_deleteData_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeRawDataQuery_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSRawDataQueryReq(args.req); + } + } +}; +IClientRPCService_executeRawDataQuery_args.prototype = {}; +IClientRPCService_executeRawDataQuery_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSRawDataQueryReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeRawDataQuery_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeRawDataQuery_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeRawDataQuery_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSExecuteStatementResp(args.success); + } + } +}; +IClientRPCService_executeRawDataQuery_result.prototype = {}; +IClientRPCService_executeRawDataQuery_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSExecuteStatementResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeRawDataQuery_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeRawDataQuery_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeLastDataQuery_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSLastDataQueryReq(args.req); + } + } +}; +IClientRPCService_executeLastDataQuery_args.prototype = {}; +IClientRPCService_executeLastDataQuery_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSLastDataQueryReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeLastDataQuery_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeLastDataQuery_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeLastDataQuery_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSExecuteStatementResp(args.success); + } + } +}; +IClientRPCService_executeLastDataQuery_result.prototype = {}; +IClientRPCService_executeLastDataQuery_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSExecuteStatementResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeLastDataQuery_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeLastDataQuery_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeAggregationQuery_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSAggregationQueryReq(args.req); + } + } +}; +IClientRPCService_executeAggregationQuery_args.prototype = {}; +IClientRPCService_executeAggregationQuery_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSAggregationQueryReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeAggregationQuery_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeAggregationQuery_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeAggregationQuery_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSExecuteStatementResp(args.success); + } + } +}; +IClientRPCService_executeAggregationQuery_result.prototype = {}; +IClientRPCService_executeAggregationQuery_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSExecuteStatementResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeAggregationQuery_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeAggregationQuery_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_requestStatementId_args = function(args) { + this.sessionId = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } + } +}; +IClientRPCService_requestStatementId_args.prototype = {}; +IClientRPCService_requestStatementId_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_requestStatementId_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_requestStatementId_args'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_requestStatementId_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = args.success; + } + } +}; +IClientRPCService_requestStatementId_result.prototype = {}; +IClientRPCService_requestStatementId_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.I64) { + this.success = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_requestStatementId_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_requestStatementId_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.I64, 0); + output.writeI64(this.success); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_createSchemaTemplate_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSCreateSchemaTemplateReq(args.req); + } + } +}; +IClientRPCService_createSchemaTemplate_args.prototype = {}; +IClientRPCService_createSchemaTemplate_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSCreateSchemaTemplateReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_createSchemaTemplate_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_createSchemaTemplate_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_createSchemaTemplate_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_createSchemaTemplate_result.prototype = {}; +IClientRPCService_createSchemaTemplate_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_createSchemaTemplate_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_createSchemaTemplate_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_appendSchemaTemplate_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSAppendSchemaTemplateReq(args.req); + } + } +}; +IClientRPCService_appendSchemaTemplate_args.prototype = {}; +IClientRPCService_appendSchemaTemplate_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSAppendSchemaTemplateReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_appendSchemaTemplate_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_appendSchemaTemplate_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_appendSchemaTemplate_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_appendSchemaTemplate_result.prototype = {}; +IClientRPCService_appendSchemaTemplate_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_appendSchemaTemplate_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_appendSchemaTemplate_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_pruneSchemaTemplate_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSPruneSchemaTemplateReq(args.req); + } + } +}; +IClientRPCService_pruneSchemaTemplate_args.prototype = {}; +IClientRPCService_pruneSchemaTemplate_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSPruneSchemaTemplateReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_pruneSchemaTemplate_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_pruneSchemaTemplate_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_pruneSchemaTemplate_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_pruneSchemaTemplate_result.prototype = {}; +IClientRPCService_pruneSchemaTemplate_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_pruneSchemaTemplate_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_pruneSchemaTemplate_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_querySchemaTemplate_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSQueryTemplateReq(args.req); + } + } +}; +IClientRPCService_querySchemaTemplate_args.prototype = {}; +IClientRPCService_querySchemaTemplate_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSQueryTemplateReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_querySchemaTemplate_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_querySchemaTemplate_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_querySchemaTemplate_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSQueryTemplateResp(args.success); + } + } +}; +IClientRPCService_querySchemaTemplate_result.prototype = {}; +IClientRPCService_querySchemaTemplate_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSQueryTemplateResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_querySchemaTemplate_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_querySchemaTemplate_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_showConfigurationTemplate_args = function(args) { +}; +IClientRPCService_showConfigurationTemplate_args.prototype = {}; +IClientRPCService_showConfigurationTemplate_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + if (ftype == Thrift.Type.STOP) { + break; + } + input.skip(ftype); + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_showConfigurationTemplate_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_showConfigurationTemplate_args'); + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_showConfigurationTemplate_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TShowConfigurationTemplateResp(args.success); + } + } +}; +IClientRPCService_showConfigurationTemplate_result.prototype = {}; +IClientRPCService_showConfigurationTemplate_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TShowConfigurationTemplateResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_showConfigurationTemplate_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_showConfigurationTemplate_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_showConfiguration_args = function(args) { + this.nodeId = null; + if (args) { + if (args.nodeId !== undefined && args.nodeId !== null) { + this.nodeId = args.nodeId; + } + } +}; +IClientRPCService_showConfiguration_args.prototype = {}; +IClientRPCService_showConfiguration_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I32) { + this.nodeId = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_showConfiguration_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_showConfiguration_args'); + if (this.nodeId !== null && this.nodeId !== undefined) { + output.writeFieldBegin('nodeId', Thrift.Type.I32, 1); + output.writeI32(this.nodeId); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_showConfiguration_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TShowConfigurationResp(args.success); + } + } +}; +IClientRPCService_showConfiguration_result.prototype = {}; +IClientRPCService_showConfiguration_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TShowConfigurationResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_showConfiguration_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_showConfiguration_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_setSchemaTemplate_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSSetSchemaTemplateReq(args.req); + } + } +}; +IClientRPCService_setSchemaTemplate_args.prototype = {}; +IClientRPCService_setSchemaTemplate_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSSetSchemaTemplateReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_setSchemaTemplate_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_setSchemaTemplate_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_setSchemaTemplate_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_setSchemaTemplate_result.prototype = {}; +IClientRPCService_setSchemaTemplate_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_setSchemaTemplate_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_setSchemaTemplate_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_unsetSchemaTemplate_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSUnsetSchemaTemplateReq(args.req); + } + } +}; +IClientRPCService_unsetSchemaTemplate_args.prototype = {}; +IClientRPCService_unsetSchemaTemplate_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSUnsetSchemaTemplateReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_unsetSchemaTemplate_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_unsetSchemaTemplate_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_unsetSchemaTemplate_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_unsetSchemaTemplate_result.prototype = {}; +IClientRPCService_unsetSchemaTemplate_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_unsetSchemaTemplate_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_unsetSchemaTemplate_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_dropSchemaTemplate_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSDropSchemaTemplateReq(args.req); + } + } +}; +IClientRPCService_dropSchemaTemplate_args.prototype = {}; +IClientRPCService_dropSchemaTemplate_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSDropSchemaTemplateReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_dropSchemaTemplate_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_dropSchemaTemplate_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_dropSchemaTemplate_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_dropSchemaTemplate_result.prototype = {}; +IClientRPCService_dropSchemaTemplate_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_dropSchemaTemplate_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_dropSchemaTemplate_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_createTimeseriesUsingSchemaTemplate_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TCreateTimeseriesUsingSchemaTemplateReq(args.req); + } + } +}; +IClientRPCService_createTimeseriesUsingSchemaTemplate_args.prototype = {}; +IClientRPCService_createTimeseriesUsingSchemaTemplate_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TCreateTimeseriesUsingSchemaTemplateReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_createTimeseriesUsingSchemaTemplate_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_createTimeseriesUsingSchemaTemplate_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_createTimeseriesUsingSchemaTemplate_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_createTimeseriesUsingSchemaTemplate_result.prototype = {}; +IClientRPCService_createTimeseriesUsingSchemaTemplate_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_createTimeseriesUsingSchemaTemplate_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_createTimeseriesUsingSchemaTemplate_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_handshake_args = function(args) { + this.info = null; + if (args) { + if (args.info !== undefined && args.info !== null) { + this.info = new ttypes.TSyncIdentityInfo(args.info); + } + } +}; +IClientRPCService_handshake_args.prototype = {}; +IClientRPCService_handshake_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case -1: + if (ftype == Thrift.Type.STRUCT) { + this.info = new ttypes.TSyncIdentityInfo(); + this.info.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_handshake_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_handshake_args'); + if (this.info !== null && this.info !== undefined) { + output.writeFieldBegin('info', Thrift.Type.STRUCT, -1); + this.info.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_handshake_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_handshake_result.prototype = {}; +IClientRPCService_handshake_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_handshake_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_handshake_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_sendPipeData_args = function(args) { + this.buff = null; + if (args) { + if (args.buff !== undefined && args.buff !== null) { + this.buff = args.buff; + } + } +}; +IClientRPCService_sendPipeData_args.prototype = {}; +IClientRPCService_sendPipeData_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.buff = input.readBinary(); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_sendPipeData_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_sendPipeData_args'); + if (this.buff !== null && this.buff !== undefined) { + output.writeFieldBegin('buff', Thrift.Type.STRING, 1); + output.writeBinary(this.buff); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_sendPipeData_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_sendPipeData_result.prototype = {}; +IClientRPCService_sendPipeData_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_sendPipeData_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_sendPipeData_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_sendFile_args = function(args) { + this.metaInfo = null; + this.buff = null; + if (args) { + if (args.metaInfo !== undefined && args.metaInfo !== null) { + this.metaInfo = new ttypes.TSyncTransportMetaInfo(args.metaInfo); + } + if (args.buff !== undefined && args.buff !== null) { + this.buff = args.buff; + } + } +}; +IClientRPCService_sendFile_args.prototype = {}; +IClientRPCService_sendFile_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.metaInfo = new ttypes.TSyncTransportMetaInfo(); + this.metaInfo.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.buff = input.readBinary(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_sendFile_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_sendFile_args'); + if (this.metaInfo !== null && this.metaInfo !== undefined) { + output.writeFieldBegin('metaInfo', Thrift.Type.STRUCT, 1); + this.metaInfo.write(output); + output.writeFieldEnd(); + } + if (this.buff !== null && this.buff !== undefined) { + output.writeFieldBegin('buff', Thrift.Type.STRING, 2); + output.writeBinary(this.buff); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_sendFile_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_sendFile_result.prototype = {}; +IClientRPCService_sendFile_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_sendFile_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_sendFile_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_pipeTransfer_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TPipeTransferReq(args.req); + } + } +}; +IClientRPCService_pipeTransfer_args.prototype = {}; +IClientRPCService_pipeTransfer_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case -1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TPipeTransferReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_pipeTransfer_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_pipeTransfer_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, -1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_pipeTransfer_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TPipeTransferResp(args.success); + } + } +}; +IClientRPCService_pipeTransfer_result.prototype = {}; +IClientRPCService_pipeTransfer_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TPipeTransferResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_pipeTransfer_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_pipeTransfer_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_pipeSubscribe_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TPipeSubscribeReq(args.req); + } + } +}; +IClientRPCService_pipeSubscribe_args.prototype = {}; +IClientRPCService_pipeSubscribe_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case -1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TPipeSubscribeReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_pipeSubscribe_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_pipeSubscribe_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, -1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_pipeSubscribe_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TPipeSubscribeResp(args.success); + } + } +}; +IClientRPCService_pipeSubscribe_result.prototype = {}; +IClientRPCService_pipeSubscribe_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TPipeSubscribeResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_pipeSubscribe_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_pipeSubscribe_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_getBackupConfiguration_args = function(args) { +}; +IClientRPCService_getBackupConfiguration_args.prototype = {}; +IClientRPCService_getBackupConfiguration_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + if (ftype == Thrift.Type.STOP) { + break; + } + input.skip(ftype); + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_getBackupConfiguration_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_getBackupConfiguration_args'); + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_getBackupConfiguration_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSBackupConfigurationResp(args.success); + } + } +}; +IClientRPCService_getBackupConfiguration_result.prototype = {}; +IClientRPCService_getBackupConfiguration_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSBackupConfigurationResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_getBackupConfiguration_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_getBackupConfiguration_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_fetchAllConnectionsInfo_args = function(args) { +}; +IClientRPCService_fetchAllConnectionsInfo_args.prototype = {}; +IClientRPCService_fetchAllConnectionsInfo_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + if (ftype == Thrift.Type.STOP) { + break; + } + input.skip(ftype); + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_fetchAllConnectionsInfo_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_fetchAllConnectionsInfo_args'); + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_fetchAllConnectionsInfo_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSConnectionInfoResp(args.success); + } + } +}; +IClientRPCService_fetchAllConnectionsInfo_result.prototype = {}; +IClientRPCService_fetchAllConnectionsInfo_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSConnectionInfoResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_fetchAllConnectionsInfo_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_fetchAllConnectionsInfo_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testConnectionEmptyRPC_args = function(args) { +}; +IClientRPCService_testConnectionEmptyRPC_args.prototype = {}; +IClientRPCService_testConnectionEmptyRPC_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + if (ftype == Thrift.Type.STOP) { + break; + } + input.skip(ftype); + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testConnectionEmptyRPC_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testConnectionEmptyRPC_args'); + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testConnectionEmptyRPC_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_testConnectionEmptyRPC_result.prototype = {}; +IClientRPCService_testConnectionEmptyRPC_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testConnectionEmptyRPC_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testConnectionEmptyRPC_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCServiceClient = exports.Client = function(output, pClass) { + this.output = output; + this.pClass = pClass; + this._seqid = 0; + this._reqs = {}; +}; +IClientRPCServiceClient.prototype = {}; +IClientRPCServiceClient.prototype.seqid = function() { return this._seqid; }; +IClientRPCServiceClient.prototype.new_seqid = function() { return this._seqid += 1; }; + +IClientRPCServiceClient.prototype.executeQueryStatementV2 = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeQueryStatementV2(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeQueryStatementV2(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeQueryStatementV2 = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeQueryStatementV2_args(params); + try { + output.writeMessageBegin('executeQueryStatementV2', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeQueryStatementV2 = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeQueryStatementV2_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeQueryStatementV2 failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.executeUpdateStatementV2 = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeUpdateStatementV2(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeUpdateStatementV2(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeUpdateStatementV2 = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeUpdateStatementV2_args(params); + try { + output.writeMessageBegin('executeUpdateStatementV2', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeUpdateStatementV2 = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeUpdateStatementV2_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeUpdateStatementV2 failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.executeStatementV2 = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeStatementV2(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeStatementV2(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeStatementV2 = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeStatementV2_args(params); + try { + output.writeMessageBegin('executeStatementV2', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeStatementV2 = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeStatementV2_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeStatementV2 failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.executeRawDataQueryV2 = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeRawDataQueryV2(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeRawDataQueryV2(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeRawDataQueryV2 = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeRawDataQueryV2_args(params); + try { + output.writeMessageBegin('executeRawDataQueryV2', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeRawDataQueryV2 = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeRawDataQueryV2_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeRawDataQueryV2 failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.executeLastDataQueryV2 = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeLastDataQueryV2(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeLastDataQueryV2(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeLastDataQueryV2 = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeLastDataQueryV2_args(params); + try { + output.writeMessageBegin('executeLastDataQueryV2', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeLastDataQueryV2 = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeLastDataQueryV2_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeLastDataQueryV2 failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.executeFastLastDataQueryForOneDeviceV2 = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeFastLastDataQueryForOneDeviceV2(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeFastLastDataQueryForOneDeviceV2(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeFastLastDataQueryForOneDeviceV2 = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeFastLastDataQueryForOneDeviceV2_args(params); + try { + output.writeMessageBegin('executeFastLastDataQueryForOneDeviceV2', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeFastLastDataQueryForOneDeviceV2 = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeFastLastDataQueryForOneDeviceV2_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeFastLastDataQueryForOneDeviceV2 failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.executeAggregationQueryV2 = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeAggregationQueryV2(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeAggregationQueryV2(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeAggregationQueryV2 = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeAggregationQueryV2_args(params); + try { + output.writeMessageBegin('executeAggregationQueryV2', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeAggregationQueryV2 = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeAggregationQueryV2_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeAggregationQueryV2 failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.executeGroupByQueryIntervalQuery = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeGroupByQueryIntervalQuery(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeGroupByQueryIntervalQuery(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeGroupByQueryIntervalQuery = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeGroupByQueryIntervalQuery_args(params); + try { + output.writeMessageBegin('executeGroupByQueryIntervalQuery', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeGroupByQueryIntervalQuery = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeGroupByQueryIntervalQuery_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeGroupByQueryIntervalQuery failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.fetchResultsV2 = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_fetchResultsV2(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_fetchResultsV2(req); + } +}; + +IClientRPCServiceClient.prototype.send_fetchResultsV2 = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_fetchResultsV2_args(params); + try { + output.writeMessageBegin('fetchResultsV2', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_fetchResultsV2 = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_fetchResultsV2_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('fetchResultsV2 failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.openSession = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_openSession(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_openSession(req); + } +}; + +IClientRPCServiceClient.prototype.send_openSession = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_openSession_args(params); + try { + output.writeMessageBegin('openSession', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_openSession = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_openSession_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('openSession failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.closeSession = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_closeSession(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_closeSession(req); + } +}; + +IClientRPCServiceClient.prototype.send_closeSession = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_closeSession_args(params); + try { + output.writeMessageBegin('closeSession', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_closeSession = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_closeSession_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('closeSession failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.executeStatement = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeStatement(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeStatement(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeStatement = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeStatement_args(params); + try { + output.writeMessageBegin('executeStatement', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeStatement = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeStatement_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeStatement failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.executeBatchStatement = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeBatchStatement(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeBatchStatement(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeBatchStatement = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeBatchStatement_args(params); + try { + output.writeMessageBegin('executeBatchStatement', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeBatchStatement = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeBatchStatement_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeBatchStatement failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.executeQueryStatement = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeQueryStatement(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeQueryStatement(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeQueryStatement = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeQueryStatement_args(params); + try { + output.writeMessageBegin('executeQueryStatement', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeQueryStatement = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeQueryStatement_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeQueryStatement failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.executeUpdateStatement = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeUpdateStatement(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeUpdateStatement(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeUpdateStatement = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeUpdateStatement_args(params); + try { + output.writeMessageBegin('executeUpdateStatement', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeUpdateStatement = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeUpdateStatement_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeUpdateStatement failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.fetchResults = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_fetchResults(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_fetchResults(req); + } +}; + +IClientRPCServiceClient.prototype.send_fetchResults = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_fetchResults_args(params); + try { + output.writeMessageBegin('fetchResults', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_fetchResults = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_fetchResults_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('fetchResults failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.fetchMetadata = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_fetchMetadata(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_fetchMetadata(req); + } +}; + +IClientRPCServiceClient.prototype.send_fetchMetadata = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_fetchMetadata_args(params); + try { + output.writeMessageBegin('fetchMetadata', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_fetchMetadata = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_fetchMetadata_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('fetchMetadata failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.cancelOperation = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_cancelOperation(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_cancelOperation(req); + } +}; + +IClientRPCServiceClient.prototype.send_cancelOperation = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_cancelOperation_args(params); + try { + output.writeMessageBegin('cancelOperation', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_cancelOperation = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_cancelOperation_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('cancelOperation failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.closeOperation = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_closeOperation(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_closeOperation(req); + } +}; + +IClientRPCServiceClient.prototype.send_closeOperation = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_closeOperation_args(params); + try { + output.writeMessageBegin('closeOperation', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_closeOperation = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_closeOperation_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('closeOperation failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.getTimeZone = function(sessionId, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_getTimeZone(sessionId); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_getTimeZone(sessionId); + } +}; + +IClientRPCServiceClient.prototype.send_getTimeZone = function(sessionId) { + var output = new this.pClass(this.output); + var params = { + sessionId: sessionId + }; + var args = new IClientRPCService_getTimeZone_args(params); + try { + output.writeMessageBegin('getTimeZone', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_getTimeZone = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_getTimeZone_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('getTimeZone failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.setTimeZone = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_setTimeZone(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_setTimeZone(req); + } +}; + +IClientRPCServiceClient.prototype.send_setTimeZone = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_setTimeZone_args(params); + try { + output.writeMessageBegin('setTimeZone', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_setTimeZone = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_setTimeZone_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('setTimeZone failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.getProperties = function(callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_getProperties(); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_getProperties(); + } +}; + +IClientRPCServiceClient.prototype.send_getProperties = function() { + var output = new this.pClass(this.output); + var args = new IClientRPCService_getProperties_args(); + try { + output.writeMessageBegin('getProperties', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_getProperties = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_getProperties_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('getProperties failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.setStorageGroup = function(sessionId, storageGroup, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_setStorageGroup(sessionId, storageGroup); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_setStorageGroup(sessionId, storageGroup); + } +}; + +IClientRPCServiceClient.prototype.send_setStorageGroup = function(sessionId, storageGroup) { + var output = new this.pClass(this.output); + var params = { + sessionId: sessionId, + storageGroup: storageGroup + }; + var args = new IClientRPCService_setStorageGroup_args(params); + try { + output.writeMessageBegin('setStorageGroup', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_setStorageGroup = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_setStorageGroup_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('setStorageGroup failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.createTimeseries = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_createTimeseries(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_createTimeseries(req); + } +}; + +IClientRPCServiceClient.prototype.send_createTimeseries = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_createTimeseries_args(params); + try { + output.writeMessageBegin('createTimeseries', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_createTimeseries = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_createTimeseries_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('createTimeseries failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.createAlignedTimeseries = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_createAlignedTimeseries(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_createAlignedTimeseries(req); + } +}; + +IClientRPCServiceClient.prototype.send_createAlignedTimeseries = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_createAlignedTimeseries_args(params); + try { + output.writeMessageBegin('createAlignedTimeseries', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_createAlignedTimeseries = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_createAlignedTimeseries_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('createAlignedTimeseries failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.createMultiTimeseries = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_createMultiTimeseries(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_createMultiTimeseries(req); + } +}; + +IClientRPCServiceClient.prototype.send_createMultiTimeseries = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_createMultiTimeseries_args(params); + try { + output.writeMessageBegin('createMultiTimeseries', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_createMultiTimeseries = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_createMultiTimeseries_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('createMultiTimeseries failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.deleteTimeseries = function(sessionId, path, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_deleteTimeseries(sessionId, path); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_deleteTimeseries(sessionId, path); + } +}; + +IClientRPCServiceClient.prototype.send_deleteTimeseries = function(sessionId, path) { + var output = new this.pClass(this.output); + var params = { + sessionId: sessionId, + path: path + }; + var args = new IClientRPCService_deleteTimeseries_args(params); + try { + output.writeMessageBegin('deleteTimeseries', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_deleteTimeseries = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_deleteTimeseries_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('deleteTimeseries failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.deleteStorageGroups = function(sessionId, storageGroup, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_deleteStorageGroups(sessionId, storageGroup); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_deleteStorageGroups(sessionId, storageGroup); + } +}; + +IClientRPCServiceClient.prototype.send_deleteStorageGroups = function(sessionId, storageGroup) { + var output = new this.pClass(this.output); + var params = { + sessionId: sessionId, + storageGroup: storageGroup + }; + var args = new IClientRPCService_deleteStorageGroups_args(params); + try { + output.writeMessageBegin('deleteStorageGroups', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_deleteStorageGroups = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_deleteStorageGroups_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('deleteStorageGroups failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.insertRecord = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_insertRecord(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_insertRecord(req); + } +}; + +IClientRPCServiceClient.prototype.send_insertRecord = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_insertRecord_args(params); + try { + output.writeMessageBegin('insertRecord', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_insertRecord = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_insertRecord_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('insertRecord failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.insertStringRecord = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_insertStringRecord(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_insertStringRecord(req); + } +}; + +IClientRPCServiceClient.prototype.send_insertStringRecord = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_insertStringRecord_args(params); + try { + output.writeMessageBegin('insertStringRecord', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_insertStringRecord = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_insertStringRecord_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('insertStringRecord failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.insertTablet = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_insertTablet(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_insertTablet(req); + } +}; + +IClientRPCServiceClient.prototype.send_insertTablet = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_insertTablet_args(params); + try { + output.writeMessageBegin('insertTablet', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_insertTablet = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_insertTablet_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('insertTablet failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.insertTablets = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_insertTablets(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_insertTablets(req); + } +}; + +IClientRPCServiceClient.prototype.send_insertTablets = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_insertTablets_args(params); + try { + output.writeMessageBegin('insertTablets', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_insertTablets = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_insertTablets_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('insertTablets failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.insertRecords = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_insertRecords(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_insertRecords(req); + } +}; + +IClientRPCServiceClient.prototype.send_insertRecords = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_insertRecords_args(params); + try { + output.writeMessageBegin('insertRecords', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_insertRecords = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_insertRecords_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('insertRecords failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.insertRecordsOfOneDevice = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_insertRecordsOfOneDevice(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_insertRecordsOfOneDevice(req); + } +}; + +IClientRPCServiceClient.prototype.send_insertRecordsOfOneDevice = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_insertRecordsOfOneDevice_args(params); + try { + output.writeMessageBegin('insertRecordsOfOneDevice', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_insertRecordsOfOneDevice = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_insertRecordsOfOneDevice_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('insertRecordsOfOneDevice failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.insertStringRecordsOfOneDevice = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_insertStringRecordsOfOneDevice(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_insertStringRecordsOfOneDevice(req); + } +}; + +IClientRPCServiceClient.prototype.send_insertStringRecordsOfOneDevice = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_insertStringRecordsOfOneDevice_args(params); + try { + output.writeMessageBegin('insertStringRecordsOfOneDevice', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_insertStringRecordsOfOneDevice = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_insertStringRecordsOfOneDevice_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('insertStringRecordsOfOneDevice failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.insertStringRecords = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_insertStringRecords(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_insertStringRecords(req); + } +}; + +IClientRPCServiceClient.prototype.send_insertStringRecords = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_insertStringRecords_args(params); + try { + output.writeMessageBegin('insertStringRecords', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_insertStringRecords = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_insertStringRecords_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('insertStringRecords failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.testInsertTablet = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_testInsertTablet(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_testInsertTablet(req); + } +}; + +IClientRPCServiceClient.prototype.send_testInsertTablet = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_testInsertTablet_args(params); + try { + output.writeMessageBegin('testInsertTablet', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_testInsertTablet = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_testInsertTablet_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('testInsertTablet failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.testInsertTablets = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_testInsertTablets(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_testInsertTablets(req); + } +}; + +IClientRPCServiceClient.prototype.send_testInsertTablets = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_testInsertTablets_args(params); + try { + output.writeMessageBegin('testInsertTablets', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_testInsertTablets = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_testInsertTablets_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('testInsertTablets failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.testInsertRecord = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_testInsertRecord(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_testInsertRecord(req); + } +}; + +IClientRPCServiceClient.prototype.send_testInsertRecord = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_testInsertRecord_args(params); + try { + output.writeMessageBegin('testInsertRecord', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_testInsertRecord = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_testInsertRecord_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('testInsertRecord failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.testInsertStringRecord = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_testInsertStringRecord(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_testInsertStringRecord(req); + } +}; + +IClientRPCServiceClient.prototype.send_testInsertStringRecord = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_testInsertStringRecord_args(params); + try { + output.writeMessageBegin('testInsertStringRecord', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_testInsertStringRecord = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_testInsertStringRecord_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('testInsertStringRecord failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.testInsertRecords = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_testInsertRecords(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_testInsertRecords(req); + } +}; + +IClientRPCServiceClient.prototype.send_testInsertRecords = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_testInsertRecords_args(params); + try { + output.writeMessageBegin('testInsertRecords', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_testInsertRecords = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_testInsertRecords_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('testInsertRecords failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.testInsertRecordsOfOneDevice = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_testInsertRecordsOfOneDevice(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_testInsertRecordsOfOneDevice(req); + } +}; + +IClientRPCServiceClient.prototype.send_testInsertRecordsOfOneDevice = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_testInsertRecordsOfOneDevice_args(params); + try { + output.writeMessageBegin('testInsertRecordsOfOneDevice', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_testInsertRecordsOfOneDevice = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_testInsertRecordsOfOneDevice_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('testInsertRecordsOfOneDevice failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.testInsertStringRecords = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_testInsertStringRecords(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_testInsertStringRecords(req); + } +}; + +IClientRPCServiceClient.prototype.send_testInsertStringRecords = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_testInsertStringRecords_args(params); + try { + output.writeMessageBegin('testInsertStringRecords', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_testInsertStringRecords = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_testInsertStringRecords_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('testInsertStringRecords failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.deleteData = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_deleteData(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_deleteData(req); + } +}; + +IClientRPCServiceClient.prototype.send_deleteData = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_deleteData_args(params); + try { + output.writeMessageBegin('deleteData', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_deleteData = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_deleteData_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('deleteData failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.executeRawDataQuery = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeRawDataQuery(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeRawDataQuery(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeRawDataQuery = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeRawDataQuery_args(params); + try { + output.writeMessageBegin('executeRawDataQuery', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeRawDataQuery = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeRawDataQuery_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeRawDataQuery failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.executeLastDataQuery = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeLastDataQuery(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeLastDataQuery(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeLastDataQuery = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeLastDataQuery_args(params); + try { + output.writeMessageBegin('executeLastDataQuery', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeLastDataQuery = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeLastDataQuery_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeLastDataQuery failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.executeAggregationQuery = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeAggregationQuery(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeAggregationQuery(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeAggregationQuery = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeAggregationQuery_args(params); + try { + output.writeMessageBegin('executeAggregationQuery', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeAggregationQuery = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeAggregationQuery_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeAggregationQuery failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.requestStatementId = function(sessionId, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_requestStatementId(sessionId); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_requestStatementId(sessionId); + } +}; + +IClientRPCServiceClient.prototype.send_requestStatementId = function(sessionId) { + var output = new this.pClass(this.output); + var params = { + sessionId: sessionId + }; + var args = new IClientRPCService_requestStatementId_args(params); + try { + output.writeMessageBegin('requestStatementId', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_requestStatementId = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_requestStatementId_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('requestStatementId failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.createSchemaTemplate = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_createSchemaTemplate(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_createSchemaTemplate(req); + } +}; + +IClientRPCServiceClient.prototype.send_createSchemaTemplate = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_createSchemaTemplate_args(params); + try { + output.writeMessageBegin('createSchemaTemplate', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_createSchemaTemplate = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_createSchemaTemplate_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('createSchemaTemplate failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.appendSchemaTemplate = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_appendSchemaTemplate(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_appendSchemaTemplate(req); + } +}; + +IClientRPCServiceClient.prototype.send_appendSchemaTemplate = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_appendSchemaTemplate_args(params); + try { + output.writeMessageBegin('appendSchemaTemplate', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_appendSchemaTemplate = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_appendSchemaTemplate_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('appendSchemaTemplate failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.pruneSchemaTemplate = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_pruneSchemaTemplate(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_pruneSchemaTemplate(req); + } +}; + +IClientRPCServiceClient.prototype.send_pruneSchemaTemplate = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_pruneSchemaTemplate_args(params); + try { + output.writeMessageBegin('pruneSchemaTemplate', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_pruneSchemaTemplate = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_pruneSchemaTemplate_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('pruneSchemaTemplate failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.querySchemaTemplate = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_querySchemaTemplate(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_querySchemaTemplate(req); + } +}; + +IClientRPCServiceClient.prototype.send_querySchemaTemplate = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_querySchemaTemplate_args(params); + try { + output.writeMessageBegin('querySchemaTemplate', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_querySchemaTemplate = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_querySchemaTemplate_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('querySchemaTemplate failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.showConfigurationTemplate = function(callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_showConfigurationTemplate(); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_showConfigurationTemplate(); + } +}; + +IClientRPCServiceClient.prototype.send_showConfigurationTemplate = function() { + var output = new this.pClass(this.output); + var args = new IClientRPCService_showConfigurationTemplate_args(); + try { + output.writeMessageBegin('showConfigurationTemplate', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_showConfigurationTemplate = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_showConfigurationTemplate_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('showConfigurationTemplate failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.showConfiguration = function(nodeId, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_showConfiguration(nodeId); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_showConfiguration(nodeId); + } +}; + +IClientRPCServiceClient.prototype.send_showConfiguration = function(nodeId) { + var output = new this.pClass(this.output); + var params = { + nodeId: nodeId + }; + var args = new IClientRPCService_showConfiguration_args(params); + try { + output.writeMessageBegin('showConfiguration', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_showConfiguration = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_showConfiguration_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('showConfiguration failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.setSchemaTemplate = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_setSchemaTemplate(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_setSchemaTemplate(req); + } +}; + +IClientRPCServiceClient.prototype.send_setSchemaTemplate = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_setSchemaTemplate_args(params); + try { + output.writeMessageBegin('setSchemaTemplate', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_setSchemaTemplate = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_setSchemaTemplate_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('setSchemaTemplate failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.unsetSchemaTemplate = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_unsetSchemaTemplate(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_unsetSchemaTemplate(req); + } +}; + +IClientRPCServiceClient.prototype.send_unsetSchemaTemplate = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_unsetSchemaTemplate_args(params); + try { + output.writeMessageBegin('unsetSchemaTemplate', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_unsetSchemaTemplate = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_unsetSchemaTemplate_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('unsetSchemaTemplate failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.dropSchemaTemplate = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_dropSchemaTemplate(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_dropSchemaTemplate(req); + } +}; + +IClientRPCServiceClient.prototype.send_dropSchemaTemplate = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_dropSchemaTemplate_args(params); + try { + output.writeMessageBegin('dropSchemaTemplate', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_dropSchemaTemplate = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_dropSchemaTemplate_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('dropSchemaTemplate failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.createTimeseriesUsingSchemaTemplate = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_createTimeseriesUsingSchemaTemplate(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_createTimeseriesUsingSchemaTemplate(req); + } +}; + +IClientRPCServiceClient.prototype.send_createTimeseriesUsingSchemaTemplate = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_createTimeseriesUsingSchemaTemplate_args(params); + try { + output.writeMessageBegin('createTimeseriesUsingSchemaTemplate', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_createTimeseriesUsingSchemaTemplate = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_createTimeseriesUsingSchemaTemplate_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('createTimeseriesUsingSchemaTemplate failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.handshake = function(info, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_handshake(info); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_handshake(info); + } +}; + +IClientRPCServiceClient.prototype.send_handshake = function(info) { + var output = new this.pClass(this.output); + var params = { + info: info + }; + var args = new IClientRPCService_handshake_args(params); + try { + output.writeMessageBegin('handshake', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_handshake = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_handshake_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('handshake failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.sendPipeData = function(buff, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_sendPipeData(buff); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_sendPipeData(buff); + } +}; + +IClientRPCServiceClient.prototype.send_sendPipeData = function(buff) { + var output = new this.pClass(this.output); + var params = { + buff: buff + }; + var args = new IClientRPCService_sendPipeData_args(params); + try { + output.writeMessageBegin('sendPipeData', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_sendPipeData = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_sendPipeData_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('sendPipeData failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.sendFile = function(metaInfo, buff, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_sendFile(metaInfo, buff); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_sendFile(metaInfo, buff); + } +}; + +IClientRPCServiceClient.prototype.send_sendFile = function(metaInfo, buff) { + var output = new this.pClass(this.output); + var params = { + metaInfo: metaInfo, + buff: buff + }; + var args = new IClientRPCService_sendFile_args(params); + try { + output.writeMessageBegin('sendFile', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_sendFile = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_sendFile_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('sendFile failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.pipeTransfer = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_pipeTransfer(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_pipeTransfer(req); + } +}; + +IClientRPCServiceClient.prototype.send_pipeTransfer = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_pipeTransfer_args(params); + try { + output.writeMessageBegin('pipeTransfer', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_pipeTransfer = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_pipeTransfer_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('pipeTransfer failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.pipeSubscribe = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_pipeSubscribe(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_pipeSubscribe(req); + } +}; + +IClientRPCServiceClient.prototype.send_pipeSubscribe = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_pipeSubscribe_args(params); + try { + output.writeMessageBegin('pipeSubscribe', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_pipeSubscribe = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_pipeSubscribe_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('pipeSubscribe failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.getBackupConfiguration = function(callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_getBackupConfiguration(); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_getBackupConfiguration(); + } +}; + +IClientRPCServiceClient.prototype.send_getBackupConfiguration = function() { + var output = new this.pClass(this.output); + var args = new IClientRPCService_getBackupConfiguration_args(); + try { + output.writeMessageBegin('getBackupConfiguration', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_getBackupConfiguration = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_getBackupConfiguration_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('getBackupConfiguration failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.fetchAllConnectionsInfo = function(callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_fetchAllConnectionsInfo(); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_fetchAllConnectionsInfo(); + } +}; + +IClientRPCServiceClient.prototype.send_fetchAllConnectionsInfo = function() { + var output = new this.pClass(this.output); + var args = new IClientRPCService_fetchAllConnectionsInfo_args(); + try { + output.writeMessageBegin('fetchAllConnectionsInfo', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_fetchAllConnectionsInfo = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_fetchAllConnectionsInfo_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('fetchAllConnectionsInfo failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.testConnectionEmptyRPC = function(callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_testConnectionEmptyRPC(); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_testConnectionEmptyRPC(); + } +}; + +IClientRPCServiceClient.prototype.send_testConnectionEmptyRPC = function() { + var output = new this.pClass(this.output); + var args = new IClientRPCService_testConnectionEmptyRPC_args(); + try { + output.writeMessageBegin('testConnectionEmptyRPC', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_testConnectionEmptyRPC = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_testConnectionEmptyRPC_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('testConnectionEmptyRPC failed: unknown result'); +}; +var IClientRPCServiceProcessor = exports.Processor = function(handler) { + this._handler = handler; +}; +IClientRPCServiceProcessor.prototype.process = function(input, output) { + var r = input.readMessageBegin(); + if (this['process_' + r.fname]) { + return this['process_' + r.fname].call(this, r.rseqid, input, output); + } else { + input.skip(Thrift.Type.STRUCT); + input.readMessageEnd(); + var x = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN_METHOD, 'Unknown function ' + r.fname); + output.writeMessageBegin(r.fname, Thrift.MessageType.EXCEPTION, r.rseqid); + x.write(output); + output.writeMessageEnd(); + output.flush(); + } +}; +IClientRPCServiceProcessor.prototype.process_executeQueryStatementV2 = function(seqid, input, output) { + var args = new IClientRPCService_executeQueryStatementV2_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeQueryStatementV2.length === 1) { + Q.fcall(this._handler.executeQueryStatementV2.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeQueryStatementV2_result({success: result}); + output.writeMessageBegin("executeQueryStatementV2", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeQueryStatementV2", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeQueryStatementV2(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeQueryStatementV2_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeQueryStatementV2", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeQueryStatementV2", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_executeUpdateStatementV2 = function(seqid, input, output) { + var args = new IClientRPCService_executeUpdateStatementV2_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeUpdateStatementV2.length === 1) { + Q.fcall(this._handler.executeUpdateStatementV2.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeUpdateStatementV2_result({success: result}); + output.writeMessageBegin("executeUpdateStatementV2", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeUpdateStatementV2", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeUpdateStatementV2(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeUpdateStatementV2_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeUpdateStatementV2", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeUpdateStatementV2", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_executeStatementV2 = function(seqid, input, output) { + var args = new IClientRPCService_executeStatementV2_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeStatementV2.length === 1) { + Q.fcall(this._handler.executeStatementV2.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeStatementV2_result({success: result}); + output.writeMessageBegin("executeStatementV2", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeStatementV2", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeStatementV2(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeStatementV2_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeStatementV2", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeStatementV2", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_executeRawDataQueryV2 = function(seqid, input, output) { + var args = new IClientRPCService_executeRawDataQueryV2_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeRawDataQueryV2.length === 1) { + Q.fcall(this._handler.executeRawDataQueryV2.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeRawDataQueryV2_result({success: result}); + output.writeMessageBegin("executeRawDataQueryV2", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeRawDataQueryV2", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeRawDataQueryV2(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeRawDataQueryV2_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeRawDataQueryV2", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeRawDataQueryV2", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_executeLastDataQueryV2 = function(seqid, input, output) { + var args = new IClientRPCService_executeLastDataQueryV2_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeLastDataQueryV2.length === 1) { + Q.fcall(this._handler.executeLastDataQueryV2.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeLastDataQueryV2_result({success: result}); + output.writeMessageBegin("executeLastDataQueryV2", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeLastDataQueryV2", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeLastDataQueryV2(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeLastDataQueryV2_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeLastDataQueryV2", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeLastDataQueryV2", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_executeFastLastDataQueryForOneDeviceV2 = function(seqid, input, output) { + var args = new IClientRPCService_executeFastLastDataQueryForOneDeviceV2_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeFastLastDataQueryForOneDeviceV2.length === 1) { + Q.fcall(this._handler.executeFastLastDataQueryForOneDeviceV2.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeFastLastDataQueryForOneDeviceV2_result({success: result}); + output.writeMessageBegin("executeFastLastDataQueryForOneDeviceV2", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeFastLastDataQueryForOneDeviceV2", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeFastLastDataQueryForOneDeviceV2(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeFastLastDataQueryForOneDeviceV2_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeFastLastDataQueryForOneDeviceV2", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeFastLastDataQueryForOneDeviceV2", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_executeAggregationQueryV2 = function(seqid, input, output) { + var args = new IClientRPCService_executeAggregationQueryV2_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeAggregationQueryV2.length === 1) { + Q.fcall(this._handler.executeAggregationQueryV2.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeAggregationQueryV2_result({success: result}); + output.writeMessageBegin("executeAggregationQueryV2", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeAggregationQueryV2", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeAggregationQueryV2(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeAggregationQueryV2_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeAggregationQueryV2", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeAggregationQueryV2", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_executeGroupByQueryIntervalQuery = function(seqid, input, output) { + var args = new IClientRPCService_executeGroupByQueryIntervalQuery_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeGroupByQueryIntervalQuery.length === 1) { + Q.fcall(this._handler.executeGroupByQueryIntervalQuery.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeGroupByQueryIntervalQuery_result({success: result}); + output.writeMessageBegin("executeGroupByQueryIntervalQuery", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeGroupByQueryIntervalQuery", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeGroupByQueryIntervalQuery(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeGroupByQueryIntervalQuery_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeGroupByQueryIntervalQuery", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeGroupByQueryIntervalQuery", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_fetchResultsV2 = function(seqid, input, output) { + var args = new IClientRPCService_fetchResultsV2_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.fetchResultsV2.length === 1) { + Q.fcall(this._handler.fetchResultsV2.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_fetchResultsV2_result({success: result}); + output.writeMessageBegin("fetchResultsV2", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("fetchResultsV2", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.fetchResultsV2(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_fetchResultsV2_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("fetchResultsV2", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("fetchResultsV2", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_openSession = function(seqid, input, output) { + var args = new IClientRPCService_openSession_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.openSession.length === 1) { + Q.fcall(this._handler.openSession.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_openSession_result({success: result}); + output.writeMessageBegin("openSession", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("openSession", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.openSession(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_openSession_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("openSession", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("openSession", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_closeSession = function(seqid, input, output) { + var args = new IClientRPCService_closeSession_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.closeSession.length === 1) { + Q.fcall(this._handler.closeSession.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_closeSession_result({success: result}); + output.writeMessageBegin("closeSession", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("closeSession", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.closeSession(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_closeSession_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("closeSession", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("closeSession", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_executeStatement = function(seqid, input, output) { + var args = new IClientRPCService_executeStatement_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeStatement.length === 1) { + Q.fcall(this._handler.executeStatement.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeStatement_result({success: result}); + output.writeMessageBegin("executeStatement", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeStatement", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeStatement(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeStatement_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeStatement", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeStatement", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_executeBatchStatement = function(seqid, input, output) { + var args = new IClientRPCService_executeBatchStatement_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeBatchStatement.length === 1) { + Q.fcall(this._handler.executeBatchStatement.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeBatchStatement_result({success: result}); + output.writeMessageBegin("executeBatchStatement", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeBatchStatement", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeBatchStatement(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeBatchStatement_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeBatchStatement", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeBatchStatement", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_executeQueryStatement = function(seqid, input, output) { + var args = new IClientRPCService_executeQueryStatement_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeQueryStatement.length === 1) { + Q.fcall(this._handler.executeQueryStatement.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeQueryStatement_result({success: result}); + output.writeMessageBegin("executeQueryStatement", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeQueryStatement", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeQueryStatement(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeQueryStatement_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeQueryStatement", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeQueryStatement", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_executeUpdateStatement = function(seqid, input, output) { + var args = new IClientRPCService_executeUpdateStatement_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeUpdateStatement.length === 1) { + Q.fcall(this._handler.executeUpdateStatement.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeUpdateStatement_result({success: result}); + output.writeMessageBegin("executeUpdateStatement", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeUpdateStatement", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeUpdateStatement(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeUpdateStatement_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeUpdateStatement", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeUpdateStatement", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_fetchResults = function(seqid, input, output) { + var args = new IClientRPCService_fetchResults_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.fetchResults.length === 1) { + Q.fcall(this._handler.fetchResults.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_fetchResults_result({success: result}); + output.writeMessageBegin("fetchResults", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("fetchResults", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.fetchResults(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_fetchResults_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("fetchResults", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("fetchResults", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_fetchMetadata = function(seqid, input, output) { + var args = new IClientRPCService_fetchMetadata_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.fetchMetadata.length === 1) { + Q.fcall(this._handler.fetchMetadata.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_fetchMetadata_result({success: result}); + output.writeMessageBegin("fetchMetadata", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("fetchMetadata", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.fetchMetadata(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_fetchMetadata_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("fetchMetadata", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("fetchMetadata", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_cancelOperation = function(seqid, input, output) { + var args = new IClientRPCService_cancelOperation_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.cancelOperation.length === 1) { + Q.fcall(this._handler.cancelOperation.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_cancelOperation_result({success: result}); + output.writeMessageBegin("cancelOperation", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("cancelOperation", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.cancelOperation(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_cancelOperation_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("cancelOperation", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("cancelOperation", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_closeOperation = function(seqid, input, output) { + var args = new IClientRPCService_closeOperation_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.closeOperation.length === 1) { + Q.fcall(this._handler.closeOperation.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_closeOperation_result({success: result}); + output.writeMessageBegin("closeOperation", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("closeOperation", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.closeOperation(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_closeOperation_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("closeOperation", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("closeOperation", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_getTimeZone = function(seqid, input, output) { + var args = new IClientRPCService_getTimeZone_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.getTimeZone.length === 1) { + Q.fcall(this._handler.getTimeZone.bind(this._handler), + args.sessionId + ).then(function(result) { + var result_obj = new IClientRPCService_getTimeZone_result({success: result}); + output.writeMessageBegin("getTimeZone", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("getTimeZone", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.getTimeZone(args.sessionId, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_getTimeZone_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("getTimeZone", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("getTimeZone", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_setTimeZone = function(seqid, input, output) { + var args = new IClientRPCService_setTimeZone_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.setTimeZone.length === 1) { + Q.fcall(this._handler.setTimeZone.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_setTimeZone_result({success: result}); + output.writeMessageBegin("setTimeZone", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("setTimeZone", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.setTimeZone(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_setTimeZone_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("setTimeZone", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("setTimeZone", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_getProperties = function(seqid, input, output) { + var args = new IClientRPCService_getProperties_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.getProperties.length === 0) { + Q.fcall(this._handler.getProperties.bind(this._handler) + ).then(function(result) { + var result_obj = new IClientRPCService_getProperties_result({success: result}); + output.writeMessageBegin("getProperties", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("getProperties", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.getProperties(function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_getProperties_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("getProperties", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("getProperties", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_setStorageGroup = function(seqid, input, output) { + var args = new IClientRPCService_setStorageGroup_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.setStorageGroup.length === 2) { + Q.fcall(this._handler.setStorageGroup.bind(this._handler), + args.sessionId, + args.storageGroup + ).then(function(result) { + var result_obj = new IClientRPCService_setStorageGroup_result({success: result}); + output.writeMessageBegin("setStorageGroup", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("setStorageGroup", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.setStorageGroup(args.sessionId, args.storageGroup, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_setStorageGroup_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("setStorageGroup", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("setStorageGroup", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_createTimeseries = function(seqid, input, output) { + var args = new IClientRPCService_createTimeseries_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.createTimeseries.length === 1) { + Q.fcall(this._handler.createTimeseries.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_createTimeseries_result({success: result}); + output.writeMessageBegin("createTimeseries", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("createTimeseries", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.createTimeseries(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_createTimeseries_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("createTimeseries", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("createTimeseries", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_createAlignedTimeseries = function(seqid, input, output) { + var args = new IClientRPCService_createAlignedTimeseries_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.createAlignedTimeseries.length === 1) { + Q.fcall(this._handler.createAlignedTimeseries.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_createAlignedTimeseries_result({success: result}); + output.writeMessageBegin("createAlignedTimeseries", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("createAlignedTimeseries", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.createAlignedTimeseries(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_createAlignedTimeseries_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("createAlignedTimeseries", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("createAlignedTimeseries", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_createMultiTimeseries = function(seqid, input, output) { + var args = new IClientRPCService_createMultiTimeseries_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.createMultiTimeseries.length === 1) { + Q.fcall(this._handler.createMultiTimeseries.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_createMultiTimeseries_result({success: result}); + output.writeMessageBegin("createMultiTimeseries", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("createMultiTimeseries", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.createMultiTimeseries(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_createMultiTimeseries_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("createMultiTimeseries", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("createMultiTimeseries", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_deleteTimeseries = function(seqid, input, output) { + var args = new IClientRPCService_deleteTimeseries_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.deleteTimeseries.length === 2) { + Q.fcall(this._handler.deleteTimeseries.bind(this._handler), + args.sessionId, + args.path + ).then(function(result) { + var result_obj = new IClientRPCService_deleteTimeseries_result({success: result}); + output.writeMessageBegin("deleteTimeseries", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("deleteTimeseries", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.deleteTimeseries(args.sessionId, args.path, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_deleteTimeseries_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("deleteTimeseries", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("deleteTimeseries", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_deleteStorageGroups = function(seqid, input, output) { + var args = new IClientRPCService_deleteStorageGroups_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.deleteStorageGroups.length === 2) { + Q.fcall(this._handler.deleteStorageGroups.bind(this._handler), + args.sessionId, + args.storageGroup + ).then(function(result) { + var result_obj = new IClientRPCService_deleteStorageGroups_result({success: result}); + output.writeMessageBegin("deleteStorageGroups", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("deleteStorageGroups", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.deleteStorageGroups(args.sessionId, args.storageGroup, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_deleteStorageGroups_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("deleteStorageGroups", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("deleteStorageGroups", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_insertRecord = function(seqid, input, output) { + var args = new IClientRPCService_insertRecord_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.insertRecord.length === 1) { + Q.fcall(this._handler.insertRecord.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_insertRecord_result({success: result}); + output.writeMessageBegin("insertRecord", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertRecord", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.insertRecord(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_insertRecord_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("insertRecord", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertRecord", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_insertStringRecord = function(seqid, input, output) { + var args = new IClientRPCService_insertStringRecord_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.insertStringRecord.length === 1) { + Q.fcall(this._handler.insertStringRecord.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_insertStringRecord_result({success: result}); + output.writeMessageBegin("insertStringRecord", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertStringRecord", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.insertStringRecord(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_insertStringRecord_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("insertStringRecord", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertStringRecord", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_insertTablet = function(seqid, input, output) { + var args = new IClientRPCService_insertTablet_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.insertTablet.length === 1) { + Q.fcall(this._handler.insertTablet.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_insertTablet_result({success: result}); + output.writeMessageBegin("insertTablet", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertTablet", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.insertTablet(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_insertTablet_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("insertTablet", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertTablet", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_insertTablets = function(seqid, input, output) { + var args = new IClientRPCService_insertTablets_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.insertTablets.length === 1) { + Q.fcall(this._handler.insertTablets.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_insertTablets_result({success: result}); + output.writeMessageBegin("insertTablets", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertTablets", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.insertTablets(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_insertTablets_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("insertTablets", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertTablets", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_insertRecords = function(seqid, input, output) { + var args = new IClientRPCService_insertRecords_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.insertRecords.length === 1) { + Q.fcall(this._handler.insertRecords.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_insertRecords_result({success: result}); + output.writeMessageBegin("insertRecords", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertRecords", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.insertRecords(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_insertRecords_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("insertRecords", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertRecords", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_insertRecordsOfOneDevice = function(seqid, input, output) { + var args = new IClientRPCService_insertRecordsOfOneDevice_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.insertRecordsOfOneDevice.length === 1) { + Q.fcall(this._handler.insertRecordsOfOneDevice.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_insertRecordsOfOneDevice_result({success: result}); + output.writeMessageBegin("insertRecordsOfOneDevice", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertRecordsOfOneDevice", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.insertRecordsOfOneDevice(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_insertRecordsOfOneDevice_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("insertRecordsOfOneDevice", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertRecordsOfOneDevice", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_insertStringRecordsOfOneDevice = function(seqid, input, output) { + var args = new IClientRPCService_insertStringRecordsOfOneDevice_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.insertStringRecordsOfOneDevice.length === 1) { + Q.fcall(this._handler.insertStringRecordsOfOneDevice.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_insertStringRecordsOfOneDevice_result({success: result}); + output.writeMessageBegin("insertStringRecordsOfOneDevice", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertStringRecordsOfOneDevice", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.insertStringRecordsOfOneDevice(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_insertStringRecordsOfOneDevice_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("insertStringRecordsOfOneDevice", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertStringRecordsOfOneDevice", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_insertStringRecords = function(seqid, input, output) { + var args = new IClientRPCService_insertStringRecords_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.insertStringRecords.length === 1) { + Q.fcall(this._handler.insertStringRecords.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_insertStringRecords_result({success: result}); + output.writeMessageBegin("insertStringRecords", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertStringRecords", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.insertStringRecords(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_insertStringRecords_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("insertStringRecords", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertStringRecords", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_testInsertTablet = function(seqid, input, output) { + var args = new IClientRPCService_testInsertTablet_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.testInsertTablet.length === 1) { + Q.fcall(this._handler.testInsertTablet.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_testInsertTablet_result({success: result}); + output.writeMessageBegin("testInsertTablet", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testInsertTablet", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.testInsertTablet(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_testInsertTablet_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("testInsertTablet", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testInsertTablet", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_testInsertTablets = function(seqid, input, output) { + var args = new IClientRPCService_testInsertTablets_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.testInsertTablets.length === 1) { + Q.fcall(this._handler.testInsertTablets.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_testInsertTablets_result({success: result}); + output.writeMessageBegin("testInsertTablets", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testInsertTablets", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.testInsertTablets(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_testInsertTablets_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("testInsertTablets", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testInsertTablets", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_testInsertRecord = function(seqid, input, output) { + var args = new IClientRPCService_testInsertRecord_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.testInsertRecord.length === 1) { + Q.fcall(this._handler.testInsertRecord.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_testInsertRecord_result({success: result}); + output.writeMessageBegin("testInsertRecord", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testInsertRecord", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.testInsertRecord(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_testInsertRecord_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("testInsertRecord", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testInsertRecord", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_testInsertStringRecord = function(seqid, input, output) { + var args = new IClientRPCService_testInsertStringRecord_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.testInsertStringRecord.length === 1) { + Q.fcall(this._handler.testInsertStringRecord.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_testInsertStringRecord_result({success: result}); + output.writeMessageBegin("testInsertStringRecord", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testInsertStringRecord", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.testInsertStringRecord(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_testInsertStringRecord_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("testInsertStringRecord", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testInsertStringRecord", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_testInsertRecords = function(seqid, input, output) { + var args = new IClientRPCService_testInsertRecords_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.testInsertRecords.length === 1) { + Q.fcall(this._handler.testInsertRecords.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_testInsertRecords_result({success: result}); + output.writeMessageBegin("testInsertRecords", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testInsertRecords", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.testInsertRecords(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_testInsertRecords_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("testInsertRecords", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testInsertRecords", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_testInsertRecordsOfOneDevice = function(seqid, input, output) { + var args = new IClientRPCService_testInsertRecordsOfOneDevice_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.testInsertRecordsOfOneDevice.length === 1) { + Q.fcall(this._handler.testInsertRecordsOfOneDevice.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_testInsertRecordsOfOneDevice_result({success: result}); + output.writeMessageBegin("testInsertRecordsOfOneDevice", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testInsertRecordsOfOneDevice", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.testInsertRecordsOfOneDevice(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_testInsertRecordsOfOneDevice_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("testInsertRecordsOfOneDevice", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testInsertRecordsOfOneDevice", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_testInsertStringRecords = function(seqid, input, output) { + var args = new IClientRPCService_testInsertStringRecords_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.testInsertStringRecords.length === 1) { + Q.fcall(this._handler.testInsertStringRecords.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_testInsertStringRecords_result({success: result}); + output.writeMessageBegin("testInsertStringRecords", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testInsertStringRecords", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.testInsertStringRecords(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_testInsertStringRecords_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("testInsertStringRecords", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testInsertStringRecords", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_deleteData = function(seqid, input, output) { + var args = new IClientRPCService_deleteData_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.deleteData.length === 1) { + Q.fcall(this._handler.deleteData.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_deleteData_result({success: result}); + output.writeMessageBegin("deleteData", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("deleteData", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.deleteData(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_deleteData_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("deleteData", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("deleteData", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_executeRawDataQuery = function(seqid, input, output) { + var args = new IClientRPCService_executeRawDataQuery_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeRawDataQuery.length === 1) { + Q.fcall(this._handler.executeRawDataQuery.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeRawDataQuery_result({success: result}); + output.writeMessageBegin("executeRawDataQuery", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeRawDataQuery", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeRawDataQuery(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeRawDataQuery_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeRawDataQuery", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeRawDataQuery", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_executeLastDataQuery = function(seqid, input, output) { + var args = new IClientRPCService_executeLastDataQuery_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeLastDataQuery.length === 1) { + Q.fcall(this._handler.executeLastDataQuery.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeLastDataQuery_result({success: result}); + output.writeMessageBegin("executeLastDataQuery", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeLastDataQuery", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeLastDataQuery(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeLastDataQuery_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeLastDataQuery", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeLastDataQuery", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_executeAggregationQuery = function(seqid, input, output) { + var args = new IClientRPCService_executeAggregationQuery_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeAggregationQuery.length === 1) { + Q.fcall(this._handler.executeAggregationQuery.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeAggregationQuery_result({success: result}); + output.writeMessageBegin("executeAggregationQuery", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeAggregationQuery", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeAggregationQuery(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeAggregationQuery_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeAggregationQuery", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeAggregationQuery", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_requestStatementId = function(seqid, input, output) { + var args = new IClientRPCService_requestStatementId_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.requestStatementId.length === 1) { + Q.fcall(this._handler.requestStatementId.bind(this._handler), + args.sessionId + ).then(function(result) { + var result_obj = new IClientRPCService_requestStatementId_result({success: result}); + output.writeMessageBegin("requestStatementId", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("requestStatementId", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.requestStatementId(args.sessionId, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_requestStatementId_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("requestStatementId", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("requestStatementId", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_createSchemaTemplate = function(seqid, input, output) { + var args = new IClientRPCService_createSchemaTemplate_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.createSchemaTemplate.length === 1) { + Q.fcall(this._handler.createSchemaTemplate.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_createSchemaTemplate_result({success: result}); + output.writeMessageBegin("createSchemaTemplate", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("createSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.createSchemaTemplate(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_createSchemaTemplate_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("createSchemaTemplate", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("createSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_appendSchemaTemplate = function(seqid, input, output) { + var args = new IClientRPCService_appendSchemaTemplate_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.appendSchemaTemplate.length === 1) { + Q.fcall(this._handler.appendSchemaTemplate.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_appendSchemaTemplate_result({success: result}); + output.writeMessageBegin("appendSchemaTemplate", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("appendSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.appendSchemaTemplate(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_appendSchemaTemplate_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("appendSchemaTemplate", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("appendSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_pruneSchemaTemplate = function(seqid, input, output) { + var args = new IClientRPCService_pruneSchemaTemplate_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.pruneSchemaTemplate.length === 1) { + Q.fcall(this._handler.pruneSchemaTemplate.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_pruneSchemaTemplate_result({success: result}); + output.writeMessageBegin("pruneSchemaTemplate", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("pruneSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.pruneSchemaTemplate(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_pruneSchemaTemplate_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("pruneSchemaTemplate", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("pruneSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_querySchemaTemplate = function(seqid, input, output) { + var args = new IClientRPCService_querySchemaTemplate_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.querySchemaTemplate.length === 1) { + Q.fcall(this._handler.querySchemaTemplate.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_querySchemaTemplate_result({success: result}); + output.writeMessageBegin("querySchemaTemplate", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("querySchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.querySchemaTemplate(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_querySchemaTemplate_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("querySchemaTemplate", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("querySchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_showConfigurationTemplate = function(seqid, input, output) { + var args = new IClientRPCService_showConfigurationTemplate_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.showConfigurationTemplate.length === 0) { + Q.fcall(this._handler.showConfigurationTemplate.bind(this._handler) + ).then(function(result) { + var result_obj = new IClientRPCService_showConfigurationTemplate_result({success: result}); + output.writeMessageBegin("showConfigurationTemplate", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("showConfigurationTemplate", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.showConfigurationTemplate(function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_showConfigurationTemplate_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("showConfigurationTemplate", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("showConfigurationTemplate", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_showConfiguration = function(seqid, input, output) { + var args = new IClientRPCService_showConfiguration_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.showConfiguration.length === 1) { + Q.fcall(this._handler.showConfiguration.bind(this._handler), + args.nodeId + ).then(function(result) { + var result_obj = new IClientRPCService_showConfiguration_result({success: result}); + output.writeMessageBegin("showConfiguration", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("showConfiguration", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.showConfiguration(args.nodeId, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_showConfiguration_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("showConfiguration", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("showConfiguration", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_setSchemaTemplate = function(seqid, input, output) { + var args = new IClientRPCService_setSchemaTemplate_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.setSchemaTemplate.length === 1) { + Q.fcall(this._handler.setSchemaTemplate.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_setSchemaTemplate_result({success: result}); + output.writeMessageBegin("setSchemaTemplate", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("setSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.setSchemaTemplate(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_setSchemaTemplate_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("setSchemaTemplate", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("setSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_unsetSchemaTemplate = function(seqid, input, output) { + var args = new IClientRPCService_unsetSchemaTemplate_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.unsetSchemaTemplate.length === 1) { + Q.fcall(this._handler.unsetSchemaTemplate.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_unsetSchemaTemplate_result({success: result}); + output.writeMessageBegin("unsetSchemaTemplate", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("unsetSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.unsetSchemaTemplate(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_unsetSchemaTemplate_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("unsetSchemaTemplate", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("unsetSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_dropSchemaTemplate = function(seqid, input, output) { + var args = new IClientRPCService_dropSchemaTemplate_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.dropSchemaTemplate.length === 1) { + Q.fcall(this._handler.dropSchemaTemplate.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_dropSchemaTemplate_result({success: result}); + output.writeMessageBegin("dropSchemaTemplate", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("dropSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.dropSchemaTemplate(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_dropSchemaTemplate_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("dropSchemaTemplate", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("dropSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_createTimeseriesUsingSchemaTemplate = function(seqid, input, output) { + var args = new IClientRPCService_createTimeseriesUsingSchemaTemplate_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.createTimeseriesUsingSchemaTemplate.length === 1) { + Q.fcall(this._handler.createTimeseriesUsingSchemaTemplate.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_createTimeseriesUsingSchemaTemplate_result({success: result}); + output.writeMessageBegin("createTimeseriesUsingSchemaTemplate", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("createTimeseriesUsingSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.createTimeseriesUsingSchemaTemplate(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_createTimeseriesUsingSchemaTemplate_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("createTimeseriesUsingSchemaTemplate", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("createTimeseriesUsingSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_handshake = function(seqid, input, output) { + var args = new IClientRPCService_handshake_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.handshake.length === 1) { + Q.fcall(this._handler.handshake.bind(this._handler), + args.info + ).then(function(result) { + var result_obj = new IClientRPCService_handshake_result({success: result}); + output.writeMessageBegin("handshake", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("handshake", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.handshake(args.info, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_handshake_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("handshake", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("handshake", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_sendPipeData = function(seqid, input, output) { + var args = new IClientRPCService_sendPipeData_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.sendPipeData.length === 1) { + Q.fcall(this._handler.sendPipeData.bind(this._handler), + args.buff + ).then(function(result) { + var result_obj = new IClientRPCService_sendPipeData_result({success: result}); + output.writeMessageBegin("sendPipeData", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("sendPipeData", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.sendPipeData(args.buff, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_sendPipeData_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("sendPipeData", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("sendPipeData", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_sendFile = function(seqid, input, output) { + var args = new IClientRPCService_sendFile_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.sendFile.length === 2) { + Q.fcall(this._handler.sendFile.bind(this._handler), + args.metaInfo, + args.buff + ).then(function(result) { + var result_obj = new IClientRPCService_sendFile_result({success: result}); + output.writeMessageBegin("sendFile", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("sendFile", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.sendFile(args.metaInfo, args.buff, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_sendFile_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("sendFile", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("sendFile", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_pipeTransfer = function(seqid, input, output) { + var args = new IClientRPCService_pipeTransfer_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.pipeTransfer.length === 1) { + Q.fcall(this._handler.pipeTransfer.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_pipeTransfer_result({success: result}); + output.writeMessageBegin("pipeTransfer", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("pipeTransfer", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.pipeTransfer(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_pipeTransfer_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("pipeTransfer", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("pipeTransfer", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_pipeSubscribe = function(seqid, input, output) { + var args = new IClientRPCService_pipeSubscribe_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.pipeSubscribe.length === 1) { + Q.fcall(this._handler.pipeSubscribe.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_pipeSubscribe_result({success: result}); + output.writeMessageBegin("pipeSubscribe", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("pipeSubscribe", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.pipeSubscribe(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_pipeSubscribe_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("pipeSubscribe", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("pipeSubscribe", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_getBackupConfiguration = function(seqid, input, output) { + var args = new IClientRPCService_getBackupConfiguration_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.getBackupConfiguration.length === 0) { + Q.fcall(this._handler.getBackupConfiguration.bind(this._handler) + ).then(function(result) { + var result_obj = new IClientRPCService_getBackupConfiguration_result({success: result}); + output.writeMessageBegin("getBackupConfiguration", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("getBackupConfiguration", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.getBackupConfiguration(function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_getBackupConfiguration_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("getBackupConfiguration", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("getBackupConfiguration", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_fetchAllConnectionsInfo = function(seqid, input, output) { + var args = new IClientRPCService_fetchAllConnectionsInfo_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.fetchAllConnectionsInfo.length === 0) { + Q.fcall(this._handler.fetchAllConnectionsInfo.bind(this._handler) + ).then(function(result) { + var result_obj = new IClientRPCService_fetchAllConnectionsInfo_result({success: result}); + output.writeMessageBegin("fetchAllConnectionsInfo", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("fetchAllConnectionsInfo", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.fetchAllConnectionsInfo(function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_fetchAllConnectionsInfo_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("fetchAllConnectionsInfo", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("fetchAllConnectionsInfo", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_testConnectionEmptyRPC = function(seqid, input, output) { + var args = new IClientRPCService_testConnectionEmptyRPC_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.testConnectionEmptyRPC.length === 0) { + Q.fcall(this._handler.testConnectionEmptyRPC.bind(this._handler) + ).then(function(result) { + var result_obj = new IClientRPCService_testConnectionEmptyRPC_result({success: result}); + output.writeMessageBegin("testConnectionEmptyRPC", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testConnectionEmptyRPC", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.testConnectionEmptyRPC(function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_testConnectionEmptyRPC_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("testConnectionEmptyRPC", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testConnectionEmptyRPC", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; diff --git a/cdsp/information-layer/handlers/iotdb/gen-nodejs/client_types.js b/cdsp/information-layer/handlers/iotdb/gen-nodejs/client_types.js new file mode 100644 index 0000000..018aec1 --- /dev/null +++ b/cdsp/information-layer/handlers/iotdb/gen-nodejs/client_types.js @@ -0,0 +1,7961 @@ +// +// Autogenerated by Thrift Compiler (0.14.1) +// +// 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 Int64 = require('node-int64'); + +var common_ttypes = require('./common_types'); + + +var ttypes = module.exports = {}; +ttypes.TSProtocolVersion = { + 'IOTDB_SERVICE_PROTOCOL_V1' : 0, + 'IOTDB_SERVICE_PROTOCOL_V2' : 1, + 'IOTDB_SERVICE_PROTOCOL_V3' : 2 +}; +ttypes.TSConnectionType = { + 'THRIFT_BASED' : 0, + 'MQTT_BASED' : 1, + 'INTERNAL' : 2, + 'REST_BASED' : 3 +}; +var TSQueryDataSet = module.exports.TSQueryDataSet = function(args) { + this.time = null; + this.valueList = null; + this.bitmapList = null; + if (args) { + if (args.time !== undefined && args.time !== null) { + this.time = args.time; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field time is unset!'); + } + if (args.valueList !== undefined && args.valueList !== null) { + this.valueList = Thrift.copyList(args.valueList, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field valueList is unset!'); + } + if (args.bitmapList !== undefined && args.bitmapList !== null) { + this.bitmapList = Thrift.copyList(args.bitmapList, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field bitmapList is unset!'); + } + } +}; +TSQueryDataSet.prototype = {}; +TSQueryDataSet.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.time = input.readBinary(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.valueList = []; + var _rtmp31 = input.readListBegin(); + var _size0 = _rtmp31.size || 0; + for (var _i2 = 0; _i2 < _size0; ++_i2) { + var elem3 = null; + elem3 = input.readBinary(); + this.valueList.push(elem3); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.bitmapList = []; + var _rtmp35 = input.readListBegin(); + var _size4 = _rtmp35.size || 0; + for (var _i6 = 0; _i6 < _size4; ++_i6) { + var elem7 = null; + elem7 = input.readBinary(); + this.bitmapList.push(elem7); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSQueryDataSet.prototype.write = function(output) { + output.writeStructBegin('TSQueryDataSet'); + if (this.time !== null && this.time !== undefined) { + output.writeFieldBegin('time', Thrift.Type.STRING, 1); + output.writeBinary(this.time); + output.writeFieldEnd(); + } + if (this.valueList !== null && this.valueList !== undefined) { + output.writeFieldBegin('valueList', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.valueList.length); + for (var iter8 in this.valueList) { + if (this.valueList.hasOwnProperty(iter8)) { + iter8 = this.valueList[iter8]; + output.writeBinary(iter8); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.bitmapList !== null && this.bitmapList !== undefined) { + output.writeFieldBegin('bitmapList', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.STRING, this.bitmapList.length); + for (var iter9 in this.bitmapList) { + if (this.bitmapList.hasOwnProperty(iter9)) { + iter9 = this.bitmapList[iter9]; + output.writeBinary(iter9); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSQueryNonAlignDataSet = module.exports.TSQueryNonAlignDataSet = function(args) { + this.timeList = null; + this.valueList = null; + if (args) { + if (args.timeList !== undefined && args.timeList !== null) { + this.timeList = Thrift.copyList(args.timeList, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timeList is unset!'); + } + if (args.valueList !== undefined && args.valueList !== null) { + this.valueList = Thrift.copyList(args.valueList, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field valueList is unset!'); + } + } +}; +TSQueryNonAlignDataSet.prototype = {}; +TSQueryNonAlignDataSet.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.LIST) { + this.timeList = []; + var _rtmp311 = input.readListBegin(); + var _size10 = _rtmp311.size || 0; + for (var _i12 = 0; _i12 < _size10; ++_i12) { + var elem13 = null; + elem13 = input.readBinary(); + this.timeList.push(elem13); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.valueList = []; + var _rtmp315 = input.readListBegin(); + var _size14 = _rtmp315.size || 0; + for (var _i16 = 0; _i16 < _size14; ++_i16) { + var elem17 = null; + elem17 = input.readBinary(); + this.valueList.push(elem17); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSQueryNonAlignDataSet.prototype.write = function(output) { + output.writeStructBegin('TSQueryNonAlignDataSet'); + if (this.timeList !== null && this.timeList !== undefined) { + output.writeFieldBegin('timeList', Thrift.Type.LIST, 1); + output.writeListBegin(Thrift.Type.STRING, this.timeList.length); + for (var iter18 in this.timeList) { + if (this.timeList.hasOwnProperty(iter18)) { + iter18 = this.timeList[iter18]; + output.writeBinary(iter18); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.valueList !== null && this.valueList !== undefined) { + output.writeFieldBegin('valueList', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.valueList.length); + for (var iter19 in this.valueList) { + if (this.valueList.hasOwnProperty(iter19)) { + iter19 = this.valueList[iter19]; + output.writeBinary(iter19); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSTracingInfo = module.exports.TSTracingInfo = function(args) { + this.activityList = null; + this.elapsedTimeList = null; + this.seriesPathNum = null; + this.seqFileNum = null; + this.unSeqFileNum = null; + this.sequenceChunkNum = null; + this.sequenceChunkPointNum = null; + this.unsequenceChunkNum = null; + this.unsequenceChunkPointNum = null; + this.totalPageNum = null; + this.overlappedPageNum = null; + if (args) { + if (args.activityList !== undefined && args.activityList !== null) { + this.activityList = Thrift.copyList(args.activityList, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field activityList is unset!'); + } + if (args.elapsedTimeList !== undefined && args.elapsedTimeList !== null) { + this.elapsedTimeList = Thrift.copyList(args.elapsedTimeList, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field elapsedTimeList is unset!'); + } + if (args.seriesPathNum !== undefined && args.seriesPathNum !== null) { + this.seriesPathNum = args.seriesPathNum; + } + if (args.seqFileNum !== undefined && args.seqFileNum !== null) { + this.seqFileNum = args.seqFileNum; + } + if (args.unSeqFileNum !== undefined && args.unSeqFileNum !== null) { + this.unSeqFileNum = args.unSeqFileNum; + } + if (args.sequenceChunkNum !== undefined && args.sequenceChunkNum !== null) { + this.sequenceChunkNum = args.sequenceChunkNum; + } + if (args.sequenceChunkPointNum !== undefined && args.sequenceChunkPointNum !== null) { + this.sequenceChunkPointNum = args.sequenceChunkPointNum; + } + if (args.unsequenceChunkNum !== undefined && args.unsequenceChunkNum !== null) { + this.unsequenceChunkNum = args.unsequenceChunkNum; + } + if (args.unsequenceChunkPointNum !== undefined && args.unsequenceChunkPointNum !== null) { + this.unsequenceChunkPointNum = args.unsequenceChunkPointNum; + } + if (args.totalPageNum !== undefined && args.totalPageNum !== null) { + this.totalPageNum = args.totalPageNum; + } + if (args.overlappedPageNum !== undefined && args.overlappedPageNum !== null) { + this.overlappedPageNum = args.overlappedPageNum; + } + } +}; +TSTracingInfo.prototype = {}; +TSTracingInfo.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.LIST) { + this.activityList = []; + var _rtmp321 = input.readListBegin(); + var _size20 = _rtmp321.size || 0; + for (var _i22 = 0; _i22 < _size20; ++_i22) { + var elem23 = null; + elem23 = input.readString(); + this.activityList.push(elem23); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.elapsedTimeList = []; + var _rtmp325 = input.readListBegin(); + var _size24 = _rtmp325.size || 0; + for (var _i26 = 0; _i26 < _size24; ++_i26) { + var elem27 = null; + elem27 = input.readI64(); + this.elapsedTimeList.push(elem27); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I32) { + this.seriesPathNum = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.I32) { + this.seqFileNum = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I32) { + this.unSeqFileNum = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.I32) { + this.sequenceChunkNum = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.I64) { + this.sequenceChunkPointNum = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.I32) { + this.unsequenceChunkNum = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 9: + if (ftype == Thrift.Type.I64) { + this.unsequenceChunkPointNum = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 10: + if (ftype == Thrift.Type.I32) { + this.totalPageNum = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 11: + if (ftype == Thrift.Type.I32) { + this.overlappedPageNum = input.readI32(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSTracingInfo.prototype.write = function(output) { + output.writeStructBegin('TSTracingInfo'); + if (this.activityList !== null && this.activityList !== undefined) { + output.writeFieldBegin('activityList', Thrift.Type.LIST, 1); + output.writeListBegin(Thrift.Type.STRING, this.activityList.length); + for (var iter28 in this.activityList) { + if (this.activityList.hasOwnProperty(iter28)) { + iter28 = this.activityList[iter28]; + output.writeString(iter28); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.elapsedTimeList !== null && this.elapsedTimeList !== undefined) { + output.writeFieldBegin('elapsedTimeList', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.I64, this.elapsedTimeList.length); + for (var iter29 in this.elapsedTimeList) { + if (this.elapsedTimeList.hasOwnProperty(iter29)) { + iter29 = this.elapsedTimeList[iter29]; + output.writeI64(iter29); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.seriesPathNum !== null && this.seriesPathNum !== undefined) { + output.writeFieldBegin('seriesPathNum', Thrift.Type.I32, 3); + output.writeI32(this.seriesPathNum); + output.writeFieldEnd(); + } + if (this.seqFileNum !== null && this.seqFileNum !== undefined) { + output.writeFieldBegin('seqFileNum', Thrift.Type.I32, 4); + output.writeI32(this.seqFileNum); + output.writeFieldEnd(); + } + if (this.unSeqFileNum !== null && this.unSeqFileNum !== undefined) { + output.writeFieldBegin('unSeqFileNum', Thrift.Type.I32, 5); + output.writeI32(this.unSeqFileNum); + output.writeFieldEnd(); + } + if (this.sequenceChunkNum !== null && this.sequenceChunkNum !== undefined) { + output.writeFieldBegin('sequenceChunkNum', Thrift.Type.I32, 6); + output.writeI32(this.sequenceChunkNum); + output.writeFieldEnd(); + } + if (this.sequenceChunkPointNum !== null && this.sequenceChunkPointNum !== undefined) { + output.writeFieldBegin('sequenceChunkPointNum', Thrift.Type.I64, 7); + output.writeI64(this.sequenceChunkPointNum); + output.writeFieldEnd(); + } + if (this.unsequenceChunkNum !== null && this.unsequenceChunkNum !== undefined) { + output.writeFieldBegin('unsequenceChunkNum', Thrift.Type.I32, 8); + output.writeI32(this.unsequenceChunkNum); + output.writeFieldEnd(); + } + if (this.unsequenceChunkPointNum !== null && this.unsequenceChunkPointNum !== undefined) { + output.writeFieldBegin('unsequenceChunkPointNum', Thrift.Type.I64, 9); + output.writeI64(this.unsequenceChunkPointNum); + output.writeFieldEnd(); + } + if (this.totalPageNum !== null && this.totalPageNum !== undefined) { + output.writeFieldBegin('totalPageNum', Thrift.Type.I32, 10); + output.writeI32(this.totalPageNum); + output.writeFieldEnd(); + } + if (this.overlappedPageNum !== null && this.overlappedPageNum !== undefined) { + output.writeFieldBegin('overlappedPageNum', Thrift.Type.I32, 11); + output.writeI32(this.overlappedPageNum); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSExecuteStatementResp = module.exports.TSExecuteStatementResp = function(args) { + this.status = null; + this.queryId = null; + this.columns = null; + this.operationType = null; + this.ignoreTimeStamp = null; + this.dataTypeList = null; + this.queryDataSet = null; + this.nonAlignQueryDataSet = null; + this.columnNameIndexMap = null; + this.sgColumns = null; + this.aliasColumns = null; + this.tracingInfo = null; + this.queryResult = null; + this.moreData = null; + if (args) { + if (args.status !== undefined && args.status !== null) { + this.status = new common_ttypes.TSStatus(args.status); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); + } + if (args.queryId !== undefined && args.queryId !== null) { + this.queryId = args.queryId; + } + if (args.columns !== undefined && args.columns !== null) { + this.columns = Thrift.copyList(args.columns, [null]); + } + if (args.operationType !== undefined && args.operationType !== null) { + this.operationType = args.operationType; + } + if (args.ignoreTimeStamp !== undefined && args.ignoreTimeStamp !== null) { + this.ignoreTimeStamp = args.ignoreTimeStamp; + } + if (args.dataTypeList !== undefined && args.dataTypeList !== null) { + this.dataTypeList = Thrift.copyList(args.dataTypeList, [null]); + } + if (args.queryDataSet !== undefined && args.queryDataSet !== null) { + this.queryDataSet = new ttypes.TSQueryDataSet(args.queryDataSet); + } + if (args.nonAlignQueryDataSet !== undefined && args.nonAlignQueryDataSet !== null) { + this.nonAlignQueryDataSet = new ttypes.TSQueryNonAlignDataSet(args.nonAlignQueryDataSet); + } + if (args.columnNameIndexMap !== undefined && args.columnNameIndexMap !== null) { + this.columnNameIndexMap = Thrift.copyMap(args.columnNameIndexMap, [null]); + } + if (args.sgColumns !== undefined && args.sgColumns !== null) { + this.sgColumns = Thrift.copyList(args.sgColumns, [null]); + } + if (args.aliasColumns !== undefined && args.aliasColumns !== null) { + this.aliasColumns = Thrift.copyList(args.aliasColumns, [null]); + } + if (args.tracingInfo !== undefined && args.tracingInfo !== null) { + this.tracingInfo = new ttypes.TSTracingInfo(args.tracingInfo); + } + if (args.queryResult !== undefined && args.queryResult !== null) { + this.queryResult = Thrift.copyList(args.queryResult, [null]); + } + if (args.moreData !== undefined && args.moreData !== null) { + this.moreData = args.moreData; + } + } +}; +TSExecuteStatementResp.prototype = {}; +TSExecuteStatementResp.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.status = new common_ttypes.TSStatus(); + this.status.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.queryId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.columns = []; + var _rtmp331 = input.readListBegin(); + var _size30 = _rtmp331.size || 0; + for (var _i32 = 0; _i32 < _size30; ++_i32) { + var elem33 = null; + elem33 = input.readString(); + this.columns.push(elem33); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRING) { + this.operationType = input.readString(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.BOOL) { + this.ignoreTimeStamp = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.LIST) { + this.dataTypeList = []; + var _rtmp335 = input.readListBegin(); + var _size34 = _rtmp335.size || 0; + for (var _i36 = 0; _i36 < _size34; ++_i36) { + var elem37 = null; + elem37 = input.readString(); + this.dataTypeList.push(elem37); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.STRUCT) { + this.queryDataSet = new ttypes.TSQueryDataSet(); + this.queryDataSet.read(input); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.STRUCT) { + this.nonAlignQueryDataSet = new ttypes.TSQueryNonAlignDataSet(); + this.nonAlignQueryDataSet.read(input); + } else { + input.skip(ftype); + } + break; + case 9: + if (ftype == Thrift.Type.MAP) { + this.columnNameIndexMap = {}; + var _rtmp339 = input.readMapBegin(); + var _size38 = _rtmp339.size || 0; + for (var _i40 = 0; _i40 < _size38; ++_i40) { + var key41 = null; + var val42 = null; + key41 = input.readString(); + val42 = input.readI32(); + this.columnNameIndexMap[key41] = val42; + } + input.readMapEnd(); + } else { + input.skip(ftype); + } + break; + case 10: + if (ftype == Thrift.Type.LIST) { + this.sgColumns = []; + var _rtmp344 = input.readListBegin(); + var _size43 = _rtmp344.size || 0; + for (var _i45 = 0; _i45 < _size43; ++_i45) { + var elem46 = null; + elem46 = input.readString(); + this.sgColumns.push(elem46); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 11: + if (ftype == Thrift.Type.LIST) { + this.aliasColumns = []; + var _rtmp348 = input.readListBegin(); + var _size47 = _rtmp348.size || 0; + for (var _i49 = 0; _i49 < _size47; ++_i49) { + var elem50 = null; + elem50 = input.readByte(); + this.aliasColumns.push(elem50); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 12: + if (ftype == Thrift.Type.STRUCT) { + this.tracingInfo = new ttypes.TSTracingInfo(); + this.tracingInfo.read(input); + } else { + input.skip(ftype); + } + break; + case 13: + if (ftype == Thrift.Type.LIST) { + this.queryResult = []; + var _rtmp352 = input.readListBegin(); + var _size51 = _rtmp352.size || 0; + for (var _i53 = 0; _i53 < _size51; ++_i53) { + var elem54 = null; + elem54 = input.readBinary(); + this.queryResult.push(elem54); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 14: + if (ftype == Thrift.Type.BOOL) { + this.moreData = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSExecuteStatementResp.prototype.write = function(output) { + output.writeStructBegin('TSExecuteStatementResp'); + if (this.status !== null && this.status !== undefined) { + output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); + this.status.write(output); + output.writeFieldEnd(); + } + if (this.queryId !== null && this.queryId !== undefined) { + output.writeFieldBegin('queryId', Thrift.Type.I64, 2); + output.writeI64(this.queryId); + output.writeFieldEnd(); + } + if (this.columns !== null && this.columns !== undefined) { + output.writeFieldBegin('columns', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.STRING, this.columns.length); + for (var iter55 in this.columns) { + if (this.columns.hasOwnProperty(iter55)) { + iter55 = this.columns[iter55]; + output.writeString(iter55); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.operationType !== null && this.operationType !== undefined) { + output.writeFieldBegin('operationType', Thrift.Type.STRING, 4); + output.writeString(this.operationType); + output.writeFieldEnd(); + } + if (this.ignoreTimeStamp !== null && this.ignoreTimeStamp !== undefined) { + output.writeFieldBegin('ignoreTimeStamp', Thrift.Type.BOOL, 5); + output.writeBool(this.ignoreTimeStamp); + output.writeFieldEnd(); + } + if (this.dataTypeList !== null && this.dataTypeList !== undefined) { + output.writeFieldBegin('dataTypeList', Thrift.Type.LIST, 6); + output.writeListBegin(Thrift.Type.STRING, this.dataTypeList.length); + for (var iter56 in this.dataTypeList) { + if (this.dataTypeList.hasOwnProperty(iter56)) { + iter56 = this.dataTypeList[iter56]; + output.writeString(iter56); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.queryDataSet !== null && this.queryDataSet !== undefined) { + output.writeFieldBegin('queryDataSet', Thrift.Type.STRUCT, 7); + this.queryDataSet.write(output); + output.writeFieldEnd(); + } + if (this.nonAlignQueryDataSet !== null && this.nonAlignQueryDataSet !== undefined) { + output.writeFieldBegin('nonAlignQueryDataSet', Thrift.Type.STRUCT, 8); + this.nonAlignQueryDataSet.write(output); + output.writeFieldEnd(); + } + if (this.columnNameIndexMap !== null && this.columnNameIndexMap !== undefined) { + output.writeFieldBegin('columnNameIndexMap', Thrift.Type.MAP, 9); + output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.I32, Thrift.objectLength(this.columnNameIndexMap)); + for (var kiter57 in this.columnNameIndexMap) { + if (this.columnNameIndexMap.hasOwnProperty(kiter57)) { + var viter58 = this.columnNameIndexMap[kiter57]; + output.writeString(kiter57); + output.writeI32(viter58); + } + } + output.writeMapEnd(); + output.writeFieldEnd(); + } + if (this.sgColumns !== null && this.sgColumns !== undefined) { + output.writeFieldBegin('sgColumns', Thrift.Type.LIST, 10); + output.writeListBegin(Thrift.Type.STRING, this.sgColumns.length); + for (var iter59 in this.sgColumns) { + if (this.sgColumns.hasOwnProperty(iter59)) { + iter59 = this.sgColumns[iter59]; + output.writeString(iter59); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.aliasColumns !== null && this.aliasColumns !== undefined) { + output.writeFieldBegin('aliasColumns', Thrift.Type.LIST, 11); + output.writeListBegin(Thrift.Type.BYTE, this.aliasColumns.length); + for (var iter60 in this.aliasColumns) { + if (this.aliasColumns.hasOwnProperty(iter60)) { + iter60 = this.aliasColumns[iter60]; + output.writeByte(iter60); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.tracingInfo !== null && this.tracingInfo !== undefined) { + output.writeFieldBegin('tracingInfo', Thrift.Type.STRUCT, 12); + this.tracingInfo.write(output); + output.writeFieldEnd(); + } + if (this.queryResult !== null && this.queryResult !== undefined) { + output.writeFieldBegin('queryResult', Thrift.Type.LIST, 13); + output.writeListBegin(Thrift.Type.STRING, this.queryResult.length); + for (var iter61 in this.queryResult) { + if (this.queryResult.hasOwnProperty(iter61)) { + iter61 = this.queryResult[iter61]; + output.writeBinary(iter61); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.moreData !== null && this.moreData !== undefined) { + output.writeFieldBegin('moreData', Thrift.Type.BOOL, 14); + output.writeBool(this.moreData); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSOpenSessionResp = module.exports.TSOpenSessionResp = function(args) { + this.status = null; + this.serverProtocolVersion = 0; + this.sessionId = null; + this.configuration = null; + if (args) { + if (args.status !== undefined && args.status !== null) { + this.status = new common_ttypes.TSStatus(args.status); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); + } + if (args.serverProtocolVersion !== undefined && args.serverProtocolVersion !== null) { + this.serverProtocolVersion = args.serverProtocolVersion; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field serverProtocolVersion is unset!'); + } + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } + if (args.configuration !== undefined && args.configuration !== null) { + this.configuration = Thrift.copyMap(args.configuration, [null]); + } + } +}; +TSOpenSessionResp.prototype = {}; +TSOpenSessionResp.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.status = new common_ttypes.TSStatus(); + this.status.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I32) { + this.serverProtocolVersion = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.MAP) { + this.configuration = {}; + var _rtmp363 = input.readMapBegin(); + var _size62 = _rtmp363.size || 0; + for (var _i64 = 0; _i64 < _size62; ++_i64) { + var key65 = null; + var val66 = null; + key65 = input.readString(); + val66 = input.readString(); + this.configuration[key65] = val66; + } + input.readMapEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSOpenSessionResp.prototype.write = function(output) { + output.writeStructBegin('TSOpenSessionResp'); + if (this.status !== null && this.status !== undefined) { + output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); + this.status.write(output); + output.writeFieldEnd(); + } + if (this.serverProtocolVersion !== null && this.serverProtocolVersion !== undefined) { + output.writeFieldBegin('serverProtocolVersion', Thrift.Type.I32, 2); + output.writeI32(this.serverProtocolVersion); + output.writeFieldEnd(); + } + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 3); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.configuration !== null && this.configuration !== undefined) { + output.writeFieldBegin('configuration', Thrift.Type.MAP, 4); + output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.configuration)); + for (var kiter67 in this.configuration) { + if (this.configuration.hasOwnProperty(kiter67)) { + var viter68 = this.configuration[kiter67]; + output.writeString(kiter67); + output.writeString(viter68); + } + } + output.writeMapEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSOpenSessionReq = module.exports.TSOpenSessionReq = function(args) { + this.client_protocol = 2; + this.zoneId = null; + this.username = null; + this.password = null; + this.configuration = null; + if (args) { + if (args.client_protocol !== undefined && args.client_protocol !== null) { + this.client_protocol = args.client_protocol; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field client_protocol is unset!'); + } + if (args.zoneId !== undefined && args.zoneId !== null) { + this.zoneId = args.zoneId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field zoneId is unset!'); + } + if (args.username !== undefined && args.username !== null) { + this.username = args.username; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field username is unset!'); + } + if (args.password !== undefined && args.password !== null) { + this.password = args.password; + } + if (args.configuration !== undefined && args.configuration !== null) { + this.configuration = Thrift.copyMap(args.configuration, [null]); + } + } +}; +TSOpenSessionReq.prototype = {}; +TSOpenSessionReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I32) { + this.client_protocol = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.zoneId = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.username = input.readString(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRING) { + this.password = input.readString(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.MAP) { + this.configuration = {}; + var _rtmp370 = input.readMapBegin(); + var _size69 = _rtmp370.size || 0; + for (var _i71 = 0; _i71 < _size69; ++_i71) { + var key72 = null; + var val73 = null; + key72 = input.readString(); + val73 = input.readString(); + this.configuration[key72] = val73; + } + input.readMapEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSOpenSessionReq.prototype.write = function(output) { + output.writeStructBegin('TSOpenSessionReq'); + if (this.client_protocol !== null && this.client_protocol !== undefined) { + output.writeFieldBegin('client_protocol', Thrift.Type.I32, 1); + output.writeI32(this.client_protocol); + output.writeFieldEnd(); + } + if (this.zoneId !== null && this.zoneId !== undefined) { + output.writeFieldBegin('zoneId', Thrift.Type.STRING, 2); + output.writeString(this.zoneId); + output.writeFieldEnd(); + } + if (this.username !== null && this.username !== undefined) { + output.writeFieldBegin('username', Thrift.Type.STRING, 3); + output.writeString(this.username); + output.writeFieldEnd(); + } + if (this.password !== null && this.password !== undefined) { + output.writeFieldBegin('password', Thrift.Type.STRING, 4); + output.writeString(this.password); + output.writeFieldEnd(); + } + if (this.configuration !== null && this.configuration !== undefined) { + output.writeFieldBegin('configuration', Thrift.Type.MAP, 5); + output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.configuration)); + for (var kiter74 in this.configuration) { + if (this.configuration.hasOwnProperty(kiter74)) { + var viter75 = this.configuration[kiter74]; + output.writeString(kiter74); + output.writeString(viter75); + } + } + output.writeMapEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSCloseSessionReq = module.exports.TSCloseSessionReq = function(args) { + this.sessionId = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + } +}; +TSCloseSessionReq.prototype = {}; +TSCloseSessionReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSCloseSessionReq.prototype.write = function(output) { + output.writeStructBegin('TSCloseSessionReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSExecuteStatementReq = module.exports.TSExecuteStatementReq = function(args) { + this.sessionId = null; + this.statement = null; + this.statementId = null; + this.fetchSize = null; + this.timeout = null; + this.enableRedirectQuery = null; + this.jdbcQuery = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.statement !== undefined && args.statement !== null) { + this.statement = args.statement; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statement is unset!'); + } + if (args.statementId !== undefined && args.statementId !== null) { + this.statementId = args.statementId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statementId is unset!'); + } + if (args.fetchSize !== undefined && args.fetchSize !== null) { + this.fetchSize = args.fetchSize; + } + if (args.timeout !== undefined && args.timeout !== null) { + this.timeout = args.timeout; + } + if (args.enableRedirectQuery !== undefined && args.enableRedirectQuery !== null) { + this.enableRedirectQuery = args.enableRedirectQuery; + } + if (args.jdbcQuery !== undefined && args.jdbcQuery !== null) { + this.jdbcQuery = args.jdbcQuery; + } + } +}; +TSExecuteStatementReq.prototype = {}; +TSExecuteStatementReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.statement = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I64) { + this.statementId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.I32) { + this.fetchSize = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I64) { + this.timeout = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.BOOL) { + this.enableRedirectQuery = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.BOOL) { + this.jdbcQuery = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSExecuteStatementReq.prototype.write = function(output) { + output.writeStructBegin('TSExecuteStatementReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.statement !== null && this.statement !== undefined) { + output.writeFieldBegin('statement', Thrift.Type.STRING, 2); + output.writeString(this.statement); + output.writeFieldEnd(); + } + if (this.statementId !== null && this.statementId !== undefined) { + output.writeFieldBegin('statementId', Thrift.Type.I64, 3); + output.writeI64(this.statementId); + output.writeFieldEnd(); + } + if (this.fetchSize !== null && this.fetchSize !== undefined) { + output.writeFieldBegin('fetchSize', Thrift.Type.I32, 4); + output.writeI32(this.fetchSize); + output.writeFieldEnd(); + } + if (this.timeout !== null && this.timeout !== undefined) { + output.writeFieldBegin('timeout', Thrift.Type.I64, 5); + output.writeI64(this.timeout); + output.writeFieldEnd(); + } + if (this.enableRedirectQuery !== null && this.enableRedirectQuery !== undefined) { + output.writeFieldBegin('enableRedirectQuery', Thrift.Type.BOOL, 6); + output.writeBool(this.enableRedirectQuery); + output.writeFieldEnd(); + } + if (this.jdbcQuery !== null && this.jdbcQuery !== undefined) { + output.writeFieldBegin('jdbcQuery', Thrift.Type.BOOL, 7); + output.writeBool(this.jdbcQuery); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSExecuteBatchStatementReq = module.exports.TSExecuteBatchStatementReq = function(args) { + this.sessionId = null; + this.statements = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.statements !== undefined && args.statements !== null) { + this.statements = Thrift.copyList(args.statements, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statements is unset!'); + } + } +}; +TSExecuteBatchStatementReq.prototype = {}; +TSExecuteBatchStatementReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.statements = []; + var _rtmp377 = input.readListBegin(); + var _size76 = _rtmp377.size || 0; + for (var _i78 = 0; _i78 < _size76; ++_i78) { + var elem79 = null; + elem79 = input.readString(); + this.statements.push(elem79); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSExecuteBatchStatementReq.prototype.write = function(output) { + output.writeStructBegin('TSExecuteBatchStatementReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.statements !== null && this.statements !== undefined) { + output.writeFieldBegin('statements', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.statements.length); + for (var iter80 in this.statements) { + if (this.statements.hasOwnProperty(iter80)) { + iter80 = this.statements[iter80]; + output.writeString(iter80); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSGetOperationStatusReq = module.exports.TSGetOperationStatusReq = function(args) { + this.sessionId = null; + this.queryId = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.queryId !== undefined && args.queryId !== null) { + this.queryId = args.queryId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field queryId is unset!'); + } + } +}; +TSGetOperationStatusReq.prototype = {}; +TSGetOperationStatusReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.queryId = input.readI64(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSGetOperationStatusReq.prototype.write = function(output) { + output.writeStructBegin('TSGetOperationStatusReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.queryId !== null && this.queryId !== undefined) { + output.writeFieldBegin('queryId', Thrift.Type.I64, 2); + output.writeI64(this.queryId); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSCancelOperationReq = module.exports.TSCancelOperationReq = function(args) { + this.sessionId = null; + this.queryId = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.queryId !== undefined && args.queryId !== null) { + this.queryId = args.queryId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field queryId is unset!'); + } + } +}; +TSCancelOperationReq.prototype = {}; +TSCancelOperationReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.queryId = input.readI64(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSCancelOperationReq.prototype.write = function(output) { + output.writeStructBegin('TSCancelOperationReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.queryId !== null && this.queryId !== undefined) { + output.writeFieldBegin('queryId', Thrift.Type.I64, 2); + output.writeI64(this.queryId); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSCloseOperationReq = module.exports.TSCloseOperationReq = function(args) { + this.sessionId = null; + this.queryId = null; + this.statementId = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.queryId !== undefined && args.queryId !== null) { + this.queryId = args.queryId; + } + if (args.statementId !== undefined && args.statementId !== null) { + this.statementId = args.statementId; + } + } +}; +TSCloseOperationReq.prototype = {}; +TSCloseOperationReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.queryId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I64) { + this.statementId = input.readI64(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSCloseOperationReq.prototype.write = function(output) { + output.writeStructBegin('TSCloseOperationReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.queryId !== null && this.queryId !== undefined) { + output.writeFieldBegin('queryId', Thrift.Type.I64, 2); + output.writeI64(this.queryId); + output.writeFieldEnd(); + } + if (this.statementId !== null && this.statementId !== undefined) { + output.writeFieldBegin('statementId', Thrift.Type.I64, 3); + output.writeI64(this.statementId); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSFetchResultsReq = module.exports.TSFetchResultsReq = function(args) { + this.sessionId = null; + this.statement = null; + this.fetchSize = null; + this.queryId = null; + this.isAlign = null; + this.timeout = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.statement !== undefined && args.statement !== null) { + this.statement = args.statement; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statement is unset!'); + } + if (args.fetchSize !== undefined && args.fetchSize !== null) { + this.fetchSize = args.fetchSize; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field fetchSize is unset!'); + } + if (args.queryId !== undefined && args.queryId !== null) { + this.queryId = args.queryId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field queryId is unset!'); + } + if (args.isAlign !== undefined && args.isAlign !== null) { + this.isAlign = args.isAlign; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field isAlign is unset!'); + } + if (args.timeout !== undefined && args.timeout !== null) { + this.timeout = args.timeout; + } + } +}; +TSFetchResultsReq.prototype = {}; +TSFetchResultsReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.statement = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I32) { + this.fetchSize = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.I64) { + this.queryId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.BOOL) { + this.isAlign = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.I64) { + this.timeout = input.readI64(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSFetchResultsReq.prototype.write = function(output) { + output.writeStructBegin('TSFetchResultsReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.statement !== null && this.statement !== undefined) { + output.writeFieldBegin('statement', Thrift.Type.STRING, 2); + output.writeString(this.statement); + output.writeFieldEnd(); + } + if (this.fetchSize !== null && this.fetchSize !== undefined) { + output.writeFieldBegin('fetchSize', Thrift.Type.I32, 3); + output.writeI32(this.fetchSize); + output.writeFieldEnd(); + } + if (this.queryId !== null && this.queryId !== undefined) { + output.writeFieldBegin('queryId', Thrift.Type.I64, 4); + output.writeI64(this.queryId); + output.writeFieldEnd(); + } + if (this.isAlign !== null && this.isAlign !== undefined) { + output.writeFieldBegin('isAlign', Thrift.Type.BOOL, 5); + output.writeBool(this.isAlign); + output.writeFieldEnd(); + } + if (this.timeout !== null && this.timeout !== undefined) { + output.writeFieldBegin('timeout', Thrift.Type.I64, 6); + output.writeI64(this.timeout); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSFetchResultsResp = module.exports.TSFetchResultsResp = function(args) { + this.status = null; + this.hasResultSet = null; + this.isAlign = null; + this.queryDataSet = null; + this.nonAlignQueryDataSet = null; + this.queryResult = null; + this.moreData = null; + if (args) { + if (args.status !== undefined && args.status !== null) { + this.status = new common_ttypes.TSStatus(args.status); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); + } + if (args.hasResultSet !== undefined && args.hasResultSet !== null) { + this.hasResultSet = args.hasResultSet; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field hasResultSet is unset!'); + } + if (args.isAlign !== undefined && args.isAlign !== null) { + this.isAlign = args.isAlign; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field isAlign is unset!'); + } + if (args.queryDataSet !== undefined && args.queryDataSet !== null) { + this.queryDataSet = new ttypes.TSQueryDataSet(args.queryDataSet); + } + if (args.nonAlignQueryDataSet !== undefined && args.nonAlignQueryDataSet !== null) { + this.nonAlignQueryDataSet = new ttypes.TSQueryNonAlignDataSet(args.nonAlignQueryDataSet); + } + if (args.queryResult !== undefined && args.queryResult !== null) { + this.queryResult = Thrift.copyList(args.queryResult, [null]); + } + if (args.moreData !== undefined && args.moreData !== null) { + this.moreData = args.moreData; + } + } +}; +TSFetchResultsResp.prototype = {}; +TSFetchResultsResp.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.status = new common_ttypes.TSStatus(); + this.status.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.BOOL) { + this.hasResultSet = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.BOOL) { + this.isAlign = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRUCT) { + this.queryDataSet = new ttypes.TSQueryDataSet(); + this.queryDataSet.read(input); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.STRUCT) { + this.nonAlignQueryDataSet = new ttypes.TSQueryNonAlignDataSet(); + this.nonAlignQueryDataSet.read(input); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.LIST) { + this.queryResult = []; + var _rtmp382 = input.readListBegin(); + var _size81 = _rtmp382.size || 0; + for (var _i83 = 0; _i83 < _size81; ++_i83) { + var elem84 = null; + elem84 = input.readBinary(); + this.queryResult.push(elem84); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.BOOL) { + this.moreData = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSFetchResultsResp.prototype.write = function(output) { + output.writeStructBegin('TSFetchResultsResp'); + if (this.status !== null && this.status !== undefined) { + output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); + this.status.write(output); + output.writeFieldEnd(); + } + if (this.hasResultSet !== null && this.hasResultSet !== undefined) { + output.writeFieldBegin('hasResultSet', Thrift.Type.BOOL, 2); + output.writeBool(this.hasResultSet); + output.writeFieldEnd(); + } + if (this.isAlign !== null && this.isAlign !== undefined) { + output.writeFieldBegin('isAlign', Thrift.Type.BOOL, 3); + output.writeBool(this.isAlign); + output.writeFieldEnd(); + } + if (this.queryDataSet !== null && this.queryDataSet !== undefined) { + output.writeFieldBegin('queryDataSet', Thrift.Type.STRUCT, 4); + this.queryDataSet.write(output); + output.writeFieldEnd(); + } + if (this.nonAlignQueryDataSet !== null && this.nonAlignQueryDataSet !== undefined) { + output.writeFieldBegin('nonAlignQueryDataSet', Thrift.Type.STRUCT, 5); + this.nonAlignQueryDataSet.write(output); + output.writeFieldEnd(); + } + if (this.queryResult !== null && this.queryResult !== undefined) { + output.writeFieldBegin('queryResult', Thrift.Type.LIST, 6); + output.writeListBegin(Thrift.Type.STRING, this.queryResult.length); + for (var iter85 in this.queryResult) { + if (this.queryResult.hasOwnProperty(iter85)) { + iter85 = this.queryResult[iter85]; + output.writeBinary(iter85); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.moreData !== null && this.moreData !== undefined) { + output.writeFieldBegin('moreData', Thrift.Type.BOOL, 7); + output.writeBool(this.moreData); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSFetchMetadataResp = module.exports.TSFetchMetadataResp = function(args) { + this.status = null; + this.metadataInJson = null; + this.columnsList = null; + this.dataType = null; + if (args) { + if (args.status !== undefined && args.status !== null) { + this.status = new common_ttypes.TSStatus(args.status); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); + } + if (args.metadataInJson !== undefined && args.metadataInJson !== null) { + this.metadataInJson = args.metadataInJson; + } + if (args.columnsList !== undefined && args.columnsList !== null) { + this.columnsList = Thrift.copyList(args.columnsList, [null]); + } + if (args.dataType !== undefined && args.dataType !== null) { + this.dataType = args.dataType; + } + } +}; +TSFetchMetadataResp.prototype = {}; +TSFetchMetadataResp.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.status = new common_ttypes.TSStatus(); + this.status.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.metadataInJson = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.columnsList = []; + var _rtmp387 = input.readListBegin(); + var _size86 = _rtmp387.size || 0; + for (var _i88 = 0; _i88 < _size86; ++_i88) { + var elem89 = null; + elem89 = input.readString(); + this.columnsList.push(elem89); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRING) { + this.dataType = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSFetchMetadataResp.prototype.write = function(output) { + output.writeStructBegin('TSFetchMetadataResp'); + if (this.status !== null && this.status !== undefined) { + output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); + this.status.write(output); + output.writeFieldEnd(); + } + if (this.metadataInJson !== null && this.metadataInJson !== undefined) { + output.writeFieldBegin('metadataInJson', Thrift.Type.STRING, 2); + output.writeString(this.metadataInJson); + output.writeFieldEnd(); + } + if (this.columnsList !== null && this.columnsList !== undefined) { + output.writeFieldBegin('columnsList', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.STRING, this.columnsList.length); + for (var iter90 in this.columnsList) { + if (this.columnsList.hasOwnProperty(iter90)) { + iter90 = this.columnsList[iter90]; + output.writeString(iter90); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.dataType !== null && this.dataType !== undefined) { + output.writeFieldBegin('dataType', Thrift.Type.STRING, 4); + output.writeString(this.dataType); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSFetchMetadataReq = module.exports.TSFetchMetadataReq = function(args) { + this.sessionId = null; + this.type = null; + this.columnPath = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.type !== undefined && args.type !== null) { + this.type = args.type; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field type is unset!'); + } + if (args.columnPath !== undefined && args.columnPath !== null) { + this.columnPath = args.columnPath; + } + } +}; +TSFetchMetadataReq.prototype = {}; +TSFetchMetadataReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.type = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.columnPath = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSFetchMetadataReq.prototype.write = function(output) { + output.writeStructBegin('TSFetchMetadataReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.type !== null && this.type !== undefined) { + output.writeFieldBegin('type', Thrift.Type.STRING, 2); + output.writeString(this.type); + output.writeFieldEnd(); + } + if (this.columnPath !== null && this.columnPath !== undefined) { + output.writeFieldBegin('columnPath', Thrift.Type.STRING, 3); + output.writeString(this.columnPath); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSGetTimeZoneResp = module.exports.TSGetTimeZoneResp = function(args) { + this.status = null; + this.timeZone = null; + if (args) { + if (args.status !== undefined && args.status !== null) { + this.status = new common_ttypes.TSStatus(args.status); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); + } + if (args.timeZone !== undefined && args.timeZone !== null) { + this.timeZone = args.timeZone; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timeZone is unset!'); + } + } +}; +TSGetTimeZoneResp.prototype = {}; +TSGetTimeZoneResp.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.status = new common_ttypes.TSStatus(); + this.status.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.timeZone = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSGetTimeZoneResp.prototype.write = function(output) { + output.writeStructBegin('TSGetTimeZoneResp'); + if (this.status !== null && this.status !== undefined) { + output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); + this.status.write(output); + output.writeFieldEnd(); + } + if (this.timeZone !== null && this.timeZone !== undefined) { + output.writeFieldBegin('timeZone', Thrift.Type.STRING, 2); + output.writeString(this.timeZone); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSSetTimeZoneReq = module.exports.TSSetTimeZoneReq = function(args) { + this.sessionId = null; + this.timeZone = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.timeZone !== undefined && args.timeZone !== null) { + this.timeZone = args.timeZone; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timeZone is unset!'); + } + } +}; +TSSetTimeZoneReq.prototype = {}; +TSSetTimeZoneReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.timeZone = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSSetTimeZoneReq.prototype.write = function(output) { + output.writeStructBegin('TSSetTimeZoneReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.timeZone !== null && this.timeZone !== undefined) { + output.writeFieldBegin('timeZone', Thrift.Type.STRING, 2); + output.writeString(this.timeZone); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSInsertRecordReq = module.exports.TSInsertRecordReq = function(args) { + this.sessionId = null; + this.prefixPath = null; + this.measurements = null; + this.values = null; + this.timestamp = null; + this.isAligned = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.prefixPath !== undefined && args.prefixPath !== null) { + this.prefixPath = args.prefixPath; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPath is unset!'); + } + if (args.measurements !== undefined && args.measurements !== null) { + this.measurements = Thrift.copyList(args.measurements, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurements is unset!'); + } + if (args.values !== undefined && args.values !== null) { + this.values = args.values; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field values is unset!'); + } + if (args.timestamp !== undefined && args.timestamp !== null) { + this.timestamp = args.timestamp; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestamp is unset!'); + } + if (args.isAligned !== undefined && args.isAligned !== null) { + this.isAligned = args.isAligned; + } + } +}; +TSInsertRecordReq.prototype = {}; +TSInsertRecordReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.prefixPath = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.measurements = []; + var _rtmp392 = input.readListBegin(); + var _size91 = _rtmp392.size || 0; + for (var _i93 = 0; _i93 < _size91; ++_i93) { + var elem94 = null; + elem94 = input.readString(); + this.measurements.push(elem94); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRING) { + this.values = input.readBinary(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I64) { + this.timestamp = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.BOOL) { + this.isAligned = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSInsertRecordReq.prototype.write = function(output) { + output.writeStructBegin('TSInsertRecordReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.prefixPath !== null && this.prefixPath !== undefined) { + output.writeFieldBegin('prefixPath', Thrift.Type.STRING, 2); + output.writeString(this.prefixPath); + output.writeFieldEnd(); + } + if (this.measurements !== null && this.measurements !== undefined) { + output.writeFieldBegin('measurements', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.STRING, this.measurements.length); + for (var iter95 in this.measurements) { + if (this.measurements.hasOwnProperty(iter95)) { + iter95 = this.measurements[iter95]; + output.writeString(iter95); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.values !== null && this.values !== undefined) { + output.writeFieldBegin('values', Thrift.Type.STRING, 4); + output.writeBinary(this.values); + output.writeFieldEnd(); + } + if (this.timestamp !== null && this.timestamp !== undefined) { + output.writeFieldBegin('timestamp', Thrift.Type.I64, 5); + output.writeI64(this.timestamp); + output.writeFieldEnd(); + } + if (this.isAligned !== null && this.isAligned !== undefined) { + output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 6); + output.writeBool(this.isAligned); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSInsertStringRecordReq = module.exports.TSInsertStringRecordReq = function(args) { + this.sessionId = null; + this.prefixPath = null; + this.measurements = null; + this.values = null; + this.timestamp = null; + this.isAligned = null; + this.timeout = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.prefixPath !== undefined && args.prefixPath !== null) { + this.prefixPath = args.prefixPath; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPath is unset!'); + } + if (args.measurements !== undefined && args.measurements !== null) { + this.measurements = Thrift.copyList(args.measurements, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurements is unset!'); + } + if (args.values !== undefined && args.values !== null) { + this.values = Thrift.copyList(args.values, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field values is unset!'); + } + if (args.timestamp !== undefined && args.timestamp !== null) { + this.timestamp = args.timestamp; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestamp is unset!'); + } + if (args.isAligned !== undefined && args.isAligned !== null) { + this.isAligned = args.isAligned; + } + if (args.timeout !== undefined && args.timeout !== null) { + this.timeout = args.timeout; + } + } +}; +TSInsertStringRecordReq.prototype = {}; +TSInsertStringRecordReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.prefixPath = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.measurements = []; + var _rtmp397 = input.readListBegin(); + var _size96 = _rtmp397.size || 0; + for (var _i98 = 0; _i98 < _size96; ++_i98) { + var elem99 = null; + elem99 = input.readString(); + this.measurements.push(elem99); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.LIST) { + this.values = []; + var _rtmp3101 = input.readListBegin(); + var _size100 = _rtmp3101.size || 0; + for (var _i102 = 0; _i102 < _size100; ++_i102) { + var elem103 = null; + elem103 = input.readString(); + this.values.push(elem103); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I64) { + this.timestamp = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.BOOL) { + this.isAligned = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.I64) { + this.timeout = input.readI64(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSInsertStringRecordReq.prototype.write = function(output) { + output.writeStructBegin('TSInsertStringRecordReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.prefixPath !== null && this.prefixPath !== undefined) { + output.writeFieldBegin('prefixPath', Thrift.Type.STRING, 2); + output.writeString(this.prefixPath); + output.writeFieldEnd(); + } + if (this.measurements !== null && this.measurements !== undefined) { + output.writeFieldBegin('measurements', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.STRING, this.measurements.length); + for (var iter104 in this.measurements) { + if (this.measurements.hasOwnProperty(iter104)) { + iter104 = this.measurements[iter104]; + output.writeString(iter104); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.values !== null && this.values !== undefined) { + output.writeFieldBegin('values', Thrift.Type.LIST, 4); + output.writeListBegin(Thrift.Type.STRING, this.values.length); + for (var iter105 in this.values) { + if (this.values.hasOwnProperty(iter105)) { + iter105 = this.values[iter105]; + output.writeString(iter105); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.timestamp !== null && this.timestamp !== undefined) { + output.writeFieldBegin('timestamp', Thrift.Type.I64, 5); + output.writeI64(this.timestamp); + output.writeFieldEnd(); + } + if (this.isAligned !== null && this.isAligned !== undefined) { + output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 6); + output.writeBool(this.isAligned); + output.writeFieldEnd(); + } + if (this.timeout !== null && this.timeout !== undefined) { + output.writeFieldBegin('timeout', Thrift.Type.I64, 7); + output.writeI64(this.timeout); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSInsertTabletReq = module.exports.TSInsertTabletReq = function(args) { + this.sessionId = null; + this.prefixPath = null; + this.measurements = null; + this.values = null; + this.timestamps = null; + this.types = null; + this.size = null; + this.isAligned = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.prefixPath !== undefined && args.prefixPath !== null) { + this.prefixPath = args.prefixPath; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPath is unset!'); + } + if (args.measurements !== undefined && args.measurements !== null) { + this.measurements = Thrift.copyList(args.measurements, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurements is unset!'); + } + if (args.values !== undefined && args.values !== null) { + this.values = args.values; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field values is unset!'); + } + if (args.timestamps !== undefined && args.timestamps !== null) { + this.timestamps = args.timestamps; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestamps is unset!'); + } + if (args.types !== undefined && args.types !== null) { + this.types = Thrift.copyList(args.types, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field types is unset!'); + } + if (args.size !== undefined && args.size !== null) { + this.size = args.size; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field size is unset!'); + } + if (args.isAligned !== undefined && args.isAligned !== null) { + this.isAligned = args.isAligned; + } + } +}; +TSInsertTabletReq.prototype = {}; +TSInsertTabletReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.prefixPath = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.measurements = []; + var _rtmp3107 = input.readListBegin(); + var _size106 = _rtmp3107.size || 0; + for (var _i108 = 0; _i108 < _size106; ++_i108) { + var elem109 = null; + elem109 = input.readString(); + this.measurements.push(elem109); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRING) { + this.values = input.readBinary(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.STRING) { + this.timestamps = input.readBinary(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.LIST) { + this.types = []; + var _rtmp3111 = input.readListBegin(); + var _size110 = _rtmp3111.size || 0; + for (var _i112 = 0; _i112 < _size110; ++_i112) { + var elem113 = null; + elem113 = input.readI32(); + this.types.push(elem113); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.I32) { + this.size = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.BOOL) { + this.isAligned = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSInsertTabletReq.prototype.write = function(output) { + output.writeStructBegin('TSInsertTabletReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.prefixPath !== null && this.prefixPath !== undefined) { + output.writeFieldBegin('prefixPath', Thrift.Type.STRING, 2); + output.writeString(this.prefixPath); + output.writeFieldEnd(); + } + if (this.measurements !== null && this.measurements !== undefined) { + output.writeFieldBegin('measurements', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.STRING, this.measurements.length); + for (var iter114 in this.measurements) { + if (this.measurements.hasOwnProperty(iter114)) { + iter114 = this.measurements[iter114]; + output.writeString(iter114); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.values !== null && this.values !== undefined) { + output.writeFieldBegin('values', Thrift.Type.STRING, 4); + output.writeBinary(this.values); + output.writeFieldEnd(); + } + if (this.timestamps !== null && this.timestamps !== undefined) { + output.writeFieldBegin('timestamps', Thrift.Type.STRING, 5); + output.writeBinary(this.timestamps); + output.writeFieldEnd(); + } + if (this.types !== null && this.types !== undefined) { + output.writeFieldBegin('types', Thrift.Type.LIST, 6); + output.writeListBegin(Thrift.Type.I32, this.types.length); + for (var iter115 in this.types) { + if (this.types.hasOwnProperty(iter115)) { + iter115 = this.types[iter115]; + output.writeI32(iter115); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.size !== null && this.size !== undefined) { + output.writeFieldBegin('size', Thrift.Type.I32, 7); + output.writeI32(this.size); + output.writeFieldEnd(); + } + if (this.isAligned !== null && this.isAligned !== undefined) { + output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 8); + output.writeBool(this.isAligned); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSInsertTabletsReq = module.exports.TSInsertTabletsReq = function(args) { + this.sessionId = null; + this.prefixPaths = null; + this.measurementsList = null; + this.valuesList = null; + this.timestampsList = null; + this.typesList = null; + this.sizeList = null; + this.isAligned = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.prefixPaths !== undefined && args.prefixPaths !== null) { + this.prefixPaths = Thrift.copyList(args.prefixPaths, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPaths is unset!'); + } + if (args.measurementsList !== undefined && args.measurementsList !== null) { + this.measurementsList = Thrift.copyList(args.measurementsList, [Thrift.copyList, null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurementsList is unset!'); + } + if (args.valuesList !== undefined && args.valuesList !== null) { + this.valuesList = Thrift.copyList(args.valuesList, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field valuesList is unset!'); + } + if (args.timestampsList !== undefined && args.timestampsList !== null) { + this.timestampsList = Thrift.copyList(args.timestampsList, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestampsList is unset!'); + } + if (args.typesList !== undefined && args.typesList !== null) { + this.typesList = Thrift.copyList(args.typesList, [Thrift.copyList, null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field typesList is unset!'); + } + if (args.sizeList !== undefined && args.sizeList !== null) { + this.sizeList = Thrift.copyList(args.sizeList, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sizeList is unset!'); + } + if (args.isAligned !== undefined && args.isAligned !== null) { + this.isAligned = args.isAligned; + } + } +}; +TSInsertTabletsReq.prototype = {}; +TSInsertTabletsReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.prefixPaths = []; + var _rtmp3117 = input.readListBegin(); + var _size116 = _rtmp3117.size || 0; + for (var _i118 = 0; _i118 < _size116; ++_i118) { + var elem119 = null; + elem119 = input.readString(); + this.prefixPaths.push(elem119); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.measurementsList = []; + var _rtmp3121 = input.readListBegin(); + var _size120 = _rtmp3121.size || 0; + for (var _i122 = 0; _i122 < _size120; ++_i122) { + var elem123 = null; + elem123 = []; + var _rtmp3125 = input.readListBegin(); + var _size124 = _rtmp3125.size || 0; + for (var _i126 = 0; _i126 < _size124; ++_i126) { + var elem127 = null; + elem127 = input.readString(); + elem123.push(elem127); + } + input.readListEnd(); + this.measurementsList.push(elem123); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.LIST) { + this.valuesList = []; + var _rtmp3129 = input.readListBegin(); + var _size128 = _rtmp3129.size || 0; + for (var _i130 = 0; _i130 < _size128; ++_i130) { + var elem131 = null; + elem131 = input.readBinary(); + this.valuesList.push(elem131); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.LIST) { + this.timestampsList = []; + var _rtmp3133 = input.readListBegin(); + var _size132 = _rtmp3133.size || 0; + for (var _i134 = 0; _i134 < _size132; ++_i134) { + var elem135 = null; + elem135 = input.readBinary(); + this.timestampsList.push(elem135); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.LIST) { + this.typesList = []; + var _rtmp3137 = input.readListBegin(); + var _size136 = _rtmp3137.size || 0; + for (var _i138 = 0; _i138 < _size136; ++_i138) { + var elem139 = null; + elem139 = []; + var _rtmp3141 = input.readListBegin(); + var _size140 = _rtmp3141.size || 0; + for (var _i142 = 0; _i142 < _size140; ++_i142) { + var elem143 = null; + elem143 = input.readI32(); + elem139.push(elem143); + } + input.readListEnd(); + this.typesList.push(elem139); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.LIST) { + this.sizeList = []; + var _rtmp3145 = input.readListBegin(); + var _size144 = _rtmp3145.size || 0; + for (var _i146 = 0; _i146 < _size144; ++_i146) { + var elem147 = null; + elem147 = input.readI32(); + this.sizeList.push(elem147); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.BOOL) { + this.isAligned = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSInsertTabletsReq.prototype.write = function(output) { + output.writeStructBegin('TSInsertTabletsReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.prefixPaths !== null && this.prefixPaths !== undefined) { + output.writeFieldBegin('prefixPaths', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.prefixPaths.length); + for (var iter148 in this.prefixPaths) { + if (this.prefixPaths.hasOwnProperty(iter148)) { + iter148 = this.prefixPaths[iter148]; + output.writeString(iter148); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.measurementsList !== null && this.measurementsList !== undefined) { + output.writeFieldBegin('measurementsList', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.LIST, this.measurementsList.length); + for (var iter149 in this.measurementsList) { + if (this.measurementsList.hasOwnProperty(iter149)) { + iter149 = this.measurementsList[iter149]; + output.writeListBegin(Thrift.Type.STRING, iter149.length); + for (var iter150 in iter149) { + if (iter149.hasOwnProperty(iter150)) { + iter150 = iter149[iter150]; + output.writeString(iter150); + } + } + output.writeListEnd(); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.valuesList !== null && this.valuesList !== undefined) { + output.writeFieldBegin('valuesList', Thrift.Type.LIST, 4); + output.writeListBegin(Thrift.Type.STRING, this.valuesList.length); + for (var iter151 in this.valuesList) { + if (this.valuesList.hasOwnProperty(iter151)) { + iter151 = this.valuesList[iter151]; + output.writeBinary(iter151); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.timestampsList !== null && this.timestampsList !== undefined) { + output.writeFieldBegin('timestampsList', Thrift.Type.LIST, 5); + output.writeListBegin(Thrift.Type.STRING, this.timestampsList.length); + for (var iter152 in this.timestampsList) { + if (this.timestampsList.hasOwnProperty(iter152)) { + iter152 = this.timestampsList[iter152]; + output.writeBinary(iter152); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.typesList !== null && this.typesList !== undefined) { + output.writeFieldBegin('typesList', Thrift.Type.LIST, 6); + output.writeListBegin(Thrift.Type.LIST, this.typesList.length); + for (var iter153 in this.typesList) { + if (this.typesList.hasOwnProperty(iter153)) { + iter153 = this.typesList[iter153]; + output.writeListBegin(Thrift.Type.I32, iter153.length); + for (var iter154 in iter153) { + if (iter153.hasOwnProperty(iter154)) { + iter154 = iter153[iter154]; + output.writeI32(iter154); + } + } + output.writeListEnd(); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.sizeList !== null && this.sizeList !== undefined) { + output.writeFieldBegin('sizeList', Thrift.Type.LIST, 7); + output.writeListBegin(Thrift.Type.I32, this.sizeList.length); + for (var iter155 in this.sizeList) { + if (this.sizeList.hasOwnProperty(iter155)) { + iter155 = this.sizeList[iter155]; + output.writeI32(iter155); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.isAligned !== null && this.isAligned !== undefined) { + output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 8); + output.writeBool(this.isAligned); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSInsertRecordsReq = module.exports.TSInsertRecordsReq = function(args) { + this.sessionId = null; + this.prefixPaths = null; + this.measurementsList = null; + this.valuesList = null; + this.timestamps = null; + this.isAligned = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.prefixPaths !== undefined && args.prefixPaths !== null) { + this.prefixPaths = Thrift.copyList(args.prefixPaths, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPaths is unset!'); + } + if (args.measurementsList !== undefined && args.measurementsList !== null) { + this.measurementsList = Thrift.copyList(args.measurementsList, [Thrift.copyList, null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurementsList is unset!'); + } + if (args.valuesList !== undefined && args.valuesList !== null) { + this.valuesList = Thrift.copyList(args.valuesList, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field valuesList is unset!'); + } + if (args.timestamps !== undefined && args.timestamps !== null) { + this.timestamps = Thrift.copyList(args.timestamps, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestamps is unset!'); + } + if (args.isAligned !== undefined && args.isAligned !== null) { + this.isAligned = args.isAligned; + } + } +}; +TSInsertRecordsReq.prototype = {}; +TSInsertRecordsReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.prefixPaths = []; + var _rtmp3157 = input.readListBegin(); + var _size156 = _rtmp3157.size || 0; + for (var _i158 = 0; _i158 < _size156; ++_i158) { + var elem159 = null; + elem159 = input.readString(); + this.prefixPaths.push(elem159); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.measurementsList = []; + var _rtmp3161 = input.readListBegin(); + var _size160 = _rtmp3161.size || 0; + for (var _i162 = 0; _i162 < _size160; ++_i162) { + var elem163 = null; + elem163 = []; + var _rtmp3165 = input.readListBegin(); + var _size164 = _rtmp3165.size || 0; + for (var _i166 = 0; _i166 < _size164; ++_i166) { + var elem167 = null; + elem167 = input.readString(); + elem163.push(elem167); + } + input.readListEnd(); + this.measurementsList.push(elem163); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.LIST) { + this.valuesList = []; + var _rtmp3169 = input.readListBegin(); + var _size168 = _rtmp3169.size || 0; + for (var _i170 = 0; _i170 < _size168; ++_i170) { + var elem171 = null; + elem171 = input.readBinary(); + this.valuesList.push(elem171); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.LIST) { + this.timestamps = []; + var _rtmp3173 = input.readListBegin(); + var _size172 = _rtmp3173.size || 0; + for (var _i174 = 0; _i174 < _size172; ++_i174) { + var elem175 = null; + elem175 = input.readI64(); + this.timestamps.push(elem175); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.BOOL) { + this.isAligned = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSInsertRecordsReq.prototype.write = function(output) { + output.writeStructBegin('TSInsertRecordsReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.prefixPaths !== null && this.prefixPaths !== undefined) { + output.writeFieldBegin('prefixPaths', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.prefixPaths.length); + for (var iter176 in this.prefixPaths) { + if (this.prefixPaths.hasOwnProperty(iter176)) { + iter176 = this.prefixPaths[iter176]; + output.writeString(iter176); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.measurementsList !== null && this.measurementsList !== undefined) { + output.writeFieldBegin('measurementsList', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.LIST, this.measurementsList.length); + for (var iter177 in this.measurementsList) { + if (this.measurementsList.hasOwnProperty(iter177)) { + iter177 = this.measurementsList[iter177]; + output.writeListBegin(Thrift.Type.STRING, iter177.length); + for (var iter178 in iter177) { + if (iter177.hasOwnProperty(iter178)) { + iter178 = iter177[iter178]; + output.writeString(iter178); + } + } + output.writeListEnd(); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.valuesList !== null && this.valuesList !== undefined) { + output.writeFieldBegin('valuesList', Thrift.Type.LIST, 4); + output.writeListBegin(Thrift.Type.STRING, this.valuesList.length); + for (var iter179 in this.valuesList) { + if (this.valuesList.hasOwnProperty(iter179)) { + iter179 = this.valuesList[iter179]; + output.writeBinary(iter179); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.timestamps !== null && this.timestamps !== undefined) { + output.writeFieldBegin('timestamps', Thrift.Type.LIST, 5); + output.writeListBegin(Thrift.Type.I64, this.timestamps.length); + for (var iter180 in this.timestamps) { + if (this.timestamps.hasOwnProperty(iter180)) { + iter180 = this.timestamps[iter180]; + output.writeI64(iter180); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.isAligned !== null && this.isAligned !== undefined) { + output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 6); + output.writeBool(this.isAligned); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSInsertRecordsOfOneDeviceReq = module.exports.TSInsertRecordsOfOneDeviceReq = function(args) { + this.sessionId = null; + this.prefixPath = null; + this.measurementsList = null; + this.valuesList = null; + this.timestamps = null; + this.isAligned = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.prefixPath !== undefined && args.prefixPath !== null) { + this.prefixPath = args.prefixPath; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPath is unset!'); + } + if (args.measurementsList !== undefined && args.measurementsList !== null) { + this.measurementsList = Thrift.copyList(args.measurementsList, [Thrift.copyList, null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurementsList is unset!'); + } + if (args.valuesList !== undefined && args.valuesList !== null) { + this.valuesList = Thrift.copyList(args.valuesList, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field valuesList is unset!'); + } + if (args.timestamps !== undefined && args.timestamps !== null) { + this.timestamps = Thrift.copyList(args.timestamps, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestamps is unset!'); + } + if (args.isAligned !== undefined && args.isAligned !== null) { + this.isAligned = args.isAligned; + } + } +}; +TSInsertRecordsOfOneDeviceReq.prototype = {}; +TSInsertRecordsOfOneDeviceReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.prefixPath = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.measurementsList = []; + var _rtmp3182 = input.readListBegin(); + var _size181 = _rtmp3182.size || 0; + for (var _i183 = 0; _i183 < _size181; ++_i183) { + var elem184 = null; + elem184 = []; + var _rtmp3186 = input.readListBegin(); + var _size185 = _rtmp3186.size || 0; + for (var _i187 = 0; _i187 < _size185; ++_i187) { + var elem188 = null; + elem188 = input.readString(); + elem184.push(elem188); + } + input.readListEnd(); + this.measurementsList.push(elem184); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.LIST) { + this.valuesList = []; + var _rtmp3190 = input.readListBegin(); + var _size189 = _rtmp3190.size || 0; + for (var _i191 = 0; _i191 < _size189; ++_i191) { + var elem192 = null; + elem192 = input.readBinary(); + this.valuesList.push(elem192); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.LIST) { + this.timestamps = []; + var _rtmp3194 = input.readListBegin(); + var _size193 = _rtmp3194.size || 0; + for (var _i195 = 0; _i195 < _size193; ++_i195) { + var elem196 = null; + elem196 = input.readI64(); + this.timestamps.push(elem196); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.BOOL) { + this.isAligned = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSInsertRecordsOfOneDeviceReq.prototype.write = function(output) { + output.writeStructBegin('TSInsertRecordsOfOneDeviceReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.prefixPath !== null && this.prefixPath !== undefined) { + output.writeFieldBegin('prefixPath', Thrift.Type.STRING, 2); + output.writeString(this.prefixPath); + output.writeFieldEnd(); + } + if (this.measurementsList !== null && this.measurementsList !== undefined) { + output.writeFieldBegin('measurementsList', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.LIST, this.measurementsList.length); + for (var iter197 in this.measurementsList) { + if (this.measurementsList.hasOwnProperty(iter197)) { + iter197 = this.measurementsList[iter197]; + output.writeListBegin(Thrift.Type.STRING, iter197.length); + for (var iter198 in iter197) { + if (iter197.hasOwnProperty(iter198)) { + iter198 = iter197[iter198]; + output.writeString(iter198); + } + } + output.writeListEnd(); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.valuesList !== null && this.valuesList !== undefined) { + output.writeFieldBegin('valuesList', Thrift.Type.LIST, 4); + output.writeListBegin(Thrift.Type.STRING, this.valuesList.length); + for (var iter199 in this.valuesList) { + if (this.valuesList.hasOwnProperty(iter199)) { + iter199 = this.valuesList[iter199]; + output.writeBinary(iter199); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.timestamps !== null && this.timestamps !== undefined) { + output.writeFieldBegin('timestamps', Thrift.Type.LIST, 5); + output.writeListBegin(Thrift.Type.I64, this.timestamps.length); + for (var iter200 in this.timestamps) { + if (this.timestamps.hasOwnProperty(iter200)) { + iter200 = this.timestamps[iter200]; + output.writeI64(iter200); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.isAligned !== null && this.isAligned !== undefined) { + output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 6); + output.writeBool(this.isAligned); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSInsertStringRecordsOfOneDeviceReq = module.exports.TSInsertStringRecordsOfOneDeviceReq = function(args) { + this.sessionId = null; + this.prefixPath = null; + this.measurementsList = null; + this.valuesList = null; + this.timestamps = null; + this.isAligned = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.prefixPath !== undefined && args.prefixPath !== null) { + this.prefixPath = args.prefixPath; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPath is unset!'); + } + if (args.measurementsList !== undefined && args.measurementsList !== null) { + this.measurementsList = Thrift.copyList(args.measurementsList, [Thrift.copyList, null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurementsList is unset!'); + } + if (args.valuesList !== undefined && args.valuesList !== null) { + this.valuesList = Thrift.copyList(args.valuesList, [Thrift.copyList, null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field valuesList is unset!'); + } + if (args.timestamps !== undefined && args.timestamps !== null) { + this.timestamps = Thrift.copyList(args.timestamps, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestamps is unset!'); + } + if (args.isAligned !== undefined && args.isAligned !== null) { + this.isAligned = args.isAligned; + } + } +}; +TSInsertStringRecordsOfOneDeviceReq.prototype = {}; +TSInsertStringRecordsOfOneDeviceReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.prefixPath = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.measurementsList = []; + var _rtmp3202 = input.readListBegin(); + var _size201 = _rtmp3202.size || 0; + for (var _i203 = 0; _i203 < _size201; ++_i203) { + var elem204 = null; + elem204 = []; + var _rtmp3206 = input.readListBegin(); + var _size205 = _rtmp3206.size || 0; + for (var _i207 = 0; _i207 < _size205; ++_i207) { + var elem208 = null; + elem208 = input.readString(); + elem204.push(elem208); + } + input.readListEnd(); + this.measurementsList.push(elem204); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.LIST) { + this.valuesList = []; + var _rtmp3210 = input.readListBegin(); + var _size209 = _rtmp3210.size || 0; + for (var _i211 = 0; _i211 < _size209; ++_i211) { + var elem212 = null; + elem212 = []; + var _rtmp3214 = input.readListBegin(); + var _size213 = _rtmp3214.size || 0; + for (var _i215 = 0; _i215 < _size213; ++_i215) { + var elem216 = null; + elem216 = input.readString(); + elem212.push(elem216); + } + input.readListEnd(); + this.valuesList.push(elem212); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.LIST) { + this.timestamps = []; + var _rtmp3218 = input.readListBegin(); + var _size217 = _rtmp3218.size || 0; + for (var _i219 = 0; _i219 < _size217; ++_i219) { + var elem220 = null; + elem220 = input.readI64(); + this.timestamps.push(elem220); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.BOOL) { + this.isAligned = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSInsertStringRecordsOfOneDeviceReq.prototype.write = function(output) { + output.writeStructBegin('TSInsertStringRecordsOfOneDeviceReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.prefixPath !== null && this.prefixPath !== undefined) { + output.writeFieldBegin('prefixPath', Thrift.Type.STRING, 2); + output.writeString(this.prefixPath); + output.writeFieldEnd(); + } + if (this.measurementsList !== null && this.measurementsList !== undefined) { + output.writeFieldBegin('measurementsList', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.LIST, this.measurementsList.length); + for (var iter221 in this.measurementsList) { + if (this.measurementsList.hasOwnProperty(iter221)) { + iter221 = this.measurementsList[iter221]; + output.writeListBegin(Thrift.Type.STRING, iter221.length); + for (var iter222 in iter221) { + if (iter221.hasOwnProperty(iter222)) { + iter222 = iter221[iter222]; + output.writeString(iter222); + } + } + output.writeListEnd(); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.valuesList !== null && this.valuesList !== undefined) { + output.writeFieldBegin('valuesList', Thrift.Type.LIST, 4); + output.writeListBegin(Thrift.Type.LIST, this.valuesList.length); + for (var iter223 in this.valuesList) { + if (this.valuesList.hasOwnProperty(iter223)) { + iter223 = this.valuesList[iter223]; + output.writeListBegin(Thrift.Type.STRING, iter223.length); + for (var iter224 in iter223) { + if (iter223.hasOwnProperty(iter224)) { + iter224 = iter223[iter224]; + output.writeString(iter224); + } + } + output.writeListEnd(); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.timestamps !== null && this.timestamps !== undefined) { + output.writeFieldBegin('timestamps', Thrift.Type.LIST, 5); + output.writeListBegin(Thrift.Type.I64, this.timestamps.length); + for (var iter225 in this.timestamps) { + if (this.timestamps.hasOwnProperty(iter225)) { + iter225 = this.timestamps[iter225]; + output.writeI64(iter225); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.isAligned !== null && this.isAligned !== undefined) { + output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 6); + output.writeBool(this.isAligned); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSInsertStringRecordsReq = module.exports.TSInsertStringRecordsReq = function(args) { + this.sessionId = null; + this.prefixPaths = null; + this.measurementsList = null; + this.valuesList = null; + this.timestamps = null; + this.isAligned = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.prefixPaths !== undefined && args.prefixPaths !== null) { + this.prefixPaths = Thrift.copyList(args.prefixPaths, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPaths is unset!'); + } + if (args.measurementsList !== undefined && args.measurementsList !== null) { + this.measurementsList = Thrift.copyList(args.measurementsList, [Thrift.copyList, null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurementsList is unset!'); + } + if (args.valuesList !== undefined && args.valuesList !== null) { + this.valuesList = Thrift.copyList(args.valuesList, [Thrift.copyList, null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field valuesList is unset!'); + } + if (args.timestamps !== undefined && args.timestamps !== null) { + this.timestamps = Thrift.copyList(args.timestamps, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestamps is unset!'); + } + if (args.isAligned !== undefined && args.isAligned !== null) { + this.isAligned = args.isAligned; + } + } +}; +TSInsertStringRecordsReq.prototype = {}; +TSInsertStringRecordsReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.prefixPaths = []; + var _rtmp3227 = input.readListBegin(); + var _size226 = _rtmp3227.size || 0; + for (var _i228 = 0; _i228 < _size226; ++_i228) { + var elem229 = null; + elem229 = input.readString(); + this.prefixPaths.push(elem229); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.measurementsList = []; + var _rtmp3231 = input.readListBegin(); + var _size230 = _rtmp3231.size || 0; + for (var _i232 = 0; _i232 < _size230; ++_i232) { + var elem233 = null; + elem233 = []; + var _rtmp3235 = input.readListBegin(); + var _size234 = _rtmp3235.size || 0; + for (var _i236 = 0; _i236 < _size234; ++_i236) { + var elem237 = null; + elem237 = input.readString(); + elem233.push(elem237); + } + input.readListEnd(); + this.measurementsList.push(elem233); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.LIST) { + this.valuesList = []; + var _rtmp3239 = input.readListBegin(); + var _size238 = _rtmp3239.size || 0; + for (var _i240 = 0; _i240 < _size238; ++_i240) { + var elem241 = null; + elem241 = []; + var _rtmp3243 = input.readListBegin(); + var _size242 = _rtmp3243.size || 0; + for (var _i244 = 0; _i244 < _size242; ++_i244) { + var elem245 = null; + elem245 = input.readString(); + elem241.push(elem245); + } + input.readListEnd(); + this.valuesList.push(elem241); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.LIST) { + this.timestamps = []; + var _rtmp3247 = input.readListBegin(); + var _size246 = _rtmp3247.size || 0; + for (var _i248 = 0; _i248 < _size246; ++_i248) { + var elem249 = null; + elem249 = input.readI64(); + this.timestamps.push(elem249); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.BOOL) { + this.isAligned = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSInsertStringRecordsReq.prototype.write = function(output) { + output.writeStructBegin('TSInsertStringRecordsReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.prefixPaths !== null && this.prefixPaths !== undefined) { + output.writeFieldBegin('prefixPaths', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.prefixPaths.length); + for (var iter250 in this.prefixPaths) { + if (this.prefixPaths.hasOwnProperty(iter250)) { + iter250 = this.prefixPaths[iter250]; + output.writeString(iter250); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.measurementsList !== null && this.measurementsList !== undefined) { + output.writeFieldBegin('measurementsList', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.LIST, this.measurementsList.length); + for (var iter251 in this.measurementsList) { + if (this.measurementsList.hasOwnProperty(iter251)) { + iter251 = this.measurementsList[iter251]; + output.writeListBegin(Thrift.Type.STRING, iter251.length); + for (var iter252 in iter251) { + if (iter251.hasOwnProperty(iter252)) { + iter252 = iter251[iter252]; + output.writeString(iter252); + } + } + output.writeListEnd(); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.valuesList !== null && this.valuesList !== undefined) { + output.writeFieldBegin('valuesList', Thrift.Type.LIST, 4); + output.writeListBegin(Thrift.Type.LIST, this.valuesList.length); + for (var iter253 in this.valuesList) { + if (this.valuesList.hasOwnProperty(iter253)) { + iter253 = this.valuesList[iter253]; + output.writeListBegin(Thrift.Type.STRING, iter253.length); + for (var iter254 in iter253) { + if (iter253.hasOwnProperty(iter254)) { + iter254 = iter253[iter254]; + output.writeString(iter254); + } + } + output.writeListEnd(); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.timestamps !== null && this.timestamps !== undefined) { + output.writeFieldBegin('timestamps', Thrift.Type.LIST, 5); + output.writeListBegin(Thrift.Type.I64, this.timestamps.length); + for (var iter255 in this.timestamps) { + if (this.timestamps.hasOwnProperty(iter255)) { + iter255 = this.timestamps[iter255]; + output.writeI64(iter255); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.isAligned !== null && this.isAligned !== undefined) { + output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 6); + output.writeBool(this.isAligned); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSDeleteDataReq = module.exports.TSDeleteDataReq = function(args) { + this.sessionId = null; + this.paths = null; + this.startTime = null; + this.endTime = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.paths !== undefined && args.paths !== null) { + this.paths = Thrift.copyList(args.paths, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field paths is unset!'); + } + if (args.startTime !== undefined && args.startTime !== null) { + this.startTime = args.startTime; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field startTime is unset!'); + } + if (args.endTime !== undefined && args.endTime !== null) { + this.endTime = args.endTime; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field endTime is unset!'); + } + } +}; +TSDeleteDataReq.prototype = {}; +TSDeleteDataReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.paths = []; + var _rtmp3257 = input.readListBegin(); + var _size256 = _rtmp3257.size || 0; + for (var _i258 = 0; _i258 < _size256; ++_i258) { + var elem259 = null; + elem259 = input.readString(); + this.paths.push(elem259); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I64) { + this.startTime = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.I64) { + this.endTime = input.readI64(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSDeleteDataReq.prototype.write = function(output) { + output.writeStructBegin('TSDeleteDataReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.paths !== null && this.paths !== undefined) { + output.writeFieldBegin('paths', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.paths.length); + for (var iter260 in this.paths) { + if (this.paths.hasOwnProperty(iter260)) { + iter260 = this.paths[iter260]; + output.writeString(iter260); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.startTime !== null && this.startTime !== undefined) { + output.writeFieldBegin('startTime', Thrift.Type.I64, 3); + output.writeI64(this.startTime); + output.writeFieldEnd(); + } + if (this.endTime !== null && this.endTime !== undefined) { + output.writeFieldBegin('endTime', Thrift.Type.I64, 4); + output.writeI64(this.endTime); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSCreateTimeseriesReq = module.exports.TSCreateTimeseriesReq = function(args) { + this.sessionId = null; + this.path = null; + this.dataType = null; + this.encoding = null; + this.compressor = null; + this.props = null; + this.tags = null; + this.attributes = null; + this.measurementAlias = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.path !== undefined && args.path !== null) { + this.path = args.path; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field path is unset!'); + } + if (args.dataType !== undefined && args.dataType !== null) { + this.dataType = args.dataType; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dataType is unset!'); + } + if (args.encoding !== undefined && args.encoding !== null) { + this.encoding = args.encoding; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field encoding is unset!'); + } + if (args.compressor !== undefined && args.compressor !== null) { + this.compressor = args.compressor; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field compressor is unset!'); + } + if (args.props !== undefined && args.props !== null) { + this.props = Thrift.copyMap(args.props, [null]); + } + if (args.tags !== undefined && args.tags !== null) { + this.tags = Thrift.copyMap(args.tags, [null]); + } + if (args.attributes !== undefined && args.attributes !== null) { + this.attributes = Thrift.copyMap(args.attributes, [null]); + } + if (args.measurementAlias !== undefined && args.measurementAlias !== null) { + this.measurementAlias = args.measurementAlias; + } + } +}; +TSCreateTimeseriesReq.prototype = {}; +TSCreateTimeseriesReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.path = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I32) { + this.dataType = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.I32) { + this.encoding = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I32) { + this.compressor = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.MAP) { + this.props = {}; + var _rtmp3262 = input.readMapBegin(); + var _size261 = _rtmp3262.size || 0; + for (var _i263 = 0; _i263 < _size261; ++_i263) { + var key264 = null; + var val265 = null; + key264 = input.readString(); + val265 = input.readString(); + this.props[key264] = val265; + } + input.readMapEnd(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.MAP) { + this.tags = {}; + var _rtmp3267 = input.readMapBegin(); + var _size266 = _rtmp3267.size || 0; + for (var _i268 = 0; _i268 < _size266; ++_i268) { + var key269 = null; + var val270 = null; + key269 = input.readString(); + val270 = input.readString(); + this.tags[key269] = val270; + } + input.readMapEnd(); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.MAP) { + this.attributes = {}; + var _rtmp3272 = input.readMapBegin(); + var _size271 = _rtmp3272.size || 0; + for (var _i273 = 0; _i273 < _size271; ++_i273) { + var key274 = null; + var val275 = null; + key274 = input.readString(); + val275 = input.readString(); + this.attributes[key274] = val275; + } + input.readMapEnd(); + } else { + input.skip(ftype); + } + break; + case 9: + if (ftype == Thrift.Type.STRING) { + this.measurementAlias = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSCreateTimeseriesReq.prototype.write = function(output) { + output.writeStructBegin('TSCreateTimeseriesReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.path !== null && this.path !== undefined) { + output.writeFieldBegin('path', Thrift.Type.STRING, 2); + output.writeString(this.path); + output.writeFieldEnd(); + } + if (this.dataType !== null && this.dataType !== undefined) { + output.writeFieldBegin('dataType', Thrift.Type.I32, 3); + output.writeI32(this.dataType); + output.writeFieldEnd(); + } + if (this.encoding !== null && this.encoding !== undefined) { + output.writeFieldBegin('encoding', Thrift.Type.I32, 4); + output.writeI32(this.encoding); + output.writeFieldEnd(); + } + if (this.compressor !== null && this.compressor !== undefined) { + output.writeFieldBegin('compressor', Thrift.Type.I32, 5); + output.writeI32(this.compressor); + output.writeFieldEnd(); + } + if (this.props !== null && this.props !== undefined) { + output.writeFieldBegin('props', Thrift.Type.MAP, 6); + output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.props)); + for (var kiter276 in this.props) { + if (this.props.hasOwnProperty(kiter276)) { + var viter277 = this.props[kiter276]; + output.writeString(kiter276); + output.writeString(viter277); + } + } + output.writeMapEnd(); + output.writeFieldEnd(); + } + if (this.tags !== null && this.tags !== undefined) { + output.writeFieldBegin('tags', Thrift.Type.MAP, 7); + output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.tags)); + for (var kiter278 in this.tags) { + if (this.tags.hasOwnProperty(kiter278)) { + var viter279 = this.tags[kiter278]; + output.writeString(kiter278); + output.writeString(viter279); + } + } + output.writeMapEnd(); + output.writeFieldEnd(); + } + if (this.attributes !== null && this.attributes !== undefined) { + output.writeFieldBegin('attributes', Thrift.Type.MAP, 8); + output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.attributes)); + for (var kiter280 in this.attributes) { + if (this.attributes.hasOwnProperty(kiter280)) { + var viter281 = this.attributes[kiter280]; + output.writeString(kiter280); + output.writeString(viter281); + } + } + output.writeMapEnd(); + output.writeFieldEnd(); + } + if (this.measurementAlias !== null && this.measurementAlias !== undefined) { + output.writeFieldBegin('measurementAlias', Thrift.Type.STRING, 9); + output.writeString(this.measurementAlias); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSCreateAlignedTimeseriesReq = module.exports.TSCreateAlignedTimeseriesReq = function(args) { + this.sessionId = null; + this.prefixPath = null; + this.measurements = null; + this.dataTypes = null; + this.encodings = null; + this.compressors = null; + this.measurementAlias = null; + this.tagsList = null; + this.attributesList = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.prefixPath !== undefined && args.prefixPath !== null) { + this.prefixPath = args.prefixPath; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPath is unset!'); + } + if (args.measurements !== undefined && args.measurements !== null) { + this.measurements = Thrift.copyList(args.measurements, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurements is unset!'); + } + if (args.dataTypes !== undefined && args.dataTypes !== null) { + this.dataTypes = Thrift.copyList(args.dataTypes, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dataTypes is unset!'); + } + if (args.encodings !== undefined && args.encodings !== null) { + this.encodings = Thrift.copyList(args.encodings, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field encodings is unset!'); + } + if (args.compressors !== undefined && args.compressors !== null) { + this.compressors = Thrift.copyList(args.compressors, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field compressors is unset!'); + } + if (args.measurementAlias !== undefined && args.measurementAlias !== null) { + this.measurementAlias = Thrift.copyList(args.measurementAlias, [null]); + } + if (args.tagsList !== undefined && args.tagsList !== null) { + this.tagsList = Thrift.copyList(args.tagsList, [Thrift.copyMap, null]); + } + if (args.attributesList !== undefined && args.attributesList !== null) { + this.attributesList = Thrift.copyList(args.attributesList, [Thrift.copyMap, null]); + } + } +}; +TSCreateAlignedTimeseriesReq.prototype = {}; +TSCreateAlignedTimeseriesReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.prefixPath = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.measurements = []; + var _rtmp3283 = input.readListBegin(); + var _size282 = _rtmp3283.size || 0; + for (var _i284 = 0; _i284 < _size282; ++_i284) { + var elem285 = null; + elem285 = input.readString(); + this.measurements.push(elem285); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.LIST) { + this.dataTypes = []; + var _rtmp3287 = input.readListBegin(); + var _size286 = _rtmp3287.size || 0; + for (var _i288 = 0; _i288 < _size286; ++_i288) { + var elem289 = null; + elem289 = input.readI32(); + this.dataTypes.push(elem289); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.LIST) { + this.encodings = []; + var _rtmp3291 = input.readListBegin(); + var _size290 = _rtmp3291.size || 0; + for (var _i292 = 0; _i292 < _size290; ++_i292) { + var elem293 = null; + elem293 = input.readI32(); + this.encodings.push(elem293); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.LIST) { + this.compressors = []; + var _rtmp3295 = input.readListBegin(); + var _size294 = _rtmp3295.size || 0; + for (var _i296 = 0; _i296 < _size294; ++_i296) { + var elem297 = null; + elem297 = input.readI32(); + this.compressors.push(elem297); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.LIST) { + this.measurementAlias = []; + var _rtmp3299 = input.readListBegin(); + var _size298 = _rtmp3299.size || 0; + for (var _i300 = 0; _i300 < _size298; ++_i300) { + var elem301 = null; + elem301 = input.readString(); + this.measurementAlias.push(elem301); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.LIST) { + this.tagsList = []; + var _rtmp3303 = input.readListBegin(); + var _size302 = _rtmp3303.size || 0; + for (var _i304 = 0; _i304 < _size302; ++_i304) { + var elem305 = null; + elem305 = {}; + var _rtmp3307 = input.readMapBegin(); + var _size306 = _rtmp3307.size || 0; + for (var _i308 = 0; _i308 < _size306; ++_i308) { + var key309 = null; + var val310 = null; + key309 = input.readString(); + val310 = input.readString(); + elem305[key309] = val310; + } + input.readMapEnd(); + this.tagsList.push(elem305); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 9: + if (ftype == Thrift.Type.LIST) { + this.attributesList = []; + var _rtmp3312 = input.readListBegin(); + var _size311 = _rtmp3312.size || 0; + for (var _i313 = 0; _i313 < _size311; ++_i313) { + var elem314 = null; + elem314 = {}; + var _rtmp3316 = input.readMapBegin(); + var _size315 = _rtmp3316.size || 0; + for (var _i317 = 0; _i317 < _size315; ++_i317) { + var key318 = null; + var val319 = null; + key318 = input.readString(); + val319 = input.readString(); + elem314[key318] = val319; + } + input.readMapEnd(); + this.attributesList.push(elem314); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSCreateAlignedTimeseriesReq.prototype.write = function(output) { + output.writeStructBegin('TSCreateAlignedTimeseriesReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.prefixPath !== null && this.prefixPath !== undefined) { + output.writeFieldBegin('prefixPath', Thrift.Type.STRING, 2); + output.writeString(this.prefixPath); + output.writeFieldEnd(); + } + if (this.measurements !== null && this.measurements !== undefined) { + output.writeFieldBegin('measurements', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.STRING, this.measurements.length); + for (var iter320 in this.measurements) { + if (this.measurements.hasOwnProperty(iter320)) { + iter320 = this.measurements[iter320]; + output.writeString(iter320); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.dataTypes !== null && this.dataTypes !== undefined) { + output.writeFieldBegin('dataTypes', Thrift.Type.LIST, 4); + output.writeListBegin(Thrift.Type.I32, this.dataTypes.length); + for (var iter321 in this.dataTypes) { + if (this.dataTypes.hasOwnProperty(iter321)) { + iter321 = this.dataTypes[iter321]; + output.writeI32(iter321); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.encodings !== null && this.encodings !== undefined) { + output.writeFieldBegin('encodings', Thrift.Type.LIST, 5); + output.writeListBegin(Thrift.Type.I32, this.encodings.length); + for (var iter322 in this.encodings) { + if (this.encodings.hasOwnProperty(iter322)) { + iter322 = this.encodings[iter322]; + output.writeI32(iter322); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.compressors !== null && this.compressors !== undefined) { + output.writeFieldBegin('compressors', Thrift.Type.LIST, 6); + output.writeListBegin(Thrift.Type.I32, this.compressors.length); + for (var iter323 in this.compressors) { + if (this.compressors.hasOwnProperty(iter323)) { + iter323 = this.compressors[iter323]; + output.writeI32(iter323); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.measurementAlias !== null && this.measurementAlias !== undefined) { + output.writeFieldBegin('measurementAlias', Thrift.Type.LIST, 7); + output.writeListBegin(Thrift.Type.STRING, this.measurementAlias.length); + for (var iter324 in this.measurementAlias) { + if (this.measurementAlias.hasOwnProperty(iter324)) { + iter324 = this.measurementAlias[iter324]; + output.writeString(iter324); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.tagsList !== null && this.tagsList !== undefined) { + output.writeFieldBegin('tagsList', Thrift.Type.LIST, 8); + output.writeListBegin(Thrift.Type.MAP, this.tagsList.length); + for (var iter325 in this.tagsList) { + if (this.tagsList.hasOwnProperty(iter325)) { + iter325 = this.tagsList[iter325]; + output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(iter325)); + for (var kiter326 in iter325) { + if (iter325.hasOwnProperty(kiter326)) { + var viter327 = iter325[kiter326]; + output.writeString(kiter326); + output.writeString(viter327); + } + } + output.writeMapEnd(); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.attributesList !== null && this.attributesList !== undefined) { + output.writeFieldBegin('attributesList', Thrift.Type.LIST, 9); + output.writeListBegin(Thrift.Type.MAP, this.attributesList.length); + for (var iter328 in this.attributesList) { + if (this.attributesList.hasOwnProperty(iter328)) { + iter328 = this.attributesList[iter328]; + output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(iter328)); + for (var kiter329 in iter328) { + if (iter328.hasOwnProperty(kiter329)) { + var viter330 = iter328[kiter329]; + output.writeString(kiter329); + output.writeString(viter330); + } + } + output.writeMapEnd(); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSRawDataQueryReq = module.exports.TSRawDataQueryReq = function(args) { + this.sessionId = null; + this.paths = null; + this.fetchSize = null; + this.startTime = null; + this.endTime = null; + this.statementId = null; + this.enableRedirectQuery = null; + this.jdbcQuery = null; + this.timeout = null; + this.legalPathNodes = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.paths !== undefined && args.paths !== null) { + this.paths = Thrift.copyList(args.paths, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field paths is unset!'); + } + if (args.fetchSize !== undefined && args.fetchSize !== null) { + this.fetchSize = args.fetchSize; + } + if (args.startTime !== undefined && args.startTime !== null) { + this.startTime = args.startTime; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field startTime is unset!'); + } + if (args.endTime !== undefined && args.endTime !== null) { + this.endTime = args.endTime; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field endTime is unset!'); + } + if (args.statementId !== undefined && args.statementId !== null) { + this.statementId = args.statementId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statementId is unset!'); + } + if (args.enableRedirectQuery !== undefined && args.enableRedirectQuery !== null) { + this.enableRedirectQuery = args.enableRedirectQuery; + } + if (args.jdbcQuery !== undefined && args.jdbcQuery !== null) { + this.jdbcQuery = args.jdbcQuery; + } + if (args.timeout !== undefined && args.timeout !== null) { + this.timeout = args.timeout; + } + if (args.legalPathNodes !== undefined && args.legalPathNodes !== null) { + this.legalPathNodes = args.legalPathNodes; + } + } +}; +TSRawDataQueryReq.prototype = {}; +TSRawDataQueryReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.paths = []; + var _rtmp3332 = input.readListBegin(); + var _size331 = _rtmp3332.size || 0; + for (var _i333 = 0; _i333 < _size331; ++_i333) { + var elem334 = null; + elem334 = input.readString(); + this.paths.push(elem334); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I32) { + this.fetchSize = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.I64) { + this.startTime = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I64) { + this.endTime = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.I64) { + this.statementId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.BOOL) { + this.enableRedirectQuery = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.BOOL) { + this.jdbcQuery = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 9: + if (ftype == Thrift.Type.I64) { + this.timeout = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 10: + if (ftype == Thrift.Type.BOOL) { + this.legalPathNodes = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSRawDataQueryReq.prototype.write = function(output) { + output.writeStructBegin('TSRawDataQueryReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.paths !== null && this.paths !== undefined) { + output.writeFieldBegin('paths', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.paths.length); + for (var iter335 in this.paths) { + if (this.paths.hasOwnProperty(iter335)) { + iter335 = this.paths[iter335]; + output.writeString(iter335); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.fetchSize !== null && this.fetchSize !== undefined) { + output.writeFieldBegin('fetchSize', Thrift.Type.I32, 3); + output.writeI32(this.fetchSize); + output.writeFieldEnd(); + } + if (this.startTime !== null && this.startTime !== undefined) { + output.writeFieldBegin('startTime', Thrift.Type.I64, 4); + output.writeI64(this.startTime); + output.writeFieldEnd(); + } + if (this.endTime !== null && this.endTime !== undefined) { + output.writeFieldBegin('endTime', Thrift.Type.I64, 5); + output.writeI64(this.endTime); + output.writeFieldEnd(); + } + if (this.statementId !== null && this.statementId !== undefined) { + output.writeFieldBegin('statementId', Thrift.Type.I64, 6); + output.writeI64(this.statementId); + output.writeFieldEnd(); + } + if (this.enableRedirectQuery !== null && this.enableRedirectQuery !== undefined) { + output.writeFieldBegin('enableRedirectQuery', Thrift.Type.BOOL, 7); + output.writeBool(this.enableRedirectQuery); + output.writeFieldEnd(); + } + if (this.jdbcQuery !== null && this.jdbcQuery !== undefined) { + output.writeFieldBegin('jdbcQuery', Thrift.Type.BOOL, 8); + output.writeBool(this.jdbcQuery); + output.writeFieldEnd(); + } + if (this.timeout !== null && this.timeout !== undefined) { + output.writeFieldBegin('timeout', Thrift.Type.I64, 9); + output.writeI64(this.timeout); + output.writeFieldEnd(); + } + if (this.legalPathNodes !== null && this.legalPathNodes !== undefined) { + output.writeFieldBegin('legalPathNodes', Thrift.Type.BOOL, 10); + output.writeBool(this.legalPathNodes); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSLastDataQueryReq = module.exports.TSLastDataQueryReq = function(args) { + this.sessionId = null; + this.paths = null; + this.fetchSize = null; + this.time = null; + this.statementId = null; + this.enableRedirectQuery = null; + this.jdbcQuery = null; + this.timeout = null; + this.legalPathNodes = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.paths !== undefined && args.paths !== null) { + this.paths = Thrift.copyList(args.paths, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field paths is unset!'); + } + if (args.fetchSize !== undefined && args.fetchSize !== null) { + this.fetchSize = args.fetchSize; + } + if (args.time !== undefined && args.time !== null) { + this.time = args.time; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field time is unset!'); + } + if (args.statementId !== undefined && args.statementId !== null) { + this.statementId = args.statementId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statementId is unset!'); + } + if (args.enableRedirectQuery !== undefined && args.enableRedirectQuery !== null) { + this.enableRedirectQuery = args.enableRedirectQuery; + } + if (args.jdbcQuery !== undefined && args.jdbcQuery !== null) { + this.jdbcQuery = args.jdbcQuery; + } + if (args.timeout !== undefined && args.timeout !== null) { + this.timeout = args.timeout; + } + if (args.legalPathNodes !== undefined && args.legalPathNodes !== null) { + this.legalPathNodes = args.legalPathNodes; + } + } +}; +TSLastDataQueryReq.prototype = {}; +TSLastDataQueryReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.paths = []; + var _rtmp3337 = input.readListBegin(); + var _size336 = _rtmp3337.size || 0; + for (var _i338 = 0; _i338 < _size336; ++_i338) { + var elem339 = null; + elem339 = input.readString(); + this.paths.push(elem339); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I32) { + this.fetchSize = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.I64) { + this.time = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I64) { + this.statementId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.BOOL) { + this.enableRedirectQuery = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.BOOL) { + this.jdbcQuery = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.I64) { + this.timeout = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 9: + if (ftype == Thrift.Type.BOOL) { + this.legalPathNodes = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSLastDataQueryReq.prototype.write = function(output) { + output.writeStructBegin('TSLastDataQueryReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.paths !== null && this.paths !== undefined) { + output.writeFieldBegin('paths', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.paths.length); + for (var iter340 in this.paths) { + if (this.paths.hasOwnProperty(iter340)) { + iter340 = this.paths[iter340]; + output.writeString(iter340); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.fetchSize !== null && this.fetchSize !== undefined) { + output.writeFieldBegin('fetchSize', Thrift.Type.I32, 3); + output.writeI32(this.fetchSize); + output.writeFieldEnd(); + } + if (this.time !== null && this.time !== undefined) { + output.writeFieldBegin('time', Thrift.Type.I64, 4); + output.writeI64(this.time); + output.writeFieldEnd(); + } + if (this.statementId !== null && this.statementId !== undefined) { + output.writeFieldBegin('statementId', Thrift.Type.I64, 5); + output.writeI64(this.statementId); + output.writeFieldEnd(); + } + if (this.enableRedirectQuery !== null && this.enableRedirectQuery !== undefined) { + output.writeFieldBegin('enableRedirectQuery', Thrift.Type.BOOL, 6); + output.writeBool(this.enableRedirectQuery); + output.writeFieldEnd(); + } + if (this.jdbcQuery !== null && this.jdbcQuery !== undefined) { + output.writeFieldBegin('jdbcQuery', Thrift.Type.BOOL, 7); + output.writeBool(this.jdbcQuery); + output.writeFieldEnd(); + } + if (this.timeout !== null && this.timeout !== undefined) { + output.writeFieldBegin('timeout', Thrift.Type.I64, 8); + output.writeI64(this.timeout); + output.writeFieldEnd(); + } + if (this.legalPathNodes !== null && this.legalPathNodes !== undefined) { + output.writeFieldBegin('legalPathNodes', Thrift.Type.BOOL, 9); + output.writeBool(this.legalPathNodes); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSFastLastDataQueryForOneDeviceReq = module.exports.TSFastLastDataQueryForOneDeviceReq = function(args) { + this.sessionId = null; + this.db = null; + this.deviceId = null; + this.sensors = null; + this.fetchSize = null; + this.statementId = null; + this.enableRedirectQuery = null; + this.jdbcQuery = null; + this.timeout = null; + this.legalPathNodes = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.db !== undefined && args.db !== null) { + this.db = args.db; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field db is unset!'); + } + if (args.deviceId !== undefined && args.deviceId !== null) { + this.deviceId = args.deviceId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field deviceId is unset!'); + } + if (args.sensors !== undefined && args.sensors !== null) { + this.sensors = Thrift.copyList(args.sensors, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sensors is unset!'); + } + if (args.fetchSize !== undefined && args.fetchSize !== null) { + this.fetchSize = args.fetchSize; + } + if (args.statementId !== undefined && args.statementId !== null) { + this.statementId = args.statementId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statementId is unset!'); + } + if (args.enableRedirectQuery !== undefined && args.enableRedirectQuery !== null) { + this.enableRedirectQuery = args.enableRedirectQuery; + } + if (args.jdbcQuery !== undefined && args.jdbcQuery !== null) { + this.jdbcQuery = args.jdbcQuery; + } + if (args.timeout !== undefined && args.timeout !== null) { + this.timeout = args.timeout; + } + if (args.legalPathNodes !== undefined && args.legalPathNodes !== null) { + this.legalPathNodes = args.legalPathNodes; + } + } +}; +TSFastLastDataQueryForOneDeviceReq.prototype = {}; +TSFastLastDataQueryForOneDeviceReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.db = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.deviceId = input.readString(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.LIST) { + this.sensors = []; + var _rtmp3342 = input.readListBegin(); + var _size341 = _rtmp3342.size || 0; + for (var _i343 = 0; _i343 < _size341; ++_i343) { + var elem344 = null; + elem344 = input.readString(); + this.sensors.push(elem344); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I32) { + this.fetchSize = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.I64) { + this.statementId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.BOOL) { + this.enableRedirectQuery = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.BOOL) { + this.jdbcQuery = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 9: + if (ftype == Thrift.Type.I64) { + this.timeout = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 10: + if (ftype == Thrift.Type.BOOL) { + this.legalPathNodes = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSFastLastDataQueryForOneDeviceReq.prototype.write = function(output) { + output.writeStructBegin('TSFastLastDataQueryForOneDeviceReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.db !== null && this.db !== undefined) { + output.writeFieldBegin('db', Thrift.Type.STRING, 2); + output.writeString(this.db); + output.writeFieldEnd(); + } + if (this.deviceId !== null && this.deviceId !== undefined) { + output.writeFieldBegin('deviceId', Thrift.Type.STRING, 3); + output.writeString(this.deviceId); + output.writeFieldEnd(); + } + if (this.sensors !== null && this.sensors !== undefined) { + output.writeFieldBegin('sensors', Thrift.Type.LIST, 4); + output.writeListBegin(Thrift.Type.STRING, this.sensors.length); + for (var iter345 in this.sensors) { + if (this.sensors.hasOwnProperty(iter345)) { + iter345 = this.sensors[iter345]; + output.writeString(iter345); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.fetchSize !== null && this.fetchSize !== undefined) { + output.writeFieldBegin('fetchSize', Thrift.Type.I32, 5); + output.writeI32(this.fetchSize); + output.writeFieldEnd(); + } + if (this.statementId !== null && this.statementId !== undefined) { + output.writeFieldBegin('statementId', Thrift.Type.I64, 6); + output.writeI64(this.statementId); + output.writeFieldEnd(); + } + if (this.enableRedirectQuery !== null && this.enableRedirectQuery !== undefined) { + output.writeFieldBegin('enableRedirectQuery', Thrift.Type.BOOL, 7); + output.writeBool(this.enableRedirectQuery); + output.writeFieldEnd(); + } + if (this.jdbcQuery !== null && this.jdbcQuery !== undefined) { + output.writeFieldBegin('jdbcQuery', Thrift.Type.BOOL, 8); + output.writeBool(this.jdbcQuery); + output.writeFieldEnd(); + } + if (this.timeout !== null && this.timeout !== undefined) { + output.writeFieldBegin('timeout', Thrift.Type.I64, 9); + output.writeI64(this.timeout); + output.writeFieldEnd(); + } + if (this.legalPathNodes !== null && this.legalPathNodes !== undefined) { + output.writeFieldBegin('legalPathNodes', Thrift.Type.BOOL, 10); + output.writeBool(this.legalPathNodes); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSAggregationQueryReq = module.exports.TSAggregationQueryReq = function(args) { + this.sessionId = null; + this.statementId = null; + this.paths = null; + this.aggregations = null; + this.startTime = null; + this.endTime = null; + this.interval = null; + this.slidingStep = null; + this.fetchSize = null; + this.timeout = null; + this.legalPathNodes = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.statementId !== undefined && args.statementId !== null) { + this.statementId = args.statementId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statementId is unset!'); + } + if (args.paths !== undefined && args.paths !== null) { + this.paths = Thrift.copyList(args.paths, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field paths is unset!'); + } + if (args.aggregations !== undefined && args.aggregations !== null) { + this.aggregations = Thrift.copyList(args.aggregations, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field aggregations is unset!'); + } + if (args.startTime !== undefined && args.startTime !== null) { + this.startTime = args.startTime; + } + if (args.endTime !== undefined && args.endTime !== null) { + this.endTime = args.endTime; + } + if (args.interval !== undefined && args.interval !== null) { + this.interval = args.interval; + } + if (args.slidingStep !== undefined && args.slidingStep !== null) { + this.slidingStep = args.slidingStep; + } + if (args.fetchSize !== undefined && args.fetchSize !== null) { + this.fetchSize = args.fetchSize; + } + if (args.timeout !== undefined && args.timeout !== null) { + this.timeout = args.timeout; + } + if (args.legalPathNodes !== undefined && args.legalPathNodes !== null) { + this.legalPathNodes = args.legalPathNodes; + } + } +}; +TSAggregationQueryReq.prototype = {}; +TSAggregationQueryReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.statementId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.paths = []; + var _rtmp3347 = input.readListBegin(); + var _size346 = _rtmp3347.size || 0; + for (var _i348 = 0; _i348 < _size346; ++_i348) { + var elem349 = null; + elem349 = input.readString(); + this.paths.push(elem349); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.LIST) { + this.aggregations = []; + var _rtmp3351 = input.readListBegin(); + var _size350 = _rtmp3351.size || 0; + for (var _i352 = 0; _i352 < _size350; ++_i352) { + var elem353 = null; + elem353 = input.readI32(); + this.aggregations.push(elem353); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I64) { + this.startTime = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.I64) { + this.endTime = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.I64) { + this.interval = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.I64) { + this.slidingStep = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 9: + if (ftype == Thrift.Type.I32) { + this.fetchSize = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 10: + if (ftype == Thrift.Type.I64) { + this.timeout = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 11: + if (ftype == Thrift.Type.BOOL) { + this.legalPathNodes = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSAggregationQueryReq.prototype.write = function(output) { + output.writeStructBegin('TSAggregationQueryReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.statementId !== null && this.statementId !== undefined) { + output.writeFieldBegin('statementId', Thrift.Type.I64, 2); + output.writeI64(this.statementId); + output.writeFieldEnd(); + } + if (this.paths !== null && this.paths !== undefined) { + output.writeFieldBegin('paths', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.STRING, this.paths.length); + for (var iter354 in this.paths) { + if (this.paths.hasOwnProperty(iter354)) { + iter354 = this.paths[iter354]; + output.writeString(iter354); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.aggregations !== null && this.aggregations !== undefined) { + output.writeFieldBegin('aggregations', Thrift.Type.LIST, 4); + output.writeListBegin(Thrift.Type.I32, this.aggregations.length); + for (var iter355 in this.aggregations) { + if (this.aggregations.hasOwnProperty(iter355)) { + iter355 = this.aggregations[iter355]; + output.writeI32(iter355); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.startTime !== null && this.startTime !== undefined) { + output.writeFieldBegin('startTime', Thrift.Type.I64, 5); + output.writeI64(this.startTime); + output.writeFieldEnd(); + } + if (this.endTime !== null && this.endTime !== undefined) { + output.writeFieldBegin('endTime', Thrift.Type.I64, 6); + output.writeI64(this.endTime); + output.writeFieldEnd(); + } + if (this.interval !== null && this.interval !== undefined) { + output.writeFieldBegin('interval', Thrift.Type.I64, 7); + output.writeI64(this.interval); + output.writeFieldEnd(); + } + if (this.slidingStep !== null && this.slidingStep !== undefined) { + output.writeFieldBegin('slidingStep', Thrift.Type.I64, 8); + output.writeI64(this.slidingStep); + output.writeFieldEnd(); + } + if (this.fetchSize !== null && this.fetchSize !== undefined) { + output.writeFieldBegin('fetchSize', Thrift.Type.I32, 9); + output.writeI32(this.fetchSize); + output.writeFieldEnd(); + } + if (this.timeout !== null && this.timeout !== undefined) { + output.writeFieldBegin('timeout', Thrift.Type.I64, 10); + output.writeI64(this.timeout); + output.writeFieldEnd(); + } + if (this.legalPathNodes !== null && this.legalPathNodes !== undefined) { + output.writeFieldBegin('legalPathNodes', Thrift.Type.BOOL, 11); + output.writeBool(this.legalPathNodes); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSGroupByQueryIntervalReq = module.exports.TSGroupByQueryIntervalReq = function(args) { + this.sessionId = null; + this.statementId = null; + this.device = null; + this.measurement = null; + this.dataType = null; + this.aggregationType = null; + this.database = null; + this.startTime = null; + this.endTime = null; + this.interval = null; + this.fetchSize = null; + this.timeout = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.statementId !== undefined && args.statementId !== null) { + this.statementId = args.statementId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statementId is unset!'); + } + if (args.device !== undefined && args.device !== null) { + this.device = args.device; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field device is unset!'); + } + if (args.measurement !== undefined && args.measurement !== null) { + this.measurement = args.measurement; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurement is unset!'); + } + if (args.dataType !== undefined && args.dataType !== null) { + this.dataType = args.dataType; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dataType is unset!'); + } + if (args.aggregationType !== undefined && args.aggregationType !== null) { + this.aggregationType = args.aggregationType; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field aggregationType is unset!'); + } + if (args.database !== undefined && args.database !== null) { + this.database = args.database; + } + if (args.startTime !== undefined && args.startTime !== null) { + this.startTime = args.startTime; + } + if (args.endTime !== undefined && args.endTime !== null) { + this.endTime = args.endTime; + } + if (args.interval !== undefined && args.interval !== null) { + this.interval = args.interval; + } + if (args.fetchSize !== undefined && args.fetchSize !== null) { + this.fetchSize = args.fetchSize; + } + if (args.timeout !== undefined && args.timeout !== null) { + this.timeout = args.timeout; + } + } +}; +TSGroupByQueryIntervalReq.prototype = {}; +TSGroupByQueryIntervalReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.statementId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.device = input.readString(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRING) { + this.measurement = input.readString(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I32) { + this.dataType = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.I32) { + this.aggregationType = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.STRING) { + this.database = input.readString(); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.I64) { + this.startTime = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 9: + if (ftype == Thrift.Type.I64) { + this.endTime = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 10: + if (ftype == Thrift.Type.I64) { + this.interval = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 11: + if (ftype == Thrift.Type.I32) { + this.fetchSize = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 12: + if (ftype == Thrift.Type.I64) { + this.timeout = input.readI64(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSGroupByQueryIntervalReq.prototype.write = function(output) { + output.writeStructBegin('TSGroupByQueryIntervalReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.statementId !== null && this.statementId !== undefined) { + output.writeFieldBegin('statementId', Thrift.Type.I64, 2); + output.writeI64(this.statementId); + output.writeFieldEnd(); + } + if (this.device !== null && this.device !== undefined) { + output.writeFieldBegin('device', Thrift.Type.STRING, 3); + output.writeString(this.device); + output.writeFieldEnd(); + } + if (this.measurement !== null && this.measurement !== undefined) { + output.writeFieldBegin('measurement', Thrift.Type.STRING, 4); + output.writeString(this.measurement); + output.writeFieldEnd(); + } + if (this.dataType !== null && this.dataType !== undefined) { + output.writeFieldBegin('dataType', Thrift.Type.I32, 5); + output.writeI32(this.dataType); + output.writeFieldEnd(); + } + if (this.aggregationType !== null && this.aggregationType !== undefined) { + output.writeFieldBegin('aggregationType', Thrift.Type.I32, 6); + output.writeI32(this.aggregationType); + output.writeFieldEnd(); + } + if (this.database !== null && this.database !== undefined) { + output.writeFieldBegin('database', Thrift.Type.STRING, 7); + output.writeString(this.database); + output.writeFieldEnd(); + } + if (this.startTime !== null && this.startTime !== undefined) { + output.writeFieldBegin('startTime', Thrift.Type.I64, 8); + output.writeI64(this.startTime); + output.writeFieldEnd(); + } + if (this.endTime !== null && this.endTime !== undefined) { + output.writeFieldBegin('endTime', Thrift.Type.I64, 9); + output.writeI64(this.endTime); + output.writeFieldEnd(); + } + if (this.interval !== null && this.interval !== undefined) { + output.writeFieldBegin('interval', Thrift.Type.I64, 10); + output.writeI64(this.interval); + output.writeFieldEnd(); + } + if (this.fetchSize !== null && this.fetchSize !== undefined) { + output.writeFieldBegin('fetchSize', Thrift.Type.I32, 11); + output.writeI32(this.fetchSize); + output.writeFieldEnd(); + } + if (this.timeout !== null && this.timeout !== undefined) { + output.writeFieldBegin('timeout', Thrift.Type.I64, 12); + output.writeI64(this.timeout); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSCreateMultiTimeseriesReq = module.exports.TSCreateMultiTimeseriesReq = function(args) { + this.sessionId = null; + this.paths = null; + this.dataTypes = null; + this.encodings = null; + this.compressors = null; + this.propsList = null; + this.tagsList = null; + this.attributesList = null; + this.measurementAliasList = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.paths !== undefined && args.paths !== null) { + this.paths = Thrift.copyList(args.paths, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field paths is unset!'); + } + if (args.dataTypes !== undefined && args.dataTypes !== null) { + this.dataTypes = Thrift.copyList(args.dataTypes, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dataTypes is unset!'); + } + if (args.encodings !== undefined && args.encodings !== null) { + this.encodings = Thrift.copyList(args.encodings, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field encodings is unset!'); + } + if (args.compressors !== undefined && args.compressors !== null) { + this.compressors = Thrift.copyList(args.compressors, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field compressors is unset!'); + } + if (args.propsList !== undefined && args.propsList !== null) { + this.propsList = Thrift.copyList(args.propsList, [Thrift.copyMap, null]); + } + if (args.tagsList !== undefined && args.tagsList !== null) { + this.tagsList = Thrift.copyList(args.tagsList, [Thrift.copyMap, null]); + } + if (args.attributesList !== undefined && args.attributesList !== null) { + this.attributesList = Thrift.copyList(args.attributesList, [Thrift.copyMap, null]); + } + if (args.measurementAliasList !== undefined && args.measurementAliasList !== null) { + this.measurementAliasList = Thrift.copyList(args.measurementAliasList, [null]); + } + } +}; +TSCreateMultiTimeseriesReq.prototype = {}; +TSCreateMultiTimeseriesReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.paths = []; + var _rtmp3357 = input.readListBegin(); + var _size356 = _rtmp3357.size || 0; + for (var _i358 = 0; _i358 < _size356; ++_i358) { + var elem359 = null; + elem359 = input.readString(); + this.paths.push(elem359); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.dataTypes = []; + var _rtmp3361 = input.readListBegin(); + var _size360 = _rtmp3361.size || 0; + for (var _i362 = 0; _i362 < _size360; ++_i362) { + var elem363 = null; + elem363 = input.readI32(); + this.dataTypes.push(elem363); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.LIST) { + this.encodings = []; + var _rtmp3365 = input.readListBegin(); + var _size364 = _rtmp3365.size || 0; + for (var _i366 = 0; _i366 < _size364; ++_i366) { + var elem367 = null; + elem367 = input.readI32(); + this.encodings.push(elem367); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.LIST) { + this.compressors = []; + var _rtmp3369 = input.readListBegin(); + var _size368 = _rtmp3369.size || 0; + for (var _i370 = 0; _i370 < _size368; ++_i370) { + var elem371 = null; + elem371 = input.readI32(); + this.compressors.push(elem371); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.LIST) { + this.propsList = []; + var _rtmp3373 = input.readListBegin(); + var _size372 = _rtmp3373.size || 0; + for (var _i374 = 0; _i374 < _size372; ++_i374) { + var elem375 = null; + elem375 = {}; + var _rtmp3377 = input.readMapBegin(); + var _size376 = _rtmp3377.size || 0; + for (var _i378 = 0; _i378 < _size376; ++_i378) { + var key379 = null; + var val380 = null; + key379 = input.readString(); + val380 = input.readString(); + elem375[key379] = val380; + } + input.readMapEnd(); + this.propsList.push(elem375); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.LIST) { + this.tagsList = []; + var _rtmp3382 = input.readListBegin(); + var _size381 = _rtmp3382.size || 0; + for (var _i383 = 0; _i383 < _size381; ++_i383) { + var elem384 = null; + elem384 = {}; + var _rtmp3386 = input.readMapBegin(); + var _size385 = _rtmp3386.size || 0; + for (var _i387 = 0; _i387 < _size385; ++_i387) { + var key388 = null; + var val389 = null; + key388 = input.readString(); + val389 = input.readString(); + elem384[key388] = val389; + } + input.readMapEnd(); + this.tagsList.push(elem384); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.LIST) { + this.attributesList = []; + var _rtmp3391 = input.readListBegin(); + var _size390 = _rtmp3391.size || 0; + for (var _i392 = 0; _i392 < _size390; ++_i392) { + var elem393 = null; + elem393 = {}; + var _rtmp3395 = input.readMapBegin(); + var _size394 = _rtmp3395.size || 0; + for (var _i396 = 0; _i396 < _size394; ++_i396) { + var key397 = null; + var val398 = null; + key397 = input.readString(); + val398 = input.readString(); + elem393[key397] = val398; + } + input.readMapEnd(); + this.attributesList.push(elem393); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 9: + if (ftype == Thrift.Type.LIST) { + this.measurementAliasList = []; + var _rtmp3400 = input.readListBegin(); + var _size399 = _rtmp3400.size || 0; + for (var _i401 = 0; _i401 < _size399; ++_i401) { + var elem402 = null; + elem402 = input.readString(); + this.measurementAliasList.push(elem402); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSCreateMultiTimeseriesReq.prototype.write = function(output) { + output.writeStructBegin('TSCreateMultiTimeseriesReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.paths !== null && this.paths !== undefined) { + output.writeFieldBegin('paths', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.paths.length); + for (var iter403 in this.paths) { + if (this.paths.hasOwnProperty(iter403)) { + iter403 = this.paths[iter403]; + output.writeString(iter403); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.dataTypes !== null && this.dataTypes !== undefined) { + output.writeFieldBegin('dataTypes', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.I32, this.dataTypes.length); + for (var iter404 in this.dataTypes) { + if (this.dataTypes.hasOwnProperty(iter404)) { + iter404 = this.dataTypes[iter404]; + output.writeI32(iter404); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.encodings !== null && this.encodings !== undefined) { + output.writeFieldBegin('encodings', Thrift.Type.LIST, 4); + output.writeListBegin(Thrift.Type.I32, this.encodings.length); + for (var iter405 in this.encodings) { + if (this.encodings.hasOwnProperty(iter405)) { + iter405 = this.encodings[iter405]; + output.writeI32(iter405); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.compressors !== null && this.compressors !== undefined) { + output.writeFieldBegin('compressors', Thrift.Type.LIST, 5); + output.writeListBegin(Thrift.Type.I32, this.compressors.length); + for (var iter406 in this.compressors) { + if (this.compressors.hasOwnProperty(iter406)) { + iter406 = this.compressors[iter406]; + output.writeI32(iter406); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.propsList !== null && this.propsList !== undefined) { + output.writeFieldBegin('propsList', Thrift.Type.LIST, 6); + output.writeListBegin(Thrift.Type.MAP, this.propsList.length); + for (var iter407 in this.propsList) { + if (this.propsList.hasOwnProperty(iter407)) { + iter407 = this.propsList[iter407]; + output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(iter407)); + for (var kiter408 in iter407) { + if (iter407.hasOwnProperty(kiter408)) { + var viter409 = iter407[kiter408]; + output.writeString(kiter408); + output.writeString(viter409); + } + } + output.writeMapEnd(); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.tagsList !== null && this.tagsList !== undefined) { + output.writeFieldBegin('tagsList', Thrift.Type.LIST, 7); + output.writeListBegin(Thrift.Type.MAP, this.tagsList.length); + for (var iter410 in this.tagsList) { + if (this.tagsList.hasOwnProperty(iter410)) { + iter410 = this.tagsList[iter410]; + output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(iter410)); + for (var kiter411 in iter410) { + if (iter410.hasOwnProperty(kiter411)) { + var viter412 = iter410[kiter411]; + output.writeString(kiter411); + output.writeString(viter412); + } + } + output.writeMapEnd(); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.attributesList !== null && this.attributesList !== undefined) { + output.writeFieldBegin('attributesList', Thrift.Type.LIST, 8); + output.writeListBegin(Thrift.Type.MAP, this.attributesList.length); + for (var iter413 in this.attributesList) { + if (this.attributesList.hasOwnProperty(iter413)) { + iter413 = this.attributesList[iter413]; + output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(iter413)); + for (var kiter414 in iter413) { + if (iter413.hasOwnProperty(kiter414)) { + var viter415 = iter413[kiter414]; + output.writeString(kiter414); + output.writeString(viter415); + } + } + output.writeMapEnd(); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.measurementAliasList !== null && this.measurementAliasList !== undefined) { + output.writeFieldBegin('measurementAliasList', Thrift.Type.LIST, 9); + output.writeListBegin(Thrift.Type.STRING, this.measurementAliasList.length); + for (var iter416 in this.measurementAliasList) { + if (this.measurementAliasList.hasOwnProperty(iter416)) { + iter416 = this.measurementAliasList[iter416]; + output.writeString(iter416); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var ServerProperties = module.exports.ServerProperties = function(args) { + this.version = null; + this.supportedTimeAggregationOperations = null; + this.timestampPrecision = null; + this.maxConcurrentClientNum = null; + this.thriftMaxFrameSize = null; + this.isReadOnly = null; + this.buildInfo = null; + this.logo = null; + if (args) { + if (args.version !== undefined && args.version !== null) { + this.version = args.version; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field version is unset!'); + } + if (args.supportedTimeAggregationOperations !== undefined && args.supportedTimeAggregationOperations !== null) { + this.supportedTimeAggregationOperations = Thrift.copyList(args.supportedTimeAggregationOperations, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field supportedTimeAggregationOperations is unset!'); + } + if (args.timestampPrecision !== undefined && args.timestampPrecision !== null) { + this.timestampPrecision = args.timestampPrecision; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestampPrecision is unset!'); + } + if (args.maxConcurrentClientNum !== undefined && args.maxConcurrentClientNum !== null) { + this.maxConcurrentClientNum = args.maxConcurrentClientNum; + } + if (args.thriftMaxFrameSize !== undefined && args.thriftMaxFrameSize !== null) { + this.thriftMaxFrameSize = args.thriftMaxFrameSize; + } + if (args.isReadOnly !== undefined && args.isReadOnly !== null) { + this.isReadOnly = args.isReadOnly; + } + if (args.buildInfo !== undefined && args.buildInfo !== null) { + this.buildInfo = args.buildInfo; + } + if (args.logo !== undefined && args.logo !== null) { + this.logo = args.logo; + } + } +}; +ServerProperties.prototype = {}; +ServerProperties.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.version = input.readString(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.supportedTimeAggregationOperations = []; + var _rtmp3418 = input.readListBegin(); + var _size417 = _rtmp3418.size || 0; + for (var _i419 = 0; _i419 < _size417; ++_i419) { + var elem420 = null; + elem420 = input.readString(); + this.supportedTimeAggregationOperations.push(elem420); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.timestampPrecision = input.readString(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.I32) { + this.maxConcurrentClientNum = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I32) { + this.thriftMaxFrameSize = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.BOOL) { + this.isReadOnly = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.STRING) { + this.buildInfo = input.readString(); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.STRING) { + this.logo = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +ServerProperties.prototype.write = function(output) { + output.writeStructBegin('ServerProperties'); + if (this.version !== null && this.version !== undefined) { + output.writeFieldBegin('version', Thrift.Type.STRING, 1); + output.writeString(this.version); + output.writeFieldEnd(); + } + if (this.supportedTimeAggregationOperations !== null && this.supportedTimeAggregationOperations !== undefined) { + output.writeFieldBegin('supportedTimeAggregationOperations', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.supportedTimeAggregationOperations.length); + for (var iter421 in this.supportedTimeAggregationOperations) { + if (this.supportedTimeAggregationOperations.hasOwnProperty(iter421)) { + iter421 = this.supportedTimeAggregationOperations[iter421]; + output.writeString(iter421); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.timestampPrecision !== null && this.timestampPrecision !== undefined) { + output.writeFieldBegin('timestampPrecision', Thrift.Type.STRING, 3); + output.writeString(this.timestampPrecision); + output.writeFieldEnd(); + } + if (this.maxConcurrentClientNum !== null && this.maxConcurrentClientNum !== undefined) { + output.writeFieldBegin('maxConcurrentClientNum', Thrift.Type.I32, 4); + output.writeI32(this.maxConcurrentClientNum); + output.writeFieldEnd(); + } + if (this.thriftMaxFrameSize !== null && this.thriftMaxFrameSize !== undefined) { + output.writeFieldBegin('thriftMaxFrameSize', Thrift.Type.I32, 5); + output.writeI32(this.thriftMaxFrameSize); + output.writeFieldEnd(); + } + if (this.isReadOnly !== null && this.isReadOnly !== undefined) { + output.writeFieldBegin('isReadOnly', Thrift.Type.BOOL, 6); + output.writeBool(this.isReadOnly); + output.writeFieldEnd(); + } + if (this.buildInfo !== null && this.buildInfo !== undefined) { + output.writeFieldBegin('buildInfo', Thrift.Type.STRING, 7); + output.writeString(this.buildInfo); + output.writeFieldEnd(); + } + if (this.logo !== null && this.logo !== undefined) { + output.writeFieldBegin('logo', Thrift.Type.STRING, 8); + output.writeString(this.logo); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSSetSchemaTemplateReq = module.exports.TSSetSchemaTemplateReq = function(args) { + this.sessionId = null; + this.templateName = null; + this.prefixPath = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.templateName !== undefined && args.templateName !== null) { + this.templateName = args.templateName; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field templateName is unset!'); + } + if (args.prefixPath !== undefined && args.prefixPath !== null) { + this.prefixPath = args.prefixPath; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPath is unset!'); + } + } +}; +TSSetSchemaTemplateReq.prototype = {}; +TSSetSchemaTemplateReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.templateName = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.prefixPath = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSSetSchemaTemplateReq.prototype.write = function(output) { + output.writeStructBegin('TSSetSchemaTemplateReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.templateName !== null && this.templateName !== undefined) { + output.writeFieldBegin('templateName', Thrift.Type.STRING, 2); + output.writeString(this.templateName); + output.writeFieldEnd(); + } + if (this.prefixPath !== null && this.prefixPath !== undefined) { + output.writeFieldBegin('prefixPath', Thrift.Type.STRING, 3); + output.writeString(this.prefixPath); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSCreateSchemaTemplateReq = module.exports.TSCreateSchemaTemplateReq = function(args) { + this.sessionId = null; + this.name = null; + this.serializedTemplate = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.name !== undefined && args.name !== null) { + this.name = args.name; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field name is unset!'); + } + if (args.serializedTemplate !== undefined && args.serializedTemplate !== null) { + this.serializedTemplate = args.serializedTemplate; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field serializedTemplate is unset!'); + } + } +}; +TSCreateSchemaTemplateReq.prototype = {}; +TSCreateSchemaTemplateReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.name = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.serializedTemplate = input.readBinary(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSCreateSchemaTemplateReq.prototype.write = function(output) { + output.writeStructBegin('TSCreateSchemaTemplateReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.name !== null && this.name !== undefined) { + output.writeFieldBegin('name', Thrift.Type.STRING, 2); + output.writeString(this.name); + output.writeFieldEnd(); + } + if (this.serializedTemplate !== null && this.serializedTemplate !== undefined) { + output.writeFieldBegin('serializedTemplate', Thrift.Type.STRING, 3); + output.writeBinary(this.serializedTemplate); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSAppendSchemaTemplateReq = module.exports.TSAppendSchemaTemplateReq = function(args) { + this.sessionId = null; + this.name = null; + this.isAligned = null; + this.measurements = null; + this.dataTypes = null; + this.encodings = null; + this.compressors = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.name !== undefined && args.name !== null) { + this.name = args.name; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field name is unset!'); + } + if (args.isAligned !== undefined && args.isAligned !== null) { + this.isAligned = args.isAligned; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field isAligned is unset!'); + } + if (args.measurements !== undefined && args.measurements !== null) { + this.measurements = Thrift.copyList(args.measurements, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurements is unset!'); + } + if (args.dataTypes !== undefined && args.dataTypes !== null) { + this.dataTypes = Thrift.copyList(args.dataTypes, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dataTypes is unset!'); + } + if (args.encodings !== undefined && args.encodings !== null) { + this.encodings = Thrift.copyList(args.encodings, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field encodings is unset!'); + } + if (args.compressors !== undefined && args.compressors !== null) { + this.compressors = Thrift.copyList(args.compressors, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field compressors is unset!'); + } + } +}; +TSAppendSchemaTemplateReq.prototype = {}; +TSAppendSchemaTemplateReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.name = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.BOOL) { + this.isAligned = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.LIST) { + this.measurements = []; + var _rtmp3423 = input.readListBegin(); + var _size422 = _rtmp3423.size || 0; + for (var _i424 = 0; _i424 < _size422; ++_i424) { + var elem425 = null; + elem425 = input.readString(); + this.measurements.push(elem425); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.LIST) { + this.dataTypes = []; + var _rtmp3427 = input.readListBegin(); + var _size426 = _rtmp3427.size || 0; + for (var _i428 = 0; _i428 < _size426; ++_i428) { + var elem429 = null; + elem429 = input.readI32(); + this.dataTypes.push(elem429); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.LIST) { + this.encodings = []; + var _rtmp3431 = input.readListBegin(); + var _size430 = _rtmp3431.size || 0; + for (var _i432 = 0; _i432 < _size430; ++_i432) { + var elem433 = null; + elem433 = input.readI32(); + this.encodings.push(elem433); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.LIST) { + this.compressors = []; + var _rtmp3435 = input.readListBegin(); + var _size434 = _rtmp3435.size || 0; + for (var _i436 = 0; _i436 < _size434; ++_i436) { + var elem437 = null; + elem437 = input.readI32(); + this.compressors.push(elem437); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSAppendSchemaTemplateReq.prototype.write = function(output) { + output.writeStructBegin('TSAppendSchemaTemplateReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.name !== null && this.name !== undefined) { + output.writeFieldBegin('name', Thrift.Type.STRING, 2); + output.writeString(this.name); + output.writeFieldEnd(); + } + if (this.isAligned !== null && this.isAligned !== undefined) { + output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 3); + output.writeBool(this.isAligned); + output.writeFieldEnd(); + } + if (this.measurements !== null && this.measurements !== undefined) { + output.writeFieldBegin('measurements', Thrift.Type.LIST, 4); + output.writeListBegin(Thrift.Type.STRING, this.measurements.length); + for (var iter438 in this.measurements) { + if (this.measurements.hasOwnProperty(iter438)) { + iter438 = this.measurements[iter438]; + output.writeString(iter438); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.dataTypes !== null && this.dataTypes !== undefined) { + output.writeFieldBegin('dataTypes', Thrift.Type.LIST, 5); + output.writeListBegin(Thrift.Type.I32, this.dataTypes.length); + for (var iter439 in this.dataTypes) { + if (this.dataTypes.hasOwnProperty(iter439)) { + iter439 = this.dataTypes[iter439]; + output.writeI32(iter439); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.encodings !== null && this.encodings !== undefined) { + output.writeFieldBegin('encodings', Thrift.Type.LIST, 6); + output.writeListBegin(Thrift.Type.I32, this.encodings.length); + for (var iter440 in this.encodings) { + if (this.encodings.hasOwnProperty(iter440)) { + iter440 = this.encodings[iter440]; + output.writeI32(iter440); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.compressors !== null && this.compressors !== undefined) { + output.writeFieldBegin('compressors', Thrift.Type.LIST, 7); + output.writeListBegin(Thrift.Type.I32, this.compressors.length); + for (var iter441 in this.compressors) { + if (this.compressors.hasOwnProperty(iter441)) { + iter441 = this.compressors[iter441]; + output.writeI32(iter441); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSPruneSchemaTemplateReq = module.exports.TSPruneSchemaTemplateReq = function(args) { + this.sessionId = null; + this.name = null; + this.path = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.name !== undefined && args.name !== null) { + this.name = args.name; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field name is unset!'); + } + if (args.path !== undefined && args.path !== null) { + this.path = args.path; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field path is unset!'); + } + } +}; +TSPruneSchemaTemplateReq.prototype = {}; +TSPruneSchemaTemplateReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.name = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.path = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSPruneSchemaTemplateReq.prototype.write = function(output) { + output.writeStructBegin('TSPruneSchemaTemplateReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.name !== null && this.name !== undefined) { + output.writeFieldBegin('name', Thrift.Type.STRING, 2); + output.writeString(this.name); + output.writeFieldEnd(); + } + if (this.path !== null && this.path !== undefined) { + output.writeFieldBegin('path', Thrift.Type.STRING, 3); + output.writeString(this.path); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSQueryTemplateReq = module.exports.TSQueryTemplateReq = function(args) { + this.sessionId = null; + this.name = null; + this.queryType = null; + this.measurement = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.name !== undefined && args.name !== null) { + this.name = args.name; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field name is unset!'); + } + if (args.queryType !== undefined && args.queryType !== null) { + this.queryType = args.queryType; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field queryType is unset!'); + } + if (args.measurement !== undefined && args.measurement !== null) { + this.measurement = args.measurement; + } + } +}; +TSQueryTemplateReq.prototype = {}; +TSQueryTemplateReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.name = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I32) { + this.queryType = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRING) { + this.measurement = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSQueryTemplateReq.prototype.write = function(output) { + output.writeStructBegin('TSQueryTemplateReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.name !== null && this.name !== undefined) { + output.writeFieldBegin('name', Thrift.Type.STRING, 2); + output.writeString(this.name); + output.writeFieldEnd(); + } + if (this.queryType !== null && this.queryType !== undefined) { + output.writeFieldBegin('queryType', Thrift.Type.I32, 3); + output.writeI32(this.queryType); + output.writeFieldEnd(); + } + if (this.measurement !== null && this.measurement !== undefined) { + output.writeFieldBegin('measurement', Thrift.Type.STRING, 4); + output.writeString(this.measurement); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSQueryTemplateResp = module.exports.TSQueryTemplateResp = function(args) { + this.status = null; + this.queryType = null; + this.result = null; + this.count = null; + this.measurements = null; + if (args) { + if (args.status !== undefined && args.status !== null) { + this.status = new common_ttypes.TSStatus(args.status); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); + } + if (args.queryType !== undefined && args.queryType !== null) { + this.queryType = args.queryType; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field queryType is unset!'); + } + if (args.result !== undefined && args.result !== null) { + this.result = args.result; + } + if (args.count !== undefined && args.count !== null) { + this.count = args.count; + } + if (args.measurements !== undefined && args.measurements !== null) { + this.measurements = Thrift.copyList(args.measurements, [null]); + } + } +}; +TSQueryTemplateResp.prototype = {}; +TSQueryTemplateResp.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.status = new common_ttypes.TSStatus(); + this.status.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I32) { + this.queryType = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.BOOL) { + this.result = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.I32) { + this.count = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.LIST) { + this.measurements = []; + var _rtmp3443 = input.readListBegin(); + var _size442 = _rtmp3443.size || 0; + for (var _i444 = 0; _i444 < _size442; ++_i444) { + var elem445 = null; + elem445 = input.readString(); + this.measurements.push(elem445); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSQueryTemplateResp.prototype.write = function(output) { + output.writeStructBegin('TSQueryTemplateResp'); + if (this.status !== null && this.status !== undefined) { + output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); + this.status.write(output); + output.writeFieldEnd(); + } + if (this.queryType !== null && this.queryType !== undefined) { + output.writeFieldBegin('queryType', Thrift.Type.I32, 2); + output.writeI32(this.queryType); + output.writeFieldEnd(); + } + if (this.result !== null && this.result !== undefined) { + output.writeFieldBegin('result', Thrift.Type.BOOL, 3); + output.writeBool(this.result); + output.writeFieldEnd(); + } + if (this.count !== null && this.count !== undefined) { + output.writeFieldBegin('count', Thrift.Type.I32, 4); + output.writeI32(this.count); + output.writeFieldEnd(); + } + if (this.measurements !== null && this.measurements !== undefined) { + output.writeFieldBegin('measurements', Thrift.Type.LIST, 5); + output.writeListBegin(Thrift.Type.STRING, this.measurements.length); + for (var iter446 in this.measurements) { + if (this.measurements.hasOwnProperty(iter446)) { + iter446 = this.measurements[iter446]; + output.writeString(iter446); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSUnsetSchemaTemplateReq = module.exports.TSUnsetSchemaTemplateReq = function(args) { + this.sessionId = null; + this.prefixPath = null; + this.templateName = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.prefixPath !== undefined && args.prefixPath !== null) { + this.prefixPath = args.prefixPath; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPath is unset!'); + } + if (args.templateName !== undefined && args.templateName !== null) { + this.templateName = args.templateName; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field templateName is unset!'); + } + } +}; +TSUnsetSchemaTemplateReq.prototype = {}; +TSUnsetSchemaTemplateReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.prefixPath = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.templateName = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSUnsetSchemaTemplateReq.prototype.write = function(output) { + output.writeStructBegin('TSUnsetSchemaTemplateReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.prefixPath !== null && this.prefixPath !== undefined) { + output.writeFieldBegin('prefixPath', Thrift.Type.STRING, 2); + output.writeString(this.prefixPath); + output.writeFieldEnd(); + } + if (this.templateName !== null && this.templateName !== undefined) { + output.writeFieldBegin('templateName', Thrift.Type.STRING, 3); + output.writeString(this.templateName); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSDropSchemaTemplateReq = module.exports.TSDropSchemaTemplateReq = function(args) { + this.sessionId = null; + this.templateName = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.templateName !== undefined && args.templateName !== null) { + this.templateName = args.templateName; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field templateName is unset!'); + } + } +}; +TSDropSchemaTemplateReq.prototype = {}; +TSDropSchemaTemplateReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.templateName = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSDropSchemaTemplateReq.prototype.write = function(output) { + output.writeStructBegin('TSDropSchemaTemplateReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.templateName !== null && this.templateName !== undefined) { + output.writeFieldBegin('templateName', Thrift.Type.STRING, 2); + output.writeString(this.templateName); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TCreateTimeseriesUsingSchemaTemplateReq = module.exports.TCreateTimeseriesUsingSchemaTemplateReq = function(args) { + this.sessionId = null; + this.devicePathList = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.devicePathList !== undefined && args.devicePathList !== null) { + this.devicePathList = Thrift.copyList(args.devicePathList, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field devicePathList is unset!'); + } + } +}; +TCreateTimeseriesUsingSchemaTemplateReq.prototype = {}; +TCreateTimeseriesUsingSchemaTemplateReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.devicePathList = []; + var _rtmp3448 = input.readListBegin(); + var _size447 = _rtmp3448.size || 0; + for (var _i449 = 0; _i449 < _size447; ++_i449) { + var elem450 = null; + elem450 = input.readString(); + this.devicePathList.push(elem450); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TCreateTimeseriesUsingSchemaTemplateReq.prototype.write = function(output) { + output.writeStructBegin('TCreateTimeseriesUsingSchemaTemplateReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.devicePathList !== null && this.devicePathList !== undefined) { + output.writeFieldBegin('devicePathList', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.devicePathList.length); + for (var iter451 in this.devicePathList) { + if (this.devicePathList.hasOwnProperty(iter451)) { + iter451 = this.devicePathList[iter451]; + output.writeString(iter451); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSyncIdentityInfo = module.exports.TSyncIdentityInfo = function(args) { + this.pipeName = null; + this.createTime = null; + this.version = null; + this.database = null; + if (args) { + if (args.pipeName !== undefined && args.pipeName !== null) { + this.pipeName = args.pipeName; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field pipeName is unset!'); + } + if (args.createTime !== undefined && args.createTime !== null) { + this.createTime = args.createTime; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field createTime is unset!'); + } + if (args.version !== undefined && args.version !== null) { + this.version = args.version; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field version is unset!'); + } + if (args.database !== undefined && args.database !== null) { + this.database = args.database; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field database is unset!'); + } + } +}; +TSyncIdentityInfo.prototype = {}; +TSyncIdentityInfo.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.pipeName = input.readString(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.createTime = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.version = input.readString(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRING) { + this.database = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSyncIdentityInfo.prototype.write = function(output) { + output.writeStructBegin('TSyncIdentityInfo'); + if (this.pipeName !== null && this.pipeName !== undefined) { + output.writeFieldBegin('pipeName', Thrift.Type.STRING, 1); + output.writeString(this.pipeName); + output.writeFieldEnd(); + } + if (this.createTime !== null && this.createTime !== undefined) { + output.writeFieldBegin('createTime', Thrift.Type.I64, 2); + output.writeI64(this.createTime); + output.writeFieldEnd(); + } + if (this.version !== null && this.version !== undefined) { + output.writeFieldBegin('version', Thrift.Type.STRING, 3); + output.writeString(this.version); + output.writeFieldEnd(); + } + if (this.database !== null && this.database !== undefined) { + output.writeFieldBegin('database', Thrift.Type.STRING, 4); + output.writeString(this.database); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSyncTransportMetaInfo = module.exports.TSyncTransportMetaInfo = function(args) { + this.fileName = null; + this.startIndex = null; + if (args) { + if (args.fileName !== undefined && args.fileName !== null) { + this.fileName = args.fileName; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field fileName is unset!'); + } + if (args.startIndex !== undefined && args.startIndex !== null) { + this.startIndex = args.startIndex; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field startIndex is unset!'); + } + } +}; +TSyncTransportMetaInfo.prototype = {}; +TSyncTransportMetaInfo.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.fileName = input.readString(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.startIndex = input.readI64(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSyncTransportMetaInfo.prototype.write = function(output) { + output.writeStructBegin('TSyncTransportMetaInfo'); + if (this.fileName !== null && this.fileName !== undefined) { + output.writeFieldBegin('fileName', Thrift.Type.STRING, 1); + output.writeString(this.fileName); + output.writeFieldEnd(); + } + if (this.startIndex !== null && this.startIndex !== undefined) { + output.writeFieldBegin('startIndex', Thrift.Type.I64, 2); + output.writeI64(this.startIndex); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TPipeTransferReq = module.exports.TPipeTransferReq = function(args) { + this.version = null; + this.type = null; + this.body = null; + if (args) { + if (args.version !== undefined && args.version !== null) { + this.version = args.version; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field version is unset!'); + } + if (args.type !== undefined && args.type !== null) { + this.type = args.type; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field type is unset!'); + } + if (args.body !== undefined && args.body !== null) { + this.body = args.body; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field body is unset!'); + } + } +}; +TPipeTransferReq.prototype = {}; +TPipeTransferReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.BYTE) { + this.version = input.readByte(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I16) { + this.type = input.readI16(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.body = input.readBinary(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TPipeTransferReq.prototype.write = function(output) { + output.writeStructBegin('TPipeTransferReq'); + if (this.version !== null && this.version !== undefined) { + output.writeFieldBegin('version', Thrift.Type.BYTE, 1); + output.writeByte(this.version); + output.writeFieldEnd(); + } + if (this.type !== null && this.type !== undefined) { + output.writeFieldBegin('type', Thrift.Type.I16, 2); + output.writeI16(this.type); + output.writeFieldEnd(); + } + if (this.body !== null && this.body !== undefined) { + output.writeFieldBegin('body', Thrift.Type.STRING, 3); + output.writeBinary(this.body); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TPipeTransferResp = module.exports.TPipeTransferResp = function(args) { + this.status = null; + this.body = null; + if (args) { + if (args.status !== undefined && args.status !== null) { + this.status = new common_ttypes.TSStatus(args.status); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); + } + if (args.body !== undefined && args.body !== null) { + this.body = args.body; + } + } +}; +TPipeTransferResp.prototype = {}; +TPipeTransferResp.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.status = new common_ttypes.TSStatus(); + this.status.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.body = input.readBinary(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TPipeTransferResp.prototype.write = function(output) { + output.writeStructBegin('TPipeTransferResp'); + if (this.status !== null && this.status !== undefined) { + output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); + this.status.write(output); + output.writeFieldEnd(); + } + if (this.body !== null && this.body !== undefined) { + output.writeFieldBegin('body', Thrift.Type.STRING, 2); + output.writeBinary(this.body); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TPipeSubscribeReq = module.exports.TPipeSubscribeReq = function(args) { + this.version = null; + this.type = null; + this.body = null; + if (args) { + if (args.version !== undefined && args.version !== null) { + this.version = args.version; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field version is unset!'); + } + if (args.type !== undefined && args.type !== null) { + this.type = args.type; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field type is unset!'); + } + if (args.body !== undefined && args.body !== null) { + this.body = args.body; + } + } +}; +TPipeSubscribeReq.prototype = {}; +TPipeSubscribeReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.BYTE) { + this.version = input.readByte(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I16) { + this.type = input.readI16(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.body = input.readBinary(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TPipeSubscribeReq.prototype.write = function(output) { + output.writeStructBegin('TPipeSubscribeReq'); + if (this.version !== null && this.version !== undefined) { + output.writeFieldBegin('version', Thrift.Type.BYTE, 1); + output.writeByte(this.version); + output.writeFieldEnd(); + } + if (this.type !== null && this.type !== undefined) { + output.writeFieldBegin('type', Thrift.Type.I16, 2); + output.writeI16(this.type); + output.writeFieldEnd(); + } + if (this.body !== null && this.body !== undefined) { + output.writeFieldBegin('body', Thrift.Type.STRING, 3); + output.writeBinary(this.body); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TPipeSubscribeResp = module.exports.TPipeSubscribeResp = function(args) { + this.status = null; + this.version = null; + this.type = null; + this.body = null; + if (args) { + if (args.status !== undefined && args.status !== null) { + this.status = new common_ttypes.TSStatus(args.status); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); + } + if (args.version !== undefined && args.version !== null) { + this.version = args.version; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field version is unset!'); + } + if (args.type !== undefined && args.type !== null) { + this.type = args.type; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field type is unset!'); + } + if (args.body !== undefined && args.body !== null) { + this.body = Thrift.copyList(args.body, [null]); + } + } +}; +TPipeSubscribeResp.prototype = {}; +TPipeSubscribeResp.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.status = new common_ttypes.TSStatus(); + this.status.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.BYTE) { + this.version = input.readByte(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I16) { + this.type = input.readI16(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.LIST) { + this.body = []; + var _rtmp3453 = input.readListBegin(); + var _size452 = _rtmp3453.size || 0; + for (var _i454 = 0; _i454 < _size452; ++_i454) { + var elem455 = null; + elem455 = input.readBinary(); + this.body.push(elem455); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TPipeSubscribeResp.prototype.write = function(output) { + output.writeStructBegin('TPipeSubscribeResp'); + if (this.status !== null && this.status !== undefined) { + output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); + this.status.write(output); + output.writeFieldEnd(); + } + if (this.version !== null && this.version !== undefined) { + output.writeFieldBegin('version', Thrift.Type.BYTE, 2); + output.writeByte(this.version); + output.writeFieldEnd(); + } + if (this.type !== null && this.type !== undefined) { + output.writeFieldBegin('type', Thrift.Type.I16, 3); + output.writeI16(this.type); + output.writeFieldEnd(); + } + if (this.body !== null && this.body !== undefined) { + output.writeFieldBegin('body', Thrift.Type.LIST, 4); + output.writeListBegin(Thrift.Type.STRING, this.body.length); + for (var iter456 in this.body) { + if (this.body.hasOwnProperty(iter456)) { + iter456 = this.body[iter456]; + output.writeBinary(iter456); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSBackupConfigurationResp = module.exports.TSBackupConfigurationResp = function(args) { + this.status = null; + this.enableOperationSync = null; + this.secondaryAddress = null; + this.secondaryPort = null; + if (args) { + if (args.status !== undefined && args.status !== null) { + this.status = new common_ttypes.TSStatus(args.status); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); + } + if (args.enableOperationSync !== undefined && args.enableOperationSync !== null) { + this.enableOperationSync = args.enableOperationSync; + } + if (args.secondaryAddress !== undefined && args.secondaryAddress !== null) { + this.secondaryAddress = args.secondaryAddress; + } + if (args.secondaryPort !== undefined && args.secondaryPort !== null) { + this.secondaryPort = args.secondaryPort; + } + } +}; +TSBackupConfigurationResp.prototype = {}; +TSBackupConfigurationResp.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.status = new common_ttypes.TSStatus(); + this.status.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.BOOL) { + this.enableOperationSync = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.secondaryAddress = input.readString(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.I32) { + this.secondaryPort = input.readI32(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSBackupConfigurationResp.prototype.write = function(output) { + output.writeStructBegin('TSBackupConfigurationResp'); + if (this.status !== null && this.status !== undefined) { + output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); + this.status.write(output); + output.writeFieldEnd(); + } + if (this.enableOperationSync !== null && this.enableOperationSync !== undefined) { + output.writeFieldBegin('enableOperationSync', Thrift.Type.BOOL, 2); + output.writeBool(this.enableOperationSync); + output.writeFieldEnd(); + } + if (this.secondaryAddress !== null && this.secondaryAddress !== undefined) { + output.writeFieldBegin('secondaryAddress', Thrift.Type.STRING, 3); + output.writeString(this.secondaryAddress); + output.writeFieldEnd(); + } + if (this.secondaryPort !== null && this.secondaryPort !== undefined) { + output.writeFieldBegin('secondaryPort', Thrift.Type.I32, 4); + output.writeI32(this.secondaryPort); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSConnectionInfo = module.exports.TSConnectionInfo = function(args) { + this.userName = null; + this.logInTime = null; + this.connectionId = null; + this.type = null; + if (args) { + if (args.userName !== undefined && args.userName !== null) { + this.userName = args.userName; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field userName is unset!'); + } + if (args.logInTime !== undefined && args.logInTime !== null) { + this.logInTime = args.logInTime; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field logInTime is unset!'); + } + if (args.connectionId !== undefined && args.connectionId !== null) { + this.connectionId = args.connectionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field connectionId is unset!'); + } + if (args.type !== undefined && args.type !== null) { + this.type = args.type; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field type is unset!'); + } + } +}; +TSConnectionInfo.prototype = {}; +TSConnectionInfo.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.userName = input.readString(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.logInTime = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.connectionId = input.readString(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.I32) { + this.type = input.readI32(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSConnectionInfo.prototype.write = function(output) { + output.writeStructBegin('TSConnectionInfo'); + if (this.userName !== null && this.userName !== undefined) { + output.writeFieldBegin('userName', Thrift.Type.STRING, 1); + output.writeString(this.userName); + output.writeFieldEnd(); + } + if (this.logInTime !== null && this.logInTime !== undefined) { + output.writeFieldBegin('logInTime', Thrift.Type.I64, 2); + output.writeI64(this.logInTime); + output.writeFieldEnd(); + } + if (this.connectionId !== null && this.connectionId !== undefined) { + output.writeFieldBegin('connectionId', Thrift.Type.STRING, 3); + output.writeString(this.connectionId); + output.writeFieldEnd(); + } + if (this.type !== null && this.type !== undefined) { + output.writeFieldBegin('type', Thrift.Type.I32, 4); + output.writeI32(this.type); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSConnectionInfoResp = module.exports.TSConnectionInfoResp = function(args) { + this.connectionInfoList = null; + if (args) { + if (args.connectionInfoList !== undefined && args.connectionInfoList !== null) { + this.connectionInfoList = Thrift.copyList(args.connectionInfoList, [ttypes.TSConnectionInfo]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field connectionInfoList is unset!'); + } + } +}; +TSConnectionInfoResp.prototype = {}; +TSConnectionInfoResp.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.LIST) { + this.connectionInfoList = []; + var _rtmp3458 = input.readListBegin(); + var _size457 = _rtmp3458.size || 0; + for (var _i459 = 0; _i459 < _size457; ++_i459) { + var elem460 = null; + elem460 = new ttypes.TSConnectionInfo(); + elem460.read(input); + this.connectionInfoList.push(elem460); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSConnectionInfoResp.prototype.write = function(output) { + output.writeStructBegin('TSConnectionInfoResp'); + if (this.connectionInfoList !== null && this.connectionInfoList !== undefined) { + output.writeFieldBegin('connectionInfoList', Thrift.Type.LIST, 1); + output.writeListBegin(Thrift.Type.STRUCT, this.connectionInfoList.length); + for (var iter461 in this.connectionInfoList) { + if (this.connectionInfoList.hasOwnProperty(iter461)) { + iter461 = this.connectionInfoList[iter461]; + iter461.write(output); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + diff --git a/cdsp/information-layer/handlers/iotdb/gen-nodejs/common_types.js b/cdsp/information-layer/handlers/iotdb/gen-nodejs/common_types.js new file mode 100644 index 0000000..26ba413 --- /dev/null +++ b/cdsp/information-layer/handlers/iotdb/gen-nodejs/common_types.js @@ -0,0 +1,2627 @@ +// +// Autogenerated by Thrift Compiler (0.14.1) +// +// 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 Int64 = require('node-int64'); + + +var ttypes = module.exports = {}; +ttypes.TConsensusGroupType = { + 'ConfigRegion' : 0, + 'DataRegion' : 1, + 'SchemaRegion' : 2 +}; +ttypes.TRegionMigrateFailedType = { + 'AddPeerFailed' : 0, + 'RemovePeerFailed' : 1, + 'RemoveConsensusGroupFailed' : 2, + 'DeleteRegionFailed' : 3, + 'CreateRegionFailed' : 4, + 'Disconnect' : 5 +}; +ttypes.TRegionMaintainTaskStatus = { + 'TASK_NOT_EXIST' : 0, + 'PROCESSING' : 1, + 'SUCCESS' : 2, + 'FAIL' : 3 +}; +ttypes.ThrottleType = { + 'REQUEST_NUMBER' : 0, + 'REQUEST_SIZE' : 1, + 'WRITE_NUMBER' : 2, + 'WRITE_SIZE' : 3, + 'READ_NUMBER' : 4, + 'READ_SIZE' : 5 +}; +ttypes.TServiceType = { + 'ConfigNodeInternalService' : 0, + 'DataNodeInternalService' : 1, + 'DataNodeMPPService' : 2, + 'DataNodeExternalService' : 3 +}; +ttypes.TAggregationType = { + 'COUNT' : 0, + 'AVG' : 1, + 'SUM' : 2, + 'FIRST_VALUE' : 3, + 'LAST_VALUE' : 4, + 'MAX_TIME' : 5, + 'MIN_TIME' : 6, + 'MAX_VALUE' : 7, + 'MIN_VALUE' : 8, + 'EXTREME' : 9, + 'COUNT_IF' : 10, + 'TIME_DURATION' : 11, + 'MODE' : 12, + 'COUNT_TIME' : 13, + 'STDDEV' : 14, + 'STDDEV_POP' : 15, + 'STDDEV_SAMP' : 16, + 'VARIANCE' : 17, + 'VAR_POP' : 18, + 'VAR_SAMP' : 19, + 'MAX_BY' : 20, + 'MIN_BY' : 21, + 'UDAF' : 22 +}; +var TEndPoint = module.exports.TEndPoint = function(args) { + this.ip = null; + this.port = null; + if (args) { + if (args.ip !== undefined && args.ip !== null) { + this.ip = args.ip; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field ip is unset!'); + } + if (args.port !== undefined && args.port !== null) { + this.port = args.port; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field port is unset!'); + } + } +}; +TEndPoint.prototype = {}; +TEndPoint.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.ip = input.readString(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I32) { + this.port = input.readI32(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TEndPoint.prototype.write = function(output) { + output.writeStructBegin('TEndPoint'); + if (this.ip !== null && this.ip !== undefined) { + output.writeFieldBegin('ip', Thrift.Type.STRING, 1); + output.writeString(this.ip); + output.writeFieldEnd(); + } + if (this.port !== null && this.port !== undefined) { + output.writeFieldBegin('port', Thrift.Type.I32, 2); + output.writeI32(this.port); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSStatus = module.exports.TSStatus = function(args) { + this.code = null; + this.message = null; + this.subStatus = null; + this.redirectNode = null; + this.needRetry = null; + if (args) { + if (args.code !== undefined && args.code !== null) { + this.code = args.code; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field code is unset!'); + } + if (args.message !== undefined && args.message !== null) { + this.message = args.message; + } + if (args.subStatus !== undefined && args.subStatus !== null) { + this.subStatus = Thrift.copyList(args.subStatus, [null]); + } + if (args.redirectNode !== undefined && args.redirectNode !== null) { + this.redirectNode = new ttypes.TEndPoint(args.redirectNode); + } + if (args.needRetry !== undefined && args.needRetry !== null) { + this.needRetry = args.needRetry; + } + } +}; +TSStatus.prototype = {}; +TSStatus.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I32) { + this.code = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.message = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.subStatus = []; + var _rtmp31 = input.readListBegin(); + var _size0 = _rtmp31.size || 0; + for (var _i2 = 0; _i2 < _size0; ++_i2) { + var elem3 = null; + elem3 = new ttypes.TSStatus(); + elem3.read(input); + this.subStatus.push(elem3); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRUCT) { + this.redirectNode = new ttypes.TEndPoint(); + this.redirectNode.read(input); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.BOOL) { + this.needRetry = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSStatus.prototype.write = function(output) { + output.writeStructBegin('TSStatus'); + if (this.code !== null && this.code !== undefined) { + output.writeFieldBegin('code', Thrift.Type.I32, 1); + output.writeI32(this.code); + output.writeFieldEnd(); + } + if (this.message !== null && this.message !== undefined) { + output.writeFieldBegin('message', Thrift.Type.STRING, 2); + output.writeString(this.message); + output.writeFieldEnd(); + } + if (this.subStatus !== null && this.subStatus !== undefined) { + output.writeFieldBegin('subStatus', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.STRUCT, this.subStatus.length); + for (var iter4 in this.subStatus) { + if (this.subStatus.hasOwnProperty(iter4)) { + iter4 = this.subStatus[iter4]; + iter4.write(output); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.redirectNode !== null && this.redirectNode !== undefined) { + output.writeFieldBegin('redirectNode', Thrift.Type.STRUCT, 4); + this.redirectNode.write(output); + output.writeFieldEnd(); + } + if (this.needRetry !== null && this.needRetry !== undefined) { + output.writeFieldBegin('needRetry', Thrift.Type.BOOL, 5); + output.writeBool(this.needRetry); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TConsensusGroupId = module.exports.TConsensusGroupId = function(args) { + this.type = null; + this.id = null; + if (args) { + if (args.type !== undefined && args.type !== null) { + this.type = args.type; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field type is unset!'); + } + if (args.id !== undefined && args.id !== null) { + this.id = args.id; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field id is unset!'); + } + } +}; +TConsensusGroupId.prototype = {}; +TConsensusGroupId.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I32) { + this.type = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I32) { + this.id = input.readI32(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TConsensusGroupId.prototype.write = function(output) { + output.writeStructBegin('TConsensusGroupId'); + if (this.type !== null && this.type !== undefined) { + output.writeFieldBegin('type', Thrift.Type.I32, 1); + output.writeI32(this.type); + output.writeFieldEnd(); + } + if (this.id !== null && this.id !== undefined) { + output.writeFieldBegin('id', Thrift.Type.I32, 2); + output.writeI32(this.id); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSeriesPartitionSlot = module.exports.TSeriesPartitionSlot = function(args) { + this.slotId = null; + if (args) { + if (args.slotId !== undefined && args.slotId !== null) { + this.slotId = args.slotId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field slotId is unset!'); + } + } +}; +TSeriesPartitionSlot.prototype = {}; +TSeriesPartitionSlot.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I32) { + this.slotId = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSeriesPartitionSlot.prototype.write = function(output) { + output.writeStructBegin('TSeriesPartitionSlot'); + if (this.slotId !== null && this.slotId !== undefined) { + output.writeFieldBegin('slotId', Thrift.Type.I32, 1); + output.writeI32(this.slotId); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TTimePartitionSlot = module.exports.TTimePartitionSlot = function(args) { + this.startTime = null; + if (args) { + if (args.startTime !== undefined && args.startTime !== null) { + this.startTime = args.startTime; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field startTime is unset!'); + } + } +}; +TTimePartitionSlot.prototype = {}; +TTimePartitionSlot.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.startTime = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TTimePartitionSlot.prototype.write = function(output) { + output.writeStructBegin('TTimePartitionSlot'); + if (this.startTime !== null && this.startTime !== undefined) { + output.writeFieldBegin('startTime', Thrift.Type.I64, 1); + output.writeI64(this.startTime); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TRegionReplicaSet = module.exports.TRegionReplicaSet = function(args) { + this.regionId = null; + this.dataNodeLocations = null; + if (args) { + if (args.regionId !== undefined && args.regionId !== null) { + this.regionId = new ttypes.TConsensusGroupId(args.regionId); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field regionId is unset!'); + } + if (args.dataNodeLocations !== undefined && args.dataNodeLocations !== null) { + this.dataNodeLocations = Thrift.copyList(args.dataNodeLocations, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dataNodeLocations is unset!'); + } + } +}; +TRegionReplicaSet.prototype = {}; +TRegionReplicaSet.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.regionId = new ttypes.TConsensusGroupId(); + this.regionId.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.dataNodeLocations = []; + var _rtmp36 = input.readListBegin(); + var _size5 = _rtmp36.size || 0; + for (var _i7 = 0; _i7 < _size5; ++_i7) { + var elem8 = null; + elem8 = new ttypes.TDataNodeLocation(); + elem8.read(input); + this.dataNodeLocations.push(elem8); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TRegionReplicaSet.prototype.write = function(output) { + output.writeStructBegin('TRegionReplicaSet'); + if (this.regionId !== null && this.regionId !== undefined) { + output.writeFieldBegin('regionId', Thrift.Type.STRUCT, 1); + this.regionId.write(output); + output.writeFieldEnd(); + } + if (this.dataNodeLocations !== null && this.dataNodeLocations !== undefined) { + output.writeFieldBegin('dataNodeLocations', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRUCT, this.dataNodeLocations.length); + for (var iter9 in this.dataNodeLocations) { + if (this.dataNodeLocations.hasOwnProperty(iter9)) { + iter9 = this.dataNodeLocations[iter9]; + iter9.write(output); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TNodeResource = module.exports.TNodeResource = function(args) { + this.cpuCoreNum = null; + this.maxMemory = null; + if (args) { + if (args.cpuCoreNum !== undefined && args.cpuCoreNum !== null) { + this.cpuCoreNum = args.cpuCoreNum; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field cpuCoreNum is unset!'); + } + if (args.maxMemory !== undefined && args.maxMemory !== null) { + this.maxMemory = args.maxMemory; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field maxMemory is unset!'); + } + } +}; +TNodeResource.prototype = {}; +TNodeResource.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I32) { + this.cpuCoreNum = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.maxMemory = input.readI64(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TNodeResource.prototype.write = function(output) { + output.writeStructBegin('TNodeResource'); + if (this.cpuCoreNum !== null && this.cpuCoreNum !== undefined) { + output.writeFieldBegin('cpuCoreNum', Thrift.Type.I32, 1); + output.writeI32(this.cpuCoreNum); + output.writeFieldEnd(); + } + if (this.maxMemory !== null && this.maxMemory !== undefined) { + output.writeFieldBegin('maxMemory', Thrift.Type.I64, 2); + output.writeI64(this.maxMemory); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TConfigNodeLocation = module.exports.TConfigNodeLocation = function(args) { + this.configNodeId = null; + this.internalEndPoint = null; + this.consensusEndPoint = null; + if (args) { + if (args.configNodeId !== undefined && args.configNodeId !== null) { + this.configNodeId = args.configNodeId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field configNodeId is unset!'); + } + if (args.internalEndPoint !== undefined && args.internalEndPoint !== null) { + this.internalEndPoint = new ttypes.TEndPoint(args.internalEndPoint); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field internalEndPoint is unset!'); + } + if (args.consensusEndPoint !== undefined && args.consensusEndPoint !== null) { + this.consensusEndPoint = new ttypes.TEndPoint(args.consensusEndPoint); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field consensusEndPoint is unset!'); + } + } +}; +TConfigNodeLocation.prototype = {}; +TConfigNodeLocation.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I32) { + this.configNodeId = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRUCT) { + this.internalEndPoint = new ttypes.TEndPoint(); + this.internalEndPoint.read(input); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRUCT) { + this.consensusEndPoint = new ttypes.TEndPoint(); + this.consensusEndPoint.read(input); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TConfigNodeLocation.prototype.write = function(output) { + output.writeStructBegin('TConfigNodeLocation'); + if (this.configNodeId !== null && this.configNodeId !== undefined) { + output.writeFieldBegin('configNodeId', Thrift.Type.I32, 1); + output.writeI32(this.configNodeId); + output.writeFieldEnd(); + } + if (this.internalEndPoint !== null && this.internalEndPoint !== undefined) { + output.writeFieldBegin('internalEndPoint', Thrift.Type.STRUCT, 2); + this.internalEndPoint.write(output); + output.writeFieldEnd(); + } + if (this.consensusEndPoint !== null && this.consensusEndPoint !== undefined) { + output.writeFieldBegin('consensusEndPoint', Thrift.Type.STRUCT, 3); + this.consensusEndPoint.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TDataNodeLocation = module.exports.TDataNodeLocation = function(args) { + this.dataNodeId = null; + this.clientRpcEndPoint = null; + this.internalEndPoint = null; + this.mPPDataExchangeEndPoint = null; + this.dataRegionConsensusEndPoint = null; + this.schemaRegionConsensusEndPoint = null; + if (args) { + if (args.dataNodeId !== undefined && args.dataNodeId !== null) { + this.dataNodeId = args.dataNodeId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dataNodeId is unset!'); + } + if (args.clientRpcEndPoint !== undefined && args.clientRpcEndPoint !== null) { + this.clientRpcEndPoint = new ttypes.TEndPoint(args.clientRpcEndPoint); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field clientRpcEndPoint is unset!'); + } + if (args.internalEndPoint !== undefined && args.internalEndPoint !== null) { + this.internalEndPoint = new ttypes.TEndPoint(args.internalEndPoint); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field internalEndPoint is unset!'); + } + if (args.mPPDataExchangeEndPoint !== undefined && args.mPPDataExchangeEndPoint !== null) { + this.mPPDataExchangeEndPoint = new ttypes.TEndPoint(args.mPPDataExchangeEndPoint); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field mPPDataExchangeEndPoint is unset!'); + } + if (args.dataRegionConsensusEndPoint !== undefined && args.dataRegionConsensusEndPoint !== null) { + this.dataRegionConsensusEndPoint = new ttypes.TEndPoint(args.dataRegionConsensusEndPoint); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dataRegionConsensusEndPoint is unset!'); + } + if (args.schemaRegionConsensusEndPoint !== undefined && args.schemaRegionConsensusEndPoint !== null) { + this.schemaRegionConsensusEndPoint = new ttypes.TEndPoint(args.schemaRegionConsensusEndPoint); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field schemaRegionConsensusEndPoint is unset!'); + } + } +}; +TDataNodeLocation.prototype = {}; +TDataNodeLocation.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I32) { + this.dataNodeId = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRUCT) { + this.clientRpcEndPoint = new ttypes.TEndPoint(); + this.clientRpcEndPoint.read(input); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRUCT) { + this.internalEndPoint = new ttypes.TEndPoint(); + this.internalEndPoint.read(input); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRUCT) { + this.mPPDataExchangeEndPoint = new ttypes.TEndPoint(); + this.mPPDataExchangeEndPoint.read(input); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.STRUCT) { + this.dataRegionConsensusEndPoint = new ttypes.TEndPoint(); + this.dataRegionConsensusEndPoint.read(input); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.STRUCT) { + this.schemaRegionConsensusEndPoint = new ttypes.TEndPoint(); + this.schemaRegionConsensusEndPoint.read(input); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TDataNodeLocation.prototype.write = function(output) { + output.writeStructBegin('TDataNodeLocation'); + if (this.dataNodeId !== null && this.dataNodeId !== undefined) { + output.writeFieldBegin('dataNodeId', Thrift.Type.I32, 1); + output.writeI32(this.dataNodeId); + output.writeFieldEnd(); + } + if (this.clientRpcEndPoint !== null && this.clientRpcEndPoint !== undefined) { + output.writeFieldBegin('clientRpcEndPoint', Thrift.Type.STRUCT, 2); + this.clientRpcEndPoint.write(output); + output.writeFieldEnd(); + } + if (this.internalEndPoint !== null && this.internalEndPoint !== undefined) { + output.writeFieldBegin('internalEndPoint', Thrift.Type.STRUCT, 3); + this.internalEndPoint.write(output); + output.writeFieldEnd(); + } + if (this.mPPDataExchangeEndPoint !== null && this.mPPDataExchangeEndPoint !== undefined) { + output.writeFieldBegin('mPPDataExchangeEndPoint', Thrift.Type.STRUCT, 4); + this.mPPDataExchangeEndPoint.write(output); + output.writeFieldEnd(); + } + if (this.dataRegionConsensusEndPoint !== null && this.dataRegionConsensusEndPoint !== undefined) { + output.writeFieldBegin('dataRegionConsensusEndPoint', Thrift.Type.STRUCT, 5); + this.dataRegionConsensusEndPoint.write(output); + output.writeFieldEnd(); + } + if (this.schemaRegionConsensusEndPoint !== null && this.schemaRegionConsensusEndPoint !== undefined) { + output.writeFieldBegin('schemaRegionConsensusEndPoint', Thrift.Type.STRUCT, 6); + this.schemaRegionConsensusEndPoint.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TDataNodeConfiguration = module.exports.TDataNodeConfiguration = function(args) { + this.location = null; + this.resource = null; + if (args) { + if (args.location !== undefined && args.location !== null) { + this.location = new ttypes.TDataNodeLocation(args.location); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field location is unset!'); + } + if (args.resource !== undefined && args.resource !== null) { + this.resource = new ttypes.TNodeResource(args.resource); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field resource is unset!'); + } + } +}; +TDataNodeConfiguration.prototype = {}; +TDataNodeConfiguration.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.location = new ttypes.TDataNodeLocation(); + this.location.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRUCT) { + this.resource = new ttypes.TNodeResource(); + this.resource.read(input); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TDataNodeConfiguration.prototype.write = function(output) { + output.writeStructBegin('TDataNodeConfiguration'); + if (this.location !== null && this.location !== undefined) { + output.writeFieldBegin('location', Thrift.Type.STRUCT, 1); + this.location.write(output); + output.writeFieldEnd(); + } + if (this.resource !== null && this.resource !== undefined) { + output.writeFieldBegin('resource', Thrift.Type.STRUCT, 2); + this.resource.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TFlushReq = module.exports.TFlushReq = function(args) { + this.isSeq = null; + this.storageGroups = null; + if (args) { + if (args.isSeq !== undefined && args.isSeq !== null) { + this.isSeq = args.isSeq; + } + if (args.storageGroups !== undefined && args.storageGroups !== null) { + this.storageGroups = Thrift.copyList(args.storageGroups, [null]); + } + } +}; +TFlushReq.prototype = {}; +TFlushReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.isSeq = input.readString(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.storageGroups = []; + var _rtmp311 = input.readListBegin(); + var _size10 = _rtmp311.size || 0; + for (var _i12 = 0; _i12 < _size10; ++_i12) { + var elem13 = null; + elem13 = input.readString(); + this.storageGroups.push(elem13); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TFlushReq.prototype.write = function(output) { + output.writeStructBegin('TFlushReq'); + if (this.isSeq !== null && this.isSeq !== undefined) { + output.writeFieldBegin('isSeq', Thrift.Type.STRING, 1); + output.writeString(this.isSeq); + output.writeFieldEnd(); + } + if (this.storageGroups !== null && this.storageGroups !== undefined) { + output.writeFieldBegin('storageGroups', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.storageGroups.length); + for (var iter14 in this.storageGroups) { + if (this.storageGroups.hasOwnProperty(iter14)) { + iter14 = this.storageGroups[iter14]; + output.writeString(iter14); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSettleReq = module.exports.TSettleReq = function(args) { + this.paths = null; + if (args) { + if (args.paths !== undefined && args.paths !== null) { + this.paths = Thrift.copyList(args.paths, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field paths is unset!'); + } + } +}; +TSettleReq.prototype = {}; +TSettleReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.LIST) { + this.paths = []; + var _rtmp316 = input.readListBegin(); + var _size15 = _rtmp316.size || 0; + for (var _i17 = 0; _i17 < _size15; ++_i17) { + var elem18 = null; + elem18 = input.readString(); + this.paths.push(elem18); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSettleReq.prototype.write = function(output) { + output.writeStructBegin('TSettleReq'); + if (this.paths !== null && this.paths !== undefined) { + output.writeFieldBegin('paths', Thrift.Type.LIST, 1); + output.writeListBegin(Thrift.Type.STRING, this.paths.length); + for (var iter19 in this.paths) { + if (this.paths.hasOwnProperty(iter19)) { + iter19 = this.paths[iter19]; + output.writeString(iter19); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSchemaNode = module.exports.TSchemaNode = function(args) { + this.nodeName = null; + this.nodeType = null; + if (args) { + if (args.nodeName !== undefined && args.nodeName !== null) { + this.nodeName = args.nodeName; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field nodeName is unset!'); + } + if (args.nodeType !== undefined && args.nodeType !== null) { + this.nodeType = args.nodeType; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field nodeType is unset!'); + } + } +}; +TSchemaNode.prototype = {}; +TSchemaNode.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.nodeName = input.readString(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.BYTE) { + this.nodeType = input.readByte(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSchemaNode.prototype.write = function(output) { + output.writeStructBegin('TSchemaNode'); + if (this.nodeName !== null && this.nodeName !== undefined) { + output.writeFieldBegin('nodeName', Thrift.Type.STRING, 1); + output.writeString(this.nodeName); + output.writeFieldEnd(); + } + if (this.nodeType !== null && this.nodeType !== undefined) { + output.writeFieldBegin('nodeType', Thrift.Type.BYTE, 2); + output.writeByte(this.nodeType); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSetConfigurationReq = module.exports.TSetConfigurationReq = function(args) { + this.configs = null; + this.nodeId = null; + if (args) { + if (args.configs !== undefined && args.configs !== null) { + this.configs = Thrift.copyMap(args.configs, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field configs is unset!'); + } + if (args.nodeId !== undefined && args.nodeId !== null) { + this.nodeId = args.nodeId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field nodeId is unset!'); + } + } +}; +TSetConfigurationReq.prototype = {}; +TSetConfigurationReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.MAP) { + this.configs = {}; + var _rtmp321 = input.readMapBegin(); + var _size20 = _rtmp321.size || 0; + for (var _i22 = 0; _i22 < _size20; ++_i22) { + var key23 = null; + var val24 = null; + key23 = input.readString(); + val24 = input.readString(); + this.configs[key23] = val24; + } + input.readMapEnd(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I32) { + this.nodeId = input.readI32(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSetConfigurationReq.prototype.write = function(output) { + output.writeStructBegin('TSetConfigurationReq'); + if (this.configs !== null && this.configs !== undefined) { + output.writeFieldBegin('configs', Thrift.Type.MAP, 1); + output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.configs)); + for (var kiter25 in this.configs) { + if (this.configs.hasOwnProperty(kiter25)) { + var viter26 = this.configs[kiter25]; + output.writeString(kiter25); + output.writeString(viter26); + } + } + output.writeMapEnd(); + output.writeFieldEnd(); + } + if (this.nodeId !== null && this.nodeId !== undefined) { + output.writeFieldBegin('nodeId', Thrift.Type.I32, 2); + output.writeI32(this.nodeId); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSetTTLReq = module.exports.TSetTTLReq = function(args) { + this.pathPattern = null; + this.TTL = null; + this.isDataBase = null; + if (args) { + if (args.pathPattern !== undefined && args.pathPattern !== null) { + this.pathPattern = Thrift.copyList(args.pathPattern, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field pathPattern is unset!'); + } + if (args.TTL !== undefined && args.TTL !== null) { + this.TTL = args.TTL; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field TTL is unset!'); + } + if (args.isDataBase !== undefined && args.isDataBase !== null) { + this.isDataBase = args.isDataBase; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field isDataBase is unset!'); + } + } +}; +TSetTTLReq.prototype = {}; +TSetTTLReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.LIST) { + this.pathPattern = []; + var _rtmp328 = input.readListBegin(); + var _size27 = _rtmp328.size || 0; + for (var _i29 = 0; _i29 < _size27; ++_i29) { + var elem30 = null; + elem30 = input.readString(); + this.pathPattern.push(elem30); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.TTL = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.BOOL) { + this.isDataBase = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSetTTLReq.prototype.write = function(output) { + output.writeStructBegin('TSetTTLReq'); + if (this.pathPattern !== null && this.pathPattern !== undefined) { + output.writeFieldBegin('pathPattern', Thrift.Type.LIST, 1); + output.writeListBegin(Thrift.Type.STRING, this.pathPattern.length); + for (var iter31 in this.pathPattern) { + if (this.pathPattern.hasOwnProperty(iter31)) { + iter31 = this.pathPattern[iter31]; + output.writeString(iter31); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.TTL !== null && this.TTL !== undefined) { + output.writeFieldBegin('TTL', Thrift.Type.I64, 2); + output.writeI64(this.TTL); + output.writeFieldEnd(); + } + if (this.isDataBase !== null && this.isDataBase !== undefined) { + output.writeFieldBegin('isDataBase', Thrift.Type.BOOL, 3); + output.writeBool(this.isDataBase); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TShowTTLReq = module.exports.TShowTTLReq = function(args) { + this.pathPattern = null; + if (args) { + if (args.pathPattern !== undefined && args.pathPattern !== null) { + this.pathPattern = Thrift.copyList(args.pathPattern, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field pathPattern is unset!'); + } + } +}; +TShowTTLReq.prototype = {}; +TShowTTLReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.LIST) { + this.pathPattern = []; + var _rtmp333 = input.readListBegin(); + var _size32 = _rtmp333.size || 0; + for (var _i34 = 0; _i34 < _size32; ++_i34) { + var elem35 = null; + elem35 = input.readString(); + this.pathPattern.push(elem35); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TShowTTLReq.prototype.write = function(output) { + output.writeStructBegin('TShowTTLReq'); + if (this.pathPattern !== null && this.pathPattern !== undefined) { + output.writeFieldBegin('pathPattern', Thrift.Type.LIST, 1); + output.writeListBegin(Thrift.Type.STRING, this.pathPattern.length); + for (var iter36 in this.pathPattern) { + if (this.pathPattern.hasOwnProperty(iter36)) { + iter36 = this.pathPattern[iter36]; + output.writeString(iter36); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TFile = module.exports.TFile = function(args) { + this.fileName = null; + this.file = null; + if (args) { + if (args.fileName !== undefined && args.fileName !== null) { + this.fileName = args.fileName; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field fileName is unset!'); + } + if (args.file !== undefined && args.file !== null) { + this.file = args.file; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field file is unset!'); + } + } +}; +TFile.prototype = {}; +TFile.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.fileName = input.readString(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.file = input.readBinary(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TFile.prototype.write = function(output) { + output.writeStructBegin('TFile'); + if (this.fileName !== null && this.fileName !== undefined) { + output.writeFieldBegin('fileName', Thrift.Type.STRING, 1); + output.writeString(this.fileName); + output.writeFieldEnd(); + } + if (this.file !== null && this.file !== undefined) { + output.writeFieldBegin('file', Thrift.Type.STRING, 2); + output.writeBinary(this.file); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TFilesResp = module.exports.TFilesResp = function(args) { + this.status = null; + this.files = null; + if (args) { + if (args.status !== undefined && args.status !== null) { + this.status = new ttypes.TSStatus(args.status); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); + } + if (args.files !== undefined && args.files !== null) { + this.files = Thrift.copyList(args.files, [ttypes.TFile]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field files is unset!'); + } + } +}; +TFilesResp.prototype = {}; +TFilesResp.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.status = new ttypes.TSStatus(); + this.status.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.files = []; + var _rtmp338 = input.readListBegin(); + var _size37 = _rtmp338.size || 0; + for (var _i39 = 0; _i39 < _size37; ++_i39) { + var elem40 = null; + elem40 = new ttypes.TFile(); + elem40.read(input); + this.files.push(elem40); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TFilesResp.prototype.write = function(output) { + output.writeStructBegin('TFilesResp'); + if (this.status !== null && this.status !== undefined) { + output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); + this.status.write(output); + output.writeFieldEnd(); + } + if (this.files !== null && this.files !== undefined) { + output.writeFieldBegin('files', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRUCT, this.files.length); + for (var iter41 in this.files) { + if (this.files.hasOwnProperty(iter41)) { + iter41 = this.files[iter41]; + iter41.write(output); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSpaceQuota = module.exports.TSpaceQuota = function(args) { + this.diskSize = null; + this.deviceNum = null; + this.timeserieNum = null; + if (args) { + if (args.diskSize !== undefined && args.diskSize !== null) { + this.diskSize = args.diskSize; + } + if (args.deviceNum !== undefined && args.deviceNum !== null) { + this.deviceNum = args.deviceNum; + } + if (args.timeserieNum !== undefined && args.timeserieNum !== null) { + this.timeserieNum = args.timeserieNum; + } + } +}; +TSpaceQuota.prototype = {}; +TSpaceQuota.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.diskSize = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.deviceNum = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I64) { + this.timeserieNum = input.readI64(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSpaceQuota.prototype.write = function(output) { + output.writeStructBegin('TSpaceQuota'); + if (this.diskSize !== null && this.diskSize !== undefined) { + output.writeFieldBegin('diskSize', Thrift.Type.I64, 1); + output.writeI64(this.diskSize); + output.writeFieldEnd(); + } + if (this.deviceNum !== null && this.deviceNum !== undefined) { + output.writeFieldBegin('deviceNum', Thrift.Type.I64, 2); + output.writeI64(this.deviceNum); + output.writeFieldEnd(); + } + if (this.timeserieNum !== null && this.timeserieNum !== undefined) { + output.writeFieldBegin('timeserieNum', Thrift.Type.I64, 3); + output.writeI64(this.timeserieNum); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TTimedQuota = module.exports.TTimedQuota = function(args) { + this.timeUnit = null; + this.softLimit = null; + if (args) { + if (args.timeUnit !== undefined && args.timeUnit !== null) { + this.timeUnit = args.timeUnit; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timeUnit is unset!'); + } + if (args.softLimit !== undefined && args.softLimit !== null) { + this.softLimit = args.softLimit; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field softLimit is unset!'); + } + } +}; +TTimedQuota.prototype = {}; +TTimedQuota.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.timeUnit = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.softLimit = input.readI64(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TTimedQuota.prototype.write = function(output) { + output.writeStructBegin('TTimedQuota'); + if (this.timeUnit !== null && this.timeUnit !== undefined) { + output.writeFieldBegin('timeUnit', Thrift.Type.I64, 1); + output.writeI64(this.timeUnit); + output.writeFieldEnd(); + } + if (this.softLimit !== null && this.softLimit !== undefined) { + output.writeFieldBegin('softLimit', Thrift.Type.I64, 2); + output.writeI64(this.softLimit); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TThrottleQuota = module.exports.TThrottleQuota = function(args) { + this.throttleLimit = null; + this.memLimit = null; + this.cpuLimit = null; + if (args) { + if (args.throttleLimit !== undefined && args.throttleLimit !== null) { + this.throttleLimit = Thrift.copyMap(args.throttleLimit, [ttypes.TTimedQuota]); + } + if (args.memLimit !== undefined && args.memLimit !== null) { + this.memLimit = args.memLimit; + } + if (args.cpuLimit !== undefined && args.cpuLimit !== null) { + this.cpuLimit = args.cpuLimit; + } + } +}; +TThrottleQuota.prototype = {}; +TThrottleQuota.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.MAP) { + this.throttleLimit = {}; + var _rtmp343 = input.readMapBegin(); + var _size42 = _rtmp343.size || 0; + for (var _i44 = 0; _i44 < _size42; ++_i44) { + var key45 = null; + var val46 = null; + key45 = input.readI32(); + val46 = new ttypes.TTimedQuota(); + val46.read(input); + this.throttleLimit[key45] = val46; + } + input.readMapEnd(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.memLimit = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I32) { + this.cpuLimit = input.readI32(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TThrottleQuota.prototype.write = function(output) { + output.writeStructBegin('TThrottleQuota'); + if (this.throttleLimit !== null && this.throttleLimit !== undefined) { + output.writeFieldBegin('throttleLimit', Thrift.Type.MAP, 1); + output.writeMapBegin(Thrift.Type.I32, Thrift.Type.STRUCT, Thrift.objectLength(this.throttleLimit)); + for (var kiter47 in this.throttleLimit) { + if (this.throttleLimit.hasOwnProperty(kiter47)) { + var viter48 = this.throttleLimit[kiter47]; + output.writeI32(kiter47); + viter48.write(output); + } + } + output.writeMapEnd(); + output.writeFieldEnd(); + } + if (this.memLimit !== null && this.memLimit !== undefined) { + output.writeFieldBegin('memLimit', Thrift.Type.I64, 2); + output.writeI64(this.memLimit); + output.writeFieldEnd(); + } + if (this.cpuLimit !== null && this.cpuLimit !== undefined) { + output.writeFieldBegin('cpuLimit', Thrift.Type.I32, 3); + output.writeI32(this.cpuLimit); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSetSpaceQuotaReq = module.exports.TSetSpaceQuotaReq = function(args) { + this.database = null; + this.spaceLimit = null; + if (args) { + if (args.database !== undefined && args.database !== null) { + this.database = Thrift.copyList(args.database, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field database is unset!'); + } + if (args.spaceLimit !== undefined && args.spaceLimit !== null) { + this.spaceLimit = new ttypes.TSpaceQuota(args.spaceLimit); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field spaceLimit is unset!'); + } + } +}; +TSetSpaceQuotaReq.prototype = {}; +TSetSpaceQuotaReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.LIST) { + this.database = []; + var _rtmp350 = input.readListBegin(); + var _size49 = _rtmp350.size || 0; + for (var _i51 = 0; _i51 < _size49; ++_i51) { + var elem52 = null; + elem52 = input.readString(); + this.database.push(elem52); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRUCT) { + this.spaceLimit = new ttypes.TSpaceQuota(); + this.spaceLimit.read(input); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSetSpaceQuotaReq.prototype.write = function(output) { + output.writeStructBegin('TSetSpaceQuotaReq'); + if (this.database !== null && this.database !== undefined) { + output.writeFieldBegin('database', Thrift.Type.LIST, 1); + output.writeListBegin(Thrift.Type.STRING, this.database.length); + for (var iter53 in this.database) { + if (this.database.hasOwnProperty(iter53)) { + iter53 = this.database[iter53]; + output.writeString(iter53); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.spaceLimit !== null && this.spaceLimit !== undefined) { + output.writeFieldBegin('spaceLimit', Thrift.Type.STRUCT, 2); + this.spaceLimit.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSetThrottleQuotaReq = module.exports.TSetThrottleQuotaReq = function(args) { + this.userName = null; + this.throttleQuota = null; + if (args) { + if (args.userName !== undefined && args.userName !== null) { + this.userName = args.userName; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field userName is unset!'); + } + if (args.throttleQuota !== undefined && args.throttleQuota !== null) { + this.throttleQuota = new ttypes.TThrottleQuota(args.throttleQuota); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field throttleQuota is unset!'); + } + } +}; +TSetThrottleQuotaReq.prototype = {}; +TSetThrottleQuotaReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.userName = input.readString(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRUCT) { + this.throttleQuota = new ttypes.TThrottleQuota(); + this.throttleQuota.read(input); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSetThrottleQuotaReq.prototype.write = function(output) { + output.writeStructBegin('TSetThrottleQuotaReq'); + if (this.userName !== null && this.userName !== undefined) { + output.writeFieldBegin('userName', Thrift.Type.STRING, 1); + output.writeString(this.userName); + output.writeFieldEnd(); + } + if (this.throttleQuota !== null && this.throttleQuota !== undefined) { + output.writeFieldBegin('throttleQuota', Thrift.Type.STRUCT, 2); + this.throttleQuota.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TLicense = module.exports.TLicense = function(args) { + this.licenseIssueTimestamp = null; + this.expireTimestamp = null; + this.dataNodeNumLimit = null; + this.cpuCoreNumLimit = null; + this.deviceNumLimit = null; + this.sensorNumLimit = null; + this.disconnectionFromActiveNodeTimeLimit = null; + this.mlNodeNumLimit = null; + if (args) { + if (args.licenseIssueTimestamp !== undefined && args.licenseIssueTimestamp !== null) { + this.licenseIssueTimestamp = args.licenseIssueTimestamp; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field licenseIssueTimestamp is unset!'); + } + if (args.expireTimestamp !== undefined && args.expireTimestamp !== null) { + this.expireTimestamp = args.expireTimestamp; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field expireTimestamp is unset!'); + } + if (args.dataNodeNumLimit !== undefined && args.dataNodeNumLimit !== null) { + this.dataNodeNumLimit = args.dataNodeNumLimit; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dataNodeNumLimit is unset!'); + } + if (args.cpuCoreNumLimit !== undefined && args.cpuCoreNumLimit !== null) { + this.cpuCoreNumLimit = args.cpuCoreNumLimit; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field cpuCoreNumLimit is unset!'); + } + if (args.deviceNumLimit !== undefined && args.deviceNumLimit !== null) { + this.deviceNumLimit = args.deviceNumLimit; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field deviceNumLimit is unset!'); + } + if (args.sensorNumLimit !== undefined && args.sensorNumLimit !== null) { + this.sensorNumLimit = args.sensorNumLimit; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sensorNumLimit is unset!'); + } + if (args.disconnectionFromActiveNodeTimeLimit !== undefined && args.disconnectionFromActiveNodeTimeLimit !== null) { + this.disconnectionFromActiveNodeTimeLimit = args.disconnectionFromActiveNodeTimeLimit; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field disconnectionFromActiveNodeTimeLimit is unset!'); + } + if (args.mlNodeNumLimit !== undefined && args.mlNodeNumLimit !== null) { + this.mlNodeNumLimit = args.mlNodeNumLimit; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field mlNodeNumLimit is unset!'); + } + } +}; +TLicense.prototype = {}; +TLicense.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.licenseIssueTimestamp = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.expireTimestamp = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.I16) { + this.dataNodeNumLimit = input.readI16(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I32) { + this.cpuCoreNumLimit = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.I64) { + this.deviceNumLimit = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.I64) { + this.sensorNumLimit = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.I64) { + this.disconnectionFromActiveNodeTimeLimit = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 9: + if (ftype == Thrift.Type.I16) { + this.mlNodeNumLimit = input.readI16(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TLicense.prototype.write = function(output) { + output.writeStructBegin('TLicense'); + if (this.licenseIssueTimestamp !== null && this.licenseIssueTimestamp !== undefined) { + output.writeFieldBegin('licenseIssueTimestamp', Thrift.Type.I64, 1); + output.writeI64(this.licenseIssueTimestamp); + output.writeFieldEnd(); + } + if (this.expireTimestamp !== null && this.expireTimestamp !== undefined) { + output.writeFieldBegin('expireTimestamp', Thrift.Type.I64, 2); + output.writeI64(this.expireTimestamp); + output.writeFieldEnd(); + } + if (this.dataNodeNumLimit !== null && this.dataNodeNumLimit !== undefined) { + output.writeFieldBegin('dataNodeNumLimit', Thrift.Type.I16, 4); + output.writeI16(this.dataNodeNumLimit); + output.writeFieldEnd(); + } + if (this.cpuCoreNumLimit !== null && this.cpuCoreNumLimit !== undefined) { + output.writeFieldBegin('cpuCoreNumLimit', Thrift.Type.I32, 5); + output.writeI32(this.cpuCoreNumLimit); + output.writeFieldEnd(); + } + if (this.deviceNumLimit !== null && this.deviceNumLimit !== undefined) { + output.writeFieldBegin('deviceNumLimit', Thrift.Type.I64, 6); + output.writeI64(this.deviceNumLimit); + output.writeFieldEnd(); + } + if (this.sensorNumLimit !== null && this.sensorNumLimit !== undefined) { + output.writeFieldBegin('sensorNumLimit', Thrift.Type.I64, 7); + output.writeI64(this.sensorNumLimit); + output.writeFieldEnd(); + } + if (this.disconnectionFromActiveNodeTimeLimit !== null && this.disconnectionFromActiveNodeTimeLimit !== undefined) { + output.writeFieldBegin('disconnectionFromActiveNodeTimeLimit', Thrift.Type.I64, 8); + output.writeI64(this.disconnectionFromActiveNodeTimeLimit); + output.writeFieldEnd(); + } + if (this.mlNodeNumLimit !== null && this.mlNodeNumLimit !== undefined) { + output.writeFieldBegin('mlNodeNumLimit', Thrift.Type.I16, 9); + output.writeI16(this.mlNodeNumLimit); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TServiceProvider = module.exports.TServiceProvider = function(args) { + this.endPoint = null; + this.serviceType = null; + if (args) { + if (args.endPoint !== undefined && args.endPoint !== null) { + this.endPoint = new ttypes.TEndPoint(args.endPoint); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field endPoint is unset!'); + } + if (args.serviceType !== undefined && args.serviceType !== null) { + this.serviceType = args.serviceType; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field serviceType is unset!'); + } + } +}; +TServiceProvider.prototype = {}; +TServiceProvider.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.endPoint = new ttypes.TEndPoint(); + this.endPoint.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I32) { + this.serviceType = input.readI32(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TServiceProvider.prototype.write = function(output) { + output.writeStructBegin('TServiceProvider'); + if (this.endPoint !== null && this.endPoint !== undefined) { + output.writeFieldBegin('endPoint', Thrift.Type.STRUCT, 1); + this.endPoint.write(output); + output.writeFieldEnd(); + } + if (this.serviceType !== null && this.serviceType !== undefined) { + output.writeFieldBegin('serviceType', Thrift.Type.I32, 2); + output.writeI32(this.serviceType); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSender = module.exports.TSender = function(args) { + this.dataNodeLocation = null; + this.configNodeLocation = null; + if (args) { + if (args.dataNodeLocation !== undefined && args.dataNodeLocation !== null) { + this.dataNodeLocation = new ttypes.TDataNodeLocation(args.dataNodeLocation); + } + if (args.configNodeLocation !== undefined && args.configNodeLocation !== null) { + this.configNodeLocation = new ttypes.TConfigNodeLocation(args.configNodeLocation); + } + } +}; +TSender.prototype = {}; +TSender.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.dataNodeLocation = new ttypes.TDataNodeLocation(); + this.dataNodeLocation.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRUCT) { + this.configNodeLocation = new ttypes.TConfigNodeLocation(); + this.configNodeLocation.read(input); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSender.prototype.write = function(output) { + output.writeStructBegin('TSender'); + if (this.dataNodeLocation !== null && this.dataNodeLocation !== undefined) { + output.writeFieldBegin('dataNodeLocation', Thrift.Type.STRUCT, 1); + this.dataNodeLocation.write(output); + output.writeFieldEnd(); + } + if (this.configNodeLocation !== null && this.configNodeLocation !== undefined) { + output.writeFieldBegin('configNodeLocation', Thrift.Type.STRUCT, 2); + this.configNodeLocation.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TTestConnectionResult = module.exports.TTestConnectionResult = function(args) { + this.serviceProvider = null; + this.sender = null; + this.success = null; + this.reason = null; + if (args) { + if (args.serviceProvider !== undefined && args.serviceProvider !== null) { + this.serviceProvider = new ttypes.TServiceProvider(args.serviceProvider); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field serviceProvider is unset!'); + } + if (args.sender !== undefined && args.sender !== null) { + this.sender = new ttypes.TSender(args.sender); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sender is unset!'); + } + if (args.success !== undefined && args.success !== null) { + this.success = args.success; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field success is unset!'); + } + if (args.reason !== undefined && args.reason !== null) { + this.reason = args.reason; + } + } +}; +TTestConnectionResult.prototype = {}; +TTestConnectionResult.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.serviceProvider = new ttypes.TServiceProvider(); + this.serviceProvider.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRUCT) { + this.sender = new ttypes.TSender(); + this.sender.read(input); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.BOOL) { + this.success = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRING) { + this.reason = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TTestConnectionResult.prototype.write = function(output) { + output.writeStructBegin('TTestConnectionResult'); + if (this.serviceProvider !== null && this.serviceProvider !== undefined) { + output.writeFieldBegin('serviceProvider', Thrift.Type.STRUCT, 1); + this.serviceProvider.write(output); + output.writeFieldEnd(); + } + if (this.sender !== null && this.sender !== undefined) { + output.writeFieldBegin('sender', Thrift.Type.STRUCT, 2); + this.sender.write(output); + output.writeFieldEnd(); + } + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.BOOL, 3); + output.writeBool(this.success); + output.writeFieldEnd(); + } + if (this.reason !== null && this.reason !== undefined) { + output.writeFieldBegin('reason', Thrift.Type.STRING, 4); + output.writeString(this.reason); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TTestConnectionResp = module.exports.TTestConnectionResp = function(args) { + this.status = null; + this.resultList = null; + if (args) { + if (args.status !== undefined && args.status !== null) { + this.status = new ttypes.TSStatus(args.status); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); + } + if (args.resultList !== undefined && args.resultList !== null) { + this.resultList = Thrift.copyList(args.resultList, [ttypes.TTestConnectionResult]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field resultList is unset!'); + } + } +}; +TTestConnectionResp.prototype = {}; +TTestConnectionResp.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.status = new ttypes.TSStatus(); + this.status.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.resultList = []; + var _rtmp355 = input.readListBegin(); + var _size54 = _rtmp355.size || 0; + for (var _i56 = 0; _i56 < _size54; ++_i56) { + var elem57 = null; + elem57 = new ttypes.TTestConnectionResult(); + elem57.read(input); + this.resultList.push(elem57); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TTestConnectionResp.prototype.write = function(output) { + output.writeStructBegin('TTestConnectionResp'); + if (this.status !== null && this.status !== undefined) { + output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); + this.status.write(output); + output.writeFieldEnd(); + } + if (this.resultList !== null && this.resultList !== undefined) { + output.writeFieldBegin('resultList', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRUCT, this.resultList.length); + for (var iter58 in this.resultList) { + if (this.resultList.hasOwnProperty(iter58)) { + iter58 = this.resultList[iter58]; + iter58.write(output); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TNodeLocations = module.exports.TNodeLocations = function(args) { + this.configNodeLocations = null; + this.dataNodeLocations = null; + if (args) { + if (args.configNodeLocations !== undefined && args.configNodeLocations !== null) { + this.configNodeLocations = Thrift.copyList(args.configNodeLocations, [ttypes.TConfigNodeLocation]); + } + if (args.dataNodeLocations !== undefined && args.dataNodeLocations !== null) { + this.dataNodeLocations = Thrift.copyList(args.dataNodeLocations, [ttypes.TDataNodeLocation]); + } + } +}; +TNodeLocations.prototype = {}; +TNodeLocations.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.LIST) { + this.configNodeLocations = []; + var _rtmp360 = input.readListBegin(); + var _size59 = _rtmp360.size || 0; + for (var _i61 = 0; _i61 < _size59; ++_i61) { + var elem62 = null; + elem62 = new ttypes.TConfigNodeLocation(); + elem62.read(input); + this.configNodeLocations.push(elem62); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.dataNodeLocations = []; + var _rtmp364 = input.readListBegin(); + var _size63 = _rtmp364.size || 0; + for (var _i65 = 0; _i65 < _size63; ++_i65) { + var elem66 = null; + elem66 = new ttypes.TDataNodeLocation(); + elem66.read(input); + this.dataNodeLocations.push(elem66); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TNodeLocations.prototype.write = function(output) { + output.writeStructBegin('TNodeLocations'); + if (this.configNodeLocations !== null && this.configNodeLocations !== undefined) { + output.writeFieldBegin('configNodeLocations', Thrift.Type.LIST, 1); + output.writeListBegin(Thrift.Type.STRUCT, this.configNodeLocations.length); + for (var iter67 in this.configNodeLocations) { + if (this.configNodeLocations.hasOwnProperty(iter67)) { + iter67 = this.configNodeLocations[iter67]; + iter67.write(output); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.dataNodeLocations !== null && this.dataNodeLocations !== undefined) { + output.writeFieldBegin('dataNodeLocations', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRUCT, this.dataNodeLocations.length); + for (var iter68 in this.dataNodeLocations) { + if (this.dataNodeLocations.hasOwnProperty(iter68)) { + iter68 = this.dataNodeLocations[iter68]; + iter68.write(output); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TShowConfigurationTemplateResp = module.exports.TShowConfigurationTemplateResp = function(args) { + this.status = null; + this.content = null; + if (args) { + if (args.status !== undefined && args.status !== null) { + this.status = new ttypes.TSStatus(args.status); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); + } + if (args.content !== undefined && args.content !== null) { + this.content = args.content; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field content is unset!'); + } + } +}; +TShowConfigurationTemplateResp.prototype = {}; +TShowConfigurationTemplateResp.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.status = new ttypes.TSStatus(); + this.status.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.content = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TShowConfigurationTemplateResp.prototype.write = function(output) { + output.writeStructBegin('TShowConfigurationTemplateResp'); + if (this.status !== null && this.status !== undefined) { + output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); + this.status.write(output); + output.writeFieldEnd(); + } + if (this.content !== null && this.content !== undefined) { + output.writeFieldBegin('content', Thrift.Type.STRING, 2); + output.writeString(this.content); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TShowConfigurationResp = module.exports.TShowConfigurationResp = function(args) { + this.status = null; + this.content = null; + if (args) { + if (args.status !== undefined && args.status !== null) { + this.status = new ttypes.TSStatus(args.status); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); + } + if (args.content !== undefined && args.content !== null) { + this.content = args.content; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field content is unset!'); + } + } +}; +TShowConfigurationResp.prototype = {}; +TShowConfigurationResp.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.status = new ttypes.TSStatus(); + this.status.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.content = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TShowConfigurationResp.prototype.write = function(output) { + output.writeStructBegin('TShowConfigurationResp'); + if (this.status !== null && this.status !== undefined) { + output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); + this.status.write(output); + output.writeFieldEnd(); + } + if (this.content !== null && this.content !== undefined) { + output.writeFieldBegin('content', Thrift.Type.STRING, 2); + output.writeString(this.content); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + diff --git a/cdsp/information-layer/handlers/iotdb/package.json b/cdsp/information-layer/handlers/iotdb/package.json new file mode 100644 index 0000000..0b68fe0 --- /dev/null +++ b/cdsp/information-layer/handlers/iotdb/package.json @@ -0,0 +1,10 @@ +{ + "name": "iotdb-handler", + "version": "1.0.0", + "description": "IoT database handler", + "main": "iotdb-handler.js", + "dependencies": { + "thrift": "^0.20.0", + "uuid": "^9.0.1" + } +} diff --git a/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js b/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js index 09cbb2e..85ef9c5 100644 --- a/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js +++ b/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js @@ -1 +1,70 @@ -// tdb \ No newline at end of file +const Thrift = require("thrift"); +const Handler = require("../../handler"); +const IClientRPCService = require("../gen-nodejs/IClientRPCService"); +const ttypes = require("../gen-nodejs/client_types"); +const config = require("../config/config"); +const { Session } = require("inspector"); +const sendMessageToClient = (ws, message) => { + ws.send(JSON.stringify(message)); +}; + +class IoTDBHandler extends Handler { + constructor() { + super(); + this.connection = null; + this.client = null; + this.sendMessageToClients = null; + this.sessionId = null; + this.statementId = 0; + } + + async authenticateAndConnect(sendMessageToClients) { + try { + this.sendMessageToClients = sendMessageToClients; + + this.connection = Thrift.createConnection( + config.iotdbHost, + config.iotdbPort, + { + transport: Thrift.TFramedTransport, + protocol: Thrift.TBinaryProtocol, + } + ); + + this.client = Thrift.createClient(IClientRPCService, this.connection); + + this.connection.on("error", (err) => { + console.error("Thrift connection error:", err); + }); + + console.log("Successfully connected to IoTDB using Thrift"); + + this.open_session(); + } catch (error) { + console.error("Failed to authenticate with IoTDB:", error); + } + } + + async open_session() { + try { + const openSessionReq = new ttypes.TSOpenSessionReq({ + username: config.iotdbUser, + password: config.iotdbPassword, + client_protocol: ttypes.TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V3, // Set the appropriate protocol version + zoneId: config.timeZone, + }); + + const resp = await this.client.openSession(openSessionReq); + + this.sessionId = resp.sessionId; + console.log( + "Successfully authenticated with IoTDB, session ID:", + this.sessionId + ); + } catch (error) { + console.error("Failed starting session with IoTDB:", error); + } + } +} + +module.exports = IoTDBHandler; diff --git a/cdsp/information-layer/router/src/.env b/cdsp/information-layer/router/src/.env index 16ac659..bcaf5de 100644 --- a/cdsp/information-layer/router/src/.env +++ b/cdsp/information-layer/router/src/.env @@ -1 +1 @@ -HANDLER_TYPE=realmdb \ No newline at end of file +HANDLER_TYPE=iotdb \ No newline at end of file diff --git a/cdsp/information-layer/router/src/websocket-server.js b/cdsp/information-layer/router/src/websocket-server.js index 06727c5..d7ed319 100644 --- a/cdsp/information-layer/router/src/websocket-server.js +++ b/cdsp/information-layer/router/src/websocket-server.js @@ -1,21 +1,22 @@ -const WebSocket = require('ws'); -const RealmDBHandler = require('../../handlers/realmdb/src/realmdb-handler'); -const { getHandlerType } = require('../config/config'); -const { validateMessage } = require('../utils/message-validator'); +const WebSocket = require("ws"); +const RealmDBHandler = require("../../handlers/realmdb/src/realmdb-handler"); +const IoTDBHandler = require("../../handlers/iotdb/src/iotdb-handler"); +const { getHandlerType } = require("../config/config"); +const { validateMessage } = require("../utils/message-validator"); const handlerType = getHandlerType(); let handler; -console.log(`this is the handler type: ${handlerType}`) +console.log(`this is the handler type: ${handlerType}`); switch (handlerType) { - case 'realmdb': + case "realmdb": handler = new RealmDBHandler(); break; - case 'iotdb': - console.error('IoTDB Handler is not implemented, yet!') + case "iotdb": + handler = new IoTDBHandler(); break; default: - throw new Error('Unsupported handler type'); + throw new Error("Unsupported handler type"); } const server = new WebSocket.Server({ port: 8080 }); @@ -23,22 +24,22 @@ const server = new WebSocket.Server({ port: 8080 }); // Define clients array globally let clients = []; -server.on('connection', (ws) => { +server.on("connection", (ws) => { console.log("Client connected"); clients.push(ws); // Add client to the array - ws.on('message', (message) => { + ws.on("message", (message) => { console.log(`Message received: ${message}`); const validatedMessage = validateMessage(message); if (validatedMessage) { handler.handleMessage(validatedMessage, ws); } else { - ws.send(JSON.stringify({ error: 'Invalid message format' })); + ws.send(JSON.stringify({ error: "Invalid message format" })); } }); - ws.on('close', () => { - console.log('Client disconnected'); + ws.on("close", () => { + console.log("Client disconnected"); // Remove disconnected client from the array clients = clients.filter((client) => client !== ws); }); @@ -53,4 +54,6 @@ const sendMessageToClients = (message) => { console.log(`Starting authentication and connection to ${handlerType} ...`); handler.authenticateAndConnect(sendMessageToClients); -console.log(`WebSocket server started on ws://localhost:8080 using ${handlerType} handler`); +console.log( + `WebSocket server started on ws://localhost:8080 using ${handlerType} handler` +); From c075e51770d0d8c2d2867f0d29f749bf2b942682 Mon Sep 17 00:00:00 2001 From: Christian Muehlbauer Date: Wed, 31 Jul 2024 09:33:00 +0200 Subject: [PATCH 17/48] Update the authentification configuration for the IoTDB handler Add git ignore for the docker generated files Add Read method to IoTDBHandler Rename Data Type Object Apply format and remove invalid comment Optimize code to standarize the response between handlers. Repair documentation for the project configuration Add anonym data Manage Sessions Add Write method add client message data to IoTDB Signed-off-by: Christian Muehlbauer --- cdsp/information-layer/README.md | 28 +- .../handlers/iotdb/README.md | 13 +- .../handlers/iotdb/config/MeasurementsType.js | 8 + .../handlers/iotdb/src/iotdb-handler.js | 269 +++++++++++++++-- .../handlers/iotdb/utils/IoTDBConstants.js | 10 + .../iotdb/utils/IoTDBDataInterpreter.js | 106 +++++++ .../handlers/iotdb/utils/IoTDBRpcDataSets.js | 272 ++++++++++++++++++ .../handlers/iotdb/utils/SessionDataSet.js | 135 +++++++++ .../handlers/realmdb/src/realmdb-handler.js | 46 +-- docker/.gitignore | 5 + 10 files changed, 843 insertions(+), 49 deletions(-) create mode 100644 cdsp/information-layer/handlers/iotdb/config/MeasurementsType.js create mode 100644 cdsp/information-layer/handlers/iotdb/utils/IoTDBConstants.js create mode 100644 cdsp/information-layer/handlers/iotdb/utils/IoTDBDataInterpreter.js create mode 100644 cdsp/information-layer/handlers/iotdb/utils/IoTDBRpcDataSets.js create mode 100644 cdsp/information-layer/handlers/iotdb/utils/SessionDataSet.js create mode 100644 docker/.gitignore diff --git a/cdsp/information-layer/README.md b/cdsp/information-layer/README.md index 6b146bc..ad54fed 100644 --- a/cdsp/information-layer/README.md +++ b/cdsp/information-layer/README.md @@ -29,12 +29,36 @@ The Hello World example in our case is quite simple. We feed an updated value fo ``` ### IoTDB -- Not yet supported +- Ensure to start and run Docker containers defined in a [Docker Compose file](/docker/). +- Ensure that in the IoTDB CLI there is a `root.Vehicles` *database* like this: + ``` + IoTDB> show databases; + +-------------+----+-----------------------+---------------------+---------------------+ + | Database| TTL|SchemaReplicationFactor|DataReplicationFactor|TimePartitionInterval| + +-------------+----+-----------------------+---------------------+---------------------+ + |root.Vehicles|null| 1| 1| 604800000| + +-------------+----+-----------------------+---------------------+---------------------+ + Total line number = 1 + It costs 0.004s + ``` + +- Create two *timeseries* with the `root.Vehicles.VIN` and some VSS data. At the moment only 1 data point is supported, namely `root.Vehicles.Vehicle_Cabin_HVAC_AmbientAirTemperature`. Here you can see how the vehicle document within the *Vehicles* should look like in IoTDB CLI: + + ``` + IoTDB> show timeseries; + +------------------------------------------------------+-----+-------------+--------+--------+-----------+----+----------+--------+------------------+--------+ + | Timeseries|Alias| Database|DataType|Encoding|Compression|Tags|Attributes|Deadband|DeadbandParameters|ViewType| + +------------------------------------------------------+-----+-------------+--------+--------+-----------+----+----------+--------+------------------+--------+ + |root.Vehicles.Vehicle_Cabin_HVAC_AmbientAirTemperature| null|root.Vehicles| FLOAT| RLE| LZ4|null| null| null| null| BASE| + | root.Vehicles.VIN| null|root.Vehicles| TEXT| PLAIN| LZ4|null| null| null| null| BASE| + +------------------------------------------------------+-----+-------------+--------+--------+-----------+----+----------+--------+------------------+--------+ + ``` + ## [Start](./router/README.md#Run) the Database Router ## Look out for the Websocket Server message in the console -Now you can changed the value of `Vehicle_Cabin_HVAC_AmbientAirTemperature` in ATLAS cloud to let's say `23`. After changing you should immediately see this line in console: +If you are running the RealmDB handler and you change the value of `Vehicle_Cabin_HVAC_AmbientAirTemperature` in ATLAS cloud (let's say `23`), you should immediately see this line in console: ``` the value of "Vehicle_Cabin_HVAC_AmbientAirTemperature" changed to 23 diff --git a/cdsp/information-layer/handlers/iotdb/README.md b/cdsp/information-layer/handlers/iotdb/README.md index 68380ed..7f3bede 100644 --- a/cdsp/information-layer/handlers/iotdb/README.md +++ b/cdsp/information-layer/handlers/iotdb/README.md @@ -23,11 +23,14 @@ Create `config/config.js` with the following format, replacing the app id and th ```js module.exports = { - iotdbHost: "your-iotdb-host", // Default "localhost" - iotdbPort: 6667, // Set this to the appropriate IotDB Port - iotdbUser: "your-iotdb-user", // Default "root" - iotdbPassword: "your-iotdb-password", // Default "root" - timeZone: "UTC+2", // Set this to the appropriate time zone + module.exports = { + iotdbHost: "your-iotdb-host", // Default "localhost" + iotdbPort: 6667, // Set this to the appropriate IotDB Port + iotdbUser: "your-iotdb-user", // Default "root" + iotdbPassword: "your-iotdb-password", // Default "root" + timeZoneId: Intl.DateTimeFormat().resolvedOptions().timeZone, // Set this to the appropriate time zone + fetchSize: 10000, // number of rows that will be fetched from the database at a time when executing a query + }; }; ``` diff --git a/cdsp/information-layer/handlers/iotdb/config/MeasurementsType.js b/cdsp/information-layer/handlers/iotdb/config/MeasurementsType.js new file mode 100644 index 0000000..1392f2e --- /dev/null +++ b/cdsp/information-layer/handlers/iotdb/config/MeasurementsType.js @@ -0,0 +1,8 @@ +const JSDataType = require("../utils/IoTDBConstants"); + +const MeasurementType = Object.freeze({ + VIN: JSDataType.TEXT, + Vehicle_Cabin_HVAC_AmbientAirTemperature: JSDataType.FLOAT, +}); + +module.exports = MeasurementType; diff --git a/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js b/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js index 85ef9c5..2fb07c0 100644 --- a/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js +++ b/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js @@ -1,9 +1,18 @@ -const Thrift = require("thrift"); +const Client = require("../gen-nodejs/IClientRPCService"); +const { + TSExecuteStatementReq, + TSOpenSessionReq, + TSProtocolVersion, + TSCloseSessionReq, + TSInsertRecordReq, +} = require("../gen-nodejs/client_types"); +const thrift = require("thrift"); const Handler = require("../../handler"); -const IClientRPCService = require("../gen-nodejs/IClientRPCService"); -const ttypes = require("../gen-nodejs/client_types"); const config = require("../config/config"); -const { Session } = require("inspector"); +const SessionDataSet = require("../utils/SessionDataSet"); +const { IoTDBDataInterpreter } = require("../utils/IoTDBDataInterpreter"); +const MeasurementType = require("../config/MeasurementsType"); + const sendMessageToClient = (ws, message) => { ws.send(JSON.stringify(message)); }; @@ -11,60 +20,270 @@ const sendMessageToClient = (ws, message) => { class IoTDBHandler extends Handler { constructor() { super(); - this.connection = null; this.client = null; this.sendMessageToClients = null; this.sessionId = null; - this.statementId = 0; + this.protocolVersion = TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V3; + this.statementId = null; + this.zoneId = config.timeZoneId; + this.fetchSize = config.fetchSize; + this.isSessionClosed = true; } async authenticateAndConnect(sendMessageToClients) { try { this.sendMessageToClients = sendMessageToClients; - this.connection = Thrift.createConnection( + const connection = thrift.createConnection( config.iotdbHost, config.iotdbPort, { - transport: Thrift.TFramedTransport, - protocol: Thrift.TBinaryProtocol, + transport: thrift.TFramedTransport, + protocol: thrift.TBinaryProtocol, } ); - this.client = Thrift.createClient(IClientRPCService, this.connection); + this.client = thrift.createClient(Client, connection); - this.connection.on("error", (err) => { - console.error("Thrift connection error:", err); + connection.on("error", (err) => { + console.error("thrift connection error:", err); }); - console.log("Successfully connected to IoTDB using Thrift"); - - this.open_session(); + console.log("Successfully connected to IoTDB using thrift."); } catch (error) { console.error("Failed to authenticate with IoTDB:", error); } } - async open_session() { + async read(message, ws) { + const objectId = message.data.VIN; + const sql = `SELECT * FROM root.Vehicles WHERE root.Vehicles.VIN = '${objectId}'`; try { - const openSessionReq = new ttypes.TSOpenSessionReq({ - username: config.iotdbUser, - password: config.iotdbPassword, - client_protocol: ttypes.TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V3, // Set the appropriate protocol version - zoneId: config.timeZone, + await this.openSession(); + const sessionDataSet = await this.#executeQueryStatement(sql); + + // Check if the response contains data + if (sessionDataSet == {}) { + console.log("No data found in query response."); + sendMessageToClient( + ws, + JSON.stringify({ error: "No data found in query response." }) + ); + } else { + let mediaElements = []; + while (sessionDataSet.hasNext()) { + const mediaElement = sessionDataSet.next(); + mediaElements.push(mediaElement); + } + if (mediaElements.length > 0) { + for (let i = 0; i < mediaElements.length; ++i) { + const transformedObject = + IoTDBDataInterpreter.extractDeviceIdFromTimeseries( + mediaElements[i] + ); + const response = { + type: "read_response", + data: transformedObject, + }; + sendMessageToClient(ws, JSON.stringify(response)); + } + } else { + sendMessageToClient( + ws, + JSON.stringify({ error: "Object not found." }) + ); + } + } + } catch (error) { + console.error("Failed to read data from IoTDB: ", error); + } finally { + this.closeSession(); + } + } + + async write(message, ws) { + let measurements = []; + let dataTypes = []; + let values = []; + try { + await this.openSession(); + Object.entries(message.data).forEach(async ([key, value]) => { + measurements.push(key); + dataTypes.push(MeasurementType[key]); + values.push(value); }); + let deviceId = "root.Vehicles"; + const timestamp = new Date().getTime(); + const status = await this.#insertRecord( + deviceId, + timestamp, + measurements, + dataTypes, + values + ); + const response = `insert one record to device ${deviceId}, message: ${status.message}`; + console.log(response); + sendMessageToClient(ws, response); + } catch (error) { + console.error("Failed to write data from IoTDB: ", error); + } finally { + this.closeSession(); + } + } + + /** + * Opens a session with the IoTDB server using the provided credentials and configuration. + */ + async openSession() { + if (!this.isSessionClosed) { + console.info("The session is already opened."); + return; + } + const openSessionReq = new TSOpenSessionReq({ + username: config.iotdbUser, + password: config.iotdbPassword, + client_protocol: this.protocolVersion, + zoneId: config.timeZoneId, + configuration: { version: "V_0_13" }, + }); + + try { const resp = await this.client.openSession(openSessionReq); + if (this.protocolVersion != resp.serverProtocolVersion) { + console.log( + "Protocol differ, Client version is " + + this.protocolVersion + + ", but Server version is " + + resp.serverProtocolVersion + ); + // version is less than 0.10 + if (resp.serverProtocolVersion == 0) { + throw new Error("Protocol not supported."); + } + } + this.sessionId = resp.sessionId; - console.log( - "Successfully authenticated with IoTDB, session ID:", - this.sessionId + this.statementId = await this.client.requestStatementId(this.sessionId); + this.isSessionClosed = false; + console.log("Session started!"); + } catch (error) { + console.error("Failed starting session with IoTDB: ", error); + } + } + + isSessionOpen() { + return !this.isSessionClosed; + } + + closeSession() { + if (this.isSessionClosed) { + console.info("Session is already closed."); + return; + } + + let req = new TSCloseSessionReq({ + sessionId: this.sessionId, + }); + + try { + this.client.closeSession(req); + } catch (error) { + console.error( + "Error occurs when closing session at server. Maybe server is down. Error message: ", + err ); + } finally { + this.isSessionClosed = true; + console.log("Session closed!"); + } + } + + /** + * Executes a SQL query statement asynchronously. + * + * @param {string} sql - The SQL query statement to be executed. + * @returns {Promise} - Returns a SessionDataSet object if the query is successful, + * otherwise returns an empty object. + * @throws {Error} - Throws an error if the session is not open. + */ + async #executeQueryStatement(sql) { + try { + if (!this.sessionId) { + throw new Error("Session is not open. Please authenticate first."); + } + + const request = new TSExecuteStatementReq({ + sessionId: this.sessionId, + statement: sql, + statementId: this.statementId, + fetchSize: this.fetchSize, + timeout: 0, + }); + + const resp = await this.client.executeQueryStatement(request); + + if (!resp || !resp.queryDataSet || !resp.queryDataSet.valueList) { + return {}; + } else { + return new SessionDataSet( + resp.columns, + resp.dataTypeList, + resp.columnNameIndexMap, + resp.queryId, + this.client, + this.statementId, + this.sessionId, + resp.queryDataSet, + resp.ignoreTimeStamp + ); + } } catch (error) { - console.error("Failed starting session with IoTDB:", error); + console.error("Failed executing query statement: ", error); } } + + /** + * Inserts a record into the time series database. + * @param {string} deviceId - The ID of the device. + * @param {number} timestamp - The timestamp of the record. + * @param {string[]} measurements - Array of measurement names. + * @param {string[]} dataTypes - Array of data types for each value. + * @param {any[]} values - Array of values to be inserted. + * @param {boolean} isAligned - Flag indicating if the data is aligned. + * @returns {Promise} - A promise that resolves with the result of the insertion. + * @throws {string} - Throws an error if lengths of data types, values, and measurements do not match. + */ + async #insertRecord( + deviceId, + timestamp, + measurements, + dataTypes, + values, + isAligned = false + ) { + if ( + values.length != dataTypes.length || + values.length != measurements.length + ) { + throw "length of data types does not equal to length of values!"; + } + const valuesInBytes = IoTDBDataInterpreter.serializeValues( + dataTypes, + values + ); + + let request = new TSInsertRecordReq({ + sessionId: this.sessionId, + prefixPath: deviceId, + measurements: measurements, + values: valuesInBytes, + timestamp: timestamp, + isAligned: isAligned, + }); + return await this.client.insertRecord(request); + } } module.exports = IoTDBHandler; diff --git a/cdsp/information-layer/handlers/iotdb/utils/IoTDBConstants.js b/cdsp/information-layer/handlers/iotdb/utils/IoTDBConstants.js new file mode 100644 index 0000000..ae7073d --- /dev/null +++ b/cdsp/information-layer/handlers/iotdb/utils/IoTDBConstants.js @@ -0,0 +1,10 @@ +const JSDataType = Object.freeze({ + BOOLEAN: 0, + INT32: 1, + INT64: 2, + FLOAT: 3, + DOUBLE: 4, + TEXT: 5, +}); + +module.exports = JSDataType; diff --git a/cdsp/information-layer/handlers/iotdb/utils/IoTDBDataInterpreter.js b/cdsp/information-layer/handlers/iotdb/utils/IoTDBDataInterpreter.js new file mode 100644 index 0000000..bb707ff --- /dev/null +++ b/cdsp/information-layer/handlers/iotdb/utils/IoTDBDataInterpreter.js @@ -0,0 +1,106 @@ +const JSDataType = require("./IoTDBConstants"); + +class IoTDBDataInterpreter { + /** + * Serializes values based on the specified data types. + * @param {Array} dataTypes - Array of data types to serialize the values as. + * @param {Array} values - Array of values to be serialized. + * @returns {Buffer} - Serialized values as a Buffer. + */ + static serializeValues(dataTypes, values) { + function serializeBoolean(value) { + return [JSDataType.BOOLEAN, value]; + } + + function serializeInt32(value) { + const int32 = new Int32Array([value]); + const uint8 = new Uint8Array(int32.buffer).reverse(); + return [JSDataType.INT32, ...uint8]; + } + + function serializeInt64(value) { + const bigint64 = new BigInt64Array([value]); + const uint8 = new Uint8Array(bigint64.buffer).reverse(); + return [JSDataType.INT64, ...uint8]; + } + + function serializeFloat(value) { + const float32 = new Float32Array([value]); + const uint8 = new Uint8Array(float32.buffer).reverse(); + return [JSDataType.FLOAT, ...uint8]; + } + + function serializeDouble(value) { + const float64 = new Float64Array([value]); + const uint8 = new Uint8Array(float64.buffer).reverse(); + return [JSDataType.DOUBLE, ...uint8]; + } + + function serializeText(value) { + const utf8arr = Buffer.from(value); + const int32 = new Uint32Array([utf8arr.length]); + const uint8 = new Uint8Array(int32.buffer).reverse(); + return [JSDataType.TEXT, ...uint8, ...utf8arr]; + } + + const serializedValues = []; + + for (let i = 0; i < dataTypes.length; i++) { + switch (dataTypes[i]) { + case JSDataType.BOOLEAN: + serializedValues.push(...serializeBoolean(values[i])); + break; + case JSDataType.INT32: + serializedValues.push(...serializeInt32(values[i])); + break; + case JSDataType.INT64: + serializedValues.push(...serializeInt64(values[i])); + break; + case JSDataType.FLOAT: + serializedValues.push(...serializeFloat(values[i])); + break; + case JSDataType.DOUBLE: + serializedValues.push(...serializeDouble(values[i])); + break; + case JSDataType.TEXT: + serializedValues.push(...serializeText(values[i])); + break; + default: + throw new Error("Unsupported data type"); + } + } + return Buffer.from(serializedValues); + } + + /** + * Transforms an object by extracting and renaming keys that start with device id 'root.Vehicles.'. + * + * @param {Object} obj - The input object to be transformed. + * @returns {Object} - A new object with keys that were prefixed with 'root.Vehicles.' renamed to their last segment. + */ + static extractDeviceIdFromTimeseries(obj) { + return Object.entries(obj).reduce((acc, [key, value]) => { + if (key.startsWith("root.Vehicles.")) { + const newKey = key.split(".").pop(); // Get the last part of the key + acc[newKey] = value; + } + return acc; + }, {}); + } + + /** + * This function converts a buffer to a BigInt64Array and extracts the timestamp. + * + * @param {Buffer} buffer - The buffer containing the timestamp. + * @returns {{ timestamp: BigInt }} An object containing the extracted timestamp. + */ + static extractTimestamp(buffer) { + const reverseBuffer = Buffer.from(buffer.subarray(0, 8).reverse()); + const uinit8Buffer = new Uint8Array(reverseBuffer).buffer; + const timestamp = new BigInt64Array(uinit8Buffer)[0]; + + return { timestamp }; + } +} + +module.exports = { IoTDBDataInterpreter }; diff --git a/cdsp/information-layer/handlers/iotdb/utils/IoTDBRpcDataSets.js b/cdsp/information-layer/handlers/iotdb/utils/IoTDBRpcDataSets.js new file mode 100644 index 0000000..c58419e --- /dev/null +++ b/cdsp/information-layer/handlers/iotdb/utils/IoTDBRpcDataSets.js @@ -0,0 +1,272 @@ +const JSDataType = require("./IoTDBConstants"); +class IoTDBRpcDataSet { + // Static properties + static TIMESTAMP_STR = "Time"; + static START_INDEX = 2; + static FLAG = 0x80; + + // Private fields + #sql; + #columnNameList; + #columnTypeList; + #queryId; + #client; + #statementId; + #sessionId; + #queryDataSet; + #ignoreTimestamp; + #fetchSize; + #columnOrdinalDict; + #columnTypeDeduplicatedList; + #timeBytes; + #currentBitmap; + #hasCachedRecord; + #value; + #emptyResultSet; + #rowsIndex; + #columnSize; + + constructor( + columnNameList, + columnTypeList, + columnNameIndex, + queryId, + client, + statementId, + sessionId, + queryDataSet, + ignoreTimestamp, + fetchSize + ) { + this.#columnNameList = []; + this.#columnTypeList = []; + this.#queryId = queryId; + this.#client = client; + this.#statementId = statementId; + this.#sessionId = sessionId; + this.#queryDataSet = queryDataSet; + this.#ignoreTimestamp = ignoreTimestamp; + this.#fetchSize = fetchSize; + this.#columnSize = columnNameList.length; + this.#columnOrdinalDict = new Map(); + this.#columnTypeDeduplicatedList = []; + this.#hasCachedRecord = false; + this.#emptyResultSet = false; + this.#rowsIndex = 0; + + if (!ignoreTimestamp) { + this.#columnNameList.push(IoTDBRpcDataSet.TIMESTAMP_STR); + this.#columnTypeList.push(JSDataType.INT64); + this.#columnOrdinalDict.set(IoTDBRpcDataSet.TIMESTAMP_STR, 1); + } + + if (columnNameIndex !== null) { + // Initialize deduplicated list + for (let j = 0; j < columnNameIndex.length; j++) { + this.#columnTypeDeduplicatedList.push(null); + } + + // Populate column_name_list and column_type_list + for (let i = 0; i < columnNameList.length; i++) { + let name = columnNameList[i]; + this.#columnNameList.push(name); + this.#columnTypeList.push(JSDataType[columnTypeList[i]]); + + if (!this.#columnOrdinalDict.has(name)) { + let index = columnNameIndex[name]; + this.#columnOrdinalDict.set( + name, + index + IoTDBRpcDataSet.START_INDEX + ); + this.#columnTypeDeduplicatedList[index] = + JSDataType[columnTypeList[i]]; + } + } + } + + this.#timeBytes = Buffer.alloc(0); + this.#currentBitmap = Array(this.#columnTypeDeduplicatedList.length).fill( + Buffer.alloc(0) + ); + this.#value = Array(this.#columnTypeDeduplicatedList.length).fill(null); + } + + /** + * Advances the cursor to the next row in the result set. + * + * @returns {boolean} - Returns true if the cursor was successfully advanced to the next row, + * or if there are no more rows in the result set. Returns false if + * there are no more rows and no cached results. + */ + next() { + if (this.#hasCachedResult()) { + this.#constructOneRow(); + return true; + } + if (this.#emptyResultSet) { + return true; + } + if (this.#fetchResults()) { + this.#constructOneRow(); + return true; + } + return false; + } + + getHasCachedRecord() { + return this.#hasCachedRecord; + } + + setHasCachedRecord(value) { + this.#hasCachedRecord = value; + } + + getTimeBytes() { + return this.#timeBytes; + } + + getColumnSize() { + return this.#columnSize; + } + + getIgnoreTimestamp() { + return this.#ignoreTimestamp; + } + + getColumnNames() { + return this.#columnNameList; + } + + getColumnOrdinalDict() { + return this.#columnOrdinalDict; + } + + /** + * Checks if the value at the specified column index is null. + * + * @param {number} columnIndex - The index of the column to check. + * @returns {boolean} - Returns true if the value at the specified column index is null, otherwise false. + */ + isNullByIndex(columnIndex) { + let index = + this.#columnOrdinalDict.get(this.findColumnNameByIndex(columnIndex)) - + IoTDBRpcDataSet.START_INDEX; + + // time column will never be null + if (index < 0) { + return true; + } + return this.#isNull(index, this.#rowsIndex - 1); + } + + getValues() { + return this.#value; + } + + getColumnTypeDeduplicatedList() { + return this.#columnTypeDeduplicatedList; + } + + /** + * Finds the column name by its index. + * @param {number} columnIndex - The index of the column (starting from 1). + * @returns {string} The name of the column corresponding to the index. + * @throws {Error} If the column index is less than or equal to 0 or greater than the number of columns. + */ + findColumnNameByIndex(columnIndex) { + if (columnIndex <= 0) { + throw new Error("Column index should start from 1"); + } + if (columnIndex > this.#columnNameList.length) { + throw new Error("Column index out of range"); + } + return this.#columnNameList[columnIndex - 1]; + } + + /** + * Checks if there is a cached result available. + * + * @returns {boolean} True if there is a cached result, otherwise false. + */ + #hasCachedResult() { + return this.#queryDataSet !== null && this.#queryDataSet.time.length != 0; + } + + /** + * Constructs one row of data by reading from the dataset buffers. + * This method updates the internal state of the object by reading + * time, bitmap, and value buffers, and discarding the bytes that have been read. + */ + #constructOneRow() { + // Simulating buffer, read 8 bytes from data set and discard first 8 bytes which have been read. + this.#timeBytes = this.#queryDataSet.time.slice(0, 8); + this.#queryDataSet.time = this.#queryDataSet.time.slice(8); + + for (let i = 0; i < this.#queryDataSet.bitmapList.length; i++) { + let bitmapBuffer = this.#queryDataSet.bitmapList[i]; + + // Another 8 new rows, should move the bitmap buffer position to next byte. + if (this.#rowsIndex % 8 === 0) { + this.#currentBitmap[i] = bitmapBuffer[0]; + this.#queryDataSet.bitmapList[i] = bitmapBuffer.slice(1); + } + + if (!this.#isNull(i, this.#rowsIndex)) { + let valueBuffer = this.#queryDataSet.valueList[i]; + let dataType = this.#columnTypeDeduplicatedList[i]; + + // Simulating buffer based on data type. + switch (dataType) { + case JSDataType.BOOLEAN: + this.#value[i] = valueBuffer.slice(0, 1); + this.#queryDataSet.valueList[i] = valueBuffer.slice(1); + break; + case JSDataType.INT32: + this.#value[i] = valueBuffer.slice(0, 4); + this.#queryDataSet.valueList[i] = valueBuffer.slice(4); + break; + case JSDataType.INT64: + this.#value[i] = valueBuffer.slice(0, 8); + this.#queryDataSet.valueList[i] = valueBuffer.slice(8); + break; + case JSDataType.FLOAT: + this.#value[i] = valueBuffer.slice(0, 4); + this.#queryDataSet.valueList[i] = valueBuffer.slice(4); + break; + case JSDataType.DOUBLE: + this.#value[i] = valueBuffer.slice(0, 8); + this.#queryDataSet.valueList[i] = valueBuffer.slice(8); + break; + case JSDataType.TEXT: + let length = valueBuffer.readInt32BE(0); + this.#value[i] = valueBuffer.slice(4, 4 + length); + this.#queryDataSet.valueList[i] = valueBuffer.slice(4 + length); + break; + default: + throw new Error("Unsupported data type."); + } + } + } + this.#rowsIndex += 1; + this.#hasCachedRecord = true; + } + + /** + * Checks if the value at the specified index and row number is null. + * + * @param {number} index - The index in the bitmap array. + * @param {number} rowNum - The row number to check. + * @returns {boolean} - Returns true if the value is null, otherwise false. + */ + #isNull(index, rowNum) { + let bitmap = this.#currentBitmap[index]; + let shift = rowNum % 8; + return ((IoTDBRpcDataSet.FLAG >> shift) & (bitmap & 0xff)) === 0; + } + + #fetchResults() { + this.#rowsIndex = 0; + } +} + +module.exports = IoTDBRpcDataSet; diff --git a/cdsp/information-layer/handlers/iotdb/utils/SessionDataSet.js b/cdsp/information-layer/handlers/iotdb/utils/SessionDataSet.js new file mode 100644 index 0000000..fbb1dd4 --- /dev/null +++ b/cdsp/information-layer/handlers/iotdb/utils/SessionDataSet.js @@ -0,0 +1,135 @@ +const JSDataType = require("./IoTDBConstants"); +const IoTDBRpcDataSet = require("./IoTDBRpcDataSets"); +const { IoTDBDataInterpreter } = require("./IoTDBDataInterpreter"); + +const dataTypeProcessors = { + [JSDataType.BOOLEAN]: (bytes) => + new Int8Array(new Uint8Array(bytes.slice(0, 1).reverse()).buffer)[0], + [JSDataType.INT32]: (bytes) => + new Int32Array(new Uint8Array(bytes.slice(0, 4).reverse()).buffer)[0], + [JSDataType.INT64]: (bytes) => + new BigInt64Array(new Uint8Array(bytes.slice(0, 8).reverse()).buffer)[0], + [JSDataType.FLOAT]: (bytes) => + new Float32Array(new Uint8Array(bytes.slice(0, 4).reverse()).buffer)[0], + [JSDataType.DOUBLE]: (bytes) => + new Float64Array(new Uint8Array(bytes.slice(0, 8).reverse()).buffer)[0], + [JSDataType.TEXT]: (bytes) => bytes.toString(), +}; + +class SessionDataSet { + /** + * Constructor for initializing the class with the provided parameters. + * + * @param {Array} columnNameList - List of column names. + * @param {Array} columnTypeList - List of column types. + * @param {Object} columnNameIndex - Index mapping of column names. + * @param {string} queryId - Unique identifier for the query. + * @param {Object} client - Client instance for database connection. + * @param {string} statementId - Unique identifier for the statement. + * @param {string} sessionId - Unique identifier for the session. + * @param {Object} queryDataSet - Data set returned from the query. + * @param {boolean} ignoreTimestamp - Flag to determine if timestamps should be ignored. + */ + constructor( + columnNameList, + columnTypeList, + columnNameIndex, + queryId, + client, + statementId, + sessionId, + queryDataSet, + ignoreTimestamp + ) { + this.iotdbRpcDataSet = new IoTDBRpcDataSet( + columnNameList, + columnTypeList, + columnNameIndex, + queryId, + client, + statementId, + sessionId, + queryDataSet, + ignoreTimestamp, + 1024 // Buffer size or default value + ); + } + + /** + * Checks if there is a next element in the IoTDB RPC DataSet. + * + * @returns {boolean} True if there is a next element, otherwise false. + */ + hasNext() { + return this.iotdbRpcDataSet.next(); + } + + /** + * Retrieves the next row record from the dataset. + * If there is no cached record, checks if there is a next record available. + * If there is no next record available, returns null. + * Resets the cached record flag after retrieving the record. + * @returns {Object|null} The next row record or null if no more records are available. + */ + next() { + if (!this.iotdbRpcDataSet.getHasCachedRecord()) { + if (!this.hasNext()) { + return null; + } + } + this.iotdbRpcDataSet.setHasCachedRecord(false); + + return this.constructRowRecordFromValueArray(); + } + + /** + * Constructs a row record from a value array. + * + * This function processes the IoTDB RPC dataset to extract and convert + * the timestamp and column values into a structured object. + * + * @returns {Object} The constructed row record with timestamp and column values. + */ + constructRowRecordFromValueArray() { + let time64 = IoTDBDataInterpreter.extractTimestamp( + this.iotdbRpcDataSet.getTimeBytes() + ); + let obj = { timestamp: time64 }; + + for (let i = 0; i < this.iotdbRpcDataSet.getColumnSize(); ++i) { + let index = i + 1; + let dataSetColumnIndex = i + IoTDBRpcDataSet.START_INDEX; + + if (this.iotdbRpcDataSet.getIgnoreTimestamp()) { + index -= 1; + dataSetColumnIndex -= 1; + } + + let columnName = this.iotdbRpcDataSet.getColumnNames()[index]; + let location = + this.iotdbRpcDataSet.getColumnOrdinalDict().get(columnName) - + IoTDBRpcDataSet.START_INDEX; + + if (!this.iotdbRpcDataSet.isNullByIndex(dataSetColumnIndex)) { + let valueBytes = this.iotdbRpcDataSet.getValues()[location]; + let dataType = + this.iotdbRpcDataSet.getColumnTypeDeduplicatedList()[location]; + let tsName = + this.iotdbRpcDataSet.findColumnNameByIndex(dataSetColumnIndex); + + if (dataTypeProcessors[dataType]) { + obj[tsName] = dataTypeProcessors[dataType](valueBytes); + } else { + throw new Error("Unsupported data type."); + } + } else { + let tsName = + this.iotdbRpcDataSet.findColumnNameByIndex(dataSetColumnIndex); + obj[tsName] = null; + } + } + return obj; + } +} + +module.exports = SessionDataSet; diff --git a/cdsp/information-layer/handlers/realmdb/src/realmdb-handler.js b/cdsp/information-layer/handlers/realmdb/src/realmdb-handler.js index 7ef679d..e67b295 100644 --- a/cdsp/information-layer/handlers/realmdb/src/realmdb-handler.js +++ b/cdsp/information-layer/handlers/realmdb/src/realmdb-handler.js @@ -1,5 +1,5 @@ const Realm = require("realm"); -const Handler = require('../../handler') +const Handler = require("../../handler"); const config = require("../config/config"); const { v4: uuidv4 } = require("uuid"); // Importing UUID generator @@ -50,9 +50,11 @@ class RealmDBHandler extends Handler { const MediaElements = this.realm.objects("Vehicles").subscribe(); // TODO: Is it necessary to log this, extra function? if (MediaElements) { - console.log(MediaElements); + console.log(MediaElements); } else { - this.sendMessageToClients({ error: "Vehicles collection not found for subscription"}); + this.sendMessageToClients({ + error: "Vehicles collection not found for subscription", + }); } } catch (error) { console.error("Failed to authenticate with Realm:", error); @@ -60,8 +62,8 @@ class RealmDBHandler extends Handler { } async read(message, ws) { - try{ - const objectId = message.data.Vin; // Retrieve objectId from config file + try { + const objectId = message.data.Vin; const MediaElement = this.realm.objectForPrimaryKey("Vehicles", objectId); if (MediaElement) { const response = { @@ -70,32 +72,40 @@ class RealmDBHandler extends Handler { }; sendMessageToClient(ws, JSON.stringify(response)); } else { - sendMessageToClient(ws, JSON.stringify({ error: 'Object not found' })); + sendMessageToClient(ws, JSON.stringify({ error: "Object not found" })); } } catch (error) { console.error("Error reading object from Realm:", error); - sendMessageToClient(ws, JSON.stringify({ error: 'Error reading object' })); + sendMessageToClient( + ws, + JSON.stringify({ error: "Error reading object" }) + ); } } - async subscribe(message, ws) { + async subscribe(message, ws) { try { const objectId = message.data.Vin; - console.log(`Subscribing element: ${objectId}`) - const MediaElement = await this.realm.objectForPrimaryKey("Vehicles", objectId); + console.log(`Subscribing element: ${objectId}`); + const MediaElement = await this.realm.objectForPrimaryKey( + "Vehicles", + objectId + ); if (MediaElement) { const websocketId = String(objectId); MediaElement.addListener((MediaElement, changes) => this.onMediaElementChange(MediaElement, changes, websocketId) ); - sendMessageToClient(ws, { success: `Subscribed to changes for object ID ${objectId}` }) + sendMessageToClient(ws, { + success: `Subscribed to changes for object ID ${objectId}`, + }); } else { - sendMessageToClient(ws, JSON.stringify({ error: 'Object not found' })); + sendMessageToClient(ws, JSON.stringify({ error: "Object not found" })); } } catch (error) { console.error("Error subscribing to object changes in Realm:", error); - sendMessageToClient(ws, { error: 'Error subscribing to object changes' }); + sendMessageToClient(ws, { error: "Error subscribing to object changes" }); } } @@ -104,11 +114,13 @@ class RealmDBHandler extends Handler { console.log(`MediaElement is deleted: ${changes.deleted}`); } else { changes.changedProperties.forEach((prop) => { - console.log(`* the value of "${prop}" changed to ${MediaElement[prop]}`); + console.log( + `* the value of "${prop}" changed to ${MediaElement[prop]}` + ); // Generate a meaningful UUID for WebSocket response const uuid = uuidv4(); - + const message = { type: "update", tree: "VSS", @@ -117,7 +129,7 @@ class RealmDBHandler extends Handler { dateTime: new Date().toISOString(), node: { name: prop, // Sending the property name as node name - value: MediaElement[prop], // Sending the property value as node value + value: MediaElement[prop], // Sending the property value as node value }, }; this.sendMessageToClients(message); @@ -126,4 +138,4 @@ class RealmDBHandler extends Handler { } } -module.exports = RealmDBHandler; \ No newline at end of file +module.exports = RealmDBHandler; diff --git a/docker/.gitignore b/docker/.gitignore new file mode 100644 index 0000000..b8ed0da --- /dev/null +++ b/docker/.gitignore @@ -0,0 +1,5 @@ +# Docker generated files +data/ +logs/ + + From 684f3f90c25fd7896ee28ad609f01e3582e140ad Mon Sep 17 00:00:00 2001 From: Christian Muehlbauer Date: Wed, 7 Aug 2024 15:31:15 +0200 Subject: [PATCH 18/48] Add validator for message format and IoTDB message processing Return messages to all clients when write in IoTDB Update IoTDB supported fields and documentation Update read dependencies and send error to clients Add read messaging in RealmDB Resolve Ajv warining about fields with multiple types Add subcribe message handling Remove unused import Repair findings Signed-off-by: Christian Muehlbauer --- cdsp/information-layer/README.md | 137 +++++++-- cdsp/information-layer/handlers/handler.js | 54 ++-- .../handlers/iotdb/README.md | 14 +- .../handlers/iotdb/config/Database.js | 11 + .../handlers/iotdb/config/MeasurementsType.js | 8 +- .../handlers/iotdb/src/iotdb-handler.js | 261 ++++++++++++++---- .../handlers/realmdb/README.md | 32 +-- .../handlers/realmdb/config/Database.js | 11 + .../realmdb/config/RealmConfiguration.js | 32 +++ .../handlers/realmdb/src/realmdb-handler.js | 240 +++++++++++----- cdsp/information-layer/router/README.md | 1 - cdsp/information-layer/router/package.json | 1 + .../router/src/websocket-server.js | 11 +- .../router/utils/message-validator.js | 142 +++++++++- 14 files changed, 728 insertions(+), 227 deletions(-) create mode 100644 cdsp/information-layer/handlers/iotdb/config/Database.js create mode 100644 cdsp/information-layer/handlers/realmdb/config/Database.js create mode 100644 cdsp/information-layer/handlers/realmdb/config/RealmConfiguration.js diff --git a/cdsp/information-layer/README.md b/cdsp/information-layer/README.md index ad54fed..bdeca09 100644 --- a/cdsp/information-layer/README.md +++ b/cdsp/information-layer/README.md @@ -11,21 +11,24 @@ Setting up an information layer in the CDSP involves running a [Database-Router] Please follow installation instructions of the chosen [handler](./handlers/). -## [Installation of Database-Router](./router/README.md#Install) +## Installation of Database-Router +See [hier](./router/README.md#Install) how to install the Database-Router. # Running "Hello World" example -The Hello World example in our case is quite simple. We feed an updated value for the HVAC ambient air temperature into the database and we check afterwards in the logs if the DB-router creates a Websocket update message for it. +The Hello World example in our case is quite simple. We feed an updated value for the `CurrentLocation_Longitude` into the database and we check afterwards in the logs if the DB-router creates a Websocket update message for it. ## Choose and prepare your Database ### Realm -- Ensure that in your [ATLAS cloud](https://cloud.mongodb.com/) app there is a vehicle *document* with an `_id: 1234567` in a collection named *Vehicles*. -- Ensure that this document as well contains VSS data. At the moment only 1 data point is supported, namely `Vehicle.Cabin.HVAC.AmbientAirTemperature`. Here you can see how the vehicle document within the *Vehicles* should look like in ATLAS: - - ``` - _id: 1234567 (Int64) - Vehicle_Cabin_HVAC_AmbientAirTemperature: 6 (Double) +- Ensure that in your [ATLAS cloud](https://cloud.mongodb.com/) app there is a vehicle *document* with an `VehicleIdentification_VIN: SMT905JN26J262542` in a collection named *`Vehicles`*. +- Ensure that this document as well contains VSS data. Here you can see the supported data in a vehicle document within the *Vehicles* should look like in ATLAS: + + ``` + _id: "" (string) + VehicleIdentification_VIN: "" (string) + CurrentLocation_Latitude: (Int64) + CurrentLocation_Longitude: (Int64) ``` ### IoTDB @@ -43,26 +46,122 @@ The Hello World example in our case is quite simple. We feed an updated value fo It costs 0.004s ``` -- Create two *timeseries* with the `root.Vehicles.VIN` and some VSS data. At the moment only 1 data point is supported, namely `root.Vehicles.Vehicle_Cabin_HVAC_AmbientAirTemperature`. Here you can see how the vehicle document within the *Vehicles* should look like in IoTDB CLI: +- Create two *timeseries* with the `root.Vehicles.VehicleIdentification_VIN` and some VSS data. Here you can see an example how the vehicle document within the *Vehicles* should look like in IoTDB CLI: ``` IoTDB> show timeseries; - +------------------------------------------------------+-----+-------------+--------+--------+-----------+----+----------+--------+------------------+--------+ - | Timeseries|Alias| Database|DataType|Encoding|Compression|Tags|Attributes|Deadband|DeadbandParameters|ViewType| - +------------------------------------------------------+-----+-------------+--------+--------+-----------+----+----------+--------+------------------+--------+ - |root.Vehicles.Vehicle_Cabin_HVAC_AmbientAirTemperature| null|root.Vehicles| FLOAT| RLE| LZ4|null| null| null| null| BASE| - | root.Vehicles.VIN| null|root.Vehicles| TEXT| PLAIN| LZ4|null| null| null| null| BASE| - +------------------------------------------------------+-----+-------------+--------+--------+-----------+----+----------+--------+------------------+--------+ + +---------------------------------------+-----+-------------+--------+--------+-----------+----+----------+--------+------------------+--------+ + | Timeseries|Alias| Database|DataType|Encoding|Compression|Tags|Attributes|Deadband|DeadbandParameters|ViewType| + +---------------------------------------+-----+-------------+--------+--------+-----------+----+----------+--------+------------------+--------+ + |root.Vehicles.VehicleIdentification_VIN| null|root.Vehicles| TEXT| PLAIN| LZ4|null| null| null| null| BASE| + | root.Vehicles.CurrentLocation_Latitude| null|root.Vehicles| DOUBLE| RLE| LZ4|null| null| null| null| BASE| + |root.Vehicles.CurrentLocation_Longitude| null|root.Vehicles| DOUBLE| RLE| LZ4|null| null| null| null| BASE| + +---------------------------------------+-----+-------------+--------+--------+-----------+----+----------+--------+------------------+--------+ ``` -## [Start](./router/README.md#Run) the Database Router +## Start the Database Router + +See [here](./router/README.md#Run) how to start the database router. ## Look out for the Websocket Server message in the console -If you are running the RealmDB handler and you change the value of `Vehicle_Cabin_HVAC_AmbientAirTemperature` in ATLAS cloud (let's say `23`), you should immediately see this line in console: +If you the handler is running and you are subscribed to that element, when you change the value of `CurrentLocation_Longitude` in ATLAS cloud (let's say `-157845.68200000003`), you should immediately see this line in console: ``` -the value of "Vehicle_Cabin_HVAC_AmbientAirTemperature" changed to 23 +{ + type: 'update', + tree: 'VSS', + id: '', + dateTime: '', + uuid: '', + node: { name: 'CurrentLocation_Longitude', value: `-157845.68200000003` } +} ``` -## Connect your own Websocket Client +# Connect your own Websocket Client Connect your own websocket client by connecting to `ws://localhost:8080` + +The examples use the VIN (Vehicle Identification Number) as object identifier. + +### Reading data + +To read data, send a message with the type of request and VIN as object ID: + + * Example for one Node: + ```json + { + "type": "read", + "tree": "VSS", + "id": "", + "uuid": "", + "node": { + "name": "" + } + } + ``` + * Example for multiple Nodes: + ```json + { + "type": "read", + "tree": "VSS", + "id": "", + "uuid": "", + "nodes": [ + { + "name": "" + }, + { + "name": "" + } + ] + } + ``` + +### Writing data + +To write data, send a message with the type of request and VIN as object ID (at this moment only with IoTDB available): + + * Example for one Node: + ```json + { + "type": "write", + "tree": "VSS", + "id": "", + "uuid": "", + "node": { + "name": "", + "value": "" + } + } + ``` + * Example for multiple Nodes: + ```json + { + "type": "write", + "tree": "VSS", + "id": "", + "uuid": "", + "nodes": [ + { + "name": "", + "value": "" + }, + { + "name": "", + "value": "" + } + ] + } + ``` +### Subscribing to changes + +To subscribe to changes in a specific object, send a message with the type of request and VIN as object ID (at this moment only with RealmDB available): + + ```json + { + "type": "subscribe", + "tree": "VSS", + "id": "", + "uuid": "", + } + ``` + diff --git a/cdsp/information-layer/handlers/handler.js b/cdsp/information-layer/handlers/handler.js index f66eaed..6ed6f62 100644 --- a/cdsp/information-layer/handlers/handler.js +++ b/cdsp/information-layer/handlers/handler.js @@ -1,35 +1,35 @@ class Handler { - authenticateAndConnect(sendMessageToClients) { - throw new Error("Method 'authenticateAndConnect' must be implemented."); - } + authenticateAndConnect(sendMessageToClients) { + throw new Error("Method 'authenticateAndConnect' must be implemented."); + } - handleMessage(message, ws) { - switch (message.type) { - case 'read': - this.read(message, ws); - break; - case 'write': - this.write(message, ws); - break; - case 'subscribe': - this.subscribe(message, ws); - break; - default: - ws.send(JSON.stringify({ error: 'Unknown message type'})) - } + handleMessage(message, ws) { + switch (message.type) { + case "read": + this.read(message, ws); + break; + case "write": + this.write(message, ws); + break; + case "subscribe": + this.subscribe(message, ws); + break; + default: + ws.send(JSON.stringify({ error: "Unknown message type" })); } + } - read(message, ws) { - throw new Error('Read method not implemented, yet!') - } + read(message, ws) { + throw new Error("Read method not implemented, yet!"); + } - write(message, ws) { - throw new Error('Write method not implemented, yet!') - } + write(message, ws) { + throw new Error("Write method not implemented, yet!"); + } - subscribe(message, ws) { - throw new Error('Subscribe method not implemented, yet!') - } + subscribe(message, ws) { + throw new Error("Subscribe method not implemented, yet!"); + } } -module.exports = Handler; \ No newline at end of file +module.exports = Handler; diff --git a/cdsp/information-layer/handlers/iotdb/README.md b/cdsp/information-layer/handlers/iotdb/README.md index 7f3bede..430d176 100644 --- a/cdsp/information-layer/handlers/iotdb/README.md +++ b/cdsp/information-layer/handlers/iotdb/README.md @@ -23,14 +23,12 @@ Create `config/config.js` with the following format, replacing the app id and th ```js module.exports = { - module.exports = { - iotdbHost: "your-iotdb-host", // Default "localhost" - iotdbPort: 6667, // Set this to the appropriate IotDB Port - iotdbUser: "your-iotdb-user", // Default "root" - iotdbPassword: "your-iotdb-password", // Default "root" - timeZoneId: Intl.DateTimeFormat().resolvedOptions().timeZone, // Set this to the appropriate time zone - fetchSize: 10000, // number of rows that will be fetched from the database at a time when executing a query - }; + iotdbHost: "your-iotdb-host", // Default "localhost" + iotdbPort: 6667, // Set this to the appropriate IotDB Port + iotdbUser: "your-iotdb-user", // Default "root" + iotdbPassword: "your-iotdb-password", // Default "root" + timeZoneId: Intl.DateTimeFormat().resolvedOptions().timeZone, // Set this to the appropriate time zone + fetchSize: 10000, // number of rows that will be fetched from the database at a time when executing a query }; ``` diff --git a/cdsp/information-layer/handlers/iotdb/config/Database.js b/cdsp/information-layer/handlers/iotdb/config/Database.js new file mode 100644 index 0000000..01d5a88 --- /dev/null +++ b/cdsp/information-layer/handlers/iotdb/config/Database.js @@ -0,0 +1,11 @@ +/* + * Contains the definition of the database name and its identifier endpoint for each catalog. + */ +const Database = Object.freeze({ + VSS: { + database_name: "root.Vehicles", // name of the configured IoTDB for the VSS Database + endpoint_id: "VehicleIdentification_VIN", // endpoint used as element ID + }, +}); + +module.exports = Database; diff --git a/cdsp/information-layer/handlers/iotdb/config/MeasurementsType.js b/cdsp/information-layer/handlers/iotdb/config/MeasurementsType.js index 1392f2e..bc991b9 100644 --- a/cdsp/information-layer/handlers/iotdb/config/MeasurementsType.js +++ b/cdsp/information-layer/handlers/iotdb/config/MeasurementsType.js @@ -1,8 +1,12 @@ const JSDataType = require("../utils/IoTDBConstants"); +/* + * Define the supported endpoints and the corresponding data types. + */ const MeasurementType = Object.freeze({ - VIN: JSDataType.TEXT, - Vehicle_Cabin_HVAC_AmbientAirTemperature: JSDataType.FLOAT, + VehicleIdentification_VIN: JSDataType.TEXT, + CurrentLocation_Latitude: JSDataType.DOUBLE, + CurrentLocation_Longitude: JSDataType.DOUBLE, }); module.exports = MeasurementType; diff --git a/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js b/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js index 2fb07c0..46f0a93 100644 --- a/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js +++ b/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js @@ -12,11 +12,95 @@ const config = require("../config/config"); const SessionDataSet = require("../utils/SessionDataSet"); const { IoTDBDataInterpreter } = require("../utils/IoTDBDataInterpreter"); const MeasurementType = require("../config/MeasurementsType"); +const Database = require("../config/Database"); const sendMessageToClient = (ws, message) => { ws.send(JSON.stringify(message)); }; +/** + * Extracts endpoint names from the given message. + * + * This function checks if the message has a single node or multiple nodes and + * extracts the names accordingly. + * + * @param {Object} message - The message containing node(s). + * @returns {Array} An array of endpoint names. + */ +function extractEndpointsFromNodes(message) { + let endpoints = []; + if (message.node) { + endpoints.push(message.node.name); + } else if (message.nodes) { + endpoints = message.nodes.map((node) => node.name); + } + return endpoints; +} + +/** + * Creates an object to insert data in IoTDB based on the provided message. + * + * @param {Object} message - The message containing data to be inserted. + * @returns {Object} The data object to be inserted. + */ +function createObjectToInsert(message) { + const data = { VehicleIdentification_VIN: message.id }; + if (message.node) { + data[message.node.name] = message.node.value; + } else if (message.nodes) { + message.nodes.forEach((node) => { + data[node.name] = node.value; + }); + } + return data; +} + +/** + * Creates an update message object based on the provided message and response nodes. + * + * @param {Object} message - The original message object containing tree, id, and uuid properties. + * @param {Array} responseNodes - An array of response nodes to be included in the update message. + * @returns {Object} The constructed update message object. + */ +function createUpdateMessage(message, responseNodes) { + let updateMessage = { + type: "update", + tree: message.tree, + id: message.id, + dateTime: new Date().toISOString(), + uuid: message.uuid, + }; + if (responseNodes.length == 1) { + updateMessage["node"] = responseNodes[0]; + } else { + updateMessage["nodes"] = responseNodes; + } + return updateMessage; +} + +/** + * Creates a read message object based on the provided message and nodes names. + * + * @param {Object} message - The message object containing tree, id, and uuid properties. + * @param {Array} nodeNames - An array of node names. If the array contains one field, it will be added as 'node'. + * If the array contains multiple fields, they will be added as 'nodes'. + * @returns {Object} The constructed read message object. + */ +function createReadMessage(message, nodeNames) { + let readMessage = { + type: "read", + tree: message.tree, + id: message.id, + uuid: message.uuid, + }; + if (nodeNames.length == 1) { + readMessage["node"] = nodeNames[0]; + } else { + readMessage["nodes"] = nodeNames; + } + return readMessage; +} + class IoTDBHandler extends Handler { constructor() { super(); @@ -56,48 +140,19 @@ class IoTDBHandler extends Handler { } async read(message, ws) { - const objectId = message.data.VIN; - const sql = `SELECT * FROM root.Vehicles WHERE root.Vehicles.VIN = '${objectId}'`; try { - await this.openSession(); - const sessionDataSet = await this.#executeQueryStatement(sql); - - // Check if the response contains data - if (sessionDataSet == {}) { - console.log("No data found in query response."); - sendMessageToClient( - ws, - JSON.stringify({ error: "No data found in query response." }) - ); - } else { - let mediaElements = []; - while (sessionDataSet.hasNext()) { - const mediaElement = sessionDataSet.next(); - mediaElements.push(mediaElement); - } - if (mediaElements.length > 0) { - for (let i = 0; i < mediaElements.length; ++i) { - const transformedObject = - IoTDBDataInterpreter.extractDeviceIdFromTimeseries( - mediaElements[i] - ); - const response = { - type: "read_response", - data: transformedObject, - }; - sendMessageToClient(ws, JSON.stringify(response)); - } - } else { - sendMessageToClient( - ws, - JSON.stringify({ error: "Object not found." }) - ); - } - } + await this.#openSessionIfNeeded(); + const responseMessage = await this.#queryLastFields(message, ws); + console.log(responseMessage); + sendMessageToClient(ws, JSON.stringify(responseMessage)); } catch (error) { console.error("Failed to read data from IoTDB: ", error); + sendMessageToClient( + ws, + JSON.stringify({ error: "Error reading object" }) + ); } finally { - this.closeSession(); + this.#closeSessionIfNeeded(); } } @@ -105,15 +160,30 @@ class IoTDBHandler extends Handler { let measurements = []; let dataTypes = []; let values = []; + try { - await this.openSession(); - Object.entries(message.data).forEach(async ([key, value]) => { + await this.#openSessionIfNeeded(); + const data = createObjectToInsert(message); + const errorUndefinedTypes = []; + + for (const [key, value] of Object.entries(data)) { + const dataType = MeasurementType[key]; + if (dataType == undefined) { + errorUndefinedTypes.push(`The endpoint "${key}" is not supported`); + continue; + } measurements.push(key); dataTypes.push(MeasurementType[key]); values.push(value); - }); - let deviceId = "root.Vehicles"; + } + + if (errorUndefinedTypes.length > 0) { + errorUndefinedTypes.forEach((error) => console.error(error)); + throw new Error("One or more endpoints are not supported."); + } + const timestamp = new Date().getTime(); + const deviceId = Database[message.tree].database_name; const status = await this.#insertRecord( deviceId, timestamp, @@ -122,24 +192,40 @@ class IoTDBHandler extends Handler { values ); - const response = `insert one record to device ${deviceId}, message: ${status.message}`; - console.log(response); - sendMessageToClient(ws, response); + const response = `insert one record to device ${deviceId}, status: `; + console.log(response, status); + + let keyList = []; + measurements.forEach((key) => { + keyList.push({ name: key }); + }); + + const readMessage = createReadMessage(message, keyList); + console.log(readMessage); + + const responseMessage = await this.#queryLastFields(message, ws); + console.log(responseMessage); + this.sendMessageToClients(responseMessage); } catch (error) { console.error("Failed to write data from IoTDB: ", error); + sendMessageToClient( + ws, + JSON.stringify({ error: "Error writing object" }) + ); } finally { - this.closeSession(); + this.#closeSessionIfNeeded(); } } /** * Opens a session with the IoTDB server using the provided credentials and configuration. */ - async openSession() { + async #openSession() { if (!this.isSessionClosed) { console.info("The session is already opened."); return; } + const openSessionReq = new TSOpenSessionReq({ username: config.iotdbUser, password: config.iotdbPassword, @@ -173,11 +259,10 @@ class IoTDBHandler extends Handler { } } - isSessionOpen() { - return !this.isSessionClosed; - } - - closeSession() { + /** + * Closes the current session if it is not already closed. + */ + #closeSession() { if (this.isSessionClosed) { console.info("Session is already closed."); return; @@ -192,7 +277,7 @@ class IoTDBHandler extends Handler { } catch (error) { console.error( "Error occurs when closing session at server. Maybe server is down. Error message: ", - err + error ); } finally { this.isSessionClosed = true; @@ -200,6 +285,18 @@ class IoTDBHandler extends Handler { } } + async #openSessionIfNeeded() { + if (this.isSessionClosed) { + await this.#openSession(); + } + } + + async #closeSessionIfNeeded() { + if (!this.isSessionClosed) { + this.#closeSession(); + } + } + /** * Executes a SQL query statement asynchronously. * @@ -284,6 +381,64 @@ class IoTDBHandler extends Handler { }); return await this.client.insertRecord(request); } + + /** + * Queries the last inserted fields from the database based on the provided message and sends the result back. + * + * @param {Object} message - The message object containing the query parameters. + * @param {WebSocket} ws - The WebSocket connection to send the response back to the client. + * @returns {Promise} - A promise that resolves when the query is complete and the response is sent. + * @throws {Error} - Throws an error if the query execution fails. + */ + async #queryLastFields(message, ws) { + const objectId = message.id; + const databaseName = Database[message.tree].database_name; + const endpointId = Database[message.tree].endpoint_id; + const fieldsToSearch = extractEndpointsFromNodes(message).join(", "); + const sql = `SELECT ${fieldsToSearch} FROM ${databaseName} WHERE ${endpointId} = '${objectId}' ORDER BY Time DESC LIMIT 1`; + + try { + const sessionDataSet = await this.#executeQueryStatement(sql); + + // Check if the response contains data + if (sessionDataSet == {}) { + console.log("No data found in query response."); + sendMessageToClient( + ws, + JSON.stringify({ error: "No data found in query response." }) + ); + } else { + let mediaElements = []; + while (sessionDataSet.hasNext()) { + const mediaElement = sessionDataSet.next(); + mediaElements.push(mediaElement); + } + + let responseNodes = []; + + if (mediaElements.length > 0) { + for (let i = 0; i < mediaElements.length; ++i) { + const transformedObject = + IoTDBDataInterpreter.extractDeviceIdFromTimeseries( + mediaElements[i] + ); + const entries = Object.entries(transformedObject); + entries.forEach(([key, value]) => { + responseNodes.push({ name: key, value: value }); + }); + } + return createUpdateMessage(message, responseNodes); + } else { + sendMessageToClient( + ws, + JSON.stringify({ error: "Object not found." }) + ); + } + } + } catch (error) { + throw new Error(error); + } + } } module.exports = IoTDBHandler; diff --git a/cdsp/information-layer/handlers/realmdb/README.md b/cdsp/information-layer/handlers/realmdb/README.md index 0166ebf..e23a4bb 100644 --- a/cdsp/information-layer/handlers/realmdb/README.md +++ b/cdsp/information-layer/handlers/realmdb/README.md @@ -37,34 +37,4 @@ module.exports = { ## Starting the RealmDB handler -You do not need to start RealmDB Handler manually. It is started by the DB-Router like described [here](../../router/README.md#Run). - -## Usage - -The examples use the VIN (Vehicle Identification Number) `1234567` as object identifier. - -### Reading Data - -To read data from the Realm database, send a message with the type of request and object ID: - -```json -{ - "type": "read", - "data": { - "Vin": 1234567 - } -} -``` - -### Subscribing to Changes - -To subscribe to changes in a specific object, send a message with the type of request and object ID: - -```json -{ - "type": "subscribe", - "data": { - "Vin": 1234567 - } -} -``` +You do not need to start RealmDB Handler manually. It is started by the DB-Router like described [here](../../router/README.md#Run). \ No newline at end of file diff --git a/cdsp/information-layer/handlers/realmdb/config/Database.js b/cdsp/information-layer/handlers/realmdb/config/Database.js new file mode 100644 index 0000000..264411c --- /dev/null +++ b/cdsp/information-layer/handlers/realmdb/config/Database.js @@ -0,0 +1,11 @@ +/* + * Contains the definition of the database name and its identifier endpoint for each catalog. + */ +const Database = Object.freeze({ + VSS: { + database_name: "Vehicles", // name of the configured RealmDB for the VSS Database + endpoint_id: "VehicleIdentification_VIN", // endpoint used as element ID + }, +}); + +module.exports = Database; diff --git a/cdsp/information-layer/handlers/realmdb/config/RealmConfiguration.js b/cdsp/information-layer/handlers/realmdb/config/RealmConfiguration.js new file mode 100644 index 0000000..8c6b61e --- /dev/null +++ b/cdsp/information-layer/handlers/realmdb/config/RealmConfiguration.js @@ -0,0 +1,32 @@ +const Database = require("./Database"); + +const MediaElementSchema = { + primaryKey: "_id", + name: Database.VSS.database_name, + properties: { + _id: "string", + VehicleIdentification_VIN: "string", + CurrentLocation_Latitude: "double", + CurrentLocation_Longitude: "double", + }, +}; + +/** + * Generates a configuration object for a Realm database. + * + * @param {object} user - The user object from the authentication. + * @returns {object} The configuration object for the Realm database. + */ +const realmConfig = (user) => ({ + schema: [MediaElementSchema], + path: "myrealm12.realm", + sync: { + user: user, + flexible: true, + error: (error) => { + console.error("Realm sync error:", error); + }, + }, +}); + +module.exports = realmConfig; diff --git a/cdsp/information-layer/handlers/realmdb/src/realmdb-handler.js b/cdsp/information-layer/handlers/realmdb/src/realmdb-handler.js index e67b295..0548ab8 100644 --- a/cdsp/information-layer/handlers/realmdb/src/realmdb-handler.js +++ b/cdsp/information-layer/handlers/realmdb/src/realmdb-handler.js @@ -1,36 +1,75 @@ const Realm = require("realm"); const Handler = require("../../handler"); const config = require("../config/config"); -const { v4: uuidv4 } = require("uuid"); // Importing UUID generator - -const MediaElementSchema = { - primaryKey: "_id", - name: "Vehicles", - properties: { - _id: "int", - Vehicle_Cabin_HVAC_AmbientAirTemperature: "double", - }, -}; +const Database = require("../config/Database"); +const realmConfig = require("../config/RealmConfiguration"); const app = new Realm.App({ id: config.realmAppId }); const credentials = Realm.Credentials.apiKey(config.realmApiKey); -const realmConfig = { - schema: [MediaElementSchema], - path: "myrealm12.realm", - sync: { - user: null, // will be assigned after authentication - flexible: true, - error: (error) => { - console.error("Realm sync error:", error); - }, - }, -}; - const sendMessageToClient = (ws, message) => { ws.send(JSON.stringify(message)); }; +/** + * Creates the update message header object with the required information. + * + * @param {Object} messageHeader - The original message header object. + * @returns {Object} The updated message header object. + */ +const UpdateMessageHeader = (messageHeader) => ({ + type: "update", + tree: messageHeader.tree, + id: messageHeader.id, + dateTime: new Date().toISOString(), + uuid: messageHeader.uuid, +}); + +/** + * Parses the response from a read event. + * + * @param {Object} message - The message object containing node or nodes information. + * @param {Object} queryResponseObj - The query response object containing values to be mapped. + * @returns {Object} - A data object with keys from the message nodes and values from the query response. + */ +function parseReadResponse(message, queryResponseObj) { + const data = []; + if (message.node) { + const prop = message.node.name; + data.push({ + name: prop, + value: queryResponseObj[prop], + }); + } else if (message.nodes) { + message.nodes.forEach((node) => { + const prop = node.name; + data.push({ + name: prop, + value: queryResponseObj[prop], + }); + }); + } + return data; +} + +/** + * Parses the response from a media element change event. + * + * @param {Object} changes - The object containing the changed properties. + * @param {Object} MediaElement - The media element object with updated properties. + * @returns {Array} An array of objects, each containing the name and value of a changed property. + */ +function parseOnMediaElementChangeResponse(changes, MediaElement) { + const data = []; + changes.changedProperties.forEach((prop) => { + data.push({ + name: prop, + value: MediaElement[prop], + }); + }); + return data; +} + class RealmDBHandler extends Handler { constructor() { super(); @@ -44,18 +83,18 @@ class RealmDBHandler extends Handler { const user = await app.logIn(credentials); console.log("Successfully authenticated with Realm"); - realmConfig.sync.user = user; - this.realm = await Realm.open(realmConfig); + const realmConfigObj = realmConfig(user); + this.realm = await Realm.open(realmConfigObj); console.log("Realm connection established successfully"); - const MediaElements = this.realm.objects("Vehicles").subscribe(); // TODO: Is it necessary to log this, extra function? - if (MediaElements) { - console.log(MediaElements); - } else { - this.sendMessageToClients({ - error: "Vehicles collection not found for subscription", - }); - } + // const MediaElements = await this.realm.objects("Vehicles").subscribe(); // TODO: Is it necessary to log this, extra function? + // if (MediaElements) { + // console.log(MediaElements); + // } else { + // this.sendMessageToClients({ + // error: "Vehicles collection not found for subscription", + // }); + // } } catch (error) { console.error("Failed to authenticate with Realm:", error); } @@ -63,17 +102,25 @@ class RealmDBHandler extends Handler { async read(message, ws) { try { - const objectId = message.data.Vin; - const MediaElement = this.realm.objectForPrimaryKey("Vehicles", objectId); - if (MediaElement) { - const response = { - type: "read_response", - data: MediaElement, - }; - sendMessageToClient(ws, JSON.stringify(response)); + const idValue = message.id; + const databaseName = Database[message.tree].database_name; + const idEndpoint = Database[message.tree].endpoint_id; + const mediaElement = await this.#getMediaElement( + databaseName, + idEndpoint, + idValue, + ws + ); + const responseNodes = parseReadResponse(message, mediaElement); + let updateMessage = UpdateMessageHeader(message); + if (responseNodes.length == 1) { + updateMessage["node"] = responseNodes[0]; } else { - sendMessageToClient(ws, JSON.stringify({ error: "Object not found" })); + updateMessage["nodes"] = responseNodes; } + + console.log(updateMessage); + sendMessageToClient(ws, JSON.stringify(updateMessage)); } catch (error) { console.error("Error reading object from Realm:", error); sendMessageToClient( @@ -85,22 +132,49 @@ class RealmDBHandler extends Handler { async subscribe(message, ws) { try { - const objectId = message.data.Vin; - console.log(`Subscribing element: ${objectId}`); - const MediaElement = await this.realm.objectForPrimaryKey( - "Vehicles", - objectId + const idValue = message.id; + const databaseName = Database[message.tree].database_name; + const idEndpoint = Database[message.tree].endpoint_id; + const MediaElement = await this.#getMediaElement( + databaseName, + idEndpoint, + idValue, + ws ); if (MediaElement) { - const websocketId = String(objectId); - MediaElement.addListener((MediaElement, changes) => - this.onMediaElementChange(MediaElement, changes, websocketId) + const objectId = MediaElement._id; + + console.log( + `Subscribing element: Object ID: ${objectId} with ${idEndpoint}: '${idValue}' on ${databaseName}` + ); + const MediaElementToSubscribe = await this.realm.objectForPrimaryKey( + databaseName, + objectId ); - sendMessageToClient(ws, { - success: `Subscribed to changes for object ID ${objectId}`, - }); + + if (MediaElementToSubscribe) { + MediaElementToSubscribe.addListener( + (MediaElementToSubscribe, changes) => + this.#onMediaElementChange(MediaElementToSubscribe, changes, { + id: idValue, + tree: message.tree, + uuid: message.uuid, + }) + ); + console.log(`Subscribed to changes for Object ID: ${objectId}`); + sendMessageToClient(ws, { + success: `Subscribed to changes for Object ID: ${objectId}`, + }); + } else { + console.log(`Object could not be subscribed`); + sendMessageToClient( + ws, + JSON.stringify({ error: "Object could not be subscribed" }) + ); + } } else { + console.log(`Object not found`); sendMessageToClient(ws, JSON.stringify({ error: "Object not found" })); } } catch (error) { @@ -109,31 +183,53 @@ class RealmDBHandler extends Handler { } } - onMediaElementChange(MediaElement, changes, websocketId) { + /** + * Asynchronously retrieves a media element from a Realm database based on the provided criteria. + * @param {string} databaseName - The name of the Realm database to query. + * @param {string} idEndpoint - The field in the database to filter on. + * @param {string} idValue - The value to match in the specified field. + * @param {WebSocket} ws - The WebSocket connection to send messages to the client. + * @returns {Promise} A Promise that resolves to the retrieved media element or rejects with an error. + */ + async #getMediaElement(databaseName, idEndpoint, idValue, ws) { + try { + return await this.realm + .objects(databaseName) + .filtered(`${idEndpoint} = '${idValue}'`)[0]; + } catch (error) { + console.error("Error reading object from Realm:", error); + sendMessageToClient( + ws, + JSON.stringify({ error: "Error reading object" }) + ); + } + } + + /** + * Handles changes to a media element and sends update messages to clients. + * @param {MediaElement} MediaElement - The media element that has changed. + * @param {object} changes - An object containing information about the changes. + * @param {MessageHeader} MessageHeader - The header information for the message. + */ + #onMediaElementChange(MediaElement, changes, MessageHeader) { if (changes.deleted) { console.log(`MediaElement is deleted: ${changes.deleted}`); } else { - changes.changedProperties.forEach((prop) => { - console.log( - `* the value of "${prop}" changed to ${MediaElement[prop]}` + if (changes.changedProperties.length > 0) { + const responseNodes = parseOnMediaElementChangeResponse( + changes, + MediaElement ); + let updateMessage = UpdateMessageHeader(MessageHeader); + if (responseNodes.length == 1) { + updateMessage["node"] = responseNodes[0]; + } else { + updateMessage["nodes"] = responseNodes; + } - // Generate a meaningful UUID for WebSocket response - const uuid = uuidv4(); - - const message = { - type: "update", - tree: "VSS", - id: websocketId, // Use the WebSocket server ID - uuid: uuid, // Use generated UUID - dateTime: new Date().toISOString(), - node: { - name: prop, // Sending the property name as node name - value: MediaElement[prop], // Sending the property value as node value - }, - }; - this.sendMessageToClients(message); - }); + console.log(updateMessage); + this.sendMessageToClients(JSON.stringify(updateMessage)); + } } } } diff --git a/cdsp/information-layer/router/README.md b/cdsp/information-layer/router/README.md index deb0030..554d403 100644 --- a/cdsp/information-layer/router/README.md +++ b/cdsp/information-layer/router/README.md @@ -9,7 +9,6 @@ Execute in this directory: ```bash npm install -npm install dotenv ``` # Run diff --git a/cdsp/information-layer/router/package.json b/cdsp/information-layer/router/package.json index 51da3e1..4bef0ba 100644 --- a/cdsp/information-layer/router/package.json +++ b/cdsp/information-layer/router/package.json @@ -7,6 +7,7 @@ "start": "node websocket-server.js" }, "dependencies": { + "ajv": "^8.17.1", "dotenv": "^16.4.5", "ws": "^7.4.6" } diff --git a/cdsp/information-layer/router/src/websocket-server.js b/cdsp/information-layer/router/src/websocket-server.js index d7ed319..6a4b3d4 100644 --- a/cdsp/information-layer/router/src/websocket-server.js +++ b/cdsp/information-layer/router/src/websocket-server.js @@ -31,10 +31,15 @@ server.on("connection", (ws) => { ws.on("message", (message) => { console.log(`Message received: ${message}`); const validatedMessage = validateMessage(message); - if (validatedMessage) { - handler.handleMessage(validatedMessage, ws); + if (validatedMessage instanceof Error) { + console.error(`Invalid message format: ${validatedMessage.message}`); + ws.send( + JSON.stringify({ + error: `Invalid message format`, + }) + ); } else { - ws.send(JSON.stringify({ error: "Invalid message format" })); + handler.handleMessage(validatedMessage, ws); } }); diff --git a/cdsp/information-layer/router/utils/message-validator.js b/cdsp/information-layer/router/utils/message-validator.js index 93d655c..ca7f1d8 100644 --- a/cdsp/information-layer/router/utils/message-validator.js +++ b/cdsp/information-layer/router/utils/message-validator.js @@ -1,14 +1,134 @@ +const Ajv = require("ajv"); +const ajv = new Ajv({ + allErrors: true, + strict: true, + allowUnionTypes: true, +}); + +const itemsHeader = ["type", "tree", "id", "uuid"]; + +const createCommonStructure = (requestType) => ({ + type: { type: "string", enum: [requestType] }, + tree: { type: "string", enum: ["VSS"] }, + id: { type: "string" }, + uuid: { type: "string" }, +}); + +const schemas = { + read: { + type: "object", + properties: { + ...createCommonStructure("read"), + node: { + type: "object", + properties: { + name: { type: "string" }, + }, + required: ["name"], + additionalProperties: false, + }, + }, + required: itemsHeader.concat("node"), + additionalProperties: false, + }, + multiNodeRead: { + type: "object", + properties: { + ...createCommonStructure("read"), + nodes: { + type: "array", + items: { + type: "object", + properties: { + name: { type: "string" }, + }, + required: ["name"], + additionalProperties: false, + }, + }, + }, + required: itemsHeader.concat("nodes"), + additionalProperties: false, + }, + write: { + type: "object", + properties: { + ...createCommonStructure("write"), + node: { + type: "object", + properties: { + name: { type: "string" }, + value: { type: ["number", "string", "boolean"] }, + }, + required: ["name", "value"], + additionalProperties: false, + }, + }, + required: itemsHeader.concat("node"), + additionalProperties: false, + }, + multiNodeWrite: { + type: "object", + properties: { + ...createCommonStructure("write"), + nodes: { + type: "array", + items: { + type: "object", + properties: { + name: { type: "string" }, + value: { type: ["number", "string", "boolean"] }, + }, + required: ["name", "value"], + additionalProperties: false, + }, + }, + }, + required: itemsHeader.concat("nodes"), + additionalProperties: false, + }, + subscribe: { + type: "object", + properties: { + ...createCommonStructure("subscribe"), + }, + required: itemsHeader, + additionalProperties: false, + }, +}; + const validateMessage = (message) => { - try { - const parsedMessage = JSON.parse(message); - // TODO: Implement validation logic here + try { + const parsedMessage = JSON.parse(message); + let schemaKey; + switch (parsedMessage.type) { + case "read": + schemaKey = parsedMessage.nodes ? "multiNodeRead" : "read"; + break; + case "write": + schemaKey = parsedMessage.nodes ? "multiNodeWrite" : "write"; + break; + case "subscribe": + schemaKey = "subscribe"; + break; + default: + throw new Error(ajv.errorsText(validate.errors)); + } + + const schema = schemas[schemaKey]; + const validate = ajv.compile(schema); + const valid = validate(parsedMessage); + + if (valid) { return parsedMessage; - } catch (error) { - return null; + } else { + throw new Error(ajv.errorsText(validate.errors)); } - }; - - module.exports = { - validateMessage, - }; - \ No newline at end of file + } catch (error) { + return new Error(`Invalid JSON message: ${error.message}`); + } +}; + +module.exports = { + validateMessage, +}; From 62e8402cd6d760cb1c415adf7613c105a0bd88ca Mon Sep 17 00:00:00 2001 From: Sebastian Schleemilch Date: Fri, 9 Aug 2024 14:09:52 +0200 Subject: [PATCH 19/48] Extend supported data points in RealmDB Handler Signed-off-by: Sebastian Schleemilch --- cdsp/information-layer/README.md | 53 ++++++++++--------- .../handlers/realmdb/config/Database.js | 2 +- .../realmdb/config/RealmConfiguration.js | 11 ++-- cdsp/information-layer/router/src/.env | 2 +- 4 files changed, 39 insertions(+), 29 deletions(-) diff --git a/cdsp/information-layer/README.md b/cdsp/information-layer/README.md index bdeca09..7bec28d 100644 --- a/cdsp/information-layer/README.md +++ b/cdsp/information-layer/README.md @@ -21,14 +21,19 @@ The Hello World example in our case is quite simple. We feed an updated value fo ## Choose and prepare your Database ### Realm -- Ensure that in your [ATLAS cloud](https://cloud.mongodb.com/) app there is a vehicle *document* with an `VehicleIdentification_VIN: SMT905JN26J262542` in a collection named *`Vehicles`*. +- Ensure that in your [ATLAS cloud](https://cloud.mongodb.com/) app there is a vehicle *document* with an `Vehicle_VehicleIdentification_VIN` in a collection named *`Vehicles`*. - Ensure that this document as well contains VSS data. Here you can see the supported data in a vehicle document within the *Vehicles* should look like in ATLAS: ``` - _id: "" (string) - VehicleIdentification_VIN: "" (string) - CurrentLocation_Latitude: (Int64) - CurrentLocation_Longitude: (Int64) + _id: "" (String) + Vehicle_Chassis_SteeringWheel_Angle: (Int32) + Vehicle_CurrentLocation_Latitude: (Double) + Vehicle_CurrentLocation_Longitude: (Double) + Vehicle_Powertrain_TractionBattery_NominalVoltage: (Int32) + Vehicle_Powertrain_TractionBattery_StateOfCharge_CurrentEnergy: (Double) + Vehicle_Powertrain_Transmission_CurrentGear: (Int32) + Vehicle_Speed: (Double) + Vehicle_VehicleIdentification_VIN: "" (String) ``` ### IoTDB @@ -70,9 +75,9 @@ If you the handler is running and you are subscribed to that element, when you c { type: 'update', tree: 'VSS', - id: '', - dateTime: '', - uuid: '', + id: '', + dateTime: '', + uuid: '', node: { name: 'CurrentLocation_Longitude', value: `-157845.68200000003` } } ``` @@ -91,10 +96,10 @@ To read data, send a message with the type of request and VIN as object ID: { "type": "read", "tree": "VSS", - "id": "", - "uuid": "", + "id": "", + "uuid": "", "node": { - "name": "" + "name": "" } } ``` @@ -103,14 +108,14 @@ To read data, send a message with the type of request and VIN as object ID: { "type": "read", "tree": "VSS", - "id": "", - "uuid": "", + "id": "", + "uuid": "", "nodes": [ { - "name": "" + "name": "" }, { - "name": "" + "name": "" } ] } @@ -125,10 +130,10 @@ To write data, send a message with the type of request and VIN as object ID (at { "type": "write", "tree": "VSS", - "id": "", - "uuid": "", + "id": "", + "uuid": "", "node": { - "name": "", + "name": "", "value": "" } } @@ -138,15 +143,15 @@ To write data, send a message with the type of request and VIN as object ID (at { "type": "write", "tree": "VSS", - "id": "", - "uuid": "", + "id": "", + "uuid": "", "nodes": [ { - "name": "", + "name": "", "value": "" }, { - "name": "", + "name": "", "value": "" } ] @@ -160,8 +165,8 @@ To subscribe to changes in a specific object, send a message with the type of re { "type": "subscribe", "tree": "VSS", - "id": "", - "uuid": "", + "id": "", + "uuid": "SOME_UUID", } ``` diff --git a/cdsp/information-layer/handlers/realmdb/config/Database.js b/cdsp/information-layer/handlers/realmdb/config/Database.js index 264411c..8046cdb 100644 --- a/cdsp/information-layer/handlers/realmdb/config/Database.js +++ b/cdsp/information-layer/handlers/realmdb/config/Database.js @@ -4,7 +4,7 @@ const Database = Object.freeze({ VSS: { database_name: "Vehicles", // name of the configured RealmDB for the VSS Database - endpoint_id: "VehicleIdentification_VIN", // endpoint used as element ID + endpoint_id: "Vehicle_VehicleIdentification_VIN", // endpoint used as element ID }, }); diff --git a/cdsp/information-layer/handlers/realmdb/config/RealmConfiguration.js b/cdsp/information-layer/handlers/realmdb/config/RealmConfiguration.js index 8c6b61e..e21c637 100644 --- a/cdsp/information-layer/handlers/realmdb/config/RealmConfiguration.js +++ b/cdsp/information-layer/handlers/realmdb/config/RealmConfiguration.js @@ -5,9 +5,14 @@ const MediaElementSchema = { name: Database.VSS.database_name, properties: { _id: "string", - VehicleIdentification_VIN: "string", - CurrentLocation_Latitude: "double", - CurrentLocation_Longitude: "double", + Vehicle_Chassis_SteeringWheel_Angle: "int", + Vehicle_CurrentLocation_Latitude: "double", + Vehicle_CurrentLocation_Longitude: "double", + Vehicle_Powertrain_TractionBattery_NominalVoltage: "int", + Vehicle_Powertrain_TractionBattery_StateOfCharge_CurrentEnergy: "float", + Vehicle_Powertrain_Transmission_CurrentGear: "int", + Vehicle_Speed: "float", + Vehicle_VehicleIdentification_VIN: "string", }, }; diff --git a/cdsp/information-layer/router/src/.env b/cdsp/information-layer/router/src/.env index bcaf5de..16ac659 100644 --- a/cdsp/information-layer/router/src/.env +++ b/cdsp/information-layer/router/src/.env @@ -1 +1 @@ -HANDLER_TYPE=iotdb \ No newline at end of file +HANDLER_TYPE=realmdb \ No newline at end of file From cd597d1a3f2de81cf3f1a6929ebddd3d9df78208 Mon Sep 17 00:00:00 2001 From: Sebastian Schleemilch Date: Fri, 9 Aug 2024 14:15:14 +0200 Subject: [PATCH 20/48] Support for UseCase endpoits in IoTDB Handler Fix: Remove extra 'dot' from endpoint into update message. Fix unknown function issue Signed-off-by: Sebastian Schleemilch --- cdsp/information-layer/README.md | 22 +-- .../handlers/iotdb/config/Database.js | 8 +- .../handlers/iotdb/config/MeasurementsType.js | 12 -- .../handlers/iotdb/config/endpointsType.js | 18 +++ .../handlers/iotdb/src/iotdb-handler.js | 146 +++++++++--------- .../handlers/iotdb/utils/IoTDBConstants.js | 14 +- .../iotdb/utils/IoTDBDataInterpreter.js | 97 ++++++++---- .../handlers/iotdb/utils/IoTDBRpcDataSets.js | 23 ++- .../handlers/iotdb/utils/SessionDataSet.js | 14 +- 9 files changed, 204 insertions(+), 150 deletions(-) delete mode 100644 cdsp/information-layer/handlers/iotdb/config/MeasurementsType.js create mode 100644 cdsp/information-layer/handlers/iotdb/config/endpointsType.js diff --git a/cdsp/information-layer/README.md b/cdsp/information-layer/README.md index 7bec28d..c9ff22b 100644 --- a/cdsp/information-layer/README.md +++ b/cdsp/information-layer/README.md @@ -51,18 +51,22 @@ The Hello World example in our case is quite simple. We feed an updated value fo It costs 0.004s ``` -- Create two *timeseries* with the `root.Vehicles.VehicleIdentification_VIN` and some VSS data. Here you can see an example how the vehicle document within the *Vehicles* should look like in IoTDB CLI: +- Create two *timeseries* with the `root.Vehicles.Vehicle_VehicleIdentification_VIN` and some VSS data. Here you can see an example how the vehicle document within the *Vehicles* should look like in IoTDB CLI: ``` IoTDB> show timeseries; - +---------------------------------------+-----+-------------+--------+--------+-----------+----+----------+--------+------------------+--------+ - | Timeseries|Alias| Database|DataType|Encoding|Compression|Tags|Attributes|Deadband|DeadbandParameters|ViewType| - +---------------------------------------+-----+-------------+--------+--------+-----------+----+----------+--------+------------------+--------+ - |root.Vehicles.VehicleIdentification_VIN| null|root.Vehicles| TEXT| PLAIN| LZ4|null| null| null| null| BASE| - | root.Vehicles.CurrentLocation_Latitude| null|root.Vehicles| DOUBLE| RLE| LZ4|null| null| null| null| BASE| - |root.Vehicles.CurrentLocation_Longitude| null|root.Vehicles| DOUBLE| RLE| LZ4|null| null| null| null| BASE| - +---------------------------------------+-----+-------------+--------+--------+-----------+----+----------+--------+------------------+--------+ - ``` + +----------------------------------------------------------------------------+-----+-------------+--------+--------+-----------+----+----------+--------+------------------+--------+ + | Timeseries|Alias| Database|DataType|Encoding|Compression|Tags|Attributes|Deadband|DeadbandParameters|ViewType| + +----------------------------------------------------------------------------+-----+-------------+--------+--------+-----------+----+----------+--------+------------------+--------+ + | root.Vehicles.Vehicle_VehicleIdentification_VIN| null|root.Vehicles| TEXT| PLAIN| LZ4|null| null| null| null| BASE| + | root.Vehicles.Vehicle_CurrentLocation_Latitude| null|root.Vehicles| DOUBLE| RLE| LZ4|null| null| null| null| BASE| + | root.Vehicles.Vehicle_CurrentLocation_Longitude| null|root.Vehicles| DOUBLE| RLE| LZ4|null| null| null| null| BASE| + | root.Vehicles.Vehicle_Speed| null|root.Vehicles| FLOAT| RLE| LZ4|null| null| null| null| BASE| + | root.Vehicles.Vehicle_Chassis_SteeringWheel_Angle| null|root.Vehicles| INT32| RLE| LZ4|null| null| null| null| BASE| + | root.Vehicles.Vehicle_Powertrain_Transmission_CurrentGear| null|root.Vehicles| INT32| RLE| LZ4|null| null| null| null| BASE| + |root.Vehicles.Vehicle_Powertrain_TractionBattery_StateOfCharge_CurrentEnergy| null|root.Vehicles| FLOAT| RLE| LZ4|null| null| null| null| BASE| + | root.Vehicles.Vehicle_Powertrain_TractionBattery_NominalVoltage| null|root.Vehicles| INT32| RLE| LZ4|null| null| null| null| BASE| + +----------------------------------------------------------------------------+-----+-------------+--------+--------+-----------+----+----------+--------+------------------+--------+ ## Start the Database Router diff --git a/cdsp/information-layer/handlers/iotdb/config/Database.js b/cdsp/information-layer/handlers/iotdb/config/Database.js index 01d5a88..58bcc59 100644 --- a/cdsp/information-layer/handlers/iotdb/config/Database.js +++ b/cdsp/information-layer/handlers/iotdb/config/Database.js @@ -1,11 +1,11 @@ /* * Contains the definition of the database name and its identifier endpoint for each catalog. */ -const Database = Object.freeze({ +const database = Object.freeze({ VSS: { - database_name: "root.Vehicles", // name of the configured IoTDB for the VSS Database - endpoint_id: "VehicleIdentification_VIN", // endpoint used as element ID + database_name: "root.Vehicles", // name of the configured IoTDB for the VSS database + endpoint_id: "Vehicle_VehicleIdentification_VIN", // endpoint used as element ID }, }); -module.exports = Database; +module.exports = database; diff --git a/cdsp/information-layer/handlers/iotdb/config/MeasurementsType.js b/cdsp/information-layer/handlers/iotdb/config/MeasurementsType.js deleted file mode 100644 index bc991b9..0000000 --- a/cdsp/information-layer/handlers/iotdb/config/MeasurementsType.js +++ /dev/null @@ -1,12 +0,0 @@ -const JSDataType = require("../utils/IoTDBConstants"); - -/* - * Define the supported endpoints and the corresponding data types. - */ -const MeasurementType = Object.freeze({ - VehicleIdentification_VIN: JSDataType.TEXT, - CurrentLocation_Latitude: JSDataType.DOUBLE, - CurrentLocation_Longitude: JSDataType.DOUBLE, -}); - -module.exports = MeasurementType; diff --git a/cdsp/information-layer/handlers/iotdb/config/endpointsType.js b/cdsp/information-layer/handlers/iotdb/config/endpointsType.js new file mode 100644 index 0000000..5b10c3b --- /dev/null +++ b/cdsp/information-layer/handlers/iotdb/config/endpointsType.js @@ -0,0 +1,18 @@ +const { MessageDataType } = require("../utils/IoTDBConstants"); + +/* + * Define the supported endpoints and the corresponding data types. + */ +const endpointsType = Object.freeze({ + Vehicle_Chassis_SteeringWheel_Angle: MessageDataType.INT16, + Vehicle_CurrentLocation_Latitude: MessageDataType.DOUBLE, + Vehicle_CurrentLocation_Longitude: MessageDataType.DOUBLE, + Vehicle_Powertrain_TractionBattery_NominalVoltage: MessageDataType.UINT16, + Vehicle_Powertrain_TractionBattery_StateOfCharge_CurrentEnergy: + MessageDataType.FLOAT, + Vehicle_Powertrain_Transmission_CurrentGear: MessageDataType.INT8, + Vehicle_Speed: MessageDataType.FLOAT, + Vehicle_VehicleIdentification_VIN: MessageDataType.STRING, +}); + +module.exports = endpointsType; diff --git a/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js b/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js index 46f0a93..147195a 100644 --- a/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js +++ b/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js @@ -11,32 +11,13 @@ const Handler = require("../../handler"); const config = require("../config/config"); const SessionDataSet = require("../utils/SessionDataSet"); const { IoTDBDataInterpreter } = require("../utils/IoTDBDataInterpreter"); -const MeasurementType = require("../config/MeasurementsType"); -const Database = require("../config/Database"); +const endpointsType = require("../config/endpointsType"); +const database = require("../config/database"); const sendMessageToClient = (ws, message) => { ws.send(JSON.stringify(message)); }; -/** - * Extracts endpoint names from the given message. - * - * This function checks if the message has a single node or multiple nodes and - * extracts the names accordingly. - * - * @param {Object} message - The message containing node(s). - * @returns {Array} An array of endpoint names. - */ -function extractEndpointsFromNodes(message) { - let endpoints = []; - if (message.node) { - endpoints.push(message.node.name); - } else if (message.nodes) { - endpoints = message.nodes.map((node) => node.name); - } - return endpoints; -} - /** * Creates an object to insert data in IoTDB based on the provided message. * @@ -44,12 +25,16 @@ function extractEndpointsFromNodes(message) { * @returns {Object} The data object to be inserted. */ function createObjectToInsert(message) { - const data = { VehicleIdentification_VIN: message.id }; + const { id, tree } = message; + const data = { [database[tree].endpoint_id]: id }; if (message.node) { - data[message.node.name] = message.node.value; + data[ + IoTDBDataInterpreter.transformEndpointFromMessageNode(message.node.name) + ] = message.node.value; } else if (message.nodes) { message.nodes.forEach((node) => { - data[node.name] = node.value; + data[IoTDBDataInterpreter.transformEndpointFromMessageNode(node.name)] = + node.value; }); } return data; @@ -63,12 +48,13 @@ function createObjectToInsert(message) { * @returns {Object} The constructed update message object. */ function createUpdateMessage(message, responseNodes) { + const { id, tree, uuid } = message; let updateMessage = { type: "update", - tree: message.tree, - id: message.id, + tree: tree, + id: id, dateTime: new Date().toISOString(), - uuid: message.uuid, + uuid: uuid, }; if (responseNodes.length == 1) { updateMessage["node"] = responseNodes[0]; @@ -87,11 +73,12 @@ function createUpdateMessage(message, responseNodes) { * @returns {Object} The constructed read message object. */ function createReadMessage(message, nodeNames) { + const { id, tree, uuid } = message; let readMessage = { type: "read", - tree: message.tree, - id: message.id, - uuid: message.uuid, + tree: tree, + id: id, + uuid: uuid, }; if (nodeNames.length == 1) { readMessage["node"] = nodeNames[0]; @@ -142,9 +129,7 @@ class IoTDBHandler extends Handler { async read(message, ws) { try { await this.#openSessionIfNeeded(); - const responseMessage = await this.#queryLastFields(message, ws); - console.log(responseMessage); - sendMessageToClient(ws, JSON.stringify(responseMessage)); + await this.#queryLastFields(message, ws); } catch (error) { console.error("Failed to read data from IoTDB: ", error); sendMessageToClient( @@ -167,13 +152,13 @@ class IoTDBHandler extends Handler { const errorUndefinedTypes = []; for (const [key, value] of Object.entries(data)) { - const dataType = MeasurementType[key]; + const dataType = endpointsType[key]; if (dataType == undefined) { errorUndefinedTypes.push(`The endpoint "${key}" is not supported`); continue; } measurements.push(key); - dataTypes.push(MeasurementType[key]); + dataTypes.push(dataType); values.push(value); } @@ -183,7 +168,7 @@ class IoTDBHandler extends Handler { } const timestamp = new Date().getTime(); - const deviceId = Database[message.tree].database_name; + const deviceId = database[message.tree].database_name; const status = await this.#insertRecord( deviceId, timestamp, @@ -203,9 +188,7 @@ class IoTDBHandler extends Handler { const readMessage = createReadMessage(message, keyList); console.log(readMessage); - const responseMessage = await this.#queryLastFields(message, ws); - console.log(responseMessage); - this.sendMessageToClients(responseMessage); + await this.#queryLastFields(message, ws); } catch (error) { console.error("Failed to write data from IoTDB: ", error); sendMessageToClient( @@ -320,7 +303,6 @@ class IoTDBHandler extends Handler { }); const resp = await this.client.executeQueryStatement(request); - if (!resp || !resp.queryDataSet || !resp.queryDataSet.valueList) { return {}; } else { @@ -383,52 +365,62 @@ class IoTDBHandler extends Handler { } /** - * Queries the last inserted fields from the database based on the provided message and sends the result back. + * Queries the last fields from the database based on the provided message and sends the response to the client. * - * @param {Object} message - The message object containing the query parameters. - * @param {WebSocket} ws - The WebSocket connection to send the response back to the client. - * @returns {Promise} - A promise that resolves when the query is complete and the response is sent. - * @throws {Error} - Throws an error if the query execution fails. + * @param {Object} message - The message object containing the query details. + * @param {WebSocket} ws - The WebSocket connection to send the response to. + * @private */ async #queryLastFields(message, ws) { - const objectId = message.id; - const databaseName = Database[message.tree].database_name; - const endpointId = Database[message.tree].endpoint_id; - const fieldsToSearch = extractEndpointsFromNodes(message).join(", "); - const sql = `SELECT ${fieldsToSearch} FROM ${databaseName} WHERE ${endpointId} = '${objectId}' ORDER BY Time DESC LIMIT 1`; + const { id: objectId, tree } = message; + const { database_name: databaseName, endpoint_id: endpointId } = + database[tree]; + const fieldsToSearch = + IoTDBDataInterpreter.extractEndpointsFromNodes(message).join(", "); + const sql = `SELECT ${fieldsToSearch} FROM ${databaseName} WHERE ${endpointId} = '${objectId}' ORDER BY Time ASC`; try { const sessionDataSet = await this.#executeQueryStatement(sql); - // Check if the response contains data - if (sessionDataSet == {}) { - console.log("No data found in query response."); - sendMessageToClient( - ws, - JSON.stringify({ error: "No data found in query response." }) - ); + if (Object.keys(sessionDataSet).length === 0) { + throw new Error({ error: "Internal error constructing read object." }); } else { - let mediaElements = []; + const mediaElements = []; while (sessionDataSet.hasNext()) { - const mediaElement = sessionDataSet.next(); - mediaElements.push(mediaElement); + mediaElements.push(sessionDataSet.next()); } - let responseNodes = []; - - if (mediaElements.length > 0) { - for (let i = 0; i < mediaElements.length; ++i) { - const transformedObject = - IoTDBDataInterpreter.extractDeviceIdFromTimeseries( - mediaElements[i] - ); - const entries = Object.entries(transformedObject); - entries.forEach(([key, value]) => { - responseNodes.push({ name: key, value: value }); - }); - } - return createUpdateMessage(message, responseNodes); + console.log("media elements: ", mediaElements); + + let latestValues = {}; + + mediaElements.forEach((mediaElement) => { + const databaseName = database[tree].database_name; + const transformedObject = + IoTDBDataInterpreter.extractNodesFromTimeseries( + mediaElement, + databaseName + ); + Object.entries(transformedObject).forEach(([key, value]) => { + if (value !== null) { + latestValues[key] = value; + } + }); + }); + + const responseNodes = Object.entries(latestValues).map( + ([name, value]) => ({ + name, + value, + }) + ); + + if (responseNodes.length > 0) { + const responseMessage = createUpdateMessage(message, responseNodes); + console.log(responseMessage); + this.sendMessageToClients(responseMessage); } else { + console.log("Object not found."); sendMessageToClient( ws, JSON.stringify({ error: "Object not found." }) @@ -436,7 +428,11 @@ class IoTDBHandler extends Handler { } } } catch (error) { - throw new Error(error); + console.error(error); + sendMessageToClient( + ws, + JSON.stringify({ error: "Internal error constructing read object." }) + ); } } } diff --git a/cdsp/information-layer/handlers/iotdb/utils/IoTDBConstants.js b/cdsp/information-layer/handlers/iotdb/utils/IoTDBConstants.js index ae7073d..8d6048d 100644 --- a/cdsp/information-layer/handlers/iotdb/utils/IoTDBConstants.js +++ b/cdsp/information-layer/handlers/iotdb/utils/IoTDBConstants.js @@ -1,4 +1,4 @@ -const JSDataType = Object.freeze({ +const IoTDBDataType = Object.freeze({ BOOLEAN: 0, INT32: 1, INT64: 2, @@ -7,4 +7,14 @@ const JSDataType = Object.freeze({ TEXT: 5, }); -module.exports = JSDataType; +const MessageDataType = Object.freeze({ + INT8: 0, + INT16: 1, + INT32: 2, + UINT16: 3, + FLOAT: 4, + DOUBLE: 5, + STRING: 6, +}); + +module.exports = { IoTDBDataType, MessageDataType }; diff --git a/cdsp/information-layer/handlers/iotdb/utils/IoTDBDataInterpreter.js b/cdsp/information-layer/handlers/iotdb/utils/IoTDBDataInterpreter.js index bb707ff..0362cca 100644 --- a/cdsp/information-layer/handlers/iotdb/utils/IoTDBDataInterpreter.js +++ b/cdsp/information-layer/handlers/iotdb/utils/IoTDBDataInterpreter.js @@ -1,4 +1,5 @@ -const JSDataType = require("./IoTDBConstants"); +const { IoTDBDataType, MessageDataType } = require("./IoTDBConstants"); +const database = require("../config/database"); class IoTDBDataInterpreter { /** @@ -8,61 +9,66 @@ class IoTDBDataInterpreter { * @returns {Buffer} - Serialized values as a Buffer. */ static serializeValues(dataTypes, values) { - function serializeBoolean(value) { - return [JSDataType.BOOLEAN, value]; - } + // this type is not supported by now, see: cdsp/information-layer/handlers/iotdb/utils/IoTDBConstants.js + // function serializeBoolean(value) { + // return [IoTDBDataType.BOOLEAN, value]; + // } function serializeInt32(value) { const int32 = new Int32Array([value]); const uint8 = new Uint8Array(int32.buffer).reverse(); - return [JSDataType.INT32, ...uint8]; + return [IoTDBDataType.INT32, ...uint8]; } - function serializeInt64(value) { - const bigint64 = new BigInt64Array([value]); - const uint8 = new Uint8Array(bigint64.buffer).reverse(); - return [JSDataType.INT64, ...uint8]; - } + // this type is not supported by now, see: cdsp/information-layer/handlers/iotdb/utils/IoTDBConstants.js + // function serializeInt64(value) { + // const bigint64 = new BigInt64Array([value]); + // const uint8 = new Uint8Array(bigint64.buffer).reverse(); + // return [IoTDBDataType.INT64, ...uint8]; + // } function serializeFloat(value) { const float32 = new Float32Array([value]); const uint8 = new Uint8Array(float32.buffer).reverse(); - return [JSDataType.FLOAT, ...uint8]; + return [IoTDBDataType.FLOAT, ...uint8]; } function serializeDouble(value) { const float64 = new Float64Array([value]); const uint8 = new Uint8Array(float64.buffer).reverse(); - return [JSDataType.DOUBLE, ...uint8]; + return [IoTDBDataType.DOUBLE, ...uint8]; } function serializeText(value) { const utf8arr = Buffer.from(value); const int32 = new Uint32Array([utf8arr.length]); const uint8 = new Uint8Array(int32.buffer).reverse(); - return [JSDataType.TEXT, ...uint8, ...utf8arr]; + return [IoTDBDataType.TEXT, ...uint8, ...utf8arr]; } const serializedValues = []; for (let i = 0; i < dataTypes.length; i++) { switch (dataTypes[i]) { - case JSDataType.BOOLEAN: - serializedValues.push(...serializeBoolean(values[i])); - break; - case JSDataType.INT32: + // case MessageDataType.BOOLEAN: // this type is not supported by now, see: cdsp/information-layer/handlers/iotdb/utils/IoTDBConstants.js + // serializedValues.push(...serializeBoolean(values[i])); + // break; + case MessageDataType.INT8: + case MessageDataType.INT16: + case MessageDataType.UINT16: + //case MessageDataType.UINT32: serializedValues.push(...serializeInt32(values[i])); break; - case JSDataType.INT64: - serializedValues.push(...serializeInt64(values[i])); - break; - case JSDataType.FLOAT: + // case MessageDataType.INT64: // this type is not supported by now, see: cdsp/information-layer/handlers/iotdb/utils/IoTDBConstants.js + // serializedValues.push(...serializeInt64(values[i])); + // break; + case MessageDataType.FLOAT: serializedValues.push(...serializeFloat(values[i])); break; - case JSDataType.DOUBLE: + case MessageDataType.DOUBLE: serializedValues.push(...serializeDouble(values[i])); break; - case JSDataType.TEXT: + case MessageDataType.STRING: serializedValues.push(...serializeText(values[i])); break; default: @@ -73,15 +79,16 @@ class IoTDBDataInterpreter { } /** - * Transforms an object by extracting and renaming keys that start with device id 'root.Vehicles.'. + * Extracts and transforms timeseries nodes from the given object with the required message format. * - * @param {Object} obj - The input object to be transformed. - * @returns {Object} - A new object with keys that were prefixed with 'root.Vehicles.' renamed to their last segment. + * @param {Object} obj - The object containing timeseries data. + * @param {string} databaseName - The database name to match and remove from the keys. + * @returns {Object} - A new object with transformed keys and their corresponding values. */ - static extractDeviceIdFromTimeseries(obj) { + static extractNodesFromTimeseries(obj, databaseName) { return Object.entries(obj).reduce((acc, [key, value]) => { - if (key.startsWith("root.Vehicles.")) { - const newKey = key.split(".").pop(); // Get the last part of the key + if (key.startsWith(databaseName)) { + const newKey = key.replace(`${databaseName}.`, "").replace(/_/g, "."); acc[newKey] = value; } return acc; @@ -101,6 +108,38 @@ class IoTDBDataInterpreter { return { timestamp }; } + + /** + * Extracts endpoint names from the given message. + * + * This function checks if the message has a single node or multiple nodes and + * extracts the names accordingly. + * + * @param {Object} message - The message containing node(s). + * @returns {Array} An array of endpoint names. + */ + static extractEndpointsFromNodes(message) { + let endpoints = []; + + if (message.node) { + endpoints.push(this.transformEndpointFromMessageNode(message.node.name)); + } else if (message.nodes) { + endpoints = message.nodes.map((node) => + this.transformEndpointFromMessageNode(node.name) + ); + } + return endpoints; + } + + /** + * Transforms a message node by replacing all dots with underscores. + * + * @param {string} node - The message node to transform. + * @returns {string} - The transformed message node with dots replaced by underscores. + */ + static transformEndpointFromMessageNode(node) { + return `${node}`.replace(/\./g, "_"); + } } module.exports = { IoTDBDataInterpreter }; diff --git a/cdsp/information-layer/handlers/iotdb/utils/IoTDBRpcDataSets.js b/cdsp/information-layer/handlers/iotdb/utils/IoTDBRpcDataSets.js index c58419e..8eda7a3 100644 --- a/cdsp/information-layer/handlers/iotdb/utils/IoTDBRpcDataSets.js +++ b/cdsp/information-layer/handlers/iotdb/utils/IoTDBRpcDataSets.js @@ -1,4 +1,4 @@ -const JSDataType = require("./IoTDBConstants"); +const { IoTDBDataType } = require("./IoTDBConstants"); class IoTDBRpcDataSet { // Static properties static TIMESTAMP_STR = "Time"; @@ -56,7 +56,7 @@ class IoTDBRpcDataSet { if (!ignoreTimestamp) { this.#columnNameList.push(IoTDBRpcDataSet.TIMESTAMP_STR); - this.#columnTypeList.push(JSDataType.INT64); + this.#columnTypeList.push(IoTDBDataType.INT64); this.#columnOrdinalDict.set(IoTDBRpcDataSet.TIMESTAMP_STR, 1); } @@ -68,10 +68,9 @@ class IoTDBRpcDataSet { // Populate column_name_list and column_type_list for (let i = 0; i < columnNameList.length; i++) { - let name = columnNameList[i]; + const name = columnNameList[i]; this.#columnNameList.push(name); - this.#columnTypeList.push(JSDataType[columnTypeList[i]]); - + this.#columnTypeList.push(IoTDBDataType[columnTypeList[i]]); if (!this.#columnOrdinalDict.has(name)) { let index = columnNameIndex[name]; this.#columnOrdinalDict.set( @@ -79,7 +78,7 @@ class IoTDBRpcDataSet { index + IoTDBRpcDataSet.START_INDEX ); this.#columnTypeDeduplicatedList[index] = - JSDataType[columnTypeList[i]]; + IoTDBDataType[columnTypeList[i]]; } } } @@ -217,27 +216,27 @@ class IoTDBRpcDataSet { // Simulating buffer based on data type. switch (dataType) { - case JSDataType.BOOLEAN: + case IoTDBDataType.BOOLEAN: this.#value[i] = valueBuffer.slice(0, 1); this.#queryDataSet.valueList[i] = valueBuffer.slice(1); break; - case JSDataType.INT32: + case IoTDBDataType.INT32: this.#value[i] = valueBuffer.slice(0, 4); this.#queryDataSet.valueList[i] = valueBuffer.slice(4); break; - case JSDataType.INT64: + case IoTDBDataType.INT64: this.#value[i] = valueBuffer.slice(0, 8); this.#queryDataSet.valueList[i] = valueBuffer.slice(8); break; - case JSDataType.FLOAT: + case IoTDBDataType.FLOAT: this.#value[i] = valueBuffer.slice(0, 4); this.#queryDataSet.valueList[i] = valueBuffer.slice(4); break; - case JSDataType.DOUBLE: + case IoTDBDataType.DOUBLE: this.#value[i] = valueBuffer.slice(0, 8); this.#queryDataSet.valueList[i] = valueBuffer.slice(8); break; - case JSDataType.TEXT: + case IoTDBDataType.TEXT: let length = valueBuffer.readInt32BE(0); this.#value[i] = valueBuffer.slice(4, 4 + length); this.#queryDataSet.valueList[i] = valueBuffer.slice(4 + length); diff --git a/cdsp/information-layer/handlers/iotdb/utils/SessionDataSet.js b/cdsp/information-layer/handlers/iotdb/utils/SessionDataSet.js index fbb1dd4..47bb9bc 100644 --- a/cdsp/information-layer/handlers/iotdb/utils/SessionDataSet.js +++ b/cdsp/information-layer/handlers/iotdb/utils/SessionDataSet.js @@ -1,19 +1,19 @@ -const JSDataType = require("./IoTDBConstants"); +const { IoTDBDataType } = require("./IoTDBConstants"); const IoTDBRpcDataSet = require("./IoTDBRpcDataSets"); const { IoTDBDataInterpreter } = require("./IoTDBDataInterpreter"); const dataTypeProcessors = { - [JSDataType.BOOLEAN]: (bytes) => + [IoTDBDataType.BOOLEAN]: (bytes) => new Int8Array(new Uint8Array(bytes.slice(0, 1).reverse()).buffer)[0], - [JSDataType.INT32]: (bytes) => + [IoTDBDataType.INT32]: (bytes) => new Int32Array(new Uint8Array(bytes.slice(0, 4).reverse()).buffer)[0], - [JSDataType.INT64]: (bytes) => + [IoTDBDataType.INT64]: (bytes) => new BigInt64Array(new Uint8Array(bytes.slice(0, 8).reverse()).buffer)[0], - [JSDataType.FLOAT]: (bytes) => + [IoTDBDataType.FLOAT]: (bytes) => new Float32Array(new Uint8Array(bytes.slice(0, 4).reverse()).buffer)[0], - [JSDataType.DOUBLE]: (bytes) => + [IoTDBDataType.DOUBLE]: (bytes) => new Float64Array(new Uint8Array(bytes.slice(0, 8).reverse()).buffer)[0], - [JSDataType.TEXT]: (bytes) => bytes.toString(), + [IoTDBDataType.TEXT]: (bytes) => bytes.toString(), }; class SessionDataSet { From 5f142ab089aec5af558be043932160a6edee2f5f Mon Sep 17 00:00:00 2001 From: Sebastian Schleemilch Date: Tue, 13 Aug 2024 09:01:53 +0200 Subject: [PATCH 21/48] Add write support to realmdb - Update Readme documentation - Add write operation to RealmDB - Repair error writing data and send message to clients correctly - Refactory: rename database parameters file - Refactoring: use variable naming convention - Subscribe Databases Signed-off-by: Sebastian Schleemilch --- cdsp/information-layer/README.md | 16 +- .../handlers/iotdb/config/Database.js | 11 - .../handlers/iotdb/config/databaseParams.js | 11 + .../handlers/iotdb/src/iotdb-handler.js | 125 +++++---- .../iotdb/utils/IoTDBDataInterpreter.js | 2 +- .../handlers/realmdb/config/Database.js | 11 - .../realmdb/config/RealmConfiguration.js | 4 +- .../handlers/realmdb/config/databaseParams.js | 11 + .../handlers/realmdb/src/realmdb-handler.js | 245 +++++++++++------- 9 files changed, 242 insertions(+), 194 deletions(-) delete mode 100644 cdsp/information-layer/handlers/iotdb/config/Database.js create mode 100644 cdsp/information-layer/handlers/iotdb/config/databaseParams.js delete mode 100644 cdsp/information-layer/handlers/realmdb/config/Database.js create mode 100644 cdsp/information-layer/handlers/realmdb/config/databaseParams.js diff --git a/cdsp/information-layer/README.md b/cdsp/information-layer/README.md index c9ff22b..ab7aee2 100644 --- a/cdsp/information-layer/README.md +++ b/cdsp/information-layer/README.md @@ -165,12 +165,12 @@ To write data, send a message with the type of request and VIN as object ID (at To subscribe to changes in a specific object, send a message with the type of request and VIN as object ID (at this moment only with RealmDB available): - ```json - { - "type": "subscribe", - "tree": "VSS", - "id": "", - "uuid": "SOME_UUID", - } - ``` + ```json + { + "type": "subscribe", + "tree": "VSS", + "id": "", + "uuid": "SOME_UUID" + } + ``` diff --git a/cdsp/information-layer/handlers/iotdb/config/Database.js b/cdsp/information-layer/handlers/iotdb/config/Database.js deleted file mode 100644 index 58bcc59..0000000 --- a/cdsp/information-layer/handlers/iotdb/config/Database.js +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Contains the definition of the database name and its identifier endpoint for each catalog. - */ -const database = Object.freeze({ - VSS: { - database_name: "root.Vehicles", // name of the configured IoTDB for the VSS database - endpoint_id: "Vehicle_VehicleIdentification_VIN", // endpoint used as element ID - }, -}); - -module.exports = database; diff --git a/cdsp/information-layer/handlers/iotdb/config/databaseParams.js b/cdsp/information-layer/handlers/iotdb/config/databaseParams.js new file mode 100644 index 0000000..d9ba29b --- /dev/null +++ b/cdsp/information-layer/handlers/iotdb/config/databaseParams.js @@ -0,0 +1,11 @@ +/* + * Contains the definition of the database name and its identifier endpoint for each catalog. + */ +const databaseParams = Object.freeze({ + VSS: { + databaseName: "root.Vehicles", // name of the configured IoTDB for the VSS database + endpointId: "Vehicle_VehicleIdentification_VIN", // endpoint used as element ID + }, +}); + +module.exports = databaseParams; diff --git a/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js b/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js index 147195a..ed5c6bd 100644 --- a/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js +++ b/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js @@ -12,7 +12,7 @@ const config = require("../config/config"); const SessionDataSet = require("../utils/SessionDataSet"); const { IoTDBDataInterpreter } = require("../utils/IoTDBDataInterpreter"); const endpointsType = require("../config/endpointsType"); -const database = require("../config/database"); +const database = require("../config/databaseParams"); const sendMessageToClient = (ws, message) => { ws.send(JSON.stringify(message)); @@ -26,7 +26,7 @@ const sendMessageToClient = (ws, message) => { */ function createObjectToInsert(message) { const { id, tree } = message; - const data = { [database[tree].endpoint_id]: id }; + const data = { [database[tree].endpointId]: id }; if (message.node) { data[ IoTDBDataInterpreter.transformEndpointFromMessageNode(message.node.name) @@ -129,7 +129,15 @@ class IoTDBHandler extends Handler { async read(message, ws) { try { await this.#openSessionIfNeeded(); - await this.#queryLastFields(message, ws); + const responseNodes = await this.#queryLastFields(message, ws); + if (responseNodes.length > 0) { + const responseMessage = createUpdateMessage(message, responseNodes); + console.log(responseMessage); + sendMessageToClient(ws, responseMessage); + } else { + console.log("Object not found."); + sendMessageToClient(ws, JSON.stringify({ error: "Object not found." })); + } } catch (error) { console.error("Failed to read data from IoTDB: ", error); sendMessageToClient( @@ -142,33 +150,32 @@ class IoTDBHandler extends Handler { } async write(message, ws) { - let measurements = []; - let dataTypes = []; - let values = []; - try { await this.#openSessionIfNeeded(); const data = createObjectToInsert(message); const errorUndefinedTypes = []; + let measurements = []; + let dataTypes = []; + let values = []; for (const [key, value] of Object.entries(data)) { - const dataType = endpointsType[key]; - if (dataType == undefined) { + if (endpointsType.hasOwnProperty(key)) { + measurements.push(key); + dataTypes.push(endpointsType[key]); + values.push(value); + } else { errorUndefinedTypes.push(`The endpoint "${key}" is not supported`); continue; } - measurements.push(key); - dataTypes.push(dataType); - values.push(value); } - if (errorUndefinedTypes.length > 0) { + if (errorUndefinedTypes.length) { errorUndefinedTypes.forEach((error) => console.error(error)); throw new Error("One or more endpoints are not supported."); } const timestamp = new Date().getTime(); - const deviceId = database[message.tree].database_name; + const deviceId = database[message.tree].databaseName; const status = await this.#insertRecord( deviceId, timestamp, @@ -177,23 +184,31 @@ class IoTDBHandler extends Handler { values ); - const response = `insert one record to device ${deviceId}, status: `; + const response = `Insert one record to device ${deviceId}, status: `; console.log(response, status); - let keyList = []; - measurements.forEach((key) => { - keyList.push({ name: key }); - }); + let keyList = measurements.map((name) => ({ + name, + })); const readMessage = createReadMessage(message, keyList); console.log(readMessage); - await this.#queryLastFields(message, ws); + const responseNodes = await this.#queryLastFields(message, ws); + + if (responseNodes.length) { + const responseMessage = createUpdateMessage(message, responseNodes); + console.log(responseMessage); + this.sendMessageToClients(responseMessage); + } else { + console.log("Object not found."); + sendMessageToClient(ws, JSON.stringify({ error: "Object not found." })); + } } catch (error) { - console.error("Failed to write data from IoTDB: ", error); + console.error(`Failed writing data to IoTDB. ${error}`); sendMessageToClient( ws, - JSON.stringify({ error: "Error writing object" }) + JSON.stringify({ error: `Failed writing data. ${error}` }) ); } finally { this.#closeSessionIfNeeded(); @@ -373,8 +388,7 @@ class IoTDBHandler extends Handler { */ async #queryLastFields(message, ws) { const { id: objectId, tree } = message; - const { database_name: databaseName, endpoint_id: endpointId } = - database[tree]; + const { databaseName, endpointId } = database[tree]; const fieldsToSearch = IoTDBDataInterpreter.extractEndpointsFromNodes(message).join(", "); const sql = `SELECT ${fieldsToSearch} FROM ${databaseName} WHERE ${endpointId} = '${objectId}' ORDER BY Time ASC`; @@ -382,51 +396,34 @@ class IoTDBHandler extends Handler { try { const sessionDataSet = await this.#executeQueryStatement(sql); - if (Object.keys(sessionDataSet).length === 0) { + if (!sessionDataSet || Object.keys(sessionDataSet).length === 0) { throw new Error({ error: "Internal error constructing read object." }); - } else { - const mediaElements = []; - while (sessionDataSet.hasNext()) { - mediaElements.push(sessionDataSet.next()); - } + } - console.log("media elements: ", mediaElements); - - let latestValues = {}; - - mediaElements.forEach((mediaElement) => { - const databaseName = database[tree].database_name; - const transformedObject = - IoTDBDataInterpreter.extractNodesFromTimeseries( - mediaElement, - databaseName - ); - Object.entries(transformedObject).forEach(([key, value]) => { - if (value !== null) { - latestValues[key] = value; - } - }); - }); + const mediaElements = []; + while (sessionDataSet.hasNext()) { + mediaElements.push(sessionDataSet.next()); + } - const responseNodes = Object.entries(latestValues).map( - ([name, value]) => ({ - name, - value, - }) - ); + let latestValues = {}; - if (responseNodes.length > 0) { - const responseMessage = createUpdateMessage(message, responseNodes); - console.log(responseMessage); - this.sendMessageToClients(responseMessage); - } else { - console.log("Object not found."); - sendMessageToClient( - ws, - JSON.stringify({ error: "Object not found." }) + mediaElements.forEach((mediaElement) => { + const transformedObject = + IoTDBDataInterpreter.extractNodesFromTimeseries( + mediaElement, + databaseName ); - } - } + Object.entries(transformedObject).forEach(([key, value]) => { + if (value !== null) { + latestValues[key] = value; + } + }); + }); + + return Object.entries(latestValues).map(([name, value]) => ({ + name, + value, + })); } catch (error) { console.error(error); sendMessageToClient( diff --git a/cdsp/information-layer/handlers/iotdb/utils/IoTDBDataInterpreter.js b/cdsp/information-layer/handlers/iotdb/utils/IoTDBDataInterpreter.js index 0362cca..e665885 100644 --- a/cdsp/information-layer/handlers/iotdb/utils/IoTDBDataInterpreter.js +++ b/cdsp/information-layer/handlers/iotdb/utils/IoTDBDataInterpreter.js @@ -1,5 +1,5 @@ const { IoTDBDataType, MessageDataType } = require("./IoTDBConstants"); -const database = require("../config/database"); +const database = require("../config/databaseParams"); class IoTDBDataInterpreter { /** diff --git a/cdsp/information-layer/handlers/realmdb/config/Database.js b/cdsp/information-layer/handlers/realmdb/config/Database.js deleted file mode 100644 index 8046cdb..0000000 --- a/cdsp/information-layer/handlers/realmdb/config/Database.js +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Contains the definition of the database name and its identifier endpoint for each catalog. - */ -const Database = Object.freeze({ - VSS: { - database_name: "Vehicles", // name of the configured RealmDB for the VSS Database - endpoint_id: "Vehicle_VehicleIdentification_VIN", // endpoint used as element ID - }, -}); - -module.exports = Database; diff --git a/cdsp/information-layer/handlers/realmdb/config/RealmConfiguration.js b/cdsp/information-layer/handlers/realmdb/config/RealmConfiguration.js index e21c637..38d8011 100644 --- a/cdsp/information-layer/handlers/realmdb/config/RealmConfiguration.js +++ b/cdsp/information-layer/handlers/realmdb/config/RealmConfiguration.js @@ -1,8 +1,8 @@ -const Database = require("./Database"); +const database = require("./databaseParams"); const MediaElementSchema = { primaryKey: "_id", - name: Database.VSS.database_name, + name: database.VSS.databaseName, properties: { _id: "string", Vehicle_Chassis_SteeringWheel_Angle: "int", diff --git a/cdsp/information-layer/handlers/realmdb/config/databaseParams.js b/cdsp/information-layer/handlers/realmdb/config/databaseParams.js new file mode 100644 index 0000000..5f7300b --- /dev/null +++ b/cdsp/information-layer/handlers/realmdb/config/databaseParams.js @@ -0,0 +1,11 @@ +/* + * Contains the definition of the database name and its identifier endpoint for each catalog. + */ +const databaseParams = Object.freeze({ + VSS: { + databaseName: "Vehicles", // name of the configured RealmDB for the VSS database + endpointId: "Vehicle_VehicleIdentification_VIN", // endpoint used as element ID + }, +}); + +module.exports = databaseParams; diff --git a/cdsp/information-layer/handlers/realmdb/src/realmdb-handler.js b/cdsp/information-layer/handlers/realmdb/src/realmdb-handler.js index 0548ab8..8282963 100644 --- a/cdsp/information-layer/handlers/realmdb/src/realmdb-handler.js +++ b/cdsp/information-layer/handlers/realmdb/src/realmdb-handler.js @@ -1,8 +1,9 @@ const Realm = require("realm"); const Handler = require("../../handler"); const config = require("../config/config"); -const Database = require("../config/Database"); -const realmConfig = require("../config/RealmConfiguration"); +const database = require("../config/databaseParams"); +const realmConfig = require("../config/realmConfiguration"); +const { v4: uuidv4 } = require("uuid"); const app = new Realm.App({ id: config.realmAppId }); const credentials = Realm.Credentials.apiKey(config.realmApiKey); @@ -12,18 +13,44 @@ const sendMessageToClient = (ws, message) => { }; /** - * Creates the update message header object with the required information. + * Creates a message header object with the specified type and properties from the given original messageHeader. * * @param {Object} messageHeader - The original message header object. - * @returns {Object} The updated message header object. + * @param {string} type - The type of the message header, e.g., "update" or "read". + * @returns {Object} The newly created message header object. */ -const UpdateMessageHeader = (messageHeader) => ({ - type: "update", - tree: messageHeader.tree, - id: messageHeader.id, - dateTime: new Date().toISOString(), - uuid: messageHeader.uuid, -}); +const createMessageHeader = (messageHeader, type) => { + const header = { + type, + tree: messageHeader.tree, + id: messageHeader.id, + uuid: messageHeader.uuid, + }; + + if (type === "update") { + header.dateTime = new Date().toISOString(); + } + + return header; +}; + +/** + * Creates a new message object with a header and response nodes. + * + * @param {string} message - The message content. + * @param {Array} responseNodes - An array of response nodes. + * @param {string} type - The type of the message, e.g., "update" or "read". + * @returns {Object} The newly created message object. + */ +const createMessage = (message, responseNodes, type) => { + const newMessage = createMessageHeader(message, type); + if (responseNodes.length === 1) { + newMessage.node = responseNodes[0]; + } else { + newMessage.nodes = responseNodes; + } + return newMessage; +}; /** * Parses the response from a read event. @@ -34,21 +61,14 @@ const UpdateMessageHeader = (messageHeader) => ({ */ function parseReadResponse(message, queryResponseObj) { const data = []; - if (message.node) { - const prop = message.node.name; + const nodes = message.node ? [message.node] : message.nodes; + nodes.forEach((node) => { + const prop = node.name; data.push({ name: prop, value: queryResponseObj[prop], }); - } else if (message.nodes) { - message.nodes.forEach((node) => { - const prop = node.name; - data.push({ - name: prop, - value: queryResponseObj[prop], - }); - }); - } + }); return data; } @@ -56,18 +76,14 @@ function parseReadResponse(message, queryResponseObj) { * Parses the response from a media element change event. * * @param {Object} changes - The object containing the changed properties. - * @param {Object} MediaElement - The media element object with updated properties. + * @param {Object} mediaElement - The media element object with updated properties. * @returns {Array} An array of objects, each containing the name and value of a changed property. */ -function parseOnMediaElementChangeResponse(changes, MediaElement) { - const data = []; - changes.changedProperties.forEach((prop) => { - data.push({ - name: prop, - value: MediaElement[prop], - }); - }); - return data; +function parseOnMediaElementChangeResponse(changes, mediaElement) { + return changes.changedProperties.map((prop) => ({ + name: prop, + value: mediaElement[prop], + })); } class RealmDBHandler extends Handler { @@ -87,14 +103,15 @@ class RealmDBHandler extends Handler { this.realm = await Realm.open(realmConfigObj); console.log("Realm connection established successfully"); - // const MediaElements = await this.realm.objects("Vehicles").subscribe(); // TODO: Is it necessary to log this, extra function? - // if (MediaElements) { - // console.log(MediaElements); - // } else { - // this.sendMessageToClients({ - // error: "Vehicles collection not found for subscription", - // }); - // } + Object.entries(database).forEach(async ([key, value]) => { + try { + const databaseName = value.databaseName; + await this.realm.objects(databaseName).subscribe(); + console.log(`Subscribed to the database ${key}: ${databaseName}`); + } catch (error) { + throw new Error("Error subscribing databases."); + } + }); } catch (error) { console.error("Failed to authenticate with Realm:", error); } @@ -102,23 +119,7 @@ class RealmDBHandler extends Handler { async read(message, ws) { try { - const idValue = message.id; - const databaseName = Database[message.tree].database_name; - const idEndpoint = Database[message.tree].endpoint_id; - const mediaElement = await this.#getMediaElement( - databaseName, - idEndpoint, - idValue, - ws - ); - const responseNodes = parseReadResponse(message, mediaElement); - let updateMessage = UpdateMessageHeader(message); - if (responseNodes.length == 1) { - updateMessage["node"] = responseNodes[0]; - } else { - updateMessage["nodes"] = responseNodes; - } - + const updateMessage = await this.#getMessageData(message, ws); console.log(updateMessage); sendMessageToClient(ws, JSON.stringify(updateMessage)); } catch (error) { @@ -130,36 +131,68 @@ class RealmDBHandler extends Handler { } } - async subscribe(message, ws) { + async write(message, ws) { try { - const idValue = message.id; - const databaseName = Database[message.tree].database_name; - const idEndpoint = Database[message.tree].endpoint_id; - const MediaElement = await this.#getMediaElement( - databaseName, - idEndpoint, - idValue, - ws - ); + const mediaElement = await this.#getMediaElement(message, ws); + let nodes = message.node ? [message.node] : message.nodes; + const endpoints = []; - if (MediaElement) { - const objectId = MediaElement._id; + if (mediaElement) { + this.realm.write(() => { + nodes.forEach(({ name, value }) => { + endpoints.push(name); + mediaElement[name] = value; + }); + }); + } else { + const endpointId = database[message.tree].endpointId; + let document = { _id: uuidv4(), [endpointId]: message.id }; + + nodes.forEach(({ name, value }) => { + endpoints.push(name); + document[name] = value; + }); + const databaseName = database[message.tree].databaseName; + + this.realm.write(() => { + this.realm.create(databaseName, document); + }); + } + let messageNodes = endpoints.map((key) => ({ name: key })); + const readMessage = createMessage(message, messageNodes, "read"); + const updateMessage = await this.#getMessageData(readMessage, ws); + console.log(updateMessage); + this.sendMessageToClients(JSON.stringify(updateMessage)); + } catch (error) { + console.error("Error writing object changes in Realm:", error); + sendMessageToClient(ws, { error: "Error writing object changes" }); + } + } + + async subscribe(message, ws) { + try { + const mediaElement = await this.#getMediaElement(message, ws); + if (mediaElement) { + const objectId = mediaElement._id; + const { id, tree, uuid } = message; + const { databaseName, endpointId } = database[tree]; console.log( - `Subscribing element: Object ID: ${objectId} with ${idEndpoint}: '${idValue}' on ${databaseName}` + `Subscribing element: Object ID: ${objectId} with ${endpointId}: '${id}' on ${databaseName}` ); - const MediaElementToSubscribe = await this.realm.objectForPrimaryKey( + + const mediaElementToSubscribe = await this.realm.objectForPrimaryKey( databaseName, objectId ); - if (MediaElementToSubscribe) { - MediaElementToSubscribe.addListener( - (MediaElementToSubscribe, changes) => - this.#onMediaElementChange(MediaElementToSubscribe, changes, { - id: idValue, - tree: message.tree, - uuid: message.uuid, + if (mediaElementToSubscribe) { + mediaElementToSubscribe.addListener( + (mediaElementToSubscribe, changes) => + this.#onMediaElementChange(mediaElementToSubscribe, changes, { + id: id, + tree: tree, + uuid: uuid, }) ); console.log(`Subscribed to changes for Object ID: ${objectId}`); @@ -184,18 +217,38 @@ class RealmDBHandler extends Handler { } /** - * Asynchronously retrieves a media element from a Realm database based on the provided criteria. - * @param {string} databaseName - The name of the Realm database to query. - * @param {string} idEndpoint - The field in the database to filter on. - * @param {string} idValue - The value to match in the specified field. - * @param {WebSocket} ws - The WebSocket connection to send messages to the client. - * @returns {Promise} A Promise that resolves to the retrieved media element or rejects with an error. + * Asynchronously retrieves media element, processes it, and creates an updated message. + * + * @param {Object} message - The message object containing the data to be processed. + * @param {WebSocket} ws - The WebSocket connection used for communication. + * @returns {Promise} - A promise that resolves to the updated message object. + * @private */ - async #getMediaElement(databaseName, idEndpoint, idValue, ws) { + async #getMessageData(message, ws) { + const mediaElement = await this.#getMediaElement(message, ws); + console.log("mediaElement: ", mediaElement); + if (mediaElement) { + const responseNodes = parseReadResponse(message, mediaElement); + return createMessage(message, responseNodes, "update"); + } else { + throw new Error(`No data found with the Id: ${message.id}`); + } + } + + /** + * Asynchronously retrieves a media element from the database based on the provided message. + * + * @param {Object} message - The message containing the id and tree information. + * @param {WebSocket} ws - The WebSocket connection to send error messages if needed. + * @returns {Promise} - The media element object from the database. + */ + async #getMediaElement(message, ws) { try { + const { id, tree } = message; + const { databaseName, endpointId } = database[tree]; return await this.realm .objects(databaseName) - .filtered(`${idEndpoint} = '${idValue}'`)[0]; + .filtered(`${endpointId} = '${id}'`)[0]; } catch (error) { console.error("Error reading object from Realm:", error); sendMessageToClient( @@ -207,26 +260,24 @@ class RealmDBHandler extends Handler { /** * Handles changes to a media element and sends update messages to clients. - * @param {MediaElement} MediaElement - The media element that has changed. + * @param {mediaElement} mediaElement - The media element that has changed. * @param {object} changes - An object containing information about the changes. - * @param {MessageHeader} MessageHeader - The header information for the message. + * @param {messageHeader} messageHeader - The header information for the message. */ - #onMediaElementChange(MediaElement, changes, MessageHeader) { + #onMediaElementChange(mediaElement, changes, messageHeader) { if (changes.deleted) { console.log(`MediaElement is deleted: ${changes.deleted}`); } else { if (changes.changedProperties.length > 0) { const responseNodes = parseOnMediaElementChangeResponse( changes, - MediaElement + mediaElement + ); + const updateMessage = createMessage( + messageHeader, + responseNodes, + "update" ); - let updateMessage = UpdateMessageHeader(MessageHeader); - if (responseNodes.length == 1) { - updateMessage["node"] = responseNodes[0]; - } else { - updateMessage["nodes"] = responseNodes; - } - console.log(updateMessage); this.sendMessageToClients(JSON.stringify(updateMessage)); } From 56a1109b72ae91e5702fa4fba93bfefd83a77cd3 Mon Sep 17 00:00:00 2001 From: Sebastian Schleemilch Date: Wed, 21 Aug 2024 14:08:31 +0200 Subject: [PATCH 22/48] Extracted common methods - Subscribe Databases - Refactoring: use variable naming convention - Refactory: rename database parameters file - Repair error writing data and send message to clients correctly - Add write operation to RealmDB - Update Readme documentation - catch all exceptions - extract similar code to handler.js - remove unused function - commit changes - added comment Signed-off-by: Sebastian Schleemilch --- cdsp/information-layer/handlers/handler.js | 67 +++++++++++---- .../handlers/iotdb/src/iotdb-handler.js | 84 +++++-------------- .../handlers/realmdb/src/realmdb-handler.js | 75 +++++------------ 3 files changed, 95 insertions(+), 131 deletions(-) diff --git a/cdsp/information-layer/handlers/handler.js b/cdsp/information-layer/handlers/handler.js index 6ed6f62..7ea3025 100644 --- a/cdsp/information-layer/handlers/handler.js +++ b/cdsp/information-layer/handlers/handler.js @@ -4,31 +4,68 @@ class Handler { } handleMessage(message, ws) { - switch (message.type) { - case "read": - this.read(message, ws); - break; - case "write": - this.write(message, ws); - break; - case "subscribe": - this.subscribe(message, ws); - break; - default: - ws.send(JSON.stringify({ error: "Unknown message type" })); + try { + switch (message.type) { + case "read": + this.read(message, ws); + break; + case "write": + this.write(message, ws); + break; + case "subscribe": + this.subscribe(message, ws); + break; + default: + ws.send(JSON.stringify({ error: "Unknown message type" })); + } + } catch (error) { + ws.send(JSON.stringify({ error: error.message })); } } read(message, ws) { - throw new Error("Read method not implemented, yet!"); + throw new Error("Read method not implemented yet!"); } write(message, ws) { - throw new Error("Write method not implemented, yet!"); + throw new Error("Write method not implemented yet!"); } subscribe(message, ws) { - throw new Error("Subscribe method not implemented, yet!"); + throw new Error("Subscribe method not implemented yet!"); + } + + /** + * Utility functions for handling messages and data structures common to IoTDB and RealmDB. + */ + + /** + * Sends a message to the client + * @param {WebSocket} ws - The WebSocket connection to send the response to. + * @param {Object} message - The message to be sent to the client. + */ + sendMessageToClient = (ws, message) => { + ws.send(JSON.stringify(message)); + }; + + /** + * Generic function to create or update a message. + * @param {Object} message - The original message. + * @param {Array} nodes - The nodes to be included in the message. + * @param {String} type - The type of the message. Should be either 'read' or 'update'. + * @returns {Object} - The transformed message. + */ + createOrUpdateMessage(message, nodes, type) { + const transformedNodes = nodes.map((node) => ({ + name: node.name, + value: node.value, + })); + return { + ...message, + nodes: transformedNodes, + type, + timestamp: new Date().toISOString(), + }; } } diff --git a/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js b/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js index ed5c6bd..ed23766 100644 --- a/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js +++ b/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js @@ -14,10 +14,6 @@ const { IoTDBDataInterpreter } = require("../utils/IoTDBDataInterpreter"); const endpointsType = require("../config/endpointsType"); const database = require("../config/databaseParams"); -const sendMessageToClient = (ws, message) => { - ws.send(JSON.stringify(message)); -}; - /** * Creates an object to insert data in IoTDB based on the provided message. * @@ -40,54 +36,6 @@ function createObjectToInsert(message) { return data; } -/** - * Creates an update message object based on the provided message and response nodes. - * - * @param {Object} message - The original message object containing tree, id, and uuid properties. - * @param {Array} responseNodes - An array of response nodes to be included in the update message. - * @returns {Object} The constructed update message object. - */ -function createUpdateMessage(message, responseNodes) { - const { id, tree, uuid } = message; - let updateMessage = { - type: "update", - tree: tree, - id: id, - dateTime: new Date().toISOString(), - uuid: uuid, - }; - if (responseNodes.length == 1) { - updateMessage["node"] = responseNodes[0]; - } else { - updateMessage["nodes"] = responseNodes; - } - return updateMessage; -} - -/** - * Creates a read message object based on the provided message and nodes names. - * - * @param {Object} message - The message object containing tree, id, and uuid properties. - * @param {Array} nodeNames - An array of node names. If the array contains one field, it will be added as 'node'. - * If the array contains multiple fields, they will be added as 'nodes'. - * @returns {Object} The constructed read message object. - */ -function createReadMessage(message, nodeNames) { - const { id, tree, uuid } = message; - let readMessage = { - type: "read", - tree: tree, - id: id, - uuid: uuid, - }; - if (nodeNames.length == 1) { - readMessage["node"] = nodeNames[0]; - } else { - readMessage["nodes"] = nodeNames; - } - return readMessage; -} - class IoTDBHandler extends Handler { constructor() { super(); @@ -131,16 +79,23 @@ class IoTDBHandler extends Handler { await this.#openSessionIfNeeded(); const responseNodes = await this.#queryLastFields(message, ws); if (responseNodes.length > 0) { - const responseMessage = createUpdateMessage(message, responseNodes); + const responseMessage = this.createOrUpdateMessage( + message, + responseNodes, + "update" + ); console.log(responseMessage); - sendMessageToClient(ws, responseMessage); + this.sendMessageToClient(ws, responseMessage); } else { console.log("Object not found."); - sendMessageToClient(ws, JSON.stringify({ error: "Object not found." })); + this.sendMessageToClient( + ws, + JSON.stringify({ error: "Object not found." }) + ); } } catch (error) { console.error("Failed to read data from IoTDB: ", error); - sendMessageToClient( + this.sendMessageToClient( ws, JSON.stringify({ error: "Error reading object" }) ); @@ -191,22 +146,29 @@ class IoTDBHandler extends Handler { name, })); - const readMessage = createReadMessage(message, keyList); + const readMessage = this.createOrUpdateMessage(message, keyList, "read"); console.log(readMessage); const responseNodes = await this.#queryLastFields(message, ws); if (responseNodes.length) { - const responseMessage = createUpdateMessage(message, responseNodes); + const responseMessage = this.createOrUpdateMessage( + message, + responseNodes, + "update" + ); console.log(responseMessage); this.sendMessageToClients(responseMessage); } else { console.log("Object not found."); - sendMessageToClient(ws, JSON.stringify({ error: "Object not found." })); + this.sendMessageToClient( + ws, + JSON.stringify({ error: "Object not found." }) + ); } } catch (error) { console.error(`Failed writing data to IoTDB. ${error}`); - sendMessageToClient( + this.sendMessageToClient( ws, JSON.stringify({ error: `Failed writing data. ${error}` }) ); @@ -426,7 +388,7 @@ class IoTDBHandler extends Handler { })); } catch (error) { console.error(error); - sendMessageToClient( + this.sendMessageToClient( ws, JSON.stringify({ error: "Internal error constructing read object." }) ); diff --git a/cdsp/information-layer/handlers/realmdb/src/realmdb-handler.js b/cdsp/information-layer/handlers/realmdb/src/realmdb-handler.js index 8282963..ba03fc6 100644 --- a/cdsp/information-layer/handlers/realmdb/src/realmdb-handler.js +++ b/cdsp/information-layer/handlers/realmdb/src/realmdb-handler.js @@ -8,50 +8,6 @@ const { v4: uuidv4 } = require("uuid"); const app = new Realm.App({ id: config.realmAppId }); const credentials = Realm.Credentials.apiKey(config.realmApiKey); -const sendMessageToClient = (ws, message) => { - ws.send(JSON.stringify(message)); -}; - -/** - * Creates a message header object with the specified type and properties from the given original messageHeader. - * - * @param {Object} messageHeader - The original message header object. - * @param {string} type - The type of the message header, e.g., "update" or "read". - * @returns {Object} The newly created message header object. - */ -const createMessageHeader = (messageHeader, type) => { - const header = { - type, - tree: messageHeader.tree, - id: messageHeader.id, - uuid: messageHeader.uuid, - }; - - if (type === "update") { - header.dateTime = new Date().toISOString(); - } - - return header; -}; - -/** - * Creates a new message object with a header and response nodes. - * - * @param {string} message - The message content. - * @param {Array} responseNodes - An array of response nodes. - * @param {string} type - The type of the message, e.g., "update" or "read". - * @returns {Object} The newly created message object. - */ -const createMessage = (message, responseNodes, type) => { - const newMessage = createMessageHeader(message, type); - if (responseNodes.length === 1) { - newMessage.node = responseNodes[0]; - } else { - newMessage.nodes = responseNodes; - } - return newMessage; -}; - /** * Parses the response from a read event. * @@ -121,10 +77,10 @@ class RealmDBHandler extends Handler { try { const updateMessage = await this.#getMessageData(message, ws); console.log(updateMessage); - sendMessageToClient(ws, JSON.stringify(updateMessage)); + this.sendMessageToClient(ws, JSON.stringify(updateMessage)); } catch (error) { console.error("Error reading object from Realm:", error); - sendMessageToClient( + this.sendMessageToClient( ws, JSON.stringify({ error: "Error reading object" }) ); @@ -160,13 +116,17 @@ class RealmDBHandler extends Handler { } let messageNodes = endpoints.map((key) => ({ name: key })); - const readMessage = createMessage(message, messageNodes, "read"); + const readMessage = this.createOrUpdateMessage( + message, + messageNodes, + "read" + ); const updateMessage = await this.#getMessageData(readMessage, ws); console.log(updateMessage); this.sendMessageToClients(JSON.stringify(updateMessage)); } catch (error) { console.error("Error writing object changes in Realm:", error); - sendMessageToClient(ws, { error: "Error writing object changes" }); + this.sendMessageToClient(ws, { error: "Error writing object changes" }); } } @@ -196,23 +156,28 @@ class RealmDBHandler extends Handler { }) ); console.log(`Subscribed to changes for Object ID: ${objectId}`); - sendMessageToClient(ws, { + this.sendMessageToClient(ws, { success: `Subscribed to changes for Object ID: ${objectId}`, }); } else { console.log(`Object could not be subscribed`); - sendMessageToClient( + this.sendMessageToClient( ws, JSON.stringify({ error: "Object could not be subscribed" }) ); } } else { console.log(`Object not found`); - sendMessageToClient(ws, JSON.stringify({ error: "Object not found" })); + this.sendMessageToClient( + ws, + JSON.stringify({ error: "Object not found" }) + ); } } catch (error) { console.error("Error subscribing to object changes in Realm:", error); - sendMessageToClient(ws, { error: "Error subscribing to object changes" }); + this.sendMessageToClient(ws, { + error: "Error subscribing to object changes", + }); } } @@ -229,7 +194,7 @@ class RealmDBHandler extends Handler { console.log("mediaElement: ", mediaElement); if (mediaElement) { const responseNodes = parseReadResponse(message, mediaElement); - return createMessage(message, responseNodes, "update"); + return this.createOrUpdateMessage(message, responseNodes, "update"); } else { throw new Error(`No data found with the Id: ${message.id}`); } @@ -251,7 +216,7 @@ class RealmDBHandler extends Handler { .filtered(`${endpointId} = '${id}'`)[0]; } catch (error) { console.error("Error reading object from Realm:", error); - sendMessageToClient( + this.sendMessageToClient( ws, JSON.stringify({ error: "Error reading object" }) ); @@ -273,7 +238,7 @@ class RealmDBHandler extends Handler { changes, mediaElement ); - const updateMessage = createMessage( + const updateMessage = this.createOrUpdateMessage( messageHeader, responseNodes, "update" From 6d28e89e57bba09ecb488528c59c51364455f2a6 Mon Sep 17 00:00:00 2001 From: "Andre Wendel (Q290938)" Date: Thu, 22 Aug 2024 13:14:02 +0200 Subject: [PATCH 23/48] Support dots separation for endpoint naming in realm db Signed-off-by: Andre Wendel --- .gitignore | 1 + cdsp/information-layer/handlers/handler.js | 40 ++++-- .../handlers/iotdb/src/iotdb-handler.js | 117 ++++++++++-------- .../iotdb/utils/IoTDBDataInterpreter.js | 34 +---- .../handlers/iotdb/utils/IoTDBRpcDataSets.js | 2 +- .../handlers/realmdb/src/realmdb-handler.js | 76 +++++------- cdsp/information-layer/router/src/.env | 2 +- 7 files changed, 135 insertions(+), 137 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..485dee6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea diff --git a/cdsp/information-layer/handlers/handler.js b/cdsp/information-layer/handlers/handler.js index 7ea3025..41b9a19 100644 --- a/cdsp/information-layer/handlers/handler.js +++ b/cdsp/information-layer/handlers/handler.js @@ -56,16 +56,40 @@ class Handler { * @returns {Object} - The transformed message. */ createOrUpdateMessage(message, nodes, type) { - const transformedNodes = nodes.map((node) => ({ - name: node.name, - value: node.value, - })); - return { - ...message, - nodes: transformedNodes, + const { id, tree, uuid } = message; + let newMessage = { type, - timestamp: new Date().toISOString(), + tree, + id, + dateTime: new Date().toISOString(), + uuid, }; + if (nodes.length === 1) { + newMessage["node"] = nodes[0]; + } else { + newMessage["nodes"] = nodes; + } + return newMessage; + } + + /** + * Transforms a message node by replacing all dots with underscores. + * + * @param {string} node - The message node to transform. + * @returns {string} - The transformed message node with dots replaced by underscores. + */ + transformEndpointFromMessageNode(node) { + return `${node}`.replace(/\./g, "_"); + } + + /** + * Transforms a database field name by replacing underscores with all dots. + * + * @param {string} field - The database filed to transform. + * @returns {string} - The transformed to message node replacing underscores by dots. + */ + transformEndpointFromDatabaseFields(field) { + return `${field}`.replace(/\_/g, "."); } } diff --git a/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js b/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js index ed23766..d4c06b3 100644 --- a/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js +++ b/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js @@ -14,28 +14,6 @@ const { IoTDBDataInterpreter } = require("../utils/IoTDBDataInterpreter"); const endpointsType = require("../config/endpointsType"); const database = require("../config/databaseParams"); -/** - * Creates an object to insert data in IoTDB based on the provided message. - * - * @param {Object} message - The message containing data to be inserted. - * @returns {Object} The data object to be inserted. - */ -function createObjectToInsert(message) { - const { id, tree } = message; - const data = { [database[tree].endpointId]: id }; - if (message.node) { - data[ - IoTDBDataInterpreter.transformEndpointFromMessageNode(message.node.name) - ] = message.node.value; - } else if (message.nodes) { - message.nodes.forEach((node) => { - data[IoTDBDataInterpreter.transformEndpointFromMessageNode(node.name)] = - node.value; - }); - } - return data; -} - class IoTDBHandler extends Handler { constructor() { super(); @@ -88,17 +66,11 @@ class IoTDBHandler extends Handler { this.sendMessageToClient(ws, responseMessage); } else { console.log("Object not found."); - this.sendMessageToClient( - ws, - JSON.stringify({ error: "Object not found." }) - ); + this.sendMessageToClient(ws, { error: "Object not found." }); } } catch (error) { console.error("Failed to read data from IoTDB: ", error); - this.sendMessageToClient( - ws, - JSON.stringify({ error: "Error reading object" }) - ); + this.sendMessageToClient(ws, { error: "Error reading object" }); } finally { this.#closeSessionIfNeeded(); } @@ -107,7 +79,7 @@ class IoTDBHandler extends Handler { async write(message, ws) { try { await this.#openSessionIfNeeded(); - const data = createObjectToInsert(message); + const data = this.#createObjectToInsert(message); const errorUndefinedTypes = []; let measurements = []; let dataTypes = []; @@ -120,7 +92,6 @@ class IoTDBHandler extends Handler { values.push(value); } else { errorUndefinedTypes.push(`The endpoint "${key}" is not supported`); - continue; } } @@ -161,17 +132,11 @@ class IoTDBHandler extends Handler { this.sendMessageToClients(responseMessage); } else { console.log("Object not found."); - this.sendMessageToClient( - ws, - JSON.stringify({ error: "Object not found." }) - ); + this.sendMessageToClient(ws, { error: "Object not found." }); } } catch (error) { console.error(`Failed writing data to IoTDB. ${error}`); - this.sendMessageToClient( - ws, - JSON.stringify({ error: `Failed writing data. ${error}` }) - ); + this.sendMessageToClient(ws, { error: `Failed writing data. ${error}` }); } finally { this.#closeSessionIfNeeded(); } @@ -197,7 +162,7 @@ class IoTDBHandler extends Handler { try { const resp = await this.client.openSession(openSessionReq); - if (this.protocolVersion != resp.serverProtocolVersion) { + if (this.protocolVersion !== resp.serverProtocolVersion) { console.log( "Protocol differ, Client version is " + this.protocolVersion + @@ -205,7 +170,7 @@ class IoTDBHandler extends Handler { resp.serverProtocolVersion ); // version is less than 0.10 - if (resp.serverProtocolVersion == 0) { + if (resp.serverProtocolVersion === 0) { throw new Error("Protocol not supported."); } } @@ -320,8 +285,8 @@ class IoTDBHandler extends Handler { isAligned = false ) { if ( - values.length != dataTypes.length || - values.length != measurements.length + values.length !== dataTypes.length || + values.length !== measurements.length ) { throw "length of data types does not equal to length of values!"; } @@ -351,15 +316,14 @@ class IoTDBHandler extends Handler { async #queryLastFields(message, ws) { const { id: objectId, tree } = message; const { databaseName, endpointId } = database[tree]; - const fieldsToSearch = - IoTDBDataInterpreter.extractEndpointsFromNodes(message).join(", "); + const fieldsToSearch = this.#extractEndpointsFromNodes(message).join(", "); const sql = `SELECT ${fieldsToSearch} FROM ${databaseName} WHERE ${endpointId} = '${objectId}' ORDER BY Time ASC`; try { const sessionDataSet = await this.#executeQueryStatement(sql); if (!sessionDataSet || Object.keys(sessionDataSet).length === 0) { - throw new Error({ error: "Internal error constructing read object." }); + throw new Error("Internal error constructing read object."); } const mediaElements = []; @@ -368,13 +332,21 @@ class IoTDBHandler extends Handler { } let latestValues = {}; - mediaElements.forEach((mediaElement) => { + // extract underscores from media element key + const transformedMediaElement = Object.fromEntries( + Object.entries(mediaElement).map(([key, value]) => { + const newKey = this.transformEndpointFromDatabaseFields(key); + return [newKey, value]; + }) + ); + const transformedObject = IoTDBDataInterpreter.extractNodesFromTimeseries( - mediaElement, + transformedMediaElement, databaseName ); + Object.entries(transformedObject).forEach(([key, value]) => { if (value !== null) { latestValues[key] = value; @@ -388,11 +360,52 @@ class IoTDBHandler extends Handler { })); } catch (error) { console.error(error); - this.sendMessageToClient( - ws, - JSON.stringify({ error: "Internal error constructing read object." }) + this.sendMessageToClient(ws, { + error: "Internal error constructing read object.", + }); + } + } + + /** + * Extracts endpoint names from the given message. + * + * This function checks if the message has a single node or multiple nodes and + * extracts the names accordingly. + * + * @param {Object} message - The message containing node(s). + * @returns {Array} An array of endpoint names. + */ + #extractEndpointsFromNodes(message) { + let endpoints = []; + + if (message.node) { + endpoints.push(this.transformEndpointFromMessageNode(message.node.name)); + } else if (message.nodes) { + endpoints = message.nodes.map((node) => + this.transformEndpointFromMessageNode(node.name) ); } + return endpoints; + } + + /** + * Creates an object to insert data in IoTDB based on the provided message. + * + * @param {Object} message - The message containing data to be inserted. + * @returns {Object} The data object to be inserted. + */ + #createObjectToInsert(message) { + const { id, tree } = message; + const data = { [database[tree].endpointId]: id }; + if (message.node) { + data[this.transformEndpointFromMessageNode(message.node.name)] = + message.node.value; + } else if (message.nodes) { + message.nodes.forEach((node) => { + data[this.transformEndpointFromMessageNode(node.name)] = node.value; + }); + } + return data; } } diff --git a/cdsp/information-layer/handlers/iotdb/utils/IoTDBDataInterpreter.js b/cdsp/information-layer/handlers/iotdb/utils/IoTDBDataInterpreter.js index e665885..2b06fc4 100644 --- a/cdsp/information-layer/handlers/iotdb/utils/IoTDBDataInterpreter.js +++ b/cdsp/information-layer/handlers/iotdb/utils/IoTDBDataInterpreter.js @@ -88,7 +88,7 @@ class IoTDBDataInterpreter { static extractNodesFromTimeseries(obj, databaseName) { return Object.entries(obj).reduce((acc, [key, value]) => { if (key.startsWith(databaseName)) { - const newKey = key.replace(`${databaseName}.`, "").replace(/_/g, "."); + const newKey = key.replace(`${databaseName}.`, ""); acc[newKey] = value; } return acc; @@ -108,38 +108,6 @@ class IoTDBDataInterpreter { return { timestamp }; } - - /** - * Extracts endpoint names from the given message. - * - * This function checks if the message has a single node or multiple nodes and - * extracts the names accordingly. - * - * @param {Object} message - The message containing node(s). - * @returns {Array} An array of endpoint names. - */ - static extractEndpointsFromNodes(message) { - let endpoints = []; - - if (message.node) { - endpoints.push(this.transformEndpointFromMessageNode(message.node.name)); - } else if (message.nodes) { - endpoints = message.nodes.map((node) => - this.transformEndpointFromMessageNode(node.name) - ); - } - return endpoints; - } - - /** - * Transforms a message node by replacing all dots with underscores. - * - * @param {string} node - The message node to transform. - * @returns {string} - The transformed message node with dots replaced by underscores. - */ - static transformEndpointFromMessageNode(node) { - return `${node}`.replace(/\./g, "_"); - } } module.exports = { IoTDBDataInterpreter }; diff --git a/cdsp/information-layer/handlers/iotdb/utils/IoTDBRpcDataSets.js b/cdsp/information-layer/handlers/iotdb/utils/IoTDBRpcDataSets.js index 8eda7a3..62bff90 100644 --- a/cdsp/information-layer/handlers/iotdb/utils/IoTDBRpcDataSets.js +++ b/cdsp/information-layer/handlers/iotdb/utils/IoTDBRpcDataSets.js @@ -188,7 +188,7 @@ class IoTDBRpcDataSet { * @returns {boolean} True if there is a cached result, otherwise false. */ #hasCachedResult() { - return this.#queryDataSet !== null && this.#queryDataSet.time.length != 0; + return this.#queryDataSet !== null && this.#queryDataSet.time.length !== 0; } /** diff --git a/cdsp/information-layer/handlers/realmdb/src/realmdb-handler.js b/cdsp/information-layer/handlers/realmdb/src/realmdb-handler.js index ba03fc6..db7038c 100644 --- a/cdsp/information-layer/handlers/realmdb/src/realmdb-handler.js +++ b/cdsp/information-layer/handlers/realmdb/src/realmdb-handler.js @@ -8,26 +8,6 @@ const { v4: uuidv4 } = require("uuid"); const app = new Realm.App({ id: config.realmAppId }); const credentials = Realm.Credentials.apiKey(config.realmApiKey); -/** - * Parses the response from a read event. - * - * @param {Object} message - The message object containing node or nodes information. - * @param {Object} queryResponseObj - The query response object containing values to be mapped. - * @returns {Object} - A data object with keys from the message nodes and values from the query response. - */ -function parseReadResponse(message, queryResponseObj) { - const data = []; - const nodes = message.node ? [message.node] : message.nodes; - nodes.forEach((node) => { - const prop = node.name; - data.push({ - name: prop, - value: queryResponseObj[prop], - }); - }); - return data; -} - /** * Parses the response from a media element change event. * @@ -77,13 +57,10 @@ class RealmDBHandler extends Handler { try { const updateMessage = await this.#getMessageData(message, ws); console.log(updateMessage); - this.sendMessageToClient(ws, JSON.stringify(updateMessage)); + this.sendMessageToClient(ws, updateMessage); } catch (error) { console.error("Error reading object from Realm:", error); - this.sendMessageToClient( - ws, - JSON.stringify({ error: "Error reading object" }) - ); + this.sendMessageToClient(ws, { error: "Error reading object" }); } } @@ -96,8 +73,9 @@ class RealmDBHandler extends Handler { if (mediaElement) { this.realm.write(() => { nodes.forEach(({ name, value }) => { + const prop = this.transformEndpointFromMessageNode(name); endpoints.push(name); - mediaElement[name] = value; + mediaElement[prop] = value; }); }); } else { @@ -105,8 +83,9 @@ class RealmDBHandler extends Handler { let document = { _id: uuidv4(), [endpointId]: message.id }; nodes.forEach(({ name, value }) => { + const prop = this.transformEndpointFromMessageNode(name); endpoints.push(name); - document[name] = value; + document[prop] = value; }); const databaseName = database[message.tree].databaseName; @@ -123,7 +102,7 @@ class RealmDBHandler extends Handler { ); const updateMessage = await this.#getMessageData(readMessage, ws); console.log(updateMessage); - this.sendMessageToClients(JSON.stringify(updateMessage)); + this.sendMessageToClients(updateMessage); } catch (error) { console.error("Error writing object changes in Realm:", error); this.sendMessageToClient(ws, { error: "Error writing object changes" }); @@ -161,17 +140,13 @@ class RealmDBHandler extends Handler { }); } else { console.log(`Object could not be subscribed`); - this.sendMessageToClient( - ws, - JSON.stringify({ error: "Object could not be subscribed" }) - ); + this.sendMessageToClient(ws, { + error: "Object could not be subscribed", + }); } } else { console.log(`Object not found`); - this.sendMessageToClient( - ws, - JSON.stringify({ error: "Object not found" }) - ); + this.sendMessageToClient(ws, { error: "Object not found" }); } } catch (error) { console.error("Error subscribing to object changes in Realm:", error); @@ -193,7 +168,7 @@ class RealmDBHandler extends Handler { const mediaElement = await this.#getMediaElement(message, ws); console.log("mediaElement: ", mediaElement); if (mediaElement) { - const responseNodes = parseReadResponse(message, mediaElement); + const responseNodes = this.#parseReadResponse(message, mediaElement); return this.createOrUpdateMessage(message, responseNodes, "update"); } else { throw new Error(`No data found with the Id: ${message.id}`); @@ -216,10 +191,7 @@ class RealmDBHandler extends Handler { .filtered(`${endpointId} = '${id}'`)[0]; } catch (error) { console.error("Error reading object from Realm:", error); - this.sendMessageToClient( - ws, - JSON.stringify({ error: "Error reading object" }) - ); + this.sendMessageToClient(ws, { error: "Error reading object" }); } } @@ -244,10 +216,30 @@ class RealmDBHandler extends Handler { "update" ); console.log(updateMessage); - this.sendMessageToClients(JSON.stringify(updateMessage)); + this.sendMessageToClients(updateMessage); } } } + + /** + * Parses the response from a read event. + * + * @param {Object} message - The message object containing node or nodes information. + * @param {Object} queryResponseObj - The query response object containing values to be mapped. + * @returns {Object} - A data object with keys from the message nodes and values from the query response. + */ + #parseReadResponse(message, queryResponseObj) { + const data = []; + const nodes = message.node ? [message.node] : message.nodes; + nodes.forEach((node) => { + const prop = this.transformEndpointFromMessageNode(node.name); + data.push({ + name: node.name, + value: queryResponseObj[prop], + }); + }); + return data; + } } module.exports = RealmDBHandler; diff --git a/cdsp/information-layer/router/src/.env b/cdsp/information-layer/router/src/.env index 16ac659..bcaf5de 100644 --- a/cdsp/information-layer/router/src/.env +++ b/cdsp/information-layer/router/src/.env @@ -1 +1 @@ -HANDLER_TYPE=realmdb \ No newline at end of file +HANDLER_TYPE=iotdb \ No newline at end of file From deff29cdea841763e0cba9317d53f8a91f7fb726 Mon Sep 17 00:00:00 2001 From: "Andre Wendel (Q290938)" Date: Tue, 27 Aug 2024 09:33:42 +0200 Subject: [PATCH 24/48] =?UTF-8?q?=E2=80=A2=20Import=20supported=20endpoint?= =?UTF-8?q?s=20for=20IoTDB=20and=20RealmDB=20from=20YAML/JSON=20files=20to?= =?UTF-8?q?=20configure=20database=20and=20element=20types.=20=E2=80=A2=20?= =?UTF-8?q?[FIXES]:=20=E2=80=A2=20Realm=20Handler:=20Messaging=20during=20?= =?UTF-8?q?document=20edits=20will=20now=20be=20sent=20only=20to=20subscri?= =?UTF-8?q?bed=20clients.=20=E2=80=A2=20Console=20Logging:=20Previously,?= =?UTF-8?q?=20it=20was=20difficult=20to=20differentiate=20between=20messag?= =?UTF-8?q?es=20(errors,=20logs,=20client=20messages)=20in=20the=20console?= =?UTF-8?q?.=20This=20has=20been=20addressed=20by=20including=20a=20logger?= =?UTF-8?q?=20that=20manages=20message=20styles=20and=20types.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andre Wendel --- cdsp/information-layer/README.md | 9 +- cdsp/information-layer/handlers/.gitignore | 3 + cdsp/information-layer/handlers/README.md | 11 +- .../handlers/config/README.md | 28 +++ .../handlers/config/config.js | 22 +++ .../handlers/config/vss_endpoints.json | 107 +++++++++++ .../handlers/config/vss_endpoints.yaml | 87 +++++++++ cdsp/information-layer/handlers/handler.js | 96 ---------- .../handlers/iotdb/config/endpointsType.js | 18 -- .../handlers/iotdb/utils/IoTDBConstants.js | 20 --- cdsp/information-layer/handlers/package.json | 6 + .../realmdb/config/RealmConfiguration.js | 37 ---- .../information-layer/handlers/src/handler.js | 166 ++++++++++++++++++ .../handlers/{ => src}/iotdb/.gitignore | 2 +- .../handlers/{ => src}/iotdb/README.md | 4 +- .../{ => src}/iotdb/config/databaseParams.js | 0 .../src/iotdb/config/endpointsType.js | 46 +++++ .../iotdb/gen-nodejs/IClientRPCService.js | 0 .../iotdb/gen-nodejs/client_types.js | 0 .../iotdb/gen-nodejs/common_types.js | 0 .../handlers/{ => src}/iotdb/package.json | 0 .../{ => src}/iotdb/src/iotdb-handler.js | 118 +++++++------ .../src/iotdb/utils/IoTDBConstants.js | 21 +++ .../iotdb/utils/IoTDBDataInterpreter.js | 48 ++--- .../{ => src}/iotdb/utils/IoTDBRpcDataSets.js | 2 +- .../{ => src}/iotdb/utils/SessionDataSet.js | 2 +- .../handlers/{ => src}/realmdb/.gitignore | 8 +- .../handlers/{ => src}/realmdb/README.md | 6 +- .../realmdb/config/database-params.js} | 8 +- .../src/realmdb/config/realm-configuration.js | 72 ++++++++ .../handlers/{ => src}/realmdb/package.json | 2 +- .../{ => src}/realmdb/src/realmdb-handler.js | 141 ++++++++------- cdsp/information-layer/router/README.md | 4 +- cdsp/information-layer/router/package.json | 4 +- cdsp/information-layer/router/src/.env | 5 +- .../router/src/websocket-server.js | 32 ++-- cdsp/information-layer/utils/logger.js | 51 ++++++ 37 files changed, 839 insertions(+), 347 deletions(-) create mode 100644 cdsp/information-layer/handlers/.gitignore create mode 100644 cdsp/information-layer/handlers/config/README.md create mode 100644 cdsp/information-layer/handlers/config/config.js create mode 100644 cdsp/information-layer/handlers/config/vss_endpoints.json create mode 100644 cdsp/information-layer/handlers/config/vss_endpoints.yaml delete mode 100644 cdsp/information-layer/handlers/handler.js delete mode 100644 cdsp/information-layer/handlers/iotdb/config/endpointsType.js delete mode 100644 cdsp/information-layer/handlers/iotdb/utils/IoTDBConstants.js create mode 100644 cdsp/information-layer/handlers/package.json delete mode 100644 cdsp/information-layer/handlers/realmdb/config/RealmConfiguration.js create mode 100644 cdsp/information-layer/handlers/src/handler.js rename cdsp/information-layer/handlers/{ => src}/iotdb/.gitignore (83%) rename cdsp/information-layer/handlers/{ => src}/iotdb/README.md (95%) rename cdsp/information-layer/handlers/{ => src}/iotdb/config/databaseParams.js (100%) create mode 100644 cdsp/information-layer/handlers/src/iotdb/config/endpointsType.js rename cdsp/information-layer/handlers/{ => src}/iotdb/gen-nodejs/IClientRPCService.js (100%) rename cdsp/information-layer/handlers/{ => src}/iotdb/gen-nodejs/client_types.js (100%) rename cdsp/information-layer/handlers/{ => src}/iotdb/gen-nodejs/common_types.js (100%) rename cdsp/information-layer/handlers/{ => src}/iotdb/package.json (100%) rename cdsp/information-layer/handlers/{ => src}/iotdb/src/iotdb-handler.js (80%) create mode 100644 cdsp/information-layer/handlers/src/iotdb/utils/IoTDBConstants.js rename cdsp/information-layer/handlers/{ => src}/iotdb/utils/IoTDBDataInterpreter.js (69%) rename cdsp/information-layer/handlers/{ => src}/iotdb/utils/IoTDBRpcDataSets.js (99%) rename cdsp/information-layer/handlers/{ => src}/iotdb/utils/SessionDataSet.js (98%) rename cdsp/information-layer/handlers/{ => src}/realmdb/.gitignore (52%) rename cdsp/information-layer/handlers/{ => src}/realmdb/README.md (85%) rename cdsp/information-layer/handlers/{realmdb/config/databaseParams.js => src/realmdb/config/database-params.js} (61%) create mode 100644 cdsp/information-layer/handlers/src/realmdb/config/realm-configuration.js rename cdsp/information-layer/handlers/{ => src}/realmdb/package.json (87%) rename cdsp/information-layer/handlers/{ => src}/realmdb/src/realmdb-handler.js (63%) create mode 100644 cdsp/information-layer/utils/logger.js diff --git a/cdsp/information-layer/README.md b/cdsp/information-layer/README.md index ab7aee2..304f35d 100644 --- a/cdsp/information-layer/README.md +++ b/cdsp/information-layer/README.md @@ -20,6 +20,9 @@ The Hello World example in our case is quite simple. We feed an updated value fo ## Choose and prepare your Database +> [!WARNING] +> Before start the application, ensure that the supported endpoints are correctly defined and configured. See [how](./handlers/config/README.md). + ### Realm - Ensure that in your [ATLAS cloud](https://cloud.mongodb.com/) app there is a vehicle *document* with an `Vehicle_VehicleIdentification_VIN` in a collection named *`Vehicles`*. - Ensure that this document as well contains VSS data. Here you can see the supported data in a vehicle document within the *Vehicles* should look like in ATLAS: @@ -73,15 +76,15 @@ The Hello World example in our case is quite simple. We feed an updated value fo See [here](./router/README.md#Run) how to start the database router. ## Look out for the Websocket Server message in the console -If you the handler is running and you are subscribed to that element, when you change the value of `CurrentLocation_Longitude` in ATLAS cloud (let's say `-157845.68200000003`), you should immediately see this line in console: +If the handler is running and you are [subscribed](#subscribing-to-changes) to an element, when you change the value of `CurrentLocation_Longitude` in ATLAS cloud (let's say `-157845.68200000003`), you should immediately see this line in console: ``` { type: 'update', tree: 'VSS', - id: '', + id: '', dateTime: '', - uuid: '', + uuid: '', node: { name: 'CurrentLocation_Longitude', value: `-157845.68200000003` } } ``` diff --git a/cdsp/information-layer/handlers/.gitignore b/cdsp/information-layer/handlers/.gitignore new file mode 100644 index 0000000..645f5bd --- /dev/null +++ b/cdsp/information-layer/handlers/.gitignore @@ -0,0 +1,3 @@ +# Node.js +node_modules/ +package-lock.json \ No newline at end of file diff --git a/cdsp/information-layer/handlers/README.md b/cdsp/information-layer/handlers/README.md index cb4711b..adccb2f 100644 --- a/cdsp/information-layer/handlers/README.md +++ b/cdsp/information-layer/handlers/README.md @@ -1,4 +1,11 @@ # Handlers -- [IotDB](./iotdb) -- [RealmDB](./realmdb) +We support two different databases. + +- [IotDB](./src/iotdb) +- [RealmDB](./src/realmdb) + +> [!WARNING] +> Before start working with any of them, ensure that the supported endpoints are correctly defined and configured. See [how](./handlers/config/README.md). +> +See [hier](../../information-layer/router/README.md) how to install the Database-Router. \ No newline at end of file diff --git a/cdsp/information-layer/handlers/config/README.md b/cdsp/information-layer/handlers/config/README.md new file mode 100644 index 0000000..4f7c265 --- /dev/null +++ b/cdsp/information-layer/handlers/config/README.md @@ -0,0 +1,28 @@ +# Configuration Handler for Endpoints + +This module is responsible for handling the configuration of supported endpoints in the application. It supports JSON, YAML, or YML formats for defining the endpoints. + +The files in this directory `vss_endpoints.yaml` and `vss_endpoints.json` contain the same endpoint definition (only one of them is necessary to build) and based on that, the system will configure the data schema used during the Database configuration. + +> [!WARNING] +> - Before starting the application, ensure that the desired YAML, YML or JSON file is correctly placed in the root directory of the module. This file should contain the definitions of the supported endpoints. The name and extension to use can be configured in the `config.js` file. +> - Ensure that the used file is correctly formatted and contains valid endpoint definitions. +> - **The application will not function correctly if the endpoints file is missing or incorrectly placed.** + +## File: `config.js` + +### Description + +The `config.js` file contains the logic to retrieve the full path to the endpoints configuration file (`vss_endpoints.yaml` in this case). This file is crucial for the application to understand which endpoints are supported and how they should be handled. + +### Functions + +#### `getEndpointsPath` + +This function resolves the root directory path of the current module and joins it with the `ENDPOINTS_FILE` constant to form the full path to the endpoints file. + +```javascript +const getEndpointsPath = () => { + const rootPath = path.resolve(__dirname); + return path.join(rootPath, ENDPOINTS_FILE); +}; diff --git a/cdsp/information-layer/handlers/config/config.js b/cdsp/information-layer/handlers/config/config.js new file mode 100644 index 0000000..f668fa8 --- /dev/null +++ b/cdsp/information-layer/handlers/config/config.js @@ -0,0 +1,22 @@ +const path = require("path"); + +/** + * This file contains the description of the supported endpoints. + * It supports JSON, YAML or YML format. + */ +const ENDPOINTS_FILE = "vss_endpoints.yaml"; + +/** + * Retrieves the full path to the endpoints file. + * + * This function resolves the root directory path of the current module + * and joins it with the ENDPOINTS_FILE constant to form the full path. + * + * @returns {string} The full path to the endpoints file. + */ +const getEndpointsPath = () => { + const rootPath = path.resolve(__dirname); + return path.join(rootPath, ENDPOINTS_FILE); +}; + +module.exports = { getEndpointsPath }; diff --git a/cdsp/information-layer/handlers/config/vss_endpoints.json b/cdsp/information-layer/handlers/config/vss_endpoints.json new file mode 100644 index 0000000..845e2aa --- /dev/null +++ b/cdsp/information-layer/handlers/config/vss_endpoints.json @@ -0,0 +1,107 @@ +{ + "Vehicle": { + "children": { + "Chassis": { + "children": { + "SteeringWheel": { + "children": { + "Angle": { + "datatype": "int16", + "description": "Steering wheel angle. Positive = degrees to the left. Negative = degrees to the right.", + "type": "sensor", + "unit": "degrees" + } + }, + "description": "Steering wheel signals", + "type": "branch" + } + }, + "description": "All data concerning steering, suspension, wheels, and brakes.", + "type": "branch" + }, + "CurrentLocation": { + "children": { + "Latitude": { + "datatype": "double", + "description": "Current latitude of vehicle in WGS 84 geodetic coordinates, as measured at the position of GNSS receiver antenna.", + "max": 90, + "min": -90, + "type": "sensor", + "unit": "degrees" + }, "Longitude": { + "datatype": "double", + "description": "Current longitude of vehicle in WGS 84 geodetic coordinates, as measured at the position of GNSS receiver antenna.", + "max": 180, + "min": -180, + "type": "sensor", + "unit": "degrees" + } + }, + "description": "The current latitude and longitude of the vehicle.", + "type": "branch" + }, + "Powertrain": { + "children": { + "TractionBattery": { + "children": { + "NominalVoltage": { + "comment": "Nominal voltage typically refers to voltage of fully charged battery when delivering rated capacity.", + "datatype": "uint16", + "description": "Nominal Voltage of the battery.", + "type": "attribute", + "unit": "V" + }, + "StateOfCharge": { + "children": { + "CurrentEnergy": { + "comment": "Current energy could be calculated as .StateOfCharge.Current * .NetCapacity.", + "datatype": "float", + "description": "Physical state of charge of high voltage battery expressed in kWh.", + "type": "sensor", + "unit": "kWh" + } + }, + "description": "Information on the state of charge of the vehicle's high voltage battery.", + "type": "branch" + } + }, + "description": "Battery Management data.", + "type": "branch" + }, + "Transmission": { + "children": { + "CurrentGear": { + "datatype": "int8", + "description": "The current gear. 0=Neutral, 1/2/..=Forward, -1/-2/..=Reverse.", + "type": "sensor" + } + }, + "description": "Transmission-specific data, stopping at the drive shafts.", + "type": "branch" + } + }, + "description": "Powertrain data for battery management, etc.", + "type": "branch" + }, + "Speed": { + "datatype": "float", + "description": "Vehicle speed.", + "type": "sensor", + "unit": "km/h" + }, + "VehicleIdentification": { + "children": { + "VIN": { + "datatype": "string", + "description": "17-character Vehicle Identification Number (VIN) as defined by ISO 3779.", + "type": "attribute" + } + }, + "description": "Attributes that identify a vehicle.", + "type": "branch" + } + }, + "description": "High-level vehicle data.", + "type": "branch" + } +} \ No newline at end of file diff --git a/cdsp/information-layer/handlers/config/vss_endpoints.yaml b/cdsp/information-layer/handlers/config/vss_endpoints.yaml new file mode 100644 index 0000000..c628d66 --- /dev/null +++ b/cdsp/information-layer/handlers/config/vss_endpoints.yaml @@ -0,0 +1,87 @@ +Vehicle: + description: High-level vehicle data. + type: branch + +Vehicle.Chassis: + description: All data concerning steering, suspension, wheels, and brakes. + type: branch + +Vehicle.Chassis.SteeringWheel: + description: Steering wheel signals + type: branch + +Vehicle.Chassis.SteeringWheel.Angle: + datatype: int16 + description: Steering wheel angle. Positive = degrees to the left. Negative = degrees to the right. + type: sensor + unit: degrees + +Vehicle.CurrentLocation: + description: The current latitude and longitude of the vehicle. + type: branch + +Vehicle.CurrentLocation.Latitude: + datatype: double + description: Current latitude of vehicle in WGS 84 geodetic coordinates, as measured at the position of GNSS receiver antenna. + max: 90 + min: -90 + type: sensor + unit: degrees + +Vehicle.CurrentLocation.Longitude: + datatype: double + description: Current longitude of vehicle in WGS 84 geodetic coordinates, as measured at the position of GNSS receiver antenna. + max: 180 + min: -180 + type: sensor + unit: degrees + +Vehicle.Powertrain: + description: Powertrain data for battery management, etc. + type: branch + +Vehicle.Powertrain.TractionBattery: + description: Battery Management data. + type: branch + +Vehicle.Powertrain.TractionBattery.NominalVoltage: + comment: Nominal voltage typically refers to voltage of fully charged battery when delivering rated capacity. + datatype: uint16 + description: Nominal Voltage of the battery. + type: attribute + unit: V + +Vehicle.Powertrain.TractionBattery.StateOfCharge: + description: Information on the state of charge of the vehicle's high voltage battery. + type: branch + +Vehicle.Powertrain.TractionBattery.StateOfCharge.CurrentEnergy: + comment: Current energy could be calculated as .StateOfCharge.Current * .NetCapacity. + datatype: float + description: Physical state of charge of high voltage battery expressed in kWh. + type: sensor + unit: kWh + +Vehicle.Powertrain.Transmission: + description: Transmission-specific data, stopping at the drive shafts. + type: branch + +Vehicle.Powertrain.Transmission.CurrentGear: + datatype: int8 + description: The current gear. 0=Neutral, 1/2/..=Forward, -1/-2/..=Reverse. + type: sensor + +Vehicle.Speed: + datatype: float + description: Vehicle speed. + type: sensor + unit: km/h + +Vehicle.VehicleIdentification: + description: Attributes that identify a vehicle. + type: branch + +Vehicle.VehicleIdentification.VIN: + datatype: string + description: 17-character Vehicle Identification Number (VIN) as defined by ISO 3779. + type: attribute diff --git a/cdsp/information-layer/handlers/handler.js b/cdsp/information-layer/handlers/handler.js deleted file mode 100644 index 41b9a19..0000000 --- a/cdsp/information-layer/handlers/handler.js +++ /dev/null @@ -1,96 +0,0 @@ -class Handler { - authenticateAndConnect(sendMessageToClients) { - throw new Error("Method 'authenticateAndConnect' must be implemented."); - } - - handleMessage(message, ws) { - try { - switch (message.type) { - case "read": - this.read(message, ws); - break; - case "write": - this.write(message, ws); - break; - case "subscribe": - this.subscribe(message, ws); - break; - default: - ws.send(JSON.stringify({ error: "Unknown message type" })); - } - } catch (error) { - ws.send(JSON.stringify({ error: error.message })); - } - } - - read(message, ws) { - throw new Error("Read method not implemented yet!"); - } - - write(message, ws) { - throw new Error("Write method not implemented yet!"); - } - - subscribe(message, ws) { - throw new Error("Subscribe method not implemented yet!"); - } - - /** - * Utility functions for handling messages and data structures common to IoTDB and RealmDB. - */ - - /** - * Sends a message to the client - * @param {WebSocket} ws - The WebSocket connection to send the response to. - * @param {Object} message - The message to be sent to the client. - */ - sendMessageToClient = (ws, message) => { - ws.send(JSON.stringify(message)); - }; - - /** - * Generic function to create or update a message. - * @param {Object} message - The original message. - * @param {Array} nodes - The nodes to be included in the message. - * @param {String} type - The type of the message. Should be either 'read' or 'update'. - * @returns {Object} - The transformed message. - */ - createOrUpdateMessage(message, nodes, type) { - const { id, tree, uuid } = message; - let newMessage = { - type, - tree, - id, - dateTime: new Date().toISOString(), - uuid, - }; - if (nodes.length === 1) { - newMessage["node"] = nodes[0]; - } else { - newMessage["nodes"] = nodes; - } - return newMessage; - } - - /** - * Transforms a message node by replacing all dots with underscores. - * - * @param {string} node - The message node to transform. - * @returns {string} - The transformed message node with dots replaced by underscores. - */ - transformEndpointFromMessageNode(node) { - return `${node}`.replace(/\./g, "_"); - } - - /** - * Transforms a database field name by replacing underscores with all dots. - * - * @param {string} field - The database filed to transform. - * @returns {string} - The transformed to message node replacing underscores by dots. - */ - transformEndpointFromDatabaseFields(field) { - return `${field}`.replace(/\_/g, "."); - } -} - -module.exports = Handler; diff --git a/cdsp/information-layer/handlers/iotdb/config/endpointsType.js b/cdsp/information-layer/handlers/iotdb/config/endpointsType.js deleted file mode 100644 index 5b10c3b..0000000 --- a/cdsp/information-layer/handlers/iotdb/config/endpointsType.js +++ /dev/null @@ -1,18 +0,0 @@ -const { MessageDataType } = require("../utils/IoTDBConstants"); - -/* - * Define the supported endpoints and the corresponding data types. - */ -const endpointsType = Object.freeze({ - Vehicle_Chassis_SteeringWheel_Angle: MessageDataType.INT16, - Vehicle_CurrentLocation_Latitude: MessageDataType.DOUBLE, - Vehicle_CurrentLocation_Longitude: MessageDataType.DOUBLE, - Vehicle_Powertrain_TractionBattery_NominalVoltage: MessageDataType.UINT16, - Vehicle_Powertrain_TractionBattery_StateOfCharge_CurrentEnergy: - MessageDataType.FLOAT, - Vehicle_Powertrain_Transmission_CurrentGear: MessageDataType.INT8, - Vehicle_Speed: MessageDataType.FLOAT, - Vehicle_VehicleIdentification_VIN: MessageDataType.STRING, -}); - -module.exports = endpointsType; diff --git a/cdsp/information-layer/handlers/iotdb/utils/IoTDBConstants.js b/cdsp/information-layer/handlers/iotdb/utils/IoTDBConstants.js deleted file mode 100644 index 8d6048d..0000000 --- a/cdsp/information-layer/handlers/iotdb/utils/IoTDBConstants.js +++ /dev/null @@ -1,20 +0,0 @@ -const IoTDBDataType = Object.freeze({ - BOOLEAN: 0, - INT32: 1, - INT64: 2, - FLOAT: 3, - DOUBLE: 4, - TEXT: 5, -}); - -const MessageDataType = Object.freeze({ - INT8: 0, - INT16: 1, - INT32: 2, - UINT16: 3, - FLOAT: 4, - DOUBLE: 5, - STRING: 6, -}); - -module.exports = { IoTDBDataType, MessageDataType }; diff --git a/cdsp/information-layer/handlers/package.json b/cdsp/information-layer/handlers/package.json new file mode 100644 index 0000000..63909dd --- /dev/null +++ b/cdsp/information-layer/handlers/package.json @@ -0,0 +1,6 @@ +{ + "dependencies": { + "dotenv": "^16.4.5", + "js-yaml": "^4.1.0" + } +} diff --git a/cdsp/information-layer/handlers/realmdb/config/RealmConfiguration.js b/cdsp/information-layer/handlers/realmdb/config/RealmConfiguration.js deleted file mode 100644 index 38d8011..0000000 --- a/cdsp/information-layer/handlers/realmdb/config/RealmConfiguration.js +++ /dev/null @@ -1,37 +0,0 @@ -const database = require("./databaseParams"); - -const MediaElementSchema = { - primaryKey: "_id", - name: database.VSS.databaseName, - properties: { - _id: "string", - Vehicle_Chassis_SteeringWheel_Angle: "int", - Vehicle_CurrentLocation_Latitude: "double", - Vehicle_CurrentLocation_Longitude: "double", - Vehicle_Powertrain_TractionBattery_NominalVoltage: "int", - Vehicle_Powertrain_TractionBattery_StateOfCharge_CurrentEnergy: "float", - Vehicle_Powertrain_Transmission_CurrentGear: "int", - Vehicle_Speed: "float", - Vehicle_VehicleIdentification_VIN: "string", - }, -}; - -/** - * Generates a configuration object for a Realm database. - * - * @param {object} user - The user object from the authentication. - * @returns {object} The configuration object for the Realm database. - */ -const realmConfig = (user) => ({ - schema: [MediaElementSchema], - path: "myrealm12.realm", - sync: { - user: user, - flexible: true, - error: (error) => { - console.error("Realm sync error:", error); - }, - }, -}); - -module.exports = realmConfig; diff --git a/cdsp/information-layer/handlers/src/handler.js b/cdsp/information-layer/handlers/src/handler.js new file mode 100644 index 0000000..0490ac4 --- /dev/null +++ b/cdsp/information-layer/handlers/src/handler.js @@ -0,0 +1,166 @@ +const config = require("../config/config"); +const fs = require("fs"); +const yaml = require("js-yaml"); +const { logMessage, MessageType } = require("../../utils/logger"); +/** + * Reads and parses an endpoints file in either JSON, YML or YAML format. + * + * @param {string} filePath - The path to the endpoints file. + * @returns {Object} The parsed content of the endpoints file. + * @throws {Error} If the file format is unsupported. + */ +function readEndpointsFile(filePath) { + const fileContent = fs.readFileSync(filePath, "utf8"); + if (filePath.endsWith(".json")) { + return JSON.parse(fileContent); + } else if (filePath.endsWith(".yaml") || filePath.endsWith(".yml")) { + return yaml.load(fileContent); + } else { + throw new Error("Unsupported endpoints file format"); + } +} + +/** + * Recursively extracts data types from an endpoints object. + * + * @param {Object} endpointsObj - The object containing endpoint definitions. + * @param {string} [parentKey=""] - The parent key used to build the nested key path. + * @param {Object} [result={}] - The object to store the extracted data types. + * @returns {Object} An object mapping endpoint keys to their data types. + */ +function extractDataTypes(endpointsObj, parentKey = "", result = {}) { + for (const key in endpointsObj) { + if (endpointsObj.hasOwnProperty(key)) { + const value = endpointsObj[key]; + const newKey = parentKey ? `${parentKey}.${key}` : key; + if (value && typeof value === "object") { + if (value.datatype) { + result[newKey] = value.datatype; + } else { + extractDataTypes(value.children || value, newKey, result); + } + } + } + } + return result; +} + +class Handler { + handleMessage(message, ws) { + try { + switch (message.type) { + case "read": + this.read(message, ws); + break; + case "write": + this.write(message, ws); + break; + case "subscribe": + this.subscribe(message, ws); + break; + default: + ws.send(JSON.stringify({ error: "Unknown message type" })); + } + } catch (error) { + ws.send(JSON.stringify({ error: error.message })); + } + } + + authenticateAndConnect(sendMessageToClients) { + throw new Error("Method 'authenticateAndConnect' must be implemented."); + } + + read(message, ws) { + throw new Error("Read method not implemented yet!"); + } + + write(message, ws) { + throw new Error("Write method not implemented yet!"); + } + + subscribe(message, ws) { + throw new Error("Subscribe method not implemented yet!"); + } + + /** + * Utility functions for handling messages and data structures common to IoTDB and RealmDB. + */ + + /** + * Sends a message to the client + * @param {WebSocket} ws - The WebSocket connection to send the response to. + * @param {Object} message - The message to be sent to the client. + */ + _sendMessageToClient = (ws, message) => { + logMessage(JSON.stringify(message), MessageType.SENT); + ws.send(JSON.stringify(message)); + }; + + /** + * Generic function to create an update message. + * @param {Object} message - The original message from client. + * @param {Array} nodes - The nodes to be included in the message. + * @returns {Object} - The transformed message. + */ + _createUpdateMessage(message, nodes) { + const { id, tree, uuid } = message; + let newMessage = { + type: "update", + tree, + id, + dateTime: new Date().toISOString(), + uuid, + }; + if (nodes.length === 1) { + newMessage["node"] = nodes[0]; + } else { + newMessage["nodes"] = nodes; + } + return newMessage; + } + + /** + * Transforms a message node by replacing all dots with underscores. + * + * @param {string} node - The message node to transform. + * @returns {string} - The transformed message node with dots replaced by underscores. + */ + _transformEndpointsWithUnderscores(node) { + return `${node}`.replace(/\./g, "_"); + } + + /** + * Transforms a database field name by replacing underscores with all dots. + * + * @param {string} field - The database filed to transform. + * @returns {string} - The transformed to message node replacing underscores by dots. + */ + _transformEndpointsWithDots(field) { + return `${field}`.replace(/\_/g, "."); + } + + /** + * Retrieves and processes supported endpoints. + * + * This method reads the endpoints configuration file, extracts the data types, + * and transforms the endpoint names to use underscores. It returns an object + * with the transformed endpoint names as keys and their corresponding data types. + * + * @returns {Object} An object containing the supported endpoints with transformed names and data types. + */ + _getSupportedEndpoints() { + const endpointPath = config.getEndpointsPath(); + const endpointObj = readEndpointsFile(endpointPath); + const supportedEndpoints = extractDataTypes(endpointObj); + let result = {}; + Object.entries(supportedEndpoints).forEach(([node, value]) => { + const underscored_node = this._transformEndpointsWithUnderscores(node); + if (value !== null) { + result[underscored_node] = value; + } + }); + return result; + } +} + +module.exports = Handler; diff --git a/cdsp/information-layer/handlers/iotdb/.gitignore b/cdsp/information-layer/handlers/src/iotdb/.gitignore similarity index 83% rename from cdsp/information-layer/handlers/iotdb/.gitignore rename to cdsp/information-layer/handlers/src/iotdb/.gitignore index 9b7b860..3cdddbd 100644 --- a/cdsp/information-layer/handlers/iotdb/.gitignore +++ b/cdsp/information-layer/handlers/src/iotdb/.gitignore @@ -3,7 +3,7 @@ node_modules/ package-lock.json # Credentials Config File -config.js +config/config.js # MAC **/.DS_Store diff --git a/cdsp/information-layer/handlers/iotdb/README.md b/cdsp/information-layer/handlers/src/iotdb/README.md similarity index 95% rename from cdsp/information-layer/handlers/iotdb/README.md rename to cdsp/information-layer/handlers/src/iotdb/README.md index 430d176..03028ab 100644 --- a/cdsp/information-layer/handlers/iotdb/README.md +++ b/cdsp/information-layer/handlers/src/iotdb/README.md @@ -1,3 +1,5 @@ +# IoTDB + This directory contains the IoTDB Handler as a Node.js application. As [Apache IoTDB](https://iotdb.apache.org/) is a time-series database, the IoTDB Handler connects to an existing IoTDB instance using the Thrift protocol. The handler utilizes the [IoTDB Thrift API](https://github.com/apache/thrift) to communicate with the database and perform operations. Configuration details, such as the IoTDB host, port, user credentials, and time zone, are specified in the handler's configuration file. The IoTDB Handler is designed to manage sessions, execute queries, and interact with the IoTDB instance efficiently during runtime. # Features @@ -36,4 +38,4 @@ module.exports = { ## Starting the IoTDB handler -You do not need to start IotDB Handler manually. It is started by the DB-Router like described [here](../../router/README.md#Run). \ No newline at end of file +You do not need to start IotDB Handler manually. It is started by the DB-Router like described [here](../../../router/README.md#Run). \ No newline at end of file diff --git a/cdsp/information-layer/handlers/iotdb/config/databaseParams.js b/cdsp/information-layer/handlers/src/iotdb/config/databaseParams.js similarity index 100% rename from cdsp/information-layer/handlers/iotdb/config/databaseParams.js rename to cdsp/information-layer/handlers/src/iotdb/config/databaseParams.js diff --git a/cdsp/information-layer/handlers/src/iotdb/config/endpointsType.js b/cdsp/information-layer/handlers/src/iotdb/config/endpointsType.js new file mode 100644 index 0000000..8d30e2d --- /dev/null +++ b/cdsp/information-layer/handlers/src/iotdb/config/endpointsType.js @@ -0,0 +1,46 @@ +const { SupportedMessageDataTypes } = require("../utils/IoTDBConstants"); + +class EndpointsSchema { + constructor(supportedEndpoints) { + const properties = {}; + + Object.entries(supportedEndpoints).forEach(([key, value]) => { + if (SupportedMessageDataTypes.hasOwnProperty(value)) { + properties[key] = value; + } else { + throw new Error( + `The initialized endpoints contains an unsupported data type: ${value}` + ); + } + }); + + this.endpointsSchema = properties; + Object.freeze(this.endpointsSchema); + } + + getEndpointsSchema() { + return this.endpointsSchema; + } +} + +// Singleton instance holder +let endpointsSchemaInstance = null; + +/** + * Creates and returns a singleton instance of EndpointsSchema. + * If the instance does not already exist, it initializes it with the provided supported endpoints + * and freezes the instance to prevent further modifications. + * + * @param {Object} supportedEndpoints - An object of supported endpoints to initialize the schema. + * @returns {Object} The endpoints schema instance. + */ +function createEndpointsSchema(supportedEndpoints) { + if (!endpointsSchemaInstance) { + endpointsSchemaInstance = new EndpointsSchema(supportedEndpoints); + Object.freeze(endpointsSchemaInstance); + } + + return endpointsSchemaInstance.getEndpointsSchema(); +} + +module.exports = { createEndpointsSchema }; diff --git a/cdsp/information-layer/handlers/iotdb/gen-nodejs/IClientRPCService.js b/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService.js similarity index 100% rename from cdsp/information-layer/handlers/iotdb/gen-nodejs/IClientRPCService.js rename to cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService.js diff --git a/cdsp/information-layer/handlers/iotdb/gen-nodejs/client_types.js b/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/client_types.js similarity index 100% rename from cdsp/information-layer/handlers/iotdb/gen-nodejs/client_types.js rename to cdsp/information-layer/handlers/src/iotdb/gen-nodejs/client_types.js diff --git a/cdsp/information-layer/handlers/iotdb/gen-nodejs/common_types.js b/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/common_types.js similarity index 100% rename from cdsp/information-layer/handlers/iotdb/gen-nodejs/common_types.js rename to cdsp/information-layer/handlers/src/iotdb/gen-nodejs/common_types.js diff --git a/cdsp/information-layer/handlers/iotdb/package.json b/cdsp/information-layer/handlers/src/iotdb/package.json similarity index 100% rename from cdsp/information-layer/handlers/iotdb/package.json rename to cdsp/information-layer/handlers/src/iotdb/package.json diff --git a/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js b/cdsp/information-layer/handlers/src/iotdb/src/iotdb-handler.js similarity index 80% rename from cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js rename to cdsp/information-layer/handlers/src/iotdb/src/iotdb-handler.js index d4c06b3..2152024 100644 --- a/cdsp/information-layer/handlers/iotdb/src/iotdb-handler.js +++ b/cdsp/information-layer/handlers/src/iotdb/src/iotdb-handler.js @@ -11,25 +11,32 @@ const Handler = require("../../handler"); const config = require("../config/config"); const SessionDataSet = require("../utils/SessionDataSet"); const { IoTDBDataInterpreter } = require("../utils/IoTDBDataInterpreter"); -const endpointsType = require("../config/endpointsType"); +const { createEndpointsSchema } = require("../config/endpointsType"); const database = require("../config/databaseParams"); +const { + logMessage, + logWithColor, + MessageType, + COLORS, +} = require("../../../../utils/logger"); class IoTDBHandler extends Handler { constructor() { super(); this.client = null; - this.sendMessageToClients = null; + this._sendMessageToClients = null; this.sessionId = null; this.protocolVersion = TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V3; this.statementId = null; this.zoneId = config.timeZoneId; this.fetchSize = config.fetchSize; this.isSessionClosed = true; + this.endpointsSchema = null; } async authenticateAndConnect(sendMessageToClients) { try { - this.sendMessageToClients = sendMessageToClients; + this._sendMessageToClients = sendMessageToClients; const connection = thrift.createConnection( config.iotdbHost, @@ -42,13 +49,22 @@ class IoTDBHandler extends Handler { this.client = thrift.createClient(Client, connection); - connection.on("error", (err) => { - console.error("thrift connection error:", err); + connection.on("error", (error) => { + logMessage( + "thrift connection error: ".concat(error), + MessageType.ERROR + ); }); - console.log("Successfully connected to IoTDB using thrift."); + const supportedEndpoint = this._getSupportedEndpoints(); + this.endpointsSchema = createEndpointsSchema(supportedEndpoint); + + console.info("Successfully connected to IoTDB using thrift"); } catch (error) { - console.error("Failed to authenticate with IoTDB:", error); + logMessage( + "Failed to authenticate with IoTDB: ".concat(error), + MessageType.ERROR + ); } } @@ -57,20 +73,16 @@ class IoTDBHandler extends Handler { await this.#openSessionIfNeeded(); const responseNodes = await this.#queryLastFields(message, ws); if (responseNodes.length > 0) { - const responseMessage = this.createOrUpdateMessage( + const responseMessage = this._createUpdateMessage( message, - responseNodes, - "update" + responseNodes ); - console.log(responseMessage); - this.sendMessageToClient(ws, responseMessage); + this._sendMessageToClient(ws, responseMessage); } else { - console.log("Object not found."); - this.sendMessageToClient(ws, { error: "Object not found." }); + this._sendMessageToClient(ws, { error: "Object not found." }); } } catch (error) { - console.error("Failed to read data from IoTDB: ", error); - this.sendMessageToClient(ws, { error: "Error reading object" }); + this._sendMessageToClient(ws, { error: "Error reading object" }); } finally { this.#closeSessionIfNeeded(); } @@ -86,9 +98,9 @@ class IoTDBHandler extends Handler { let values = []; for (const [key, value] of Object.entries(data)) { - if (endpointsType.hasOwnProperty(key)) { + if (this.endpointsSchema.hasOwnProperty(key)) { measurements.push(key); - dataTypes.push(endpointsType[key]); + dataTypes.push(this.endpointsSchema[key]); values.push(value); } else { errorUndefinedTypes.push(`The endpoint "${key}" is not supported`); @@ -110,33 +122,26 @@ class IoTDBHandler extends Handler { values ); - const response = `Insert one record to device ${deviceId}, status: `; - console.log(response, status); - - let keyList = measurements.map((name) => ({ - name, - })); - - const readMessage = this.createOrUpdateMessage(message, keyList, "read"); - console.log(readMessage); + logWithColor( + `Record inserted to device ${deviceId}, status code: `.concat( + JSON.stringify(status) + ), + COLORS.GREY + ); const responseNodes = await this.#queryLastFields(message, ws); if (responseNodes.length) { - const responseMessage = this.createOrUpdateMessage( + const responseMessage = this._createUpdateMessage( message, - responseNodes, - "update" + responseNodes ); - console.log(responseMessage); - this.sendMessageToClients(responseMessage); + this._sendMessageToClients(responseMessage); } else { - console.log("Object not found."); - this.sendMessageToClient(ws, { error: "Object not found." }); + this._sendMessageToClient(ws, { error: "Object not found." }); } } catch (error) { - console.error(`Failed writing data to IoTDB. ${error}`); - this.sendMessageToClient(ws, { error: `Failed writing data. ${error}` }); + this._sendMessageToClient(ws, { error: `Failed writing data. ${error}` }); } finally { this.#closeSessionIfNeeded(); } @@ -163,7 +168,7 @@ class IoTDBHandler extends Handler { const resp = await this.client.openSession(openSessionReq); if (this.protocolVersion !== resp.serverProtocolVersion) { - console.log( + console.info( "Protocol differ, Client version is " + this.protocolVersion + ", but Server version is " + @@ -178,9 +183,12 @@ class IoTDBHandler extends Handler { this.sessionId = resp.sessionId; this.statementId = await this.client.requestStatementId(this.sessionId); this.isSessionClosed = false; - console.log("Session started!"); + console.info("Session started!"); } catch (error) { - console.error("Failed starting session with IoTDB: ", error); + logMessage( + "Failed starting session with IoTDB: ".concat(error), + MessageType.ERROR + ); } } @@ -200,13 +208,15 @@ class IoTDBHandler extends Handler { try { this.client.closeSession(req); } catch (error) { - console.error( - "Error occurs when closing session at server. Maybe server is down. Error message: ", - error + logMessage( + "Error occurs when closing session at server. Maybe server is down. Error message: ".concat( + error + ), + MessageType.ERROR ); } finally { this.isSessionClosed = true; - console.log("Session closed!"); + console.info("Session closed!"); } } @@ -261,7 +271,10 @@ class IoTDBHandler extends Handler { ); } } catch (error) { - console.error("Failed executing query statement: ", error); + logMessage( + "Failed executing query statement: ".concat(error), + MessageType.ERROR + ); } } @@ -336,7 +349,7 @@ class IoTDBHandler extends Handler { // extract underscores from media element key const transformedMediaElement = Object.fromEntries( Object.entries(mediaElement).map(([key, value]) => { - const newKey = this.transformEndpointFromDatabaseFields(key); + const newKey = this._transformEndpointsWithDots(key); return [newKey, value]; }) ); @@ -359,9 +372,8 @@ class IoTDBHandler extends Handler { value, })); } catch (error) { - console.error(error); - this.sendMessageToClient(ws, { - error: "Internal error constructing read object.", + this._sendMessageToClient(ws, { + error: "internal error constructing read object", }); } } @@ -379,10 +391,12 @@ class IoTDBHandler extends Handler { let endpoints = []; if (message.node) { - endpoints.push(this.transformEndpointFromMessageNode(message.node.name)); + endpoints.push( + this._transformEndpointsWithUnderscores(message.node.name) + ); } else if (message.nodes) { endpoints = message.nodes.map((node) => - this.transformEndpointFromMessageNode(node.name) + this._transformEndpointsWithUnderscores(node.name) ); } return endpoints; @@ -398,11 +412,11 @@ class IoTDBHandler extends Handler { const { id, tree } = message; const data = { [database[tree].endpointId]: id }; if (message.node) { - data[this.transformEndpointFromMessageNode(message.node.name)] = + data[this._transformEndpointsWithUnderscores(message.node.name)] = message.node.value; } else if (message.nodes) { message.nodes.forEach((node) => { - data[this.transformEndpointFromMessageNode(node.name)] = node.value; + data[this._transformEndpointsWithUnderscores(node.name)] = node.value; }); } return data; diff --git a/cdsp/information-layer/handlers/src/iotdb/utils/IoTDBConstants.js b/cdsp/information-layer/handlers/src/iotdb/utils/IoTDBConstants.js new file mode 100644 index 0000000..152f176 --- /dev/null +++ b/cdsp/information-layer/handlers/src/iotdb/utils/IoTDBConstants.js @@ -0,0 +1,21 @@ +const IoTDBDataType = Object.freeze({ + BOOLEAN: 0, + INT32: 1, + INT64: 2, + FLOAT: 3, + DOUBLE: 4, + TEXT: 5, +}); + +const SupportedMessageDataTypes = Object.freeze({ + boolean: "boolean", + string: "string", + float: "float", + double: "double", + int8: "int8", + int16: "int16", + uint8: "uint8", + uint16: "uint16", +}); + +module.exports = { IoTDBDataType, SupportedMessageDataTypes }; diff --git a/cdsp/information-layer/handlers/iotdb/utils/IoTDBDataInterpreter.js b/cdsp/information-layer/handlers/src/iotdb/utils/IoTDBDataInterpreter.js similarity index 69% rename from cdsp/information-layer/handlers/iotdb/utils/IoTDBDataInterpreter.js rename to cdsp/information-layer/handlers/src/iotdb/utils/IoTDBDataInterpreter.js index 2b06fc4..840112e 100644 --- a/cdsp/information-layer/handlers/iotdb/utils/IoTDBDataInterpreter.js +++ b/cdsp/information-layer/handlers/src/iotdb/utils/IoTDBDataInterpreter.js @@ -1,5 +1,7 @@ -const { IoTDBDataType, MessageDataType } = require("./IoTDBConstants"); -const database = require("../config/databaseParams"); +const { + IoTDBDataType, + SupportedMessageDataTypes, +} = require("./IoTDBConstants"); class IoTDBDataInterpreter { /** @@ -9,10 +11,9 @@ class IoTDBDataInterpreter { * @returns {Buffer} - Serialized values as a Buffer. */ static serializeValues(dataTypes, values) { - // this type is not supported by now, see: cdsp/information-layer/handlers/iotdb/utils/IoTDBConstants.js - // function serializeBoolean(value) { - // return [IoTDBDataType.BOOLEAN, value]; - // } + function serializeBoolean(value) { + return [IoTDBDataType.BOOLEAN, value]; + } function serializeInt32(value) { const int32 = new Int32Array([value]); @@ -20,12 +21,11 @@ class IoTDBDataInterpreter { return [IoTDBDataType.INT32, ...uint8]; } - // this type is not supported by now, see: cdsp/information-layer/handlers/iotdb/utils/IoTDBConstants.js - // function serializeInt64(value) { - // const bigint64 = new BigInt64Array([value]); - // const uint8 = new Uint8Array(bigint64.buffer).reverse(); - // return [IoTDBDataType.INT64, ...uint8]; - // } + function serializeInt64(value) { + const bigint64 = new BigInt64Array([value]); + const uint8 = new Uint8Array(bigint64.buffer).reverse(); + return [IoTDBDataType.INT64, ...uint8]; + } function serializeFloat(value) { const float32 = new Float32Array([value]); @@ -50,29 +50,29 @@ class IoTDBDataInterpreter { for (let i = 0; i < dataTypes.length; i++) { switch (dataTypes[i]) { - // case MessageDataType.BOOLEAN: // this type is not supported by now, see: cdsp/information-layer/handlers/iotdb/utils/IoTDBConstants.js - // serializedValues.push(...serializeBoolean(values[i])); - // break; - case MessageDataType.INT8: - case MessageDataType.INT16: - case MessageDataType.UINT16: - //case MessageDataType.UINT32: + case SupportedMessageDataTypes.boolean: + serializedValues.push(...serializeBoolean(values[i])); + break; + case SupportedMessageDataTypes.int8: + case SupportedMessageDataTypes.int16: + case SupportedMessageDataTypes.uint8: + case SupportedMessageDataTypes.uint16: serializedValues.push(...serializeInt32(values[i])); break; - // case MessageDataType.INT64: // this type is not supported by now, see: cdsp/information-layer/handlers/iotdb/utils/IoTDBConstants.js + // case SupportedMessageDataTypes.int64: // this type is not supported by now, see: cdsp/information-layer/handlers/iotdb/utils/IoTDBConstants.js // serializedValues.push(...serializeInt64(values[i])); // break; - case MessageDataType.FLOAT: + case SupportedMessageDataTypes.float: serializedValues.push(...serializeFloat(values[i])); break; - case MessageDataType.DOUBLE: + case SupportedMessageDataTypes.double: serializedValues.push(...serializeDouble(values[i])); break; - case MessageDataType.STRING: + case SupportedMessageDataTypes.string: serializedValues.push(...serializeText(values[i])); break; default: - throw new Error("Unsupported data type"); + throw new Error(`Unsupported data type: ${dataTypes[i]}`); } } return Buffer.from(serializedValues); diff --git a/cdsp/information-layer/handlers/iotdb/utils/IoTDBRpcDataSets.js b/cdsp/information-layer/handlers/src/iotdb/utils/IoTDBRpcDataSets.js similarity index 99% rename from cdsp/information-layer/handlers/iotdb/utils/IoTDBRpcDataSets.js rename to cdsp/information-layer/handlers/src/iotdb/utils/IoTDBRpcDataSets.js index 62bff90..b103b23 100644 --- a/cdsp/information-layer/handlers/iotdb/utils/IoTDBRpcDataSets.js +++ b/cdsp/information-layer/handlers/src/iotdb/utils/IoTDBRpcDataSets.js @@ -242,7 +242,7 @@ class IoTDBRpcDataSet { this.#queryDataSet.valueList[i] = valueBuffer.slice(4 + length); break; default: - throw new Error("Unsupported data type."); + throw new Error(`Unsupported data type: ${dataType}`); } } } diff --git a/cdsp/information-layer/handlers/iotdb/utils/SessionDataSet.js b/cdsp/information-layer/handlers/src/iotdb/utils/SessionDataSet.js similarity index 98% rename from cdsp/information-layer/handlers/iotdb/utils/SessionDataSet.js rename to cdsp/information-layer/handlers/src/iotdb/utils/SessionDataSet.js index 47bb9bc..c4b0b79 100644 --- a/cdsp/information-layer/handlers/iotdb/utils/SessionDataSet.js +++ b/cdsp/information-layer/handlers/src/iotdb/utils/SessionDataSet.js @@ -120,7 +120,7 @@ class SessionDataSet { if (dataTypeProcessors[dataType]) { obj[tsName] = dataTypeProcessors[dataType](valueBytes); } else { - throw new Error("Unsupported data type."); + throw new Error(`Unsupported data type: ${dataType}`); } } else { let tsName = diff --git a/cdsp/information-layer/handlers/realmdb/.gitignore b/cdsp/information-layer/handlers/src/realmdb/.gitignore similarity index 52% rename from cdsp/information-layer/handlers/realmdb/.gitignore rename to cdsp/information-layer/handlers/src/realmdb/.gitignore index 7652e67..4bdca67 100644 --- a/cdsp/information-layer/handlers/realmdb/.gitignore +++ b/cdsp/information-layer/handlers/src/realmdb/.gitignore @@ -1,12 +1,6 @@ -# MongoDB Realm -mongodb-realm/ - # Node.js node_modules/ package-lock.json # Credentials Config File -config.js - -# MAC -**/.DS_Store +config/config.js \ No newline at end of file diff --git a/cdsp/information-layer/handlers/realmdb/README.md b/cdsp/information-layer/handlers/src/realmdb/README.md similarity index 85% rename from cdsp/information-layer/handlers/realmdb/README.md rename to cdsp/information-layer/handlers/src/realmdb/README.md index e23a4bb..6e68fb1 100644 --- a/cdsp/information-layer/handlers/realmdb/README.md +++ b/cdsp/information-layer/handlers/src/realmdb/README.md @@ -1,4 +1,6 @@ -This directory contains the RealmDB Handler as Node.js application. As [RealmDB](https://www.mongodb.com/docs/atlas/device-sdks/sdk/node/) is an embedded database, the RealmDB Handler directly embedds the RealmSDK which creates the [RealmDB database](https://github.com/realm/realm-js) file(s) automatically in the working directory during runtime of RealmDB Handler. +# RealmDB + +This directory contains the RealmDB Handler as Node.js application. As [RealmDB](https://www.mongodb.com/docs/atlas/device-sdks/sdk/node/) is an embedded database, the RealmDB Handler directly embeds the RealmSDK which creates the [RealmDB database](https://github.com/realm/realm-js) file(s) automatically in the working directory during runtime of RealmDB Handler. # Features - **Authentication**: Authenticates with MongoDB Realm using an API key. @@ -37,4 +39,4 @@ module.exports = { ## Starting the RealmDB handler -You do not need to start RealmDB Handler manually. It is started by the DB-Router like described [here](../../router/README.md#Run). \ No newline at end of file +You do not need to start RealmDB Handler manually. It is started by the DB-Router like described [here](../../../router/README.md#Run). \ No newline at end of file diff --git a/cdsp/information-layer/handlers/realmdb/config/databaseParams.js b/cdsp/information-layer/handlers/src/realmdb/config/database-params.js similarity index 61% rename from cdsp/information-layer/handlers/realmdb/config/databaseParams.js rename to cdsp/information-layer/handlers/src/realmdb/config/database-params.js index 5f7300b..43b198e 100644 --- a/cdsp/information-layer/handlers/realmdb/config/databaseParams.js +++ b/cdsp/information-layer/handlers/src/realmdb/config/database-params.js @@ -1,11 +1,15 @@ /* * Contains the definition of the database name and its identifier endpoint for each catalog. */ -const databaseParams = Object.freeze({ +const mediaElementsParams = Object.freeze({ VSS: { databaseName: "Vehicles", // name of the configured RealmDB for the VSS database endpointId: "Vehicle_VehicleIdentification_VIN", // endpoint used as element ID }, }); -module.exports = databaseParams; +const databaseConfig = Object.freeze({ + storePath: "myrealm12.realm", +}); + +module.exports = { mediaElementsParams, databaseConfig }; diff --git a/cdsp/information-layer/handlers/src/realmdb/config/realm-configuration.js b/cdsp/information-layer/handlers/src/realmdb/config/realm-configuration.js new file mode 100644 index 0000000..89ba3c9 --- /dev/null +++ b/cdsp/information-layer/handlers/src/realmdb/config/realm-configuration.js @@ -0,0 +1,72 @@ +const { mediaElementsParams, databaseConfig } = require("./database-params"); +const dotenv = require("dotenv"); +dotenv.config(); + +function realmConfig(user, supportedEndpoints) { + const mediaElementSchema = createMediaElementSchema(supportedEndpoints); + return { + schema: [mediaElementSchema], + path: databaseConfig.storePath, + sync: { + user: user, + flexible: true, + error: (error) => { + console.error("Realm sync error:", error); + }, + }, + // `schemaVersion` is by default 0, it can be incremented when the schema changes, + // but you need to write the logic to migrate existing data to the new schema. + // See: https://www.mongodb.com/docs/atlas/device-sdks/sdk/node/model-data/modify-an-object-schema/ + schemaVersion: getSchemaVersion(), + migration: (oldRealm, newRealm) => { + // Perform migration logic here + }, + }; +} + +const getSchemaVersion = () => { + const schemaVersion = parseInt(process.env.VERSION, 10); + if (isNaN(schemaVersion)) { + throw new Error( + "Version must be specified as an ENV variable and it must be 0 or a positive integer" + ); + } + return schemaVersion; +}; + +function createMediaElementSchema(supportedEndpoints) { + const properties = { _id: "string" }; + + Object.entries(supportedEndpoints).forEach(([key, value]) => { + switch (value) { + case "boolean": + properties[key] = "bool"; + break; + case "string": + case "float": + case "double": + properties[key] = value; + break; + case "int8": + case "int16": + case "uint8": + case "uint16": + properties[key] = "int"; + break; + default: + throw new Error( + `The initialized endpoints contains an unsupported data type: ${value}` + ); + } + }); + + const mediaElementSchema = { + primaryKey: "_id", + name: mediaElementsParams.VSS.databaseName, + properties: properties, + }; + + return mediaElementSchema; +} + +module.exports = realmConfig; diff --git a/cdsp/information-layer/handlers/realmdb/package.json b/cdsp/information-layer/handlers/src/realmdb/package.json similarity index 87% rename from cdsp/information-layer/handlers/realmdb/package.json rename to cdsp/information-layer/handlers/src/realmdb/package.json index 45c1a6e..71a4504 100644 --- a/cdsp/information-layer/handlers/realmdb/package.json +++ b/cdsp/information-layer/handlers/src/realmdb/package.json @@ -4,7 +4,7 @@ "description": "Realm database handler", "main": "realmdb-handler.js", "dependencies": { - "realm": "^12.9.0", + "realm": "^12.13.1", "uuid": "^9.0.1" } } diff --git a/cdsp/information-layer/handlers/realmdb/src/realmdb-handler.js b/cdsp/information-layer/handlers/src/realmdb/src/realmdb-handler.js similarity index 63% rename from cdsp/information-layer/handlers/realmdb/src/realmdb-handler.js rename to cdsp/information-layer/handlers/src/realmdb/src/realmdb-handler.js index db7038c..ce6ef53 100644 --- a/cdsp/information-layer/handlers/realmdb/src/realmdb-handler.js +++ b/cdsp/information-layer/handlers/src/realmdb/src/realmdb-handler.js @@ -1,13 +1,17 @@ const Realm = require("realm"); const Handler = require("../../handler"); const config = require("../config/config"); -const database = require("../config/databaseParams"); -const realmConfig = require("../config/realmConfiguration"); +const { mediaElementsParams } = require("../config/database-params"); +const realmConfig = require("../config/realm-configuration"); const { v4: uuidv4 } = require("uuid"); - const app = new Realm.App({ id: config.realmAppId }); const credentials = Realm.Credentials.apiKey(config.realmApiKey); - +const { + logMessage, + logWithColor, + MessageType, + COLORS, +} = require("../../../../utils/logger"); /** * Parses the response from a media element change event. * @@ -26,41 +30,49 @@ class RealmDBHandler extends Handler { constructor() { super(); this.realm = null; - this.sendMessageToClients = null; + this._sendMessageToClients = null; } async authenticateAndConnect(sendMessageToClients) { try { - this.sendMessageToClients = sendMessageToClients; + this._sendMessageToClients = sendMessageToClients; const user = await app.logIn(credentials); - console.log("Successfully authenticated with Realm"); - - const realmConfigObj = realmConfig(user); + console.info("Successfully authenticated to RealmDB"); + const supportedEndpoints = this._getSupportedEndpoints(); + const realmConfigObj = realmConfig(user, supportedEndpoints); this.realm = await Realm.open(realmConfigObj); - console.log("Realm connection established successfully"); + console.info("Connection established successfully"); - Object.entries(database).forEach(async ([key, value]) => { + Object.entries(mediaElementsParams).forEach(async ([key, value]) => { try { const databaseName = value.databaseName; await this.realm.objects(databaseName).subscribe(); - console.log(`Subscribed to the database ${key}: ${databaseName}`); + console.info(`Subscribed to the database ${key}: ${databaseName}`); } catch (error) { - throw new Error("Error subscribing databases."); + logMessage( + "Error subscribing databases: ".concat(error), + MessageType.ERROR + ); } }); } catch (error) { - console.error("Failed to authenticate with Realm:", error); + logMessage( + "Failed to authenticate with Realm: ".concat(error), + MessageType.ERROR + ); } } async read(message, ws) { try { const updateMessage = await this.#getMessageData(message, ws); - console.log(updateMessage); - this.sendMessageToClient(ws, updateMessage); + this._sendMessageToClient(ws, updateMessage); } catch (error) { - console.error("Error reading object from Realm:", error); - this.sendMessageToClient(ws, { error: "Error reading object" }); + logMessage( + "Error reading object from Realm: ".concat(error), + MessageType.ERROR + ); + this._sendMessageToClient(ws, { error: "Error reading object" }); } } @@ -73,21 +85,21 @@ class RealmDBHandler extends Handler { if (mediaElement) { this.realm.write(() => { nodes.forEach(({ name, value }) => { - const prop = this.transformEndpointFromMessageNode(name); + const prop = this._transformEndpointsWithUnderscores(name); endpoints.push(name); mediaElement[prop] = value; }); }); } else { - const endpointId = database[message.tree].endpointId; + const endpointId = mediaElementsParams[message.tree].endpointId; let document = { _id: uuidv4(), [endpointId]: message.id }; nodes.forEach(({ name, value }) => { - const prop = this.transformEndpointFromMessageNode(name); + const prop = this._transformEndpointsWithUnderscores(name); endpoints.push(name); document[prop] = value; }); - const databaseName = database[message.tree].databaseName; + const databaseName = mediaElementsParams[message.tree].databaseName; this.realm.write(() => { this.realm.create(databaseName, document); @@ -95,17 +107,15 @@ class RealmDBHandler extends Handler { } let messageNodes = endpoints.map((key) => ({ name: key })); - const readMessage = this.createOrUpdateMessage( - message, - messageNodes, - "read" - ); - const updateMessage = await this.#getMessageData(readMessage, ws); - console.log(updateMessage); - this.sendMessageToClients(updateMessage); + + const updateMessage = await this.#getMessageData(message, ws); + this._sendMessageToClients(updateMessage); } catch (error) { - console.error("Error writing object changes in Realm:", error); - this.sendMessageToClient(ws, { error: "Error writing object changes" }); + logMessage( + "Error writing object changes in Realm: ".concat(error), + MessageType.ERROR + ); + this._sendMessageToClient(ws, { error: "Error writing object changes" }); } } @@ -115,9 +125,10 @@ class RealmDBHandler extends Handler { if (mediaElement) { const objectId = mediaElement._id; const { id, tree, uuid } = message; - const { databaseName, endpointId } = database[tree]; - console.log( - `Subscribing element: Object ID: ${objectId} with ${endpointId}: '${id}' on ${databaseName}` + const { databaseName, endpointId } = mediaElementsParams[tree]; + logWithColor( + `Subscribing element: Object ID: ${objectId} with ${endpointId}: '${id}' on ${databaseName}`, + COLORS.GREY ); const mediaElementToSubscribe = await this.realm.objectForPrimaryKey( @@ -128,29 +139,30 @@ class RealmDBHandler extends Handler { if (mediaElementToSubscribe) { mediaElementToSubscribe.addListener( (mediaElementToSubscribe, changes) => - this.#onMediaElementChange(mediaElementToSubscribe, changes, { - id: id, - tree: tree, - uuid: uuid, - }) + this.#onMediaElementChange( + mediaElementToSubscribe, + changes, + { + id: id, + tree: tree, + uuid: uuid, + }, + ws + ) ); - console.log(`Subscribed to changes for Object ID: ${objectId}`); - this.sendMessageToClient(ws, { - success: `Subscribed to changes for Object ID: ${objectId}`, + this._sendMessageToClient(ws, { + success: `subscribed to ${endpointId}: '${id}'`, }); } else { - console.log(`Object could not be subscribed`); - this.sendMessageToClient(ws, { + this._sendMessageToClient(ws, { error: "Object could not be subscribed", }); } } else { - console.log(`Object not found`); - this.sendMessageToClient(ws, { error: "Object not found" }); + this._sendMessageToClient(ws, { error: "Object not found" }); } } catch (error) { - console.error("Error subscribing to object changes in Realm:", error); - this.sendMessageToClient(ws, { + this._sendMessageToClient(ws, { error: "Error subscribing to object changes", }); } @@ -166,10 +178,13 @@ class RealmDBHandler extends Handler { */ async #getMessageData(message, ws) { const mediaElement = await this.#getMediaElement(message, ws); - console.log("mediaElement: ", mediaElement); + logWithColor( + `Media Element: \n ${JSON.stringify(mediaElement)}`, + COLORS.GREY + ); if (mediaElement) { const responseNodes = this.#parseReadResponse(message, mediaElement); - return this.createOrUpdateMessage(message, responseNodes, "update"); + return this._createUpdateMessage(message, responseNodes); } else { throw new Error(`No data found with the Id: ${message.id}`); } @@ -185,13 +200,12 @@ class RealmDBHandler extends Handler { async #getMediaElement(message, ws) { try { const { id, tree } = message; - const { databaseName, endpointId } = database[tree]; + const { databaseName, endpointId } = mediaElementsParams[tree]; return await this.realm .objects(databaseName) .filtered(`${endpointId} = '${id}'`)[0]; } catch (error) { - console.error("Error reading object from Realm:", error); - this.sendMessageToClient(ws, { error: "Error reading object" }); + this._sendMessageToClient(ws, { error: "Error reading object" }); } } @@ -201,22 +215,25 @@ class RealmDBHandler extends Handler { * @param {object} changes - An object containing information about the changes. * @param {messageHeader} messageHeader - The header information for the message. */ - #onMediaElementChange(mediaElement, changes, messageHeader) { + #onMediaElementChange(mediaElement, changes, messageHeader, ws) { + logMessage( + "Media element changed", + MessageType.RECEIVED, + `Web-Socket Connection Event Received` + ); if (changes.deleted) { - console.log(`MediaElement is deleted: ${changes.deleted}`); + logMessage(changes.deleted, COLORS.YELLOW, "MediaElement is deleted"); } else { if (changes.changedProperties.length > 0) { const responseNodes = parseOnMediaElementChangeResponse( changes, mediaElement ); - const updateMessage = this.createOrUpdateMessage( + const updateMessage = this._createUpdateMessage( messageHeader, - responseNodes, - "update" + responseNodes ); - console.log(updateMessage); - this.sendMessageToClients(updateMessage); + this._sendMessageToClient(ws, updateMessage); } } } @@ -232,7 +249,7 @@ class RealmDBHandler extends Handler { const data = []; const nodes = message.node ? [message.node] : message.nodes; nodes.forEach((node) => { - const prop = this.transformEndpointFromMessageNode(node.name); + const prop = this._transformEndpointsWithUnderscores(node.name); data.push({ name: node.name, value: queryResponseObj[prop], diff --git a/cdsp/information-layer/router/README.md b/cdsp/information-layer/router/README.md index 554d403..e93a185 100644 --- a/cdsp/information-layer/router/README.md +++ b/cdsp/information-layer/router/README.md @@ -12,10 +12,10 @@ npm install ``` # Run - -In the `.env` file are defined the environment variables: +The `.env` file contains key-value pairs of environment variables that are used during the build and runtime of the Docker container. This allows for easy configuration of the application without changing the source code. - **HANDLER_TYPE**: Configure `realmdb` to start the RealmDB Handler or `iotdb` to start the IoTDB Handler. +- **VERSION**: This variable is automatically incremented by the build script, ensuring that every Docker image build has a unique version identifier. > [!WARNING] > Create a `.env` file in the same directory as your `docker-compose.yml`. If it doesn't exist, create it in the same directory as `websocket-server.js`. diff --git a/cdsp/information-layer/router/package.json b/cdsp/information-layer/router/package.json index 4bef0ba..d5aafb0 100644 --- a/cdsp/information-layer/router/package.json +++ b/cdsp/information-layer/router/package.json @@ -2,9 +2,9 @@ "name": "websocket-server", "version": "1.0.0", "description": "WebSocket server", - "main": "websocket-server.js", + "main": "src/websocket-server.js", "scripts": { - "start": "node websocket-server.js" + "start": "node src/websocket-server.js" }, "dependencies": { "ajv": "^8.17.1", diff --git a/cdsp/information-layer/router/src/.env b/cdsp/information-layer/router/src/.env index bcaf5de..a900aca 100644 --- a/cdsp/information-layer/router/src/.env +++ b/cdsp/information-layer/router/src/.env @@ -1 +1,4 @@ -HANDLER_TYPE=iotdb \ No newline at end of file +# HANDLER_TYPE can be initialized with two different values: `realmdb` or `iotdb` +HANDLER_TYPE=realmdb +# VERSION must be 0 or a positive integer. This is used for versioning the RealmDB configuration schema. +VERSION=0 diff --git a/cdsp/information-layer/router/src/websocket-server.js b/cdsp/information-layer/router/src/websocket-server.js index 6a4b3d4..b4895b1 100644 --- a/cdsp/information-layer/router/src/websocket-server.js +++ b/cdsp/information-layer/router/src/websocket-server.js @@ -1,12 +1,19 @@ const WebSocket = require("ws"); -const RealmDBHandler = require("../../handlers/realmdb/src/realmdb-handler"); -const IoTDBHandler = require("../../handlers/iotdb/src/iotdb-handler"); +const RealmDBHandler = require("../../handlers/src/realmdb/src/realmdb-handler"); +const IoTDBHandler = require("../../handlers/src/iotdb/src/iotdb-handler"); const { getHandlerType } = require("../config/config"); const { validateMessage } = require("../utils/message-validator"); +const { + logMessage, + logWithColor, + MessageType, + COLORS, +} = require("../../utils/logger"); const handlerType = getHandlerType(); let handler; -console.log(`this is the handler type: ${handlerType}`); + +logWithColor(`\n ** Handler: ${handlerType} ** \n`, COLORS.BOLD); switch (handlerType) { case "realmdb": @@ -25,14 +32,17 @@ const server = new WebSocket.Server({ port: 8080 }); let clients = []; server.on("connection", (ws) => { - console.log("Client connected"); + logWithColor("* Client connected *", COLORS.YELLOW); clients.push(ws); // Add client to the array ws.on("message", (message) => { - console.log(`Message received: ${message}`); + logMessage(JSON.stringify(message), MessageType.RECEIVED); const validatedMessage = validateMessage(message); if (validatedMessage instanceof Error) { - console.error(`Invalid message format: ${validatedMessage.message}`); + logMessage( + `Invalid message format: ${validatedMessage.message}`, + MessageType.ERROR + ); ws.send( JSON.stringify({ error: `Invalid message format`, @@ -44,21 +54,19 @@ server.on("connection", (ws) => { }); ws.on("close", () => { - console.log("Client disconnected"); + console.info("* Client disconnected *"); // Remove disconnected client from the array clients = clients.filter((client) => client !== ws); }); }); const sendMessageToClients = (message) => { + logMessage(JSON.stringify(message), MessageType.SENT); clients.forEach((client) => { client.send(JSON.stringify(message)); }); }; -console.log(`Starting authentication and connection to ${handlerType} ...`); +console.info(`Starting authentication and connection ...`); handler.authenticateAndConnect(sendMessageToClients); - -console.log( - `WebSocket server started on ws://localhost:8080 using ${handlerType} handler` -); +logWithColor(`Web-Socket server started on ws://localhost:8080\n`, COLORS.BOLD); diff --git a/cdsp/information-layer/utils/logger.js b/cdsp/information-layer/utils/logger.js new file mode 100644 index 0000000..8b0f957 --- /dev/null +++ b/cdsp/information-layer/utils/logger.js @@ -0,0 +1,51 @@ +const COLORS = { + RESET: "\x1b[0m", + GREEN: "\x1b[32m", + BLUE: "\x1b[34m", + RED: "\x1b[31m", + PALE_WHITE: "\x1b[37m", + GREY: "\x1b[90m", + YELLOW: "\x1b[33m", + BOLD: "\x1b[1m", +}; + +const MessageType = { + RECEIVED: COLORS.GREEN, + SENT: COLORS.BLUE, + ERROR: COLORS.RED, + OTHER: COLORS, +}; + +function logWithColor(message, color) { + console.log("\n", color, message, COLORS.RESET); +} + +function logMessage(featureStr, type, label = "") { + let color = type; + const datetimeNow = new Date().toLocaleString(); + let labelText; + switch (type) { + case MessageType.RECEIVED: + labelText = "\u2193 ".concat(label || "Client Received"); + break; + case MessageType.SENT: + labelText = "\u2191 ".concat(label || "Client Sent"); + break; + case MessageType.ERROR: + labelText = "\u2716".concat(label || "Internal Error"); + break; + default: + if (Object.values(MessageType.OTHER).includes(type)) { + labelText = label || "Message"; + } else { + color = COLORS.RESET; + labelText = label || "777"; + } + break; + } + const logEntry = `\n${COLORS.PALE_WHITE}${datetimeNow}${COLORS.RESET} ${color}${labelText}${COLORS.RESET}`; + console.log(logEntry); + console.log(featureStr); +} + +module.exports = { logMessage, logWithColor, MessageType, COLORS }; From c8ef06d999097db95a97eb344baee4fef7623b9e Mon Sep 17 00:00:00 2001 From: "Andre Wendel (Q290938)" Date: Fri, 6 Sep 2024 15:54:14 +0200 Subject: [PATCH 25/48] Dockerize informations-layer Signed-off-by: Andre Wendel --- .vscode/settings.json | 4 + cdsp/information-layer/.dockerignore | 6 + cdsp/information-layer/.gitignore | 6 + cdsp/information-layer/.prettierignore | 5 + cdsp/information-layer/Dockerfile | 45 ++++ cdsp/information-layer/README.md | 255 +++++++++++------- cdsp/information-layer/handlers/README.md | 12 +- .../handlers/config/README.md | 26 +- .../handlers/config/config.js | 33 ++- .../vss_data_points.json} | 7 +- .../vss_data_points.yaml} | 2 +- cdsp/information-layer/handlers/package.json | 6 - .../handlers/{ => src}/.gitignore | 0 .../information-layer/handlers/src/handler.js | 61 +++-- .../handlers/src/iotdb/.gitignore | 3 - .../handlers/src/iotdb/README.md | 50 ++-- .../src/iotdb/config/data-points-type.js | 46 ++++ .../src/iotdb/config/database-params.js | 51 ++++ .../src/iotdb/config/databaseParams.js | 11 - .../src/iotdb/config/endpointsType.js | 46 ---- .../handlers/src/iotdb/src/iotdb-handler.js | 113 ++++---- .../{IoTDBConstants.js => iotdb-constants.js} | 0 ...terpreter.js => iotdb-data-interpreter.js} | 8 +- ...BRpcDataSets.js => iotdb-rpc-data-sets.js} | 8 +- ...{SessionDataSet.js => session-data-set.js} | 12 +- .../handlers/src/package.json | 8 + .../handlers/src/realmdb/.gitignore | 5 +- .../handlers/src/realmdb/README.md | 52 ++-- .../src/realmdb/config/database-params.js | 41 ++- .../src/realmdb/config/realm-configuration.js | 20 +- .../src/realmdb/src/realmdb-handler.js | 170 ++++++++---- cdsp/information-layer/package.json | 22 ++ cdsp/information-layer/router/README.md | 27 +- .../information-layer/router/config/config.js | 4 +- cdsp/information-layer/router/package.json | 1 - cdsp/information-layer/router/src/.env | 4 - .../router/src/websocket-server.js | 8 +- .../router/utils/message-validator.js | 11 + docker/.gitignore | 3 +- docker/README.md | 115 ++++++-- docker/docker-compose-cdsp.yml | 89 +++--- docker/start_docker.sh | 0 42 files changed, 900 insertions(+), 496 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 cdsp/information-layer/.dockerignore create mode 100644 cdsp/information-layer/.gitignore create mode 100644 cdsp/information-layer/.prettierignore create mode 100644 cdsp/information-layer/Dockerfile rename cdsp/information-layer/handlers/config/{vss_endpoints.json => schema-files/vss_data_points.json} (98%) rename cdsp/information-layer/handlers/config/{vss_endpoints.yaml => schema-files/vss_data_points.yaml} (98%) delete mode 100644 cdsp/information-layer/handlers/package.json rename cdsp/information-layer/handlers/{ => src}/.gitignore (100%) create mode 100644 cdsp/information-layer/handlers/src/iotdb/config/data-points-type.js create mode 100644 cdsp/information-layer/handlers/src/iotdb/config/database-params.js delete mode 100644 cdsp/information-layer/handlers/src/iotdb/config/databaseParams.js delete mode 100644 cdsp/information-layer/handlers/src/iotdb/config/endpointsType.js rename cdsp/information-layer/handlers/src/iotdb/utils/{IoTDBConstants.js => iotdb-constants.js} (100%) rename cdsp/information-layer/handlers/src/iotdb/utils/{IoTDBDataInterpreter.js => iotdb-data-interpreter.js} (96%) rename cdsp/information-layer/handlers/src/iotdb/utils/{IoTDBRpcDataSets.js => iotdb-rpc-data-sets.js} (98%) rename cdsp/information-layer/handlers/src/iotdb/utils/{SessionDataSet.js => session-data-set.js} (93%) create mode 100644 cdsp/information-layer/handlers/src/package.json create mode 100644 cdsp/information-layer/package.json delete mode 100644 cdsp/information-layer/router/src/.env create mode 100644 docker/start_docker.sh diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..96da0b8 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "pieces.cloudCapabilities": "Blended", + "pieces.telemetry": true +} diff --git a/cdsp/information-layer/.dockerignore b/cdsp/information-layer/.dockerignore new file mode 100644 index 0000000..1c412eb --- /dev/null +++ b/cdsp/information-layer/.dockerignore @@ -0,0 +1,6 @@ +# ignore mongodb generated files +mongodb-realm + +# ignore all node generated file +node_modules +package-lock.json \ No newline at end of file diff --git a/cdsp/information-layer/.gitignore b/cdsp/information-layer/.gitignore new file mode 100644 index 0000000..79ef773 --- /dev/null +++ b/cdsp/information-layer/.gitignore @@ -0,0 +1,6 @@ +# MongoDB Realm +mongodb-realm/ + +# Node.js +node_modules/ +package-lock.json diff --git a/cdsp/information-layer/.prettierignore b/cdsp/information-layer/.prettierignore new file mode 100644 index 0000000..3e52534 --- /dev/null +++ b/cdsp/information-layer/.prettierignore @@ -0,0 +1,5 @@ +#ignore node modules +node_modules + +#ignore autogenerated files by thrift +handlers/src/iotdb/gen-nodejs \ No newline at end of file diff --git a/cdsp/information-layer/Dockerfile b/cdsp/information-layer/Dockerfile new file mode 100644 index 0000000..e0336a0 --- /dev/null +++ b/cdsp/information-layer/Dockerfile @@ -0,0 +1,45 @@ +# Base image for Node.js +FROM node:22.5.1 + +######################### +# GENERAL CONFIGURATION # +######################### + +# HANDLER_TYPE can be initialized with two different values: `realmdb` or `iotdb` +ENV HANDLER_TYPE=${HANDLER_TYPE} + +######################### +# REALMDB CONFIGURATION # +######################### + +# VERSION must be 0 or a positive integer. This is used for versioning the RealmDB configuration schema. +ENV VERSION_REALMDB_SCHEMA=${VERSION_REALMDB_SCHEMA} + +# Access to ATLAS Cloud instance +ENV REALMDB_APP_ID=${REALMDB_APP_ID} +ENV REALMDB_API_KEY=${REALMDB_API_KEY} + +####################### +# IOTDB CONFIGURATION # +####################### + +# Access to iotdb-service +ENV IOTDB_HOST: ${IOTDB_HOST} +ENV IOTDB_PORT: ${IOTDB_PORT} +ENV IOTDB_USER: ${IOTDB_USER} +ENV IOTDB_PASSWORD: ${IOTDB_PASSWORD} +ENV IOTDB_FETCH_SIZE: ${IOTDB_FETCH_SIZE} + +# Set working directory inside the container +WORKDIR /app + +COPY . ./ + +# Install dependencies, including workspaces +RUN npm install --production + +# Expose the necessary port +EXPOSE 8080 + +# Command to run the WebSocket server +CMD ["node", "router/src/websocket-server.js"] \ No newline at end of file diff --git a/cdsp/information-layer/README.md b/cdsp/information-layer/README.md index 304f35d..ab73937 100644 --- a/cdsp/information-layer/README.md +++ b/cdsp/information-layer/README.md @@ -1,33 +1,33 @@ +# Information Layer Playground components + This directory contains files related to the [Information Layer](https://en.wikipedia.org/wiki/DIKW_pyramid) of the Central Data Service Playground. -# Information Layer Playground components - - [Database-Handlers](./handlers) - - [Database-Router](./router) +- [Database-Handlers](./handlers/README.md) +- [Database-Router](./router/README.md) # Setting up a CDSP Information Layer -Setting up an information layer in the CDSP involves running a [Database-Router](./router), which is technically a configurable Websocket server that enables northbound connections for WebSocket clients, such as a [Knowledge Layer Connector](../knowledge-layer/README.md), to read, subscribe, and write data. The WebSocket server is connected to a database, which can be selected before starting the web server. Southbound feeders write data to the database in a predefined semantic format, such as [VSS](https://github.com/COVESA/vehicle_signal_specification). + +Setting up an information layer in the CDSP involves running a [Database-Router](./router/README.md), which is technically a configurable Websocket server that enables northbound connections for WebSocket clients, such as a [Knowledge Layer Connector](../knowledge-layer/README.md), to read, subscribe, and write data. The WebSocket server is connected to a database, which can be selected before starting the web server. Southbound feeders write data to the database in a predefined semantic format, such as [VSS](https://github.com/COVESA/vehicle_signal_specification). ## Installation of Database-Handler -Please follow installation instructions of the chosen [handler](./handlers/). - -## Installation of Database-Router -See [hier](./router/README.md#Install) how to install the Database-Router. +Please follow installation instructions of the chosen [handler](./handlers/README.md). -# Running "Hello World" example +# Running "Hello World" example (WIP) The Hello World example in our case is quite simple. We feed an updated value for the `CurrentLocation_Longitude` into the database and we check afterwards in the logs if the DB-router creates a Websocket update message for it. ## Choose and prepare your Database > [!WARNING] -> Before start the application, ensure that the supported endpoints are correctly defined and configured. See [how](./handlers/config/README.md). +> Before start the application, ensure that the supported data points are correctly defined and configured. See [how](./handlers/config/README.md). ### Realm -- Ensure that in your [ATLAS cloud](https://cloud.mongodb.com/) app there is a vehicle *document* with an `Vehicle_VehicleIdentification_VIN` in a collection named *`Vehicles`*. -- Ensure that this document as well contains VSS data. Here you can see the supported data in a vehicle document within the *Vehicles* should look like in ATLAS: - ``` +- Ensure that in your [ATLAS cloud](https://cloud.mongodb.com/) app there is a vehicle _document_ with an `Vehicle_VehicleIdentification_VIN` in a collection named _`Vehicles`_. +- Ensure that this document as well contains VSS data. Here you can see the data supported in this repository for a vehicle document within _Vehicles_ that should be reflected in ATLAS: + + ```text _id: "" (String) Vehicle_Chassis_SteeringWheel_Angle: (Int32) Vehicle_CurrentLocation_Latitude: (Double) @@ -40,10 +40,11 @@ The Hello World example in our case is quite simple. We feed an updated value fo ``` ### IoTDB -- Ensure to start and run Docker containers defined in a [Docker Compose file](/docker/). -- Ensure that in the IoTDB CLI there is a `root.Vehicles` *database* like this: - ``` +- Ensure to start and run Docker containers defined in a [Docker Compose file](/docker/README.md). +- Ensure that in the IoTDB CLI there is a `root.Vehicles` _database_ like this: + + ```text IoTDB> show databases; +-------------+----+-----------------------+---------------------+---------------------+ | Database| TTL|SchemaReplicationFactor|DataReplicationFactor|TimePartitionInterval| @@ -54,9 +55,9 @@ The Hello World example in our case is quite simple. We feed an updated value fo It costs 0.004s ``` -- Create two *timeseries* with the `root.Vehicles.Vehicle_VehicleIdentification_VIN` and some VSS data. Here you can see an example how the vehicle document within the *Vehicles* should look like in IoTDB CLI: +- Create two _timeseries_ with the `root.Vehicles.Vehicle_VehicleIdentification_VIN` and some VSS data. Here you can see an example how the vehicle document within the _Vehicles_ should look like in IoTDB CLI: - ``` + ```text IoTDB> show timeseries; +----------------------------------------------------------------------------+-----+-------------+--------+--------+-----------+----+----------+--------+------------------+--------+ | Timeseries|Alias| Database|DataType|Encoding|Compression|Tags|Attributes|Deadband|DeadbandParameters|ViewType| @@ -70,26 +71,83 @@ The Hello World example in our case is quite simple. We feed an updated value fo |root.Vehicles.Vehicle_Powertrain_TractionBattery_StateOfCharge_CurrentEnergy| null|root.Vehicles| FLOAT| RLE| LZ4|null| null| null| null| BASE| | root.Vehicles.Vehicle_Powertrain_TractionBattery_NominalVoltage| null|root.Vehicles| INT32| RLE| LZ4|null| null| null| null| BASE| +----------------------------------------------------------------------------+-----+-------------+--------+--------+-----------+----+----------+--------+------------------+--------+ - + ``` + ## Start the Database Router -See [here](./router/README.md#Run) how to start the database router. +### Using Docker Compose + +See [here](/docker/README.md) how to start the services using Docker. + +### Using Docker directly from Dockerfile in information-layer + +Go to `covesa.cdsp/cdsp/information-layer` and run in CLI: + +```shell +$ docker build -t webserver-service . +``` + +To run `RealmDB` use: + +> [!IMPORTANT] See [here](./handlers/src/realmdb/README.md) all the required ENV variables. + +```shell +$ docker run --name websocket-service -e HANDLER_TYPE=realmdb [-e required_env_variables] -p 8080:8080 websocket-service +``` + +To run `IoTDB` use: + +> [!IMPORTANT] See [here](./handlers/src/iotdb/README.md) all the required ENV variables. These are optional, because by default it uses the local configuration to connect to the `iotdb-service` container. + +```shell +$ docker run --name websocket-service -e HANDLER_TYPE=iotdb --network cdsp_default [-e required_env_variables] -p 8080:8080 websocket-service +``` + +### Using Node.js + +#### Install + +Execute in this directory: + +```shell +npm install +``` + +To start the websocket-server using `RealmDB` execute the command: + +To run `RealmDB` use: + +> [!IMPORTANT] See [here](./handlers/src/realmdb/README.md) all the required ENV variables. + +```shell +$ HANDLER_TYPE=realm [ENV_VARIABLE_NAME required_env_variables] npm start +``` + +To start the websocket-server using `IoTDB` execute the command: + +> [!IMPORTANT] See [here](./handlers/src/iotdb/README.md) all the required ENV variables. These are optional, because by default it uses the local configuration to connect to the `iotdb-service` container. + +```shell +$ HANDLER_TYPE=iotdb IOTDB_HOST=localhost [ENV_VARIABLE_NAME required_env_variables] npm start +``` ## Look out for the Websocket Server message in the console + If the handler is running and you are [subscribed](#subscribing-to-changes) to an element, when you change the value of `CurrentLocation_Longitude` in ATLAS cloud (let's say `-157845.68200000003`), you should immediately see this line in console: -``` +```json { - type: 'update', - tree: 'VSS', - id: '', - dateTime: '', - uuid: '', - node: { name: 'CurrentLocation_Longitude', value: `-157845.68200000003` } + "type": "update", + "tree": "VSS", + "id": "", + "dateTime": "", + "uuid": "", + "node": { "name": "CurrentLocation_Longitude", "value": "-157845.68200000003" } } ``` # Connect your own Websocket Client + Connect your own websocket client by connecting to `ws://localhost:8080` The examples use the VIN (Vehicle Identification Number) as object identifier. @@ -98,82 +156,95 @@ The examples use the VIN (Vehicle Identification Number) as object identifier. To read data, send a message with the type of request and VIN as object ID: - * Example for one Node: - ```json - { - "type": "read", - "tree": "VSS", - "id": "", - "uuid": "", - "node": { +- Example for one Node: + ```json + { + "type": "read", + "tree": "VSS", + "id": "", + "uuid": "", + "node": { + "name": "" + } + } + ``` +- Example for multiple Nodes: + ```json + { + "type": "read", + "tree": "VSS", + "id": "", + "uuid": "", + "nodes": [ + { "name": "" + }, + { + "name": "" } - } - ``` - * Example for multiple Nodes: - ```json - { - "type": "read", - "tree": "VSS", - "id": "", - "uuid": "", - "nodes": [ - { - "name": "" - }, - { - "name": "" - } - ] - } - ``` + ] + } + ``` ### Writing data To write data, send a message with the type of request and VIN as object ID (at this moment only with IoTDB available): - * Example for one Node: - ```json - { - "type": "write", - "tree": "VSS", - "id": "", - "uuid": "", - "node": { - "name": "", - "value": "" - } - } - ``` - * Example for multiple Nodes: - ```json - { - "type": "write", - "tree": "VSS", - "id": "", - "uuid": "", - "nodes": [ - { - "name": "", - "value": "" - }, - { - "name": "", - "value": "" - } - ] +- Example for one Node: + ```json + { + "type": "write", + "tree": "VSS", + "id": "", + "uuid": "", + "node": { + "name": "", + "value": "" } - ``` -### Subscribing to changes - -To subscribe to changes in a specific object, send a message with the type of request and VIN as object ID (at this moment only with RealmDB available): - + } + ``` +- Example for multiple Nodes: ```json { - "type": "subscribe", + "type": "write", "tree": "VSS", "id": "", - "uuid": "SOME_UUID" + "uuid": "", + "nodes": [ + { + "name": "", + "value": "" + }, + { + "name": "", + "value": "" + } + ] } ``` - + +### Subscribing to changes + +To subscribe to changes in a specific object, send a message with the type of request and VIN as object ID (at this moment only with RealmDB available): + +```json +{ + "type": "subscribe", + "tree": "VSS", + "id": "", + "uuid": "SOME_UUID" +} +``` + +### Subscribing to changes + +To unsubscribe to changes in a specific object, send a message with the type of request and VIN as object ID (at this moment only with RealmDB available): + +```json +{ + "type": "unsubscribe", + "tree": "VSS", + "id": "", + "uuid": "SOME_UUID" +} +``` diff --git a/cdsp/information-layer/handlers/README.md b/cdsp/information-layer/handlers/README.md index adccb2f..b81bd95 100644 --- a/cdsp/information-layer/handlers/README.md +++ b/cdsp/information-layer/handlers/README.md @@ -1,11 +1,11 @@ # Handlers -We support two different databases. +We support two different databases. For each of them is required to configurate the corresponding ENV variables in `/docker/.env` file. -- [IotDB](./src/iotdb) -- [RealmDB](./src/realmdb) +- [IotDB](./src/iotdb/README.md) +- [RealmDB](./src/realmdb/README.md) > [!WARNING] -> Before start working with any of them, ensure that the supported endpoints are correctly defined and configured. See [how](./handlers/config/README.md). -> -See [hier](../../information-layer/router/README.md) how to install the Database-Router. \ No newline at end of file +> Before start working with any of them, ensure that the supported data points are correctly defined and configured. See [how](./handlers/config/README.md). + +See [hier](../../information-layer/README.md) how to install and start the Websocket-Server. diff --git a/cdsp/information-layer/handlers/config/README.md b/cdsp/information-layer/handlers/config/README.md index 4f7c265..8cbbd5c 100644 --- a/cdsp/information-layer/handlers/config/README.md +++ b/cdsp/information-layer/handlers/config/README.md @@ -1,28 +1,18 @@ -# Configuration Handler for Endpoints +# Configuration Handler for supported Data Points -This module is responsible for handling the configuration of supported endpoints in the application. It supports JSON, YAML, or YML formats for defining the endpoints. +This module is responsible for handling the configuration of supported data points in the application. It supports JSON, YAML, or YML formats for defining the data points. -The files in this directory `vss_endpoints.yaml` and `vss_endpoints.json` contain the same endpoint definition (only one of them is necessary to build) and based on that, the system will configure the data schema used during the Database configuration. +The `vss_data_points.yaml` and `vss_data_points.json` files in the `./schema-files` directory contain the same data point definition (only one of them is necessary to build) and based on that, the system will configure the data schema used during the Database configuration. > [!WARNING] -> - Before starting the application, ensure that the desired YAML, YML or JSON file is correctly placed in the root directory of the module. This file should contain the definitions of the supported endpoints. The name and extension to use can be configured in the `config.js` file. -> - Ensure that the used file is correctly formatted and contains valid endpoint definitions. -> - **The application will not function correctly if the endpoints file is missing or incorrectly placed.** +> +> - Before starting the application, ensure that the desired YAML, YML or JSON file is correctly placed in the `./schema-files` directory. This file should contain the definitions of the supported data points. The name and extension to use can be configured in the `/docker/.env` file, it uses the ENV variable named `DATA_POINTS_SCHEMA_FILE`. If it is not specified, it uses `vss_data_points.yaml` by default, which is one of the files contained in this repository. . +> - Ensure that the used file is correctly formatted and contains valid data points definitions. +> - **The application will not function correctly if the data points file is missing or incorrectly placed.** ## File: `config.js` ### Description -The `config.js` file contains the logic to retrieve the full path to the endpoints configuration file (`vss_endpoints.yaml` in this case). This file is crucial for the application to understand which endpoints are supported and how they should be handled. +The `config.js` file contains the logic to retrieve the data defined in the ENV variables and the full path to the data points schema configuration file (`./schema-files/vss_data_points.yaml` in this case). This file is crucial for the application to understand which data points are supported and how they should be handled. -### Functions - -#### `getEndpointsPath` - -This function resolves the root directory path of the current module and joins it with the `ENDPOINTS_FILE` constant to form the full path to the endpoints file. - -```javascript -const getEndpointsPath = () => { - const rootPath = path.resolve(__dirname); - return path.join(rootPath, ENDPOINTS_FILE); -}; diff --git a/cdsp/information-layer/handlers/config/config.js b/cdsp/information-layer/handlers/config/config.js index f668fa8..4313b06 100644 --- a/cdsp/information-layer/handlers/config/config.js +++ b/cdsp/information-layer/handlers/config/config.js @@ -1,22 +1,37 @@ const path = require("path"); - +const dotenv = require("dotenv"); +dotenv.config(); /** - * This file contains the description of the supported endpoints. + * This file contains the description of the supported data points. * It supports JSON, YAML or YML format. */ -const ENDPOINTS_FILE = "vss_endpoints.yaml"; +const ENDPOINTS_FILE = "vss_data_points.yaml"; + +/** + * Retrieves the value of an environment variable. + * + * @param {string} envVar - The environment variable to retrieve. + * @returns {string|null} - The value of the environment variable. + */ +const getEnvValue = (envVar) => { + if (!process.env[envVar]) { + console.info(`${envVar} environment variable is not set in .env file.`); + return null; + } + return process.env[envVar]; +}; /** - * Retrieves the full path to the endpoints file. + * Retrieves the full path to the data points file. * - * This function resolves the root directory path of the current module + * This function resolves the schema-files directory path of the current module * and joins it with the ENDPOINTS_FILE constant to form the full path. * - * @returns {string} The full path to the endpoints file. + * @returns {string} The full path to the data points file. */ -const getEndpointsPath = () => { - const rootPath = path.resolve(__dirname); +const getDataPointsPath = () => { + const rootPath = path.resolve(`${__dirname}/schema-files`); return path.join(rootPath, ENDPOINTS_FILE); }; -module.exports = { getEndpointsPath }; +module.exports = { getDataPointsPath, getEnvValue }; diff --git a/cdsp/information-layer/handlers/config/vss_endpoints.json b/cdsp/information-layer/handlers/config/schema-files/vss_data_points.json similarity index 98% rename from cdsp/information-layer/handlers/config/vss_endpoints.json rename to cdsp/information-layer/handlers/config/schema-files/vss_data_points.json index 845e2aa..5792bca 100644 --- a/cdsp/information-layer/handlers/config/vss_endpoints.json +++ b/cdsp/information-layer/handlers/config/schema-files/vss_data_points.json @@ -1,6 +1,6 @@ { "Vehicle": { - "children": { + "children": { "Chassis": { "children": { "SteeringWheel": { @@ -28,7 +28,8 @@ "min": -90, "type": "sensor", "unit": "degrees" - }, "Longitude": { + }, + "Longitude": { "datatype": "double", "description": "Current longitude of vehicle in WGS 84 geodetic coordinates, as measured at the position of GNSS receiver antenna.", "max": 180, @@ -104,4 +105,4 @@ "description": "High-level vehicle data.", "type": "branch" } -} \ No newline at end of file +} diff --git a/cdsp/information-layer/handlers/config/vss_endpoints.yaml b/cdsp/information-layer/handlers/config/schema-files/vss_data_points.yaml similarity index 98% rename from cdsp/information-layer/handlers/config/vss_endpoints.yaml rename to cdsp/information-layer/handlers/config/schema-files/vss_data_points.yaml index c628d66..625c731 100644 --- a/cdsp/information-layer/handlers/config/vss_endpoints.yaml +++ b/cdsp/information-layer/handlers/config/schema-files/vss_data_points.yaml @@ -40,7 +40,7 @@ Vehicle.Powertrain: description: Powertrain data for battery management, etc. type: branch -Vehicle.Powertrain.TractionBattery: +Vehicle.Powertrain.TractionBattery: description: Battery Management data. type: branch diff --git a/cdsp/information-layer/handlers/package.json b/cdsp/information-layer/handlers/package.json deleted file mode 100644 index 63909dd..0000000 --- a/cdsp/information-layer/handlers/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "dependencies": { - "dotenv": "^16.4.5", - "js-yaml": "^4.1.0" - } -} diff --git a/cdsp/information-layer/handlers/.gitignore b/cdsp/information-layer/handlers/src/.gitignore similarity index 100% rename from cdsp/information-layer/handlers/.gitignore rename to cdsp/information-layer/handlers/src/.gitignore diff --git a/cdsp/information-layer/handlers/src/handler.js b/cdsp/information-layer/handlers/src/handler.js index 0490ac4..155af45 100644 --- a/cdsp/information-layer/handlers/src/handler.js +++ b/cdsp/information-layer/handlers/src/handler.js @@ -3,35 +3,35 @@ const fs = require("fs"); const yaml = require("js-yaml"); const { logMessage, MessageType } = require("../../utils/logger"); /** - * Reads and parses an endpoints file in either JSON, YML or YAML format. + * Reads and parses a data points file in either JSON, YML or YAML format. * - * @param {string} filePath - The path to the endpoints file. - * @returns {Object} The parsed content of the endpoints file. + * @param {string} filePath - The path to the data points file. + * @returns {Object} The parsed content of the data points file. * @throws {Error} If the file format is unsupported. */ -function readEndpointsFile(filePath) { +function readDataPointsFile(filePath) { const fileContent = fs.readFileSync(filePath, "utf8"); if (filePath.endsWith(".json")) { return JSON.parse(fileContent); } else if (filePath.endsWith(".yaml") || filePath.endsWith(".yml")) { return yaml.load(fileContent); } else { - throw new Error("Unsupported endpoints file format"); + throw new Error("Unsupported data points file format"); } } /** - * Recursively extracts data types from an endpoints object. + * Recursively extracts data types from a data point object. * - * @param {Object} endpointsObj - The object containing endpoint definitions. + * @param {Object} dataPointsObj - The object containing data point definitions. * @param {string} [parentKey=""] - The parent key used to build the nested key path. * @param {Object} [result={}] - The object to store the extracted data types. - * @returns {Object} An object mapping endpoint keys to their data types. + * @returns {Object} An object mapping data point keys to their data types. */ -function extractDataTypes(endpointsObj, parentKey = "", result = {}) { - for (const key in endpointsObj) { - if (endpointsObj.hasOwnProperty(key)) { - const value = endpointsObj[key]; +function extractDataTypes(dataPointsObj, parentKey = "", result = {}) { + for (const key in dataPointsObj) { + if (dataPointsObj.hasOwnProperty(key)) { + const value = dataPointsObj[key]; const newKey = parentKey ? `${parentKey}.${key}` : key; if (value && typeof value === "object") { if (value.datatype) { @@ -58,6 +58,9 @@ class Handler { case "subscribe": this.subscribe(message, ws); break; + case "unsubscribe": + this.unsubscribe(message, ws); + break; default: ws.send(JSON.stringify({ error: "Unknown message type" })); } @@ -82,6 +85,14 @@ class Handler { throw new Error("Subscribe method not implemented yet!"); } + unsubscribe(message, ws) { + throw new Error("Unsubscribe method not implemented yet!"); + } + + unsubscribe_client(uuid) { + throw new Error("Unsubscribe client method not implemented yet!"); + } + /** * Utility functions for handling messages and data structures common to IoTDB and RealmDB. */ @@ -125,7 +136,7 @@ class Handler { * @param {string} node - The message node to transform. * @returns {string} - The transformed message node with dots replaced by underscores. */ - _transformEndpointsWithUnderscores(node) { + _transformDatapointsWithUnderscores(node) { return `${node}`.replace(/\./g, "_"); } @@ -135,26 +146,26 @@ class Handler { * @param {string} field - The database filed to transform. * @returns {string} - The transformed to message node replacing underscores by dots. */ - _transformEndpointsWithDots(field) { + _transformDataPointsWithDots(field) { return `${field}`.replace(/\_/g, "."); } /** - * Retrieves and processes supported endpoints. + * Retrieves and processes supported data points. * - * This method reads the endpoints configuration file, extracts the data types, - * and transforms the endpoint names to use underscores. It returns an object - * with the transformed endpoint names as keys and their corresponding data types. + * This method reads the data points configuration file, extracts the data types, + * and transforms the data point names to use underscores. It returns an object + * with the transformed data point names as keys and their corresponding data types. * - * @returns {Object} An object containing the supported endpoints with transformed names and data types. + * @returns {Object} An object containing the supported data points with transformed names and data types. */ - _getSupportedEndpoints() { - const endpointPath = config.getEndpointsPath(); - const endpointObj = readEndpointsFile(endpointPath); - const supportedEndpoints = extractDataTypes(endpointObj); + _getSupportedDataPoints() { + const datapointPath = config.getDataPointsPath(); + const dataPointObj = readDataPointsFile(datapointPath); + const supportedDataPoints = extractDataTypes(dataPointObj); let result = {}; - Object.entries(supportedEndpoints).forEach(([node, value]) => { - const underscored_node = this._transformEndpointsWithUnderscores(node); + Object.entries(supportedDataPoints).forEach(([node, value]) => { + const underscored_node = this._transformDatapointsWithUnderscores(node); if (value !== null) { result[underscored_node] = value; } diff --git a/cdsp/information-layer/handlers/src/iotdb/.gitignore b/cdsp/information-layer/handlers/src/iotdb/.gitignore index 3cdddbd..473d609 100644 --- a/cdsp/information-layer/handlers/src/iotdb/.gitignore +++ b/cdsp/information-layer/handlers/src/iotdb/.gitignore @@ -2,8 +2,5 @@ node_modules/ package-lock.json -# Credentials Config File -config/config.js - # MAC **/.DS_Store diff --git a/cdsp/information-layer/handlers/src/iotdb/README.md b/cdsp/information-layer/handlers/src/iotdb/README.md index 03028ab..097c1b8 100644 --- a/cdsp/information-layer/handlers/src/iotdb/README.md +++ b/cdsp/information-layer/handlers/src/iotdb/README.md @@ -4,38 +4,44 @@ This directory contains the IoTDB Handler as a Node.js application. As [Apache I # Features -- **Authentication**: Authenticates with IoTDB using the IoTDB host, port, user credentials, and time zone. +- **Authentication**: Authenticates with IoTDB using the IoTDB host, port, user credentials, number of rows to be fetched, and time zone. +- **Read Data**: Retrieves data from the IoTDB using a VIN as object ID. +- **Write Data**: Write data to the IoTDB using a VIN as object ID. - **Error Handling**: Logs and handles errors during database operations and synchronization. -# Installation - -Execute within `iotdb` directory - -```bash -npm install -``` - # Configure IoTDB Before the Database-Router can start the IoTDB Handler without any errors you need to start and run Docker containers defined in a [Docker Compose file](/docker/). ## Configure of a IoTDB Handler -Create `config/config.js` with the following format, replacing the app id and the api key with yours. - -```js -module.exports = { - iotdbHost: "your-iotdb-host", // Default "localhost" - iotdbPort: 6667, // Set this to the appropriate IotDB Port - iotdbUser: "your-iotdb-user", // Default "root" - iotdbPassword: "your-iotdb-password", // Default "root" - timeZoneId: Intl.DateTimeFormat().resolvedOptions().timeZone, // Set this to the appropriate time zone - fetchSize: 10000, // number of rows that will be fetched from the database at a time when executing a query -}; +Create (if it does not exist) `/docker/.env` and add the following environment variables, replacing the values with yours. + +```shell + ######################### + # GENERAL CONFIGURATION # + ######################### + + # HANDLER_TYPE define the database to initialize + HANDLER_TYPE=iotdb + # DATA_POINTS_SCHEMA_FILE is the YAML or JSON file containing all data points supported. See the ../../config/README.md for more information. + DATA_POINTS_SCHEMA_FILE=vss_data_points.yaml + + ####################### + # IOTDB CONFIGURATION # + ####################### + + # Access to iotdb-service. All this are optional, they have an predefine default value + IOTDB_HOST="your-iotdb-host" # Docker container name for IoTDB or host, default container name "iotdb-service" + IOTDB_PORT=6667 # Set this to the appropriate IotDB Port, default "6667" + IOTDB_USER="your-iotdb-user" # Default "root" + IOTDB_PASSWORD="your-iotdb-password" # Default "root" + IOTDB_TIMEZONE="your-time-zone" # Default your local configured time zone + FETCH_SIZE=10000 #number of rows that will be fetched from the database at a time when executing a query, default 10000 ``` -> **_IMPORTANT:_** Do not commit this file to github! +> **_IMPORTANT:_** Do not commit this file to GitHub! ## Starting the IoTDB handler -You do not need to start IotDB Handler manually. It is started by the DB-Router like described [here](../../../router/README.md#Run). \ No newline at end of file +You do not need to start IotDB Handler manually. It is started by the Websocket-Server like described [here](../../../README.md). diff --git a/cdsp/information-layer/handlers/src/iotdb/config/data-points-type.js b/cdsp/information-layer/handlers/src/iotdb/config/data-points-type.js new file mode 100644 index 0000000..d4de5b3 --- /dev/null +++ b/cdsp/information-layer/handlers/src/iotdb/config/data-points-type.js @@ -0,0 +1,46 @@ +const { SupportedMessageDataTypes } = require("../utils/iotdb-constants"); + +class DataPointsSchema { + constructor(supportedDataPoints) { + const properties = {}; + + Object.entries(supportedDataPoints).forEach(([key, value]) => { + if (SupportedMessageDataTypes.hasOwnProperty(value)) { + properties[key] = value; + } else { + throw new Error( + `The initialized data points contains an unsupported data type: ${value}`, + ); + } + }); + + this.dataPointsSchema = properties; + Object.freeze(this.dataPointsSchema); + } + + getDataPointsSchema() { + return this.dataPointsSchema; + } +} + +// Singleton instance holder +let dataPointsSchemaInstance = null; + +/** + * Creates and returns a singleton instance of DataPointsSchema. + * If the instance does not already exist, it initializes it with the provided supported data points + * and freezes the instance to prevent further modifications. + * + * @param {Object} supportedEndpoints - An object of supported data points to initialize the schema. + * @returns {Object} The data points schema instance. + */ +function createDataPointsSchema(supportedEndpoints) { + if (!dataPointsSchemaInstance) { + dataPointsSchemaInstance = new DataPointsSchema(supportedEndpoints); + Object.freeze(dataPointsSchemaInstance); + } + + return dataPointsSchemaInstance.getDataPointsSchema(); +} + +module.exports = { createDataPointsSchema }; diff --git a/cdsp/information-layer/handlers/src/iotdb/config/database-params.js b/cdsp/information-layer/handlers/src/iotdb/config/database-params.js new file mode 100644 index 0000000..3edff12 --- /dev/null +++ b/cdsp/information-layer/handlers/src/iotdb/config/database-params.js @@ -0,0 +1,51 @@ +const { getEnvValue } = require("../../../config/config"); + +/* + * Contains the definition of the database name and its identifier data point for each catalog. + */ +const databaseParams = Object.freeze({ + VSS: { + databaseName: "root.Vehicles", // name of the configured IoTDB for the VSS database + dataPointId: "Vehicle_VehicleIdentification_VIN", // data point used as element ID + }, +}); + +const useDefaultValue = (defaultValue) => { + console.info(`Using default: ${defaultValue}`); + return defaultValue; +}; + +/** + * Retrieves the database configuration for IoTDB. + * + * This function gathers configuration values for connecting to an IoTDB instance. + * It first attempts to get the values from environment variables. If the environment + * variables are not set, it uses default values. + * + * @returns {Object} An object containing the IoTDB configuration. + */ +const getDatabaseConfig = () => { + const iotdb_config = {}; + + let default_timeZoneId = Intl.DateTimeFormat().resolvedOptions().timeZone; + + iotdb_config["iotdbHost"] = + getEnvValue("IOTDB_HOST") || useDefaultValue("iotdb-service"); + iotdb_config["iotdbPort"] = + getEnvValue("IOTDB_PORT") || useDefaultValue(6667); + iotdb_config["iotdbUser"] = + getEnvValue("IOTDB_USER") || useDefaultValue("root"); + iotdb_config["iotdbPassword"] = + getEnvValue("IOTDB_PASSWORD") || useDefaultValue("root"); + iotdb_config["fetchSize"] = + getEnvValue("IOTDB_FETCH_SIZE") || useDefaultValue(10000); + iotdb_config["timeZoneId"] = + getEnvValue("IOTDB_TIME_ZONE_ID") || useDefaultValue(default_timeZoneId); + + return Object.freeze(iotdb_config); +}; + +const databaseConfig = + getEnvValue("HANDLER_TYPE") === "iotdb" ? getDatabaseConfig() : {}; + +module.exports = { databaseParams, databaseConfig }; diff --git a/cdsp/information-layer/handlers/src/iotdb/config/databaseParams.js b/cdsp/information-layer/handlers/src/iotdb/config/databaseParams.js deleted file mode 100644 index d9ba29b..0000000 --- a/cdsp/information-layer/handlers/src/iotdb/config/databaseParams.js +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Contains the definition of the database name and its identifier endpoint for each catalog. - */ -const databaseParams = Object.freeze({ - VSS: { - databaseName: "root.Vehicles", // name of the configured IoTDB for the VSS database - endpointId: "Vehicle_VehicleIdentification_VIN", // endpoint used as element ID - }, -}); - -module.exports = databaseParams; diff --git a/cdsp/information-layer/handlers/src/iotdb/config/endpointsType.js b/cdsp/information-layer/handlers/src/iotdb/config/endpointsType.js deleted file mode 100644 index 8d30e2d..0000000 --- a/cdsp/information-layer/handlers/src/iotdb/config/endpointsType.js +++ /dev/null @@ -1,46 +0,0 @@ -const { SupportedMessageDataTypes } = require("../utils/IoTDBConstants"); - -class EndpointsSchema { - constructor(supportedEndpoints) { - const properties = {}; - - Object.entries(supportedEndpoints).forEach(([key, value]) => { - if (SupportedMessageDataTypes.hasOwnProperty(value)) { - properties[key] = value; - } else { - throw new Error( - `The initialized endpoints contains an unsupported data type: ${value}` - ); - } - }); - - this.endpointsSchema = properties; - Object.freeze(this.endpointsSchema); - } - - getEndpointsSchema() { - return this.endpointsSchema; - } -} - -// Singleton instance holder -let endpointsSchemaInstance = null; - -/** - * Creates and returns a singleton instance of EndpointsSchema. - * If the instance does not already exist, it initializes it with the provided supported endpoints - * and freezes the instance to prevent further modifications. - * - * @param {Object} supportedEndpoints - An object of supported endpoints to initialize the schema. - * @returns {Object} The endpoints schema instance. - */ -function createEndpointsSchema(supportedEndpoints) { - if (!endpointsSchemaInstance) { - endpointsSchemaInstance = new EndpointsSchema(supportedEndpoints); - Object.freeze(endpointsSchemaInstance); - } - - return endpointsSchemaInstance.getEndpointsSchema(); -} - -module.exports = { createEndpointsSchema }; diff --git a/cdsp/information-layer/handlers/src/iotdb/src/iotdb-handler.js b/cdsp/information-layer/handlers/src/iotdb/src/iotdb-handler.js index 2152024..4f5a8d2 100644 --- a/cdsp/information-layer/handlers/src/iotdb/src/iotdb-handler.js +++ b/cdsp/information-layer/handlers/src/iotdb/src/iotdb-handler.js @@ -8,11 +8,10 @@ const { } = require("../gen-nodejs/client_types"); const thrift = require("thrift"); const Handler = require("../../handler"); -const config = require("../config/config"); -const SessionDataSet = require("../utils/SessionDataSet"); -const { IoTDBDataInterpreter } = require("../utils/IoTDBDataInterpreter"); -const { createEndpointsSchema } = require("../config/endpointsType"); -const database = require("../config/databaseParams"); +const SessionDataSet = require("../utils/session-data-set"); +const { IoTDBDataInterpreter } = require("../utils/iotdb-data-interpreter"); +const { createDataPointsSchema } = require("../config/data-points-type"); +const { databaseParams, databaseConfig } = require("../config/database-params"); const { logMessage, logWithColor, @@ -28,10 +27,10 @@ class IoTDBHandler extends Handler { this.sessionId = null; this.protocolVersion = TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V3; this.statementId = null; - this.zoneId = config.timeZoneId; - this.fetchSize = config.fetchSize; + this.zoneId = databaseConfig.timeZoneId; + this.fetchSize = databaseConfig.fetchSize; this.isSessionClosed = true; - this.endpointsSchema = null; + this.dataPointsSchema = null; } async authenticateAndConnect(sendMessageToClients) { @@ -39,12 +38,12 @@ class IoTDBHandler extends Handler { this._sendMessageToClients = sendMessageToClients; const connection = thrift.createConnection( - config.iotdbHost, - config.iotdbPort, + databaseConfig.iotdbHost, + databaseConfig.iotdbPort, { transport: thrift.TFramedTransport, protocol: thrift.TBinaryProtocol, - } + }, ); this.client = thrift.createClient(Client, connection); @@ -52,18 +51,18 @@ class IoTDBHandler extends Handler { connection.on("error", (error) => { logMessage( "thrift connection error: ".concat(error), - MessageType.ERROR + MessageType.ERROR, ); }); - const supportedEndpoint = this._getSupportedEndpoints(); - this.endpointsSchema = createEndpointsSchema(supportedEndpoint); + const supportedDataPoint = this._getSupportedDataPoints(); + this.dataPointsSchema = createDataPointsSchema(supportedDataPoint); console.info("Successfully connected to IoTDB using thrift"); } catch (error) { logMessage( "Failed to authenticate with IoTDB: ".concat(error), - MessageType.ERROR + MessageType.ERROR, ); } } @@ -75,7 +74,7 @@ class IoTDBHandler extends Handler { if (responseNodes.length > 0) { const responseMessage = this._createUpdateMessage( message, - responseNodes + responseNodes, ); this._sendMessageToClient(ws, responseMessage); } else { @@ -84,7 +83,7 @@ class IoTDBHandler extends Handler { } catch (error) { this._sendMessageToClient(ws, { error: "Error reading object" }); } finally { - this.#closeSessionIfNeeded(); + await this.#closeSessionIfNeeded(); } } @@ -98,35 +97,35 @@ class IoTDBHandler extends Handler { let values = []; for (const [key, value] of Object.entries(data)) { - if (this.endpointsSchema.hasOwnProperty(key)) { + if (this.dataPointsSchema.hasOwnProperty(key)) { measurements.push(key); - dataTypes.push(this.endpointsSchema[key]); + dataTypes.push(this.dataPointsSchema[key]); values.push(value); } else { - errorUndefinedTypes.push(`The endpoint "${key}" is not supported`); + errorUndefinedTypes.push(`The data point "${key}" is not supported`); } } if (errorUndefinedTypes.length) { errorUndefinedTypes.forEach((error) => console.error(error)); - throw new Error("One or more endpoints are not supported."); + throw new Error("One or more data points are not supported."); } const timestamp = new Date().getTime(); - const deviceId = database[message.tree].databaseName; + const deviceId = databaseParams[message.tree].databaseName; const status = await this.#insertRecord( deviceId, timestamp, measurements, dataTypes, - values + values, ); logWithColor( `Record inserted to device ${deviceId}, status code: `.concat( - JSON.stringify(status) + JSON.stringify(status), ), - COLORS.GREY + COLORS.GREY, ); const responseNodes = await this.#queryLastFields(message, ws); @@ -134,16 +133,16 @@ class IoTDBHandler extends Handler { if (responseNodes.length) { const responseMessage = this._createUpdateMessage( message, - responseNodes + responseNodes, ); - this._sendMessageToClients(responseMessage); + this._sendMessageToClient(ws, responseMessage); } else { this._sendMessageToClient(ws, { error: "Object not found." }); } } catch (error) { this._sendMessageToClient(ws, { error: `Failed writing data. ${error}` }); } finally { - this.#closeSessionIfNeeded(); + await this.#closeSessionIfNeeded(); } } @@ -157,10 +156,10 @@ class IoTDBHandler extends Handler { } const openSessionReq = new TSOpenSessionReq({ - username: config.iotdbUser, - password: config.iotdbPassword, + username: databaseConfig.iotdbUser, + password: databaseConfig.iotdbPassword, client_protocol: this.protocolVersion, - zoneId: config.timeZoneId, + zoneId: databaseConfig.timeZoneId, configuration: { version: "V_0_13" }, }); @@ -172,7 +171,7 @@ class IoTDBHandler extends Handler { "Protocol differ, Client version is " + this.protocolVersion + ", but Server version is " + - resp.serverProtocolVersion + resp.serverProtocolVersion, ); // version is less than 0.10 if (resp.serverProtocolVersion === 0) { @@ -187,7 +186,7 @@ class IoTDBHandler extends Handler { } catch (error) { logMessage( "Failed starting session with IoTDB: ".concat(error), - MessageType.ERROR + MessageType.ERROR, ); } } @@ -210,9 +209,9 @@ class IoTDBHandler extends Handler { } catch (error) { logMessage( "Error occurs when closing session at server. Maybe server is down. Error message: ".concat( - error + error, ), - MessageType.ERROR + MessageType.ERROR, ); } finally { this.isSessionClosed = true; @@ -267,13 +266,13 @@ class IoTDBHandler extends Handler { this.statementId, this.sessionId, resp.queryDataSet, - resp.ignoreTimeStamp + resp.ignoreTimeStamp, ); } } catch (error) { logMessage( "Failed executing query statement: ".concat(error), - MessageType.ERROR + MessageType.ERROR, ); } } @@ -295,7 +294,7 @@ class IoTDBHandler extends Handler { measurements, dataTypes, values, - isAligned = false + isAligned = false, ) { if ( values.length !== dataTypes.length || @@ -305,7 +304,7 @@ class IoTDBHandler extends Handler { } const valuesInBytes = IoTDBDataInterpreter.serializeValues( dataTypes, - values + values, ); let request = new TSInsertRecordReq({ @@ -328,9 +327,9 @@ class IoTDBHandler extends Handler { */ async #queryLastFields(message, ws) { const { id: objectId, tree } = message; - const { databaseName, endpointId } = database[tree]; - const fieldsToSearch = this.#extractEndpointsFromNodes(message).join(", "); - const sql = `SELECT ${fieldsToSearch} FROM ${databaseName} WHERE ${endpointId} = '${objectId}' ORDER BY Time ASC`; + const { databaseName, dataPointId } = databaseParams[tree]; + const fieldsToSearch = this.#extractDataPointsFromNodes(message).join(", "); + const sql = `SELECT ${fieldsToSearch} FROM ${databaseName} WHERE ${dataPointId} = '${objectId}' ORDER BY Time ASC`; try { const sessionDataSet = await this.#executeQueryStatement(sql); @@ -349,15 +348,15 @@ class IoTDBHandler extends Handler { // extract underscores from media element key const transformedMediaElement = Object.fromEntries( Object.entries(mediaElement).map(([key, value]) => { - const newKey = this._transformEndpointsWithDots(key); + const newKey = this._transformDataPointsWithDots(key); return [newKey, value]; - }) + }), ); const transformedObject = IoTDBDataInterpreter.extractNodesFromTimeseries( transformedMediaElement, - databaseName + databaseName, ); Object.entries(transformedObject).forEach(([key, value]) => { @@ -379,27 +378,27 @@ class IoTDBHandler extends Handler { } /** - * Extracts endpoint names from the given message. + * Extracts data point names from the given message. * * This function checks if the message has a single node or multiple nodes and * extracts the names accordingly. * * @param {Object} message - The message containing node(s). - * @returns {Array} An array of endpoint names. + * @returns {Array} An array of data point names. */ - #extractEndpointsFromNodes(message) { - let endpoints = []; + #extractDataPointsFromNodes(message) { + let dataPoints = []; if (message.node) { - endpoints.push( - this._transformEndpointsWithUnderscores(message.node.name) + dataPoints.push( + this._transformDatapointsWithUnderscores(message.node.name), ); } else if (message.nodes) { - endpoints = message.nodes.map((node) => - this._transformEndpointsWithUnderscores(node.name) + dataPoints = message.nodes.map((node) => + this._transformDatapointsWithUnderscores(node.name), ); } - return endpoints; + return dataPoints; } /** @@ -410,13 +409,13 @@ class IoTDBHandler extends Handler { */ #createObjectToInsert(message) { const { id, tree } = message; - const data = { [database[tree].endpointId]: id }; + const data = { [databaseParams[tree].dataPointId]: id }; if (message.node) { - data[this._transformEndpointsWithUnderscores(message.node.name)] = + data[this._transformDatapointsWithUnderscores(message.node.name)] = message.node.value; } else if (message.nodes) { message.nodes.forEach((node) => { - data[this._transformEndpointsWithUnderscores(node.name)] = node.value; + data[this._transformDatapointsWithUnderscores(node.name)] = node.value; }); } return data; diff --git a/cdsp/information-layer/handlers/src/iotdb/utils/IoTDBConstants.js b/cdsp/information-layer/handlers/src/iotdb/utils/iotdb-constants.js similarity index 100% rename from cdsp/information-layer/handlers/src/iotdb/utils/IoTDBConstants.js rename to cdsp/information-layer/handlers/src/iotdb/utils/iotdb-constants.js diff --git a/cdsp/information-layer/handlers/src/iotdb/utils/IoTDBDataInterpreter.js b/cdsp/information-layer/handlers/src/iotdb/utils/iotdb-data-interpreter.js similarity index 96% rename from cdsp/information-layer/handlers/src/iotdb/utils/IoTDBDataInterpreter.js rename to cdsp/information-layer/handlers/src/iotdb/utils/iotdb-data-interpreter.js index 840112e..7a52b4f 100644 --- a/cdsp/information-layer/handlers/src/iotdb/utils/IoTDBDataInterpreter.js +++ b/cdsp/information-layer/handlers/src/iotdb/utils/iotdb-data-interpreter.js @@ -1,9 +1,9 @@ const { IoTDBDataType, SupportedMessageDataTypes, -} = require("./IoTDBConstants"); +} = require("./iotdb-constants"); -class IoTDBDataInterpreter { +class IotdbDataInterpreter { /** * Serializes values based on the specified data types. * @param {Array} dataTypes - Array of data types to serialize the values as. @@ -59,7 +59,7 @@ class IoTDBDataInterpreter { case SupportedMessageDataTypes.uint16: serializedValues.push(...serializeInt32(values[i])); break; - // case SupportedMessageDataTypes.int64: // this type is not supported by now, see: cdsp/information-layer/handlers/iotdb/utils/IoTDBConstants.js + // case SupportedMessageDataTypes.int64: // this type is not supported by now, see: cdsp/information-layer/handlers/iotdb/utils/iotdb-constants.js // serializedValues.push(...serializeInt64(values[i])); // break; case SupportedMessageDataTypes.float: @@ -110,4 +110,4 @@ class IoTDBDataInterpreter { } } -module.exports = { IoTDBDataInterpreter }; +module.exports = { IoTDBDataInterpreter: IotdbDataInterpreter }; diff --git a/cdsp/information-layer/handlers/src/iotdb/utils/IoTDBRpcDataSets.js b/cdsp/information-layer/handlers/src/iotdb/utils/iotdb-rpc-data-sets.js similarity index 98% rename from cdsp/information-layer/handlers/src/iotdb/utils/IoTDBRpcDataSets.js rename to cdsp/information-layer/handlers/src/iotdb/utils/iotdb-rpc-data-sets.js index b103b23..18a3745 100644 --- a/cdsp/information-layer/handlers/src/iotdb/utils/IoTDBRpcDataSets.js +++ b/cdsp/information-layer/handlers/src/iotdb/utils/iotdb-rpc-data-sets.js @@ -1,4 +1,4 @@ -const { IoTDBDataType } = require("./IoTDBConstants"); +const { IoTDBDataType } = require("./iotdb-constants"); class IoTDBRpcDataSet { // Static properties static TIMESTAMP_STR = "Time"; @@ -36,7 +36,7 @@ class IoTDBRpcDataSet { sessionId, queryDataSet, ignoreTimestamp, - fetchSize + fetchSize, ) { this.#columnNameList = []; this.#columnTypeList = []; @@ -75,7 +75,7 @@ class IoTDBRpcDataSet { let index = columnNameIndex[name]; this.#columnOrdinalDict.set( name, - index + IoTDBRpcDataSet.START_INDEX + index + IoTDBRpcDataSet.START_INDEX, ); this.#columnTypeDeduplicatedList[index] = IoTDBDataType[columnTypeList[i]]; @@ -85,7 +85,7 @@ class IoTDBRpcDataSet { this.#timeBytes = Buffer.alloc(0); this.#currentBitmap = Array(this.#columnTypeDeduplicatedList.length).fill( - Buffer.alloc(0) + Buffer.alloc(0), ); this.#value = Array(this.#columnTypeDeduplicatedList.length).fill(null); } diff --git a/cdsp/information-layer/handlers/src/iotdb/utils/SessionDataSet.js b/cdsp/information-layer/handlers/src/iotdb/utils/session-data-set.js similarity index 93% rename from cdsp/information-layer/handlers/src/iotdb/utils/SessionDataSet.js rename to cdsp/information-layer/handlers/src/iotdb/utils/session-data-set.js index c4b0b79..6bf0cb5 100644 --- a/cdsp/information-layer/handlers/src/iotdb/utils/SessionDataSet.js +++ b/cdsp/information-layer/handlers/src/iotdb/utils/session-data-set.js @@ -1,6 +1,6 @@ -const { IoTDBDataType } = require("./IoTDBConstants"); -const IoTDBRpcDataSet = require("./IoTDBRpcDataSets"); -const { IoTDBDataInterpreter } = require("./IoTDBDataInterpreter"); +const { IoTDBDataType } = require("./iotdb-constants"); +const IoTDBRpcDataSet = require("./iotdb-rpc-data-sets"); +const { IoTDBDataInterpreter } = require("./iotdb-data-interpreter"); const dataTypeProcessors = { [IoTDBDataType.BOOLEAN]: (bytes) => @@ -39,7 +39,7 @@ class SessionDataSet { statementId, sessionId, queryDataSet, - ignoreTimestamp + ignoreTimestamp, ) { this.iotdbRpcDataSet = new IoTDBRpcDataSet( columnNameList, @@ -51,7 +51,7 @@ class SessionDataSet { sessionId, queryDataSet, ignoreTimestamp, - 1024 // Buffer size or default value + 1024, // Buffer size or default value ); } @@ -92,7 +92,7 @@ class SessionDataSet { */ constructRowRecordFromValueArray() { let time64 = IoTDBDataInterpreter.extractTimestamp( - this.iotdbRpcDataSet.getTimeBytes() + this.iotdbRpcDataSet.getTimeBytes(), ); let obj = { timestamp: time64 }; diff --git a/cdsp/information-layer/handlers/src/package.json b/cdsp/information-layer/handlers/src/package.json new file mode 100644 index 0000000..40ea91b --- /dev/null +++ b/cdsp/information-layer/handlers/src/package.json @@ -0,0 +1,8 @@ +{ + "name": "handlers", + "version": "1.0.0", + "description": "Database handlers", + "dependencies": { + "js-yaml": "^4.1.0" + } +} diff --git a/cdsp/information-layer/handlers/src/realmdb/.gitignore b/cdsp/information-layer/handlers/src/realmdb/.gitignore index 4bdca67..645f5bd 100644 --- a/cdsp/information-layer/handlers/src/realmdb/.gitignore +++ b/cdsp/information-layer/handlers/src/realmdb/.gitignore @@ -1,6 +1,3 @@ # Node.js node_modules/ -package-lock.json - -# Credentials Config File -config/config.js \ No newline at end of file +package-lock.json \ No newline at end of file diff --git a/cdsp/information-layer/handlers/src/realmdb/README.md b/cdsp/information-layer/handlers/src/realmdb/README.md index 6e68fb1..013dee7 100644 --- a/cdsp/information-layer/handlers/src/realmdb/README.md +++ b/cdsp/information-layer/handlers/src/realmdb/README.md @@ -1,42 +1,52 @@ # RealmDB This directory contains the RealmDB Handler as Node.js application. As [RealmDB](https://www.mongodb.com/docs/atlas/device-sdks/sdk/node/) is an embedded database, the RealmDB Handler directly embeds the RealmSDK which creates the [RealmDB database](https://github.com/realm/realm-js) file(s) automatically in the working directory during runtime of RealmDB Handler. + # Features - **Authentication**: Authenticates with MongoDB Realm using an API key. -- **Read Data**: Retrieves data from the Realm database using a primary key. -- **Subscribe to Changes**: Listens to changes in specific data objects and sends updates to WebSocket clients. +- **Read Data**: Retrieves data from the Realm database using a VIN (for VSS object) object ID. +- **Write Data**: Write data to the Realm database using a VIN (for VSS object) as object ID.- +- **Subscribe to Changes**: Listens to changes in specific data objects using VIN (for VSS object) as object ID and sends updates to WebSocket clients. +- **Unsubscribe to Changes**: Unsubscribe listener to a specific data object using VIN (for VSS object) as object ID. +- **Unsubscribe client**: Unsubscribe all listeners applied to a client. - **Error Handling**: Logs and handles errors during database operations and synchronization. -# Installation - -Execute within `realmdb` directory - -```bash -npm install -``` - # Configure RealmDB -Before the Database-Router can start the RealmDB Handler without any errors you need to configure the RealmSDK before. +Before the Database-Router can start the RealmDB Handler without any errors you need to start and run Docker containers defined in a [Docker Compose file](/docker/). ## Create a ATLAS Cloud instance -To get APIKey and AppID you need to setup a [ATLAS cloud](https://cloud.mongodb.com/) instance and App Services. There is a free Tier solution (Status as of May 29, 2024) and you will find a lot of documentation in the internet how to set up everything. +To get APIKey and AppID you need to set up a [ATLAS cloud](https://cloud.mongodb.com/) instance and App Services. There is a free Tier solution (Status as of May 29, 2024) and you will find a lot of documentation in the internet how to set up everything. ## Configure of a RealmDB Handler -Create `config/config.js` with the following format, replacing the app id and the api key with yours. - -```js -module.exports = { - realmAppId: "your-realm-AppId", - realmApiKey: "your-realm-ApiKey", -}; +Create (if it does not exist) `/docker/.env` and add the following environment variables, replacing the app id and the api key with yours. + +```sh + ######################### + # GENERAL CONFIGURATION # + ######################### + + # HANDLER_TYPE define the database to initialize + HANDLER_TYPE=realmdb + # DATA_POINTS_SCHEMA_FILE is the YAML or JSON file containing all data points supported. See the ../../config/README.md for more information. + DATA_POINTS_SCHEMA_FILE=vss_data_points.yaml + ######################### + # REALMDB CONFIGURATION # + ######################### + + # VERSION must be 0 or a positive integer. This is used for versioning the RealmDB configuration schema. + VERSION_REALMDB_SCHEMA=0 + + # Access to ATLAS Cloud instance + REALMDB_APP_ID="your-app-key" + REALMDB_API_KEY="your-api-key" ``` -> **_IMPORTANT:_** Do not commit this file to github! +> **_IMPORTANT:_** Do not commit this file to GitHub! ## Starting the RealmDB handler -You do not need to start RealmDB Handler manually. It is started by the DB-Router like described [here](../../../router/README.md#Run). \ No newline at end of file +You do not need to start RealmDB Handler manually. It is started by the DB-Router like described [here](../../../README.md). diff --git a/cdsp/information-layer/handlers/src/realmdb/config/database-params.js b/cdsp/information-layer/handlers/src/realmdb/config/database-params.js index 43b198e..c9d585b 100644 --- a/cdsp/information-layer/handlers/src/realmdb/config/database-params.js +++ b/cdsp/information-layer/handlers/src/realmdb/config/database-params.js @@ -1,15 +1,46 @@ +const { getEnvValue } = require("../../../config/config"); + /* - * Contains the definition of the database name and its identifier endpoint for each catalog. + * Contains the definition of the database name and its identifier data point for each catalog. */ const mediaElementsParams = Object.freeze({ VSS: { databaseName: "Vehicles", // name of the configured RealmDB for the VSS database - endpointId: "Vehicle_VehicleIdentification_VIN", // endpoint used as element ID + dataPointId: "Vehicle_VehicleIdentification_VIN", // data point used as element ID }, }); -const databaseConfig = Object.freeze({ - storePath: "myrealm12.realm", -}); +/** + * Retrieves the database configuration. + * + * This function fetches the Realm application ID and API key from the environment variables. + * If either of these values is not found, it throws an error. + * + * @throws {Error} If the REALMDB_APP_ID is not set in the environment variables. + * @throws {Error} If the REALMDB_API_KEY is not set in the environment variables. + * + * @returns {Object} The database configuration object containing: + * - storePath: The path to the Realm database file. + * - realmAppId: The Realm application ID. + * - realmApiKey: The Realm API key. + */ +const getDatabaseConfig = () => { + const realmAppId = getEnvValue("REALMDB_APP_ID"); + const realmApiKey = getEnvValue("REALMDB_API_KEY"); + if (!realmAppId) { + throw new Error("REALMDB_APP_ID is required, any default has been set"); + } else if (!realmApiKey) { + throw new Error("REALMDB_API_KEY is required, any default has been set"); + } + + return Object.freeze({ + storePath: "myrealm12.realm", + realmAppId: realmAppId, + realmApiKey: realmApiKey, + }); +}; + +const databaseConfig = + getEnvValue("HANDLER_TYPE") === "realmdb" ? getDatabaseConfig() : {}; module.exports = { mediaElementsParams, databaseConfig }; diff --git a/cdsp/information-layer/handlers/src/realmdb/config/realm-configuration.js b/cdsp/information-layer/handlers/src/realmdb/config/realm-configuration.js index 89ba3c9..26912dd 100644 --- a/cdsp/information-layer/handlers/src/realmdb/config/realm-configuration.js +++ b/cdsp/information-layer/handlers/src/realmdb/config/realm-configuration.js @@ -1,9 +1,15 @@ const { mediaElementsParams, databaseConfig } = require("./database-params"); -const dotenv = require("dotenv"); -dotenv.config(); +const { getEnvValue } = require("../../../config/config"); -function realmConfig(user, supportedEndpoints) { - const mediaElementSchema = createMediaElementSchema(supportedEndpoints); +/** + * Configures the Realm database settings. + * + * @param {Object} user - The user object for authentication. + * @param {Array} supportedEndpoints - List of supported endpoints for the media element schema. + * @returns {Object} - The configuration object for the Realm database. + */ +function realmConfig(user, supportedDataPoints) { + const mediaElementSchema = createMediaElementSchema(supportedDataPoints); return { schema: [mediaElementSchema], path: databaseConfig.storePath, @@ -25,10 +31,10 @@ function realmConfig(user, supportedEndpoints) { } const getSchemaVersion = () => { - const schemaVersion = parseInt(process.env.VERSION, 10); + const schemaVersion = parseInt(getEnvValue("VERSION_REALMDB_SCHEMA"), 10); if (isNaN(schemaVersion)) { throw new Error( - "Version must be specified as an ENV variable and it must be 0 or a positive integer" + "Version must be specified as an ENV variable and it must be 0 or a positive integer", ); } return schemaVersion; @@ -55,7 +61,7 @@ function createMediaElementSchema(supportedEndpoints) { break; default: throw new Error( - `The initialized endpoints contains an unsupported data type: ${value}` + `The initialized data points contains an unsupported data type: ${value}`, ); } }); diff --git a/cdsp/information-layer/handlers/src/realmdb/src/realmdb-handler.js b/cdsp/information-layer/handlers/src/realmdb/src/realmdb-handler.js index ce6ef53..17c3c7e 100644 --- a/cdsp/information-layer/handlers/src/realmdb/src/realmdb-handler.js +++ b/cdsp/information-layer/handlers/src/realmdb/src/realmdb-handler.js @@ -1,17 +1,18 @@ const Realm = require("realm"); const Handler = require("../../handler"); -const config = require("../config/config"); -const { mediaElementsParams } = require("../config/database-params"); +const { + mediaElementsParams, + databaseConfig, +} = require("../config/database-params"); const realmConfig = require("../config/realm-configuration"); const { v4: uuidv4 } = require("uuid"); -const app = new Realm.App({ id: config.realmAppId }); -const credentials = Realm.Credentials.apiKey(config.realmApiKey); const { logMessage, logWithColor, MessageType, COLORS, } = require("../../../../utils/logger"); + /** * Parses the response from a media element change event. * @@ -31,19 +32,24 @@ class RealmDBHandler extends Handler { super(); this.realm = null; this._sendMessageToClients = null; + this.listeners = new Map(); } async authenticateAndConnect(sendMessageToClients) { try { this._sendMessageToClients = sendMessageToClients; + + const app = new Realm.App({ id: databaseConfig.realmAppId }); + const credentials = Realm.Credentials.apiKey(databaseConfig.realmApiKey); const user = await app.logIn(credentials); console.info("Successfully authenticated to RealmDB"); - const supportedEndpoints = this._getSupportedEndpoints(); - const realmConfigObj = realmConfig(user, supportedEndpoints); + + const supportedDataPoints = this._getSupportedDataPoints(); + const realmConfigObj = realmConfig(user, supportedDataPoints); this.realm = await Realm.open(realmConfigObj); console.info("Connection established successfully"); - Object.entries(mediaElementsParams).forEach(async ([key, value]) => { + for (const [key, value] of Object.entries(mediaElementsParams)) { try { const databaseName = value.databaseName; await this.realm.objects(databaseName).subscribe(); @@ -51,14 +57,14 @@ class RealmDBHandler extends Handler { } catch (error) { logMessage( "Error subscribing databases: ".concat(error), - MessageType.ERROR + MessageType.ERROR, ); } - }); + } } catch (error) { logMessage( "Failed to authenticate with Realm: ".concat(error), - MessageType.ERROR + MessageType.ERROR, ); } } @@ -70,7 +76,7 @@ class RealmDBHandler extends Handler { } catch (error) { logMessage( "Error reading object from Realm: ".concat(error), - MessageType.ERROR + MessageType.ERROR, ); this._sendMessageToClient(ws, { error: "Error reading object" }); } @@ -80,23 +86,23 @@ class RealmDBHandler extends Handler { try { const mediaElement = await this.#getMediaElement(message, ws); let nodes = message.node ? [message.node] : message.nodes; - const endpoints = []; + const dataPoints = []; if (mediaElement) { this.realm.write(() => { nodes.forEach(({ name, value }) => { - const prop = this._transformEndpointsWithUnderscores(name); - endpoints.push(name); + const prop = this._transformDatapointsWithUnderscores(name); + dataPoints.push(name); mediaElement[prop] = value; }); }); } else { - const endpointId = mediaElementsParams[message.tree].endpointId; - let document = { _id: uuidv4(), [endpointId]: message.id }; + const dataPointId = mediaElementsParams[message.tree].dataPointId; + let document = { _id: uuidv4(), [dataPointId]: message.id }; nodes.forEach(({ name, value }) => { - const prop = this._transformEndpointsWithUnderscores(name); - endpoints.push(name); + const prop = this._transformDatapointsWithUnderscores(name); + dataPoints.push(name); document[prop] = value; }); const databaseName = mediaElementsParams[message.tree].databaseName; @@ -106,14 +112,12 @@ class RealmDBHandler extends Handler { }); } - let messageNodes = endpoints.map((key) => ({ name: key })); - const updateMessage = await this.#getMessageData(message, ws); - this._sendMessageToClients(updateMessage); + this._sendMessageToClient(ws, updateMessage); } catch (error) { logMessage( "Error writing object changes in Realm: ".concat(error), - MessageType.ERROR + MessageType.ERROR, ); this._sendMessageToClient(ws, { error: "Error writing object changes" }); } @@ -125,20 +129,25 @@ class RealmDBHandler extends Handler { if (mediaElement) { const objectId = mediaElement._id; const { id, tree, uuid } = message; - const { databaseName, endpointId } = mediaElementsParams[tree]; - logWithColor( - `Subscribing element: Object ID: ${objectId} with ${endpointId}: '${id}' on ${databaseName}`, - COLORS.GREY - ); + const { databaseName, dataPointId } = mediaElementsParams[tree]; - const mediaElementToSubscribe = await this.realm.objectForPrimaryKey( - databaseName, - objectId - ); + if (!this.listeners.has(ws)) { + this.listeners.set(ws, new Map()); + } - if (mediaElementToSubscribe) { - mediaElementToSubscribe.addListener( - (mediaElementToSubscribe, changes) => + if (!this.listeners.get(ws).has(id)) { + logWithColor( + `Subscribing element for user '${uuid}': Object ID: ${objectId} with ${dataPointId}: '${id}' on ${databaseName}`, + COLORS.GREY, + ); + + const mediaElementToSubscribe = await this.realm.objectForPrimaryKey( + databaseName, + objectId, + ); + + if (mediaElementToSubscribe) { + const listener = (mediaElementToSubscribe, changes) => this.#onMediaElementChange( mediaElementToSubscribe, changes, @@ -147,15 +156,34 @@ class RealmDBHandler extends Handler { tree: tree, uuid: uuid, }, - ws - ) - ); - this._sendMessageToClient(ws, { - success: `subscribed to ${endpointId}: '${id}'`, - }); + ws, + ); + + mediaElementToSubscribe.addListener(listener); + + // Store the listener so we can remove it later + this.listeners.get(ws).set(id, { + objectId: objectId, + mediaElement: mediaElementToSubscribe, + listener: listener, + }); + + this._sendMessageToClient(ws, { + success: `Subscribed to ${dataPointId}: '${id}'`, + }); + + logWithColor( + `Subscription added! Amount Clients: ${this.listeners.size}`, + COLORS.GREY, + ); + } else { + this._sendMessageToClient(ws, { + error: "Object could not be subscribed", + }); + } } else { this._sendMessageToClient(ws, { - error: "Object could not be subscribed", + success: `Subscription was already done to ${dataPointId}: '${id}'`, }); } } else { @@ -168,6 +196,52 @@ class RealmDBHandler extends Handler { } } + async unsubscribe(message, ws) { + const { id, tree, uuid } = message; + const { databaseName, dataPointId } = mediaElementsParams[tree]; + + if (this.listeners.has(ws)) { + const wsListeners = this.listeners.get(ws); + if (wsListeners.has(id)) { + const listener = wsListeners.get(id); + logWithColor( + `Unsubscribing element for user '${uuid}': Object ID: ${listener.objectId} with ${dataPointId}: '${id}' on ${databaseName}`, + COLORS.GREY, + ); + listener.mediaElement.removeListener(listener.listener); + wsListeners.delete(id); + + if (wsListeners.size === 0) { + this.listeners.delete(ws); + } + + this._sendMessageToClient(ws, { + success: `Unsubscribed to ${dataPointId}: '${id}'`, + }); + } else { + this._sendMessageToClient(ws, { + error: `No subscription found for VIN: ${id}`, + }); + } + } else { + this._sendMessageToClient(ws, { + error: `No subscription found for VIN: ${id}`, + }); + } + logWithColor( + `Subscription removed! Amount Clients: ${this.listeners.size}`, + COLORS.GREY, + ); + } + + async unsubscribe_client(ws) { + this.listeners.delete(ws); + logWithColor( + `All client subscriptions removed! Amount Clients: ${this.listeners.size}`, + COLORS.GREY, + ); + } + /** * Asynchronously retrieves media element, processes it, and creates an updated message. * @@ -180,7 +254,7 @@ class RealmDBHandler extends Handler { const mediaElement = await this.#getMediaElement(message, ws); logWithColor( `Media Element: \n ${JSON.stringify(mediaElement)}`, - COLORS.GREY + COLORS.GREY, ); if (mediaElement) { const responseNodes = this.#parseReadResponse(message, mediaElement); @@ -200,10 +274,10 @@ class RealmDBHandler extends Handler { async #getMediaElement(message, ws) { try { const { id, tree } = message; - const { databaseName, endpointId } = mediaElementsParams[tree]; + const { databaseName, dataPointId } = mediaElementsParams[tree]; return await this.realm .objects(databaseName) - .filtered(`${endpointId} = '${id}'`)[0]; + .filtered(`${dataPointId} = '${id}'`)[0]; } catch (error) { this._sendMessageToClient(ws, { error: "Error reading object" }); } @@ -219,7 +293,7 @@ class RealmDBHandler extends Handler { logMessage( "Media element changed", MessageType.RECEIVED, - `Web-Socket Connection Event Received` + `Web-Socket Connection Event Received`, ); if (changes.deleted) { logMessage(changes.deleted, COLORS.YELLOW, "MediaElement is deleted"); @@ -227,11 +301,11 @@ class RealmDBHandler extends Handler { if (changes.changedProperties.length > 0) { const responseNodes = parseOnMediaElementChangeResponse( changes, - mediaElement + mediaElement, ); const updateMessage = this._createUpdateMessage( messageHeader, - responseNodes + responseNodes, ); this._sendMessageToClient(ws, updateMessage); } @@ -249,7 +323,7 @@ class RealmDBHandler extends Handler { const data = []; const nodes = message.node ? [message.node] : message.nodes; nodes.forEach((node) => { - const prop = this._transformEndpointsWithUnderscores(node.name); + const prop = this._transformDatapointsWithUnderscores(node.name); data.push({ name: node.name, value: queryResponseObj[prop], diff --git a/cdsp/information-layer/package.json b/cdsp/information-layer/package.json new file mode 100644 index 0000000..a86d372 --- /dev/null +++ b/cdsp/information-layer/package.json @@ -0,0 +1,22 @@ +{ + "name": "information-layer", + "version": "1.0.0", + "description": "WebSocket server with handlers for IoTDB and RealmDB", + "private": true, + "workspaces": [ + "handlers/src", + "handlers/src/iotdb", + "handlers/src/realmdb", + "router" + ], + "main": "router/src/websocket-server.js", + "scripts": { + "start": "node router/src/websocket-server.js" + }, + "dependencies": { + "dotenv": "^16.4.5" + }, + "devDependencies": { + "prettier": "3.3.3" + } +} diff --git a/cdsp/information-layer/router/README.md b/cdsp/information-layer/router/README.md index e93a185..38ff920 100644 --- a/cdsp/information-layer/router/README.md +++ b/cdsp/information-layer/router/README.md @@ -1,27 +1,4 @@ -With this component, you can configure which database it connects to. +# Websocket-Server -> [!WARNING] -> While configuring Docker for environment variable definition, the `dotenv` package is used to load environment variables from an `.env` file into `process.env`. +This project is a [WebSocket server](src/websocket-server.js) that dynamically integrates different database handlers (e.g., RealmDB, IoTDB) based on the [configuration](../handlers/README.md). It listens for incoming WebSocket connections, processes messages according to the specified handler, and broadcasts messages to connected clients. -# Install - -Execute in this directory: - -```bash -npm install -``` - -# Run -The `.env` file contains key-value pairs of environment variables that are used during the build and runtime of the Docker container. This allows for easy configuration of the application without changing the source code. - -- **HANDLER_TYPE**: Configure `realmdb` to start the RealmDB Handler or `iotdb` to start the IoTDB Handler. -- **VERSION**: This variable is automatically incremented by the build script, ensuring that every Docker image build has a unique version identifier. - -> [!WARNING] -> Create a `.env` file in the same directory as your `docker-compose.yml`. If it doesn't exist, create it in the same directory as `websocket-server.js`. - -Start router by executing in [src](./src/) directory the command: - -```bash -node websocket-server.js -``` diff --git a/cdsp/information-layer/router/config/config.js b/cdsp/information-layer/router/config/config.js index 2aaa80f..4233552 100644 --- a/cdsp/information-layer/router/config/config.js +++ b/cdsp/information-layer/router/config/config.js @@ -1,10 +1,10 @@ -const dotenv = require('dotenv'); +const dotenv = require("dotenv"); dotenv.config(); const getHandlerType = () => { const handlerType = process.env.HANDLER_TYPE; if (!handlerType) { - throw new Error('Handler type must be specified as an ENV variable.'); + throw new Error("HANDLER_TYPE must be specified as an ENV variable"); } return handlerType.toLowerCase(); }; diff --git a/cdsp/information-layer/router/package.json b/cdsp/information-layer/router/package.json index d5aafb0..333c2ac 100644 --- a/cdsp/information-layer/router/package.json +++ b/cdsp/information-layer/router/package.json @@ -8,7 +8,6 @@ }, "dependencies": { "ajv": "^8.17.1", - "dotenv": "^16.4.5", "ws": "^7.4.6" } } diff --git a/cdsp/information-layer/router/src/.env b/cdsp/information-layer/router/src/.env deleted file mode 100644 index a900aca..0000000 --- a/cdsp/information-layer/router/src/.env +++ /dev/null @@ -1,4 +0,0 @@ -# HANDLER_TYPE can be initialized with two different values: `realmdb` or `iotdb` -HANDLER_TYPE=realmdb -# VERSION must be 0 or a positive integer. This is used for versioning the RealmDB configuration schema. -VERSION=0 diff --git a/cdsp/information-layer/router/src/websocket-server.js b/cdsp/information-layer/router/src/websocket-server.js index b4895b1..8bf9c9e 100644 --- a/cdsp/information-layer/router/src/websocket-server.js +++ b/cdsp/information-layer/router/src/websocket-server.js @@ -41,12 +41,12 @@ server.on("connection", (ws) => { if (validatedMessage instanceof Error) { logMessage( `Invalid message format: ${validatedMessage.message}`, - MessageType.ERROR + MessageType.ERROR, ); ws.send( JSON.stringify({ error: `Invalid message format`, - }) + }), ); } else { handler.handleMessage(validatedMessage, ws); @@ -54,9 +54,11 @@ server.on("connection", (ws) => { }); ws.on("close", () => { - console.info("* Client disconnected *"); + // Remove all client listeners + handler.unsubscribe_client(ws); // Remove disconnected client from the array clients = clients.filter((client) => client !== ws); + console.info("* Client disconnected *"); }); }); diff --git a/cdsp/information-layer/router/utils/message-validator.js b/cdsp/information-layer/router/utils/message-validator.js index ca7f1d8..8948273 100644 --- a/cdsp/information-layer/router/utils/message-validator.js +++ b/cdsp/information-layer/router/utils/message-validator.js @@ -95,6 +95,14 @@ const schemas = { required: itemsHeader, additionalProperties: false, }, + unsubscribe: { + type: "object", + properties: { + ...createCommonStructure("unsubscribe"), + }, + required: itemsHeader, + additionalProperties: false, + }, }; const validateMessage = (message) => { @@ -111,6 +119,9 @@ const validateMessage = (message) => { case "subscribe": schemaKey = "subscribe"; break; + case "unsubscribe": + schemaKey = "unsubscribe"; + break; default: throw new Error(ajv.errorsText(validate.errors)); } diff --git a/docker/.gitignore b/docker/.gitignore index b8ed0da..1881067 100644 --- a/docker/.gitignore +++ b/docker/.gitignore @@ -2,4 +2,5 @@ data/ logs/ - +# Enviroment variables containing secrets +.env \ No newline at end of file diff --git a/docker/README.md b/docker/README.md index 1913f13..297d06e 100644 --- a/docker/README.md +++ b/docker/README.md @@ -3,6 +3,12 @@ This directory contains files related to the Docker deployment of the Central Da # Central Data Service Playground The compose file `docker-compose-cdsp.yml` provides a containerized deployment of the playground using docker. +## Table of contents +- [Docker installation](#docker-installation) +- [VISSR docker image build setup](#vissr-docker-image-build-setup) +- [Websocket-Server docker image build setup](#websocket-server-docker-image-build-setup) +- [Deploy with Docker Compose](#deploy-with-docker-compose) + ## Docker installation If you are not familiar with Docker it is a widely deployed and well documented technology. For which you should find numerous tutorials on its use on the internet. @@ -32,7 +38,7 @@ Depending on your distro you may need to setup `GOROOT` and `GOPATH`. This was n ### Create persistent local volume `/tmp/docker` The upstream Docker compose assumes the existence of the local directory `/tmp/docker` but does not create it. Fix the issue by creating it yourself: -``` +```shell $ mkdir /tmp/docker ``` See upstream issue report https://github.com/w3c/automotive-viss2/issues/99 for details. @@ -44,8 +50,8 @@ See upstream issue report https://github.com/w3c/automotive-viss2/issues/86 for ### Disable Access Grant support (agt_public_key.rsa build error) There is a current issue with the upstream VISSR VISS Server Dockerfile in which the server fails to build due to a missing public key for the Access Control server. See upstream issue report https://github.com/w3c/automotive-viss2/issues/88 for details. After discussion with the upstream maintainers the current workaround is to comment out the relevant following line from the end of the `vissv2server` section of the Dockerfile. The change should be made to `cdsp/cdsp/vissr/Dockerfile.rlserver` -``` -#COPY --from=builder /build/server/agt_server/agt_public_key.rsa . +```shell +# COPY --from=builder /build/server/agt_server/agt_public_key.rsa . ``` If your project requires Access Grant support please discuss enabling it with the VISSR community. @@ -72,8 +78,8 @@ A solution is to add the CA root certificate to the VISSR Dockerfile which will The VISSR Dockerfile already includes an example of this for a Cisco system which uses the CA root certificate `cisco.crt`. From `cdsp/vissr/Dockerfile.rlserver`: -``` -#corporate proxy settings can sometimes cause tls verification error. Add root crt to docker container. +```dockerfile +# corporate proxy settings can sometimes cause tls verification error. Add root crt to docker container. COPY testCredGen/cicso-umbrella/cisco.crt /usr/local/share/ca-certificates/cisco.crt RUN update-ca-certificates ``` @@ -82,7 +88,7 @@ To add your own: 2. Copy the `.crt` file into `cdsp/vissr/testCredGen` 3. Add your own line to the Dockerfile to copy the certificate so that it is included when `update-ca-certificates` is run. As shown below. -``` +```dockerfile COPY testCredGen/cicso-umbrella/cisco.crt /usr/local/share/ca-certificates/cisco.crt COPY testCredGen/ /usr/local/share/ RUN update-ca-certificates @@ -97,39 +103,98 @@ You can start working with the playground by starting the deployment with just t In parallel you can work through any VISSR build issues to add VISS support northbound and the other features it supports. Deploy (start) just IoTDB: +```shell +$ sudo docker compose -f docker-compose-cdsp.yml up -d iotdb-service +# [+] Running 1/0 +# ✔ Container iotdb-service Running 0.0s +``` + +## Websocket-Server docker image build setup + +This guide provides instructions for deploying the Websocket-Server using Docker Compose. You can choose to deploy the server with either RealmDB or IoTDB as the backend service. + +### Prerequisites + +- Correct configuration of the `.env` file based on the database you are using (RealmDB or IoTDB) + +### Configuring the `.env` File + +The `.env` file contains environment variables that need to be configured depending on the database you are using. Detailed instructions on how to configure the `.env` file can be found in the [database handlers README](../cdsp/information-layer/handlers/README.md). + +> [!IMPORTANT] +> Before proceeding with the deployment, ensure that the `.env` file is correctly configured for the database you plan to use. + +### Using RealmDB + +To deploy the Websocket-Server with RealmDB, use the following command: + +```shell +$ sudo docker compose -f docker-compose-cdsp.yml up -d websocket-service +# [+] Running 1/1 +# ✔ Container websocket-service Started 0.4s ``` +### Using IoTDB + +When deploying with IoTDB, ensure that the iotdb-service is up and running before starting the Websocket-Server. + +> [!IMPORTANT] If required, ensure that the iotdb-service container is started before running the Websocket-Server. You can also configure your own IoTDB connection. + +#### Start IoTDB and Websocket-Server + +To start both the iotdb-service and websocket-service, use the following commands: + +```shell $ sudo docker compose -f docker-compose-cdsp.yml up -d iotdb-service -[+] Running 1/0 - ✔ Container iotdb-service Running 0.0s +# [+] Running 1/1 +# ✔ Container iotdb-service Started 0.4s 0.4s + +$ sudo docker compose -f docker-compose-cdsp.yml up -d websocket-service +# [+] Running 1/1 +# ✔ Container websocket-service Started 0.4s +``` + +### Expected result + +Listing should show three running containers as shown below: +```shell +$ sudo docker ps +``` + +``` +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +025b5dd05c56 cdsp-websocket-service "docker-entrypoint.s…" 16 minutes ago Up 16 minutes 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp websocket-service +e16c8ed4ed42 apache/iotdb:1.2.2-standalone "/usr/bin/dumb-init …" 23 minutes ago Up 19 minutes 0.0.0.0:6667->6667/tcp, :::6667->6667/tcp iotdb-service ``` ## Deploy with Docker Compose ### Start/stop containers Start the containers: -``` +```shell $ sudo docker compose -f docker-compose-cdsp.yml up -d -[+] Running 4/5 - ⠴ Network cdsp_default Created 1.5s - ✔ Container vissr_container_volumes Started 0.5s - ✔ Container iotdb-service Started 0.7s - ✔ Container app_redis Started 1.0s - ✔ Container vissv2server Started 1.3s +# [+] Running 4/5 +# ⠴ Network cdsp_default Created 1.5s +# ✔ Container vissr_container_volumes Started 0.5s +# ✔ Container iotdb-service Started 0.7s +# ✔ Container app_redis Started 1.0s +# ✔ Container vissv2server Started 1.3s ``` Stop and remove the containers: -``` +```shell $ sudo docker compose -f docker-compose-cdsp.yml down -[+] Running 5/5 - ✔ Container vissv2server Removed 0.0s - ✔ Container app_redis Removed 0.3s - ✔ Container iotdb-service Removed 2.2s - ✔ Container vissr_container_volumes Removed 0.0s - ✔ Network cdsp_default Removed 0.1s +# [+] Running 5/5 +# ✔ Container vissv2server Removed 0.0s +# ✔ Container app_redis Removed 0.3s +# ✔ Container iotdb-service Removed 2.2s +# ✔ Container vissr_container_volumes Removed 0.0s +# ✔ Network cdsp_default Removed 0.1s ``` ### Expected Result Listing should show three running containers as shown below: -``` +```shell $ sudo docker ps +``` +``` NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS app_redis redis "docker-entrypoint.s…" redis 10 minutes ago Up 10 minutes 6379/tcp iotdb-service apache/iotdb:1.2.2-standalone "/usr/bin/dumb-init …" iotdb-service 10 minutes ago Up 10 minutes 0.0.0.0:6667->6667/tcp, :::6667->6667/tcp @@ -137,8 +202,10 @@ vissv2server cdsp-vissv2server "/app/vissv2server -…" vissv ``` #### Apache IoTDB You can confirm the Apache IoTDB server is running by connecting to it with the IoTDB CLI client (_quit_ to exit the client): -``` +```shell $ sudo docker exec -ti iotdb-service /iotdb/sbin/start-cli.sh -h iotdb-service +``` +``` --------------------- Starting IoTDB Cli --------------------- diff --git a/docker/docker-compose-cdsp.yml b/docker/docker-compose-cdsp.yml index 8ef75a5..5976d11 100644 --- a/docker/docker-compose-cdsp.yml +++ b/docker/docker-compose-cdsp.yml @@ -27,48 +27,61 @@ services: - dn_target_config_node_list=iotdb-service:10710 volumes: - ./data:/iotdb/data - - ./logs:/iotdb/logs + - ./logs/iotdb:/iotdb/logs -# VISSR acting as VISS Data Server +# WebSocket server service + websocket-service: + build: + context: ../cdsp/information-layer + dockerfile: Dockerfile + container_name: websocket-service + ports: + - "8080:8080" + volumes: + - ./logs/information-layer:/app/logs + env_file: + - .env + + # VISSR acting as VISS Data Server tmp: - image: busybox - container_name: vissr_container_volumes - user: root - command: > - chmod -R 777 /tmp/docker/ - volumes: - - /tmp/docker/ + image: busybox + container_name: vissr_container_volumes + user: root + command: > + chmod -R 777 /tmp/docker/ + volumes: + - /tmp/docker/ redis: - image: redis - container_name: app_redis - privileged: true - user: root - restart: on-failure:3 - command: redis-server /etc/redis.conf - volumes: - - ../cdsp/vissr/redis/redis.conf:/etc/redis.conf - volumes_from: - - tmp + image: redis + container_name: app_redis + privileged: true + user: root + restart: on-failure:3 + command: redis-server /etc/redis.conf + volumes: + - ../cdsp/vissr/redis/redis.conf:/etc/redis.conf + volumes_from: + - tmp vissv2server: - container_name: vissv2server - depends_on: - - redis - - iotdb-service - restart: on-failure:3 - build: - context: ../cdsp/vissr # context set to repo root - dockerfile: Dockerfile.rlserver - target: vissv2server - entrypoint: [ /app/vissv2server,-s,apache-iotdb] - ports: - - "0.0.0.0:8081:8081" - - "127.0.0.1:8888:8888" - - "0.0.0.0:8887:8887" - - "0.0.0.0:8600:8600" - volumes: - - ./logs:/app/logs - volumes_from: - - tmp + container_name: vissv2server + depends_on: + - redis + - iotdb-service + restart: on-failure:3 + build: + context: ../cdsp/vissr # context set to repo root + dockerfile: Dockerfile.rlserver + target: vissv2server + entrypoint: [ /app/vissv2server,-s,apache-iotdb] + ports: + - "0.0.0.0:8081:8081" + - "127.0.0.1:8888:8888" + - "0.0.0.0:8887:8887" + - "0.0.0.0:8600:8600" + volumes: + - ./logs/vssr:/app/logs + volumes_from: + - tmp diff --git a/docker/start_docker.sh b/docker/start_docker.sh new file mode 100644 index 0000000..e69de29 From 7f1ae371f5286530d8dc5d612880bfd21d171f6b Mon Sep 17 00:00:00 2001 From: Sebastian Schleemilch Date: Fri, 6 Sep 2024 16:45:06 +0200 Subject: [PATCH 26/48] Fixed doc typos Signed-off-by: Sebastian Schleemilch --- cdsp/information-layer/handlers/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdsp/information-layer/handlers/README.md b/cdsp/information-layer/handlers/README.md index b81bd95..a2eb5f4 100644 --- a/cdsp/information-layer/handlers/README.md +++ b/cdsp/information-layer/handlers/README.md @@ -8,4 +8,4 @@ We support two different databases. For each of them is required to configurate > [!WARNING] > Before start working with any of them, ensure that the supported data points are correctly defined and configured. See [how](./handlers/config/README.md). -See [hier](../../information-layer/README.md) how to install and start the Websocket-Server. +See [here](../../information-layer/README.md) how to install and start the Websocket-Server. From 838af3fd046a460c746d4a53671078639d3baf83 Mon Sep 17 00:00:00 2001 From: "Andre Wendel (Q290938)" Date: Fri, 13 Sep 2024 09:12:00 +0200 Subject: [PATCH 27/48] Remove unnecessary config files and add it as gitignore. Signed-off-by: Andre Wendel --- .gitignore | 1 + .vscode/settings.json | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index 485dee6..d48c759 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .idea +.vscode \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 96da0b8..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "pieces.cloudCapabilities": "Blended", - "pieces.telemetry": true -} From dfb873f314dcdd6caccbb5c81939cf0a8b418729 Mon Sep 17 00:00:00 2001 From: "Andre Wendel (Q290938)" Date: Mon, 16 Sep 2024 11:34:47 +0200 Subject: [PATCH 28/48] Data transmission via websocket client in knowledge layer: - Update documentation and remove unused code. - Start the websocket client and update docuentation - Working synchronous calls - First running implementation of websocket_client Signed-off-by: Andre Wendel --- .gitignore | 3 + cdsp/knowledge-layer/.clang-format | 5 ++ cdsp/knowledge-layer/.gitignore | 2 + cdsp/knowledge-layer/CMakeLists.txt | 24 +++++ cdsp/knowledge-layer/README.md | 78 +++++++++++++++- .../connector/websocket-client/CMakeLists.txt | 11 +++ .../connector/websocket-client/README.md | 4 +- .../connector/websocket-client/main.cpp | 25 ++++++ .../websocket-client/websocket_client.cpp | 90 +++++++++++++++++++ .../websocket-client/websocket_client.hpp | 36 ++++++++ 10 files changed, 276 insertions(+), 2 deletions(-) create mode 100644 cdsp/knowledge-layer/.clang-format create mode 100644 cdsp/knowledge-layer/.gitignore create mode 100644 cdsp/knowledge-layer/CMakeLists.txt create mode 100644 cdsp/knowledge-layer/connector/websocket-client/CMakeLists.txt create mode 100644 cdsp/knowledge-layer/connector/websocket-client/main.cpp create mode 100644 cdsp/knowledge-layer/connector/websocket-client/websocket_client.cpp create mode 100644 cdsp/knowledge-layer/connector/websocket-client/websocket_client.hpp diff --git a/.gitignore b/.gitignore index d48c759..2db98af 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ +# IntelliJ Settings .idea + +# VSCode Settings .vscode \ No newline at end of file diff --git a/cdsp/knowledge-layer/.clang-format b/cdsp/knowledge-layer/.clang-format new file mode 100644 index 0000000..88980f1 --- /dev/null +++ b/cdsp/knowledge-layer/.clang-format @@ -0,0 +1,5 @@ +BasedOnStyle: Google +IndentWidth: 4 +ColumnLimit: 100 +AllowShortIfStatementsOnASingleLine: false +SpaceAfterCStyleCast: true diff --git a/cdsp/knowledge-layer/.gitignore b/cdsp/knowledge-layer/.gitignore new file mode 100644 index 0000000..961e9ce --- /dev/null +++ b/cdsp/knowledge-layer/.gitignore @@ -0,0 +1,2 @@ +# CMake build folder +build/ \ No newline at end of file diff --git a/cdsp/knowledge-layer/CMakeLists.txt b/cdsp/knowledge-layer/CMakeLists.txt new file mode 100644 index 0000000..f4e70f8 --- /dev/null +++ b/cdsp/knowledge-layer/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.10) + +project(knowledge-layer) + +# C++ standard +set(CMAKE_CXX_STANDARD 17) + +# Find Boost libraries +find_package(Boost 1.86.0 REQUIRED COMPONENTS system filesystem thread) + +# FetchContent to include nlohmann/json +include(FetchContent) +FetchContent_Declare( + json + GIT_REPOSITORY https://github.com/nlohmann/json.git + GIT_TAG v3.11.3 +) +FetchContent_MakeAvailable(json) + +# Output directory for the executable +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + +# Add subdirectory for the websocket-client +add_subdirectory(connector/websocket-client) \ No newline at end of file diff --git a/cdsp/knowledge-layer/README.md b/cdsp/knowledge-layer/README.md index fd9e641..f5f9d02 100644 --- a/cdsp/knowledge-layer/README.md +++ b/cdsp/knowledge-layer/README.md @@ -1 +1,77 @@ -tbd \ No newline at end of file +# Knowledge Layer - WebSocket Client + +This project contains a WebSocket client built in C++17, which communicates with a WebSocket server. The client can send and receive JSON messages using Boost libraries. + +## Prerequisites + +Before setting up the project, make sure you have the following installed: + +- **CMake** (version 3.10 or higher) +- **Boost** (version 1.86.0 or higher) +- **g++/clang++** with C++17 support +- **Homebrew** (for macOS users) +- A WebSocket server to connect to, see how to start the **information-layer** Websocket server [here](../information-layer/README.md) + +### Installing Dependencies + +1. **Installing Boost (macOS/Linux)**: + If you're on macOS, you can install Boost using Homebrew: + + ```bash + brew install boost + ``` + + For Linux, you can install Boost using your package manager, or build from source: + + ```bash + sudo apt-get install libboost-all-dev + ``` + +2. **Install CMake**: + Ensure you have CMake installed: + + ```bash + brew install cmake # For macOS + sudo apt-get install cmake # For Linux + ``` + +## Project Setup + +**Build the WebSocket Client**: + + The WebSocket client is located in the `connector/websocket-client/` directory. To build it from this directory: + + ```bash + # Create a build directory + mkdir -p build + cd build + + # Run CMake to generate build files + cmake .. + + # Build the project + make + ``` + + If the build is successful, the WebSocket client executable will be generated in the `build/bin/` directory. + +## Running the WebSocket Client + +### Environment Variables + +The project expects two environment variables for the WebSocket server’s host and port. By default, the websocket client uses the `information-layer` (host: localhost, port: 8080). See how to configure them [here](../information-layer/README.md). You can use a custom websocket server configuration adding the following ENV variables in `/docker/.env` file: + +```text +################################## +# WEBSOCKET-SERVER CONFIGURATION # +################################## +HOST_WEBSOCKET_SERVER="your_custom_host" +PORT_WEBSOCKET_SERVER="your_custom_port" +``` + +### Start the Websocket Client +After successfully building the client, you can run it with the following command: + +```bash +./build/bin/websocket_client +``` diff --git a/cdsp/knowledge-layer/connector/websocket-client/CMakeLists.txt b/cdsp/knowledge-layer/connector/websocket-client/CMakeLists.txt new file mode 100644 index 0000000..0737b5d --- /dev/null +++ b/cdsp/knowledge-layer/connector/websocket-client/CMakeLists.txt @@ -0,0 +1,11 @@ +# Define the WebSocket client target +add_executable(websocket_client main.cpp websocket_client.cpp) + +# Link Boost libraries +target_link_libraries(websocket_client Boost::system Boost::filesystem Boost::thread) + +# Link nlohmann/json +target_link_libraries(websocket_client nlohmann_json::nlohmann_json) + +# Use defined output directory for the executable +set_target_properties(websocket_client PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/websocket-client/README.md b/cdsp/knowledge-layer/connector/websocket-client/README.md index fd9e641..17efc5b 100644 --- a/cdsp/knowledge-layer/connector/websocket-client/README.md +++ b/cdsp/knowledge-layer/connector/websocket-client/README.md @@ -1 +1,3 @@ -tbd \ No newline at end of file +# Websocket-Client + +This project starts a [WebSocket client](main.cpp) that connects to a WebSocket server, sends JSON messages, and handles incoming responses. The client dynamically reads the server’s host and port from the environment variables or falls back to default values if none are provided. diff --git a/cdsp/knowledge-layer/connector/websocket-client/main.cpp b/cdsp/knowledge-layer/connector/websocket-client/main.cpp new file mode 100644 index 0000000..134c25e --- /dev/null +++ b/cdsp/knowledge-layer/connector/websocket-client/main.cpp @@ -0,0 +1,25 @@ +#include +#include +#include + +#include "websocket_client.hpp" + +using json = nlohmann::json; + +std::string DefaultHostWebsocketServer{"127.0.0.1"}; +std::string DefaultPortWebSocketServer{"8080"}; + +int main() { + // Read the Websocket-Server HOST and PORT from the environment variables + const char* hostEnv = std::getenv("HOST_WEBSOCKET_SERVER"); + const char* portEnv = std::getenv("PORT_WEBSOCKET_SERVER"); + + std::string HostWebsocketServer = hostEnv ? hostEnv : DefaultHostWebsocketServer; + std::string PortWebSocketServer = portEnv ? portEnv : DefaultPortWebSocketServer; + + std::cout << "** Starting client! **" << std::endl; + auto client = std::make_shared(HostWebsocketServer, PortWebSocketServer); + client->run(); + + return 0; +} \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/websocket-client/websocket_client.cpp b/cdsp/knowledge-layer/connector/websocket-client/websocket_client.cpp new file mode 100644 index 0000000..fdb1b2c --- /dev/null +++ b/cdsp/knowledge-layer/connector/websocket-client/websocket_client.cpp @@ -0,0 +1,90 @@ +#include "websocket_client.hpp" + +#include + +namespace { +void Fail(beast::error_code error_code, const std::string& what) { + std::cerr << what << ": " << error_code.message() << "\n"; +} + +// [WIP]: createTestMessage is used to test the first knowledge layer implementation. The +// subscription messaging should manage dynamically. +json createTestMessage() { + nlohmann::json message; + message["type"] = "subscribe"; + message["tree"] = "VSS"; + message["id"] = "WBY11CF080CH470711"; + message["uuid"] = "Some_UUID"; + return message; +} +} // namespace + +WebSocketClient::WebSocketClient(const std::string& host, const std::string& port) + : resolver_(io_context_), ws_(io_context_), server_uri_(host), server_port_(port) {} + +void WebSocketClient::run() { + resolver_.async_resolve( + server_uri_, server_port_, + beast::bind_front_handler(&WebSocketClient::onResolve, shared_from_this())); + + // Run the io_context to process asynchronous events + io_context_.run(); +} + +void WebSocketClient::onResolve(beast::error_code ec, tcp::resolver::results_type results) { + if (ec) { + return Fail(ec, "Resolve failed:"); + } + net::async_connect(ws_.next_layer(), results.begin(), results.end(), + beast::bind_front_handler(&WebSocketClient::onConnect, shared_from_this())); +} + +void WebSocketClient::onConnect(boost::system::error_code ec, + tcp::resolver::iterator /*end_point*/) { + if (ec) { + return Fail(ec, "Connection failed:"); + } + + ws_.async_handshake(server_uri_, "/", + beast::bind_front_handler(&WebSocketClient::handshake, shared_from_this())); +} + +void WebSocketClient::handshake(beast::error_code ec) { + if (ec) { + return Fail(ec, "Handshake failed:"); + } + std::cout << "Connected to WebSocket server: " << server_uri_ << std::endl; + json message = createTestMessage(); + sendMessage(message); +} + +void WebSocketClient::receiveMessage() { + ws_.async_read( + buffer_, beast::bind_front_handler(&WebSocketClient::onReceiveMessage, shared_from_this())); +} + +void WebSocketClient::onReceiveMessage(beast::error_code ec, std::size_t bytes_transferred) { + if (ec) { + return Fail(ec, "read"); + } + + std::string received_message = boost::beast::buffers_to_string(buffer_.data()); + json response = json::parse(received_message); + std::cout << "Received message: " << response.dump(4) << std::endl; + buffer_.consume(bytes_transferred); // Clear the buffer for the next message + receiveMessage(); // Continue receiving +} + +void WebSocketClient::sendMessage(const json& message) { + std::cout << "Sending message send:" << message.dump() << std::endl; + ws_.async_write(net::buffer(message.dump()), + beast::bind_front_handler(&WebSocketClient::onSendMessage, shared_from_this())); +} + +void WebSocketClient::onSendMessage(boost::system::error_code ec, std::size_t bytes_transferred) { + if (ec) { + return Fail(ec, "write"); + } + std::cout << "Message send! " << bytes_transferred << " bytes transferred" << std::endl; + receiveMessage(); +} \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/websocket-client/websocket_client.hpp b/cdsp/knowledge-layer/connector/websocket-client/websocket_client.hpp new file mode 100644 index 0000000..9eea1bd --- /dev/null +++ b/cdsp/knowledge-layer/connector/websocket-client/websocket_client.hpp @@ -0,0 +1,36 @@ +#include +#include +#include +#include +#include +#include + +namespace beast = boost::beast; +namespace websocket = beast::websocket; +namespace net = boost::asio; +using tcp = net::ip::tcp; +using json = nlohmann::json; + +class WebSocketClient : public std::enable_shared_from_this { + public: + WebSocketClient(const std::string& host, const std::string& port); + void run(); + void sendMessage(const json& message); + + private: + void onResolve(beast::error_code error_code, tcp::resolver::results_type results); + void onConnect(boost::system::error_code error_code, tcp::resolver::iterator end_point); + void handshake(beast::error_code error_code); + void receiveMessage(); + void onReceiveMessage(beast::error_code error_code, std::size_t bytes_transferred); + void onSendMessage(boost::system::error_code ec, std::size_t bytes_transferred); + + private: + net::io_context io_context_; + websocket::stream ws_; + tcp::resolver resolver_; + beast::flat_buffer buffer_; + + std::string server_uri_; + std::string server_port_; +}; \ No newline at end of file From 28ec28b7216f02c4acfffca487392624be93beb5 Mon Sep 17 00:00:00 2001 From: "Andre Wendel (Q290938)" Date: Mon, 16 Sep 2024 14:23:36 +0200 Subject: [PATCH 29/48] Documentation for new data source within information layer - Add README to add new data source in the information layer Signed-off-by: Andre Wendel --- cdsp/information-layer/handlers/README.md | 2 +- cdsp/information-layer/handlers/src/README.md | 108 ++++++++++++++++++ .../handlers/src/iotdb/README.md | 3 +- .../handlers/src/realmdb/README.md | 3 +- 4 files changed, 113 insertions(+), 3 deletions(-) create mode 100644 cdsp/information-layer/handlers/src/README.md diff --git a/cdsp/information-layer/handlers/README.md b/cdsp/information-layer/handlers/README.md index a2eb5f4..a2a20a0 100644 --- a/cdsp/information-layer/handlers/README.md +++ b/cdsp/information-layer/handlers/README.md @@ -1,6 +1,6 @@ # Handlers -We support two different databases. For each of them is required to configurate the corresponding ENV variables in `/docker/.env` file. +We support two different databases. For each of them is required to configure the corresponding ENV variables in `/docker/.env` file. - [IotDB](./src/iotdb/README.md) - [RealmDB](./src/realmdb/README.md) diff --git a/cdsp/information-layer/handlers/src/README.md b/cdsp/information-layer/handlers/src/README.md new file mode 100644 index 0000000..5a06db3 --- /dev/null +++ b/cdsp/information-layer/handlers/src/README.md @@ -0,0 +1,108 @@ +# Database handlers + +This project already contains handlers configured to be use with RealmDB and IoTDB. + +## Adding a New Database Handler + +This project uses a handler interface to dynamically integrate new database backends such as RealmDB or IoTDB. Each handler must implement the core functionality to handle WebSocket messages (read, write, subscribe, unsubscribe). + +### How to Add a New Database Handler + +1. **Create a new handler class**: + Create a new file for your database handler (e.g., `mydb-handler.js`) in the `./mydb/src` directory. This handler should extend the base `Handler` class from [handler.js](./handler.js). + +2. **Implement the handler methods**: + You must implement the following methods in your new handler: + - `authenticateAndConnect(sendMessageToClients)`: Establish a connection with the database and authenticate. + - `read(message, ws)`: Retrieve data from the database based on the incoming WebSocket message. + - `write(message, ws)`: Write data to the database. + - `subscribe(message, ws)`: Subscribe to changes in the database, and automatically send updates over WebSocket. + - `unsubscribe(message, ws)`: Unsubscribe from database updates. + +3. **Example Handler Implementation**: + Here’s a basic template you can follow: +```js +const Handler = require('../../handler'); + +class MyDBHandler extends Handler { +async authenticateAndConnect(sendMessageToClients) { + // Connect to your database here +} + +async read(message, ws) { + // Implement the logic to read data from the database +} + +async write(message, ws) { + // Implement the logic to write data to the database +} + +async subscribe(message, ws) { + // Implement the logic to subscribe to updates from the database +} + +async unsubscribe(message, ws) { + // Implement the logic to unsubscribe from updates +} +} + +module.exports = MyDBHandler; +``` + +4. **Create configuration files**: + Create the the configuration files into `./mydb/config` to include parameters for your new database (e.g., database names, data schemas, etc.). +> [!IMPORTANT] +> Ensure to create the necessary files to support the necessary data points that will be store in the DB and required for your clients. See [how](../config/README.md). + +5. **Work with the Handler**: + + Create (if it does not exist) `/docker/.env` and add the following environment variables, replacing the values with yours: + +```sh +######################### +# GENERAL CONFIGURATION # +######################### + +# HANDLER_TYPE define the database to initialize +HANDLER_TYPE=mydb +# DATA_POINTS_SCHEMA_FILE is the YAML or JSON file containing all data points supported. See the ../../config/README.md for more information. +DATA_POINTS_SCHEMA_FILE=vss_data_points.yaml +######################### +# MYDB CONFIGURATION # +######################### + +# Other variables are optional, they will not be committed. You can define custom variables like API Keys or secrets. +OPTIONAL_CUSTOM_VARIABLES="value" +``` + +> [!WARNING] +> Do not commit this file to GitHub! + +In order to work with your custom database handler, it is required to initialize it in the [websocket-server.js](../../router/src/websocket-server.js). + +```js +switch (handlerType) { + case "realmdb": + handler = new RealmDBHandler(); + break; + case "iotdb": + handler = new IoTDBHandler(); + break; + // define the new MyDBhandler object. + case "mydb": + handler = new MyDBHandler(); + break; + default: + throw new Error("Unsupported handler type"); +} +``` + +Run the WebSocket server, and connect with your handler by sending WebSocket messages to test reading, writing, and subscribing functionalities. The handler should be started by the DB-Router like described [here](../../README.md). + +### Existing Handlers + +You can check the following examples to understand how to structure your new handler: +- **RealmDB Handler**: [RealmHandler](./realmdb/src/realmdb-handler.js) provides an example of how to interact with RealmDB. +- **IoTDB Handler**: A similar implementation can be followed for [IoTDBHandler](./iotdb/src/iotdb-handler.js) . + +For additional logging, you can utilize the `logMessage` function from [logger.js](../../utils/logger.js). \ No newline at end of file diff --git a/cdsp/information-layer/handlers/src/iotdb/README.md b/cdsp/information-layer/handlers/src/iotdb/README.md index 097c1b8..88dc13f 100644 --- a/cdsp/information-layer/handlers/src/iotdb/README.md +++ b/cdsp/information-layer/handlers/src/iotdb/README.md @@ -40,7 +40,8 @@ Create (if it does not exist) `/docker/.env` and add the following environment v FETCH_SIZE=10000 #number of rows that will be fetched from the database at a time when executing a query, default 10000 ``` -> **_IMPORTANT:_** Do not commit this file to GitHub! +> [!WARNING] +> Do not commit this file to GitHub! ## Starting the IoTDB handler diff --git a/cdsp/information-layer/handlers/src/realmdb/README.md b/cdsp/information-layer/handlers/src/realmdb/README.md index 013dee7..8eefddb 100644 --- a/cdsp/information-layer/handlers/src/realmdb/README.md +++ b/cdsp/information-layer/handlers/src/realmdb/README.md @@ -45,7 +45,8 @@ Create (if it does not exist) `/docker/.env` and add the following environment v REALMDB_API_KEY="your-api-key" ``` -> **_IMPORTANT:_** Do not commit this file to GitHub! +> [!WARNING] +> Do not commit this file to GitHub! ## Starting the RealmDB handler From b84a37e28c948df5faa3230ac8553c78d7c47985 Mon Sep 17 00:00:00 2001 From: "Andre Wendel (Q290938)" Date: Mon, 16 Sep 2024 15:12:47 +0200 Subject: [PATCH 30/48] Handle and send error message within information layer for websocket connection. Signed-off-by: Andre Wendel --- cdsp/information-layer/README.md | 42 ++- .../information-layer/handlers/src/handler.js | 54 ++- .../handlers/src/iotdb/src/iotdb-handler.js | 182 ++++++---- .../src/realmdb/src/realmdb-handler.js | 326 +++++++++++------- .../router/src/websocket-server.js | 12 +- .../router/utils/message-validator.js | 96 +++++- .../utils/error-message-helper.js | 12 + 7 files changed, 506 insertions(+), 218 deletions(-) create mode 100644 cdsp/information-layer/utils/error-message-helper.js diff --git a/cdsp/information-layer/README.md b/cdsp/information-layer/README.md index ab73937..bbeab11 100644 --- a/cdsp/information-layer/README.md +++ b/cdsp/information-layer/README.md @@ -133,7 +133,7 @@ $ HANDLER_TYPE=iotdb IOTDB_HOST=localhost [ENV_VARIABLE_NAME required_env_variab ## Look out for the Websocket Server message in the console -If the handler is running and you are [subscribed](#subscribing-to-changes) to an element, when you change the value of `CurrentLocation_Longitude` in ATLAS cloud (let's say `-157845.68200000003`), you should immediately see this line in console: +If the handler is running, and you are [subscribed](#subscribing-to-changes) to an element, when you change the value of `CurrentLocation_Longitude` in ATLAS cloud (let's say `-157845.68200000003`), you should immediately see this line in console: ```json { @@ -146,6 +146,16 @@ If the handler is running and you are [subscribed](#subscribing-to-changes) to a } ``` +If the handler response with some error during any request, the client may get error response similar to this (with the same format): + +```json +{ + "type": ":status", + "errorCode": 404, + "error": "" +} +``` + # Connect your own Websocket Client Connect your own websocket client by connecting to `ws://localhost:8080` @@ -232,11 +242,23 @@ To subscribe to changes in a specific object, send a message with the type of re "type": "subscribe", "tree": "VSS", "id": "", - "uuid": "SOME_UUID" + "uuid": "" } ``` -### Subscribing to changes +If the subscription succeed, the server will respond with the following message: + +```json +{ + "type": "subscribe:status", + "tree": "VSS", + "id": "", + "dateTime": "2024-09-12T15:50:17.232Z", + "uuid": "", + "status": "succeed" +} +``` +### Unsubscribing to changes To unsubscribe to changes in a specific object, send a message with the type of request and VIN as object ID (at this moment only with RealmDB available): @@ -245,6 +267,18 @@ To unsubscribe to changes in a specific object, send a message with the type of "type": "unsubscribe", "tree": "VSS", "id": "", - "uuid": "SOME_UUID" + "uuid": "" +} +``` +If the unsubscription succeed, the server will respond with the following message: +```json +{ + "type": "unsubscribe:status", + "tree": "VSS", + "id": "WBY11CF080CH470711", + "dateTime": "2024-09-12T17:40:00.754Z", + "uuid": "CLIENT_1_SUBS", + "status": "succeed" } ``` + diff --git a/cdsp/information-layer/handlers/src/handler.js b/cdsp/information-layer/handlers/src/handler.js index 155af45..303c044 100644 --- a/cdsp/information-layer/handlers/src/handler.js +++ b/cdsp/information-layer/handlers/src/handler.js @@ -130,13 +130,32 @@ class Handler { return newMessage; } + /** + * Generic function to create or remove a subscription message. + * @param {{"subscribe", "unsubscribe"}} type - Type of subscription message. + * @param {Object} message - The original message from client. + * @param {String} status - The status of the subscription. + * @returns {Object} - The transformed message. + */ + _createSubscribeMessage(type, message, status) { + const { id, tree, uuid } = message; + return { + type: `${type}:status`, + tree, + id, + dateTime: new Date().toISOString(), + uuid, + status: status, + }; + } + /** * Transforms a message node by replacing all dots with underscores. * * @param {string} node - The message node to transform. * @returns {string} - The transformed message node with dots replaced by underscores. */ - _transformDatapointsWithUnderscores(node) { + _transformDataPointsWithUnderscores(node) { return `${node}`.replace(/\./g, "_"); } @@ -165,13 +184,44 @@ class Handler { const supportedDataPoints = extractDataTypes(dataPointObj); let result = {}; Object.entries(supportedDataPoints).forEach(([node, value]) => { - const underscored_node = this._transformDatapointsWithUnderscores(node); + const underscored_node = this._transformDataPointsWithUnderscores(node); if (value !== null) { result[underscored_node] = value; } }); return result; } + + /** + * Validates nodes against a given schema. + * + * @param {Object} message - The message containing nodes to be validated. + * @param {Object} dataPointsSchema - The schema against which nodes are validated. + * @returns {Object|null} An object containing error details if validation fails, otherwise null. + */ + _validateNodesAgainstSchema(message, dataPointsSchema) { + const { type } = message; + let nodes = message.node ? [message.node] : message.nodes; + + // Check if all nodes are valid based on the schema + const unknownFields = nodes.filter(({ name }) => { + const transformedName = this._transformDataPointsWithUnderscores(name); + return !dataPointsSchema.hasOwnProperty(transformedName); + }); + + if (unknownFields.length > 0) { + let errors = unknownFields.map(({ name }) => ({ + name: name, + status: "Parent object or node not found.", + })); + + const errorData = + errors.length === 1 ? { node: errors.at(0) } : { nodes: errors }; + + return errorData; + } + return null; + } } module.exports = Handler; diff --git a/cdsp/information-layer/handlers/src/iotdb/src/iotdb-handler.js b/cdsp/information-layer/handlers/src/iotdb/src/iotdb-handler.js index 4f5a8d2..b7aa035 100644 --- a/cdsp/information-layer/handlers/src/iotdb/src/iotdb-handler.js +++ b/cdsp/information-layer/handlers/src/iotdb/src/iotdb-handler.js @@ -18,6 +18,9 @@ const { MessageType, COLORS, } = require("../../../../utils/logger"); +const { + createErrorMessage, +} = require("../../../../utils/error-message-helper"); class IoTDBHandler extends Handler { constructor() { @@ -68,81 +71,95 @@ class IoTDBHandler extends Handler { } async read(message, ws) { - try { - await this.#openSessionIfNeeded(); - const responseNodes = await this.#queryLastFields(message, ws); - if (responseNodes.length > 0) { - const responseMessage = this._createUpdateMessage( - message, - responseNodes, + if (this.#areNodesValid(message, ws)) { + try { + await this.#openSessionIfNeeded(); + const responseNodes = await this.#queryLastFields(message, ws); + if (responseNodes.length > 0) { + const responseMessage = this._createUpdateMessage( + message, + responseNodes, + ); + this._sendMessageToClient(ws, responseMessage); + } else { + this._sendMessageToClient( + ws, + createErrorMessage( + "read", + 404, + `No data found with the Id: ${message.id}`, + ), + ); + } + } catch (error) { + this._sendMessageToClient( + ws, + createErrorMessage("read", 404, error.message), ); - this._sendMessageToClient(ws, responseMessage); - } else { - this._sendMessageToClient(ws, { error: "Object not found." }); + } finally { + await this.#closeSessionIfNeeded(); } - } catch (error) { - this._sendMessageToClient(ws, { error: "Error reading object" }); - } finally { - await this.#closeSessionIfNeeded(); } } async write(message, ws) { - try { - await this.#openSessionIfNeeded(); - const data = this.#createObjectToInsert(message); - const errorUndefinedTypes = []; - let measurements = []; - let dataTypes = []; - let values = []; - - for (const [key, value] of Object.entries(data)) { - if (this.dataPointsSchema.hasOwnProperty(key)) { + if (this.#areNodesValid(message, ws)) { + try { + await this.#openSessionIfNeeded(); + const data = this.#createObjectToInsert(message); + let measurements = []; + let dataTypes = []; + let values = []; + + for (const [key, value] of Object.entries(data)) { measurements.push(key); dataTypes.push(this.dataPointsSchema[key]); values.push(value); - } else { - errorUndefinedTypes.push(`The data point "${key}" is not supported`); } - } - - if (errorUndefinedTypes.length) { - errorUndefinedTypes.forEach((error) => console.error(error)); - throw new Error("One or more data points are not supported."); - } - const timestamp = new Date().getTime(); - const deviceId = databaseParams[message.tree].databaseName; - const status = await this.#insertRecord( - deviceId, - timestamp, - measurements, - dataTypes, - values, - ); + const timestamp = new Date().getTime(); + const deviceId = databaseParams[message.tree].databaseName; + const status = await this.#insertRecord( + deviceId, + timestamp, + measurements, + dataTypes, + values, + ); - logWithColor( - `Record inserted to device ${deviceId}, status code: `.concat( - JSON.stringify(status), - ), - COLORS.GREY, - ); + logWithColor( + `Record inserted to device ${deviceId}, status code: `.concat( + JSON.stringify(status), + ), + COLORS.GREY, + ); - const responseNodes = await this.#queryLastFields(message, ws); + const responseNodes = await this.#queryLastFields(message, ws); - if (responseNodes.length) { - const responseMessage = this._createUpdateMessage( - message, - responseNodes, + if (responseNodes.length) { + const responseMessage = this._createUpdateMessage( + message, + responseNodes, + ); + this._sendMessageToClient(ws, responseMessage); + } else { + this._sendMessageToClient( + ws, + createErrorMessage( + "write", + 404, + `No data found with the Id: ${message.id}`, + ), + ); + } + } catch (error) { + this._sendMessageToClient( + ws, + createErrorMessage("write", 503, `Failed writing data. ${error}`), ); - this._sendMessageToClient(ws, responseMessage); - } else { - this._sendMessageToClient(ws, { error: "Object not found." }); + } finally { + await this.#closeSessionIfNeeded(); } - } catch (error) { - this._sendMessageToClient(ws, { error: `Failed writing data. ${error}` }); - } finally { - await this.#closeSessionIfNeeded(); } } @@ -231,6 +248,36 @@ class IoTDBHandler extends Handler { } } + /** + * Validates the nodes in a message against the schema of a media element. + * + * @param {Object} message - The message object containing details for the request. + * @param {WebSocket} ws - The WebSocket object for communication. + * @returns {boolean} - Returns true if all nodes are valid against the schema, otherwise false. + */ + #areNodesValid(message, ws) { + const { type } = message; + + const errorData = this._validateNodesAgainstSchema( + message, + this.dataPointsSchema, + ); + + if (errorData) { + logMessage( + `Error validating message nodes against schema: ${JSON.stringify(errorData)}`, + MessageType.ERROR, + ); + this._sendMessageToClient( + ws, + createErrorMessage(`${type}`, 404, errorData), + ); + + return false; + } + return true; + } + /** * Executes a SQL query statement asynchronously. * @@ -360,7 +407,7 @@ class IoTDBHandler extends Handler { ); Object.entries(transformedObject).forEach(([key, value]) => { - if (value !== null) { + if (value !== null && !isNaN(value)) { latestValues[key] = value; } }); @@ -371,9 +418,10 @@ class IoTDBHandler extends Handler { value, })); } catch (error) { - this._sendMessageToClient(ws, { - error: "internal error constructing read object", - }); + this._sendMessageToClient( + ws, + createErrorMessage("read", 503, error.message), + ); } } @@ -391,11 +439,11 @@ class IoTDBHandler extends Handler { if (message.node) { dataPoints.push( - this._transformDatapointsWithUnderscores(message.node.name), + this._transformDataPointsWithUnderscores(message.node.name), ); } else if (message.nodes) { dataPoints = message.nodes.map((node) => - this._transformDatapointsWithUnderscores(node.name), + this._transformDataPointsWithUnderscores(node.name), ); } return dataPoints; @@ -411,11 +459,11 @@ class IoTDBHandler extends Handler { const { id, tree } = message; const data = { [databaseParams[tree].dataPointId]: id }; if (message.node) { - data[this._transformDatapointsWithUnderscores(message.node.name)] = + data[this._transformDataPointsWithUnderscores(message.node.name)] = message.node.value; } else if (message.nodes) { message.nodes.forEach((node) => { - data[this._transformDatapointsWithUnderscores(node.name)] = node.value; + data[this._transformDataPointsWithUnderscores(node.name)] = node.value; }); } return data; diff --git a/cdsp/information-layer/handlers/src/realmdb/src/realmdb-handler.js b/cdsp/information-layer/handlers/src/realmdb/src/realmdb-handler.js index 17c3c7e..0ff5e83 100644 --- a/cdsp/information-layer/handlers/src/realmdb/src/realmdb-handler.js +++ b/cdsp/information-layer/handlers/src/realmdb/src/realmdb-handler.js @@ -12,6 +12,9 @@ const { MessageType, COLORS, } = require("../../../../utils/logger"); +const { + createErrorMessage, +} = require("../../../../utils/error-message-helper"); /** * Parses the response from a media element change event. @@ -70,62 +73,67 @@ class RealmDBHandler extends Handler { } async read(message, ws) { - try { - const updateMessage = await this.#getMessageData(message, ws); - this._sendMessageToClient(ws, updateMessage); - } catch (error) { - logMessage( - "Error reading object from Realm: ".concat(error), - MessageType.ERROR, - ); - this._sendMessageToClient(ws, { error: "Error reading object" }); + if (this.#areNodesValid(message, ws)) { + try { + const updateMessage = await this.#getMessageData(message); + this._sendMessageToClient(ws, updateMessage); + } catch (error) { + logMessage( + `Error reading object from Realm: ${error.message}`, + MessageType.ERROR, + ); + this._sendMessageToClient( + ws, + createErrorMessage("read", 404, JSON.parse(error.message)), + ); + } } } async write(message, ws) { - try { - const mediaElement = await this.#getMediaElement(message, ws); - let nodes = message.node ? [message.node] : message.nodes; - const dataPoints = []; + if (this.#areNodesValid(message, ws)) { + try { + const mediaElement = await this.#getMediaElement(message); + const nodes = message.node ? [message.node] : message.nodes; - if (mediaElement) { - this.realm.write(() => { + const transformAndAssign = (element, nodes) => { nodes.forEach(({ name, value }) => { - const prop = this._transformDatapointsWithUnderscores(name); - dataPoints.push(name); - mediaElement[prop] = value; + const prop = this._transformDataPointsWithUnderscores(name); + element[prop] = value; }); - }); - } else { - const dataPointId = mediaElementsParams[message.tree].dataPointId; - let document = { _id: uuidv4(), [dataPointId]: message.id }; - - nodes.forEach(({ name, value }) => { - const prop = this._transformDatapointsWithUnderscores(name); - dataPoints.push(name); - document[prop] = value; - }); - const databaseName = mediaElementsParams[message.tree].databaseName; + }; this.realm.write(() => { - this.realm.create(databaseName, document); + if (mediaElement) { + // Write on existing media element + transformAndAssign(mediaElement, nodes); + } else { + // Create a new media element + const dataPointId = mediaElementsParams[message.tree].dataPointId; + const document = { _id: uuidv4(), [dataPointId]: message.id }; + transformAndAssign(document, nodes); + const databaseName = mediaElementsParams[message.tree].databaseName; + this.realm.create(databaseName, document); + } }); - } - const updateMessage = await this.#getMessageData(message, ws); - this._sendMessageToClient(ws, updateMessage); - } catch (error) { - logMessage( - "Error writing object changes in Realm: ".concat(error), - MessageType.ERROR, - ); - this._sendMessageToClient(ws, { error: "Error writing object changes" }); + // Read the updated media element + await this.read(message, ws); + } catch (error) { + const errorMessage = `Schema is not compatible for that media element: ${error.message}`; + logMessage(errorMessage, MessageType.ERROR); + this._sendMessageToClient( + ws, + createErrorMessage("write", 404, errorMessage), + ); + } } } async subscribe(message, ws) { try { - const mediaElement = await this.#getMediaElement(message, ws); + const mediaElement = await this.#getMediaElement(message); + if (mediaElement) { const objectId = mediaElement._id; const { id, tree, uuid } = message; @@ -141,58 +149,61 @@ class RealmDBHandler extends Handler { COLORS.GREY, ); - const mediaElementToSubscribe = await this.realm.objectForPrimaryKey( - databaseName, - objectId, + const listener = (mediaElement, changes) => + this.#onMediaElementChange( + mediaElement, + changes, + { + id: id, + tree: tree, + uuid: uuid, + }, + ws, + ); + + mediaElement.addListener(listener); + + // Store the listener so we can remove it later + this.listeners.get(ws).set(id, { + objectId: objectId, + mediaElement: mediaElement, + listener: listener, + }); + + this._sendMessageToClient( + ws, + this._createSubscribeMessage("subscribe", message, "succeed"), ); - if (mediaElementToSubscribe) { - const listener = (mediaElementToSubscribe, changes) => - this.#onMediaElementChange( - mediaElementToSubscribe, - changes, - { - id: id, - tree: tree, - uuid: uuid, - }, - ws, - ); - - mediaElementToSubscribe.addListener(listener); - - // Store the listener so we can remove it later - this.listeners.get(ws).set(id, { - objectId: objectId, - mediaElement: mediaElementToSubscribe, - listener: listener, - }); - - this._sendMessageToClient(ws, { - success: `Subscribed to ${dataPointId}: '${id}'`, - }); - - logWithColor( - `Subscription added! Amount Clients: ${this.listeners.size}`, - COLORS.GREY, - ); - } else { - this._sendMessageToClient(ws, { - error: "Object could not be subscribed", - }); - } + logWithColor( + `Subscription added! Amount Clients: ${this.listeners.size}`, + COLORS.GREY, + ); } else { - this._sendMessageToClient(ws, { - success: `Subscription was already done to ${dataPointId}: '${id}'`, - }); + this._sendMessageToClient( + ws, + createErrorMessage( + "subscribe", + 400, + `Subscription already done to ${dataPointId}: '${id}'`, + ), + ); } } else { - this._sendMessageToClient(ws, { error: "Object not found" }); + this._sendMessageToClient( + ws, + createErrorMessage("subscribe", 400, "Object not found"), + ); } } catch (error) { - this._sendMessageToClient(ws, { - error: "Error subscribing to object changes", - }); + this._sendMessageToClient( + ws, + createErrorMessage( + "subscribe", + 503, + "Subscription process could not finish, try again", + ), + ); } } @@ -215,18 +226,29 @@ class RealmDBHandler extends Handler { this.listeners.delete(ws); } - this._sendMessageToClient(ws, { - success: `Unsubscribed to ${dataPointId}: '${id}'`, - }); + this._sendMessageToClient( + ws, + this._createSubscribeMessage("unsubscribe", message, "succeed"), + ); } else { - this._sendMessageToClient(ws, { - error: `No subscription found for VIN: ${id}`, - }); + this._sendMessageToClient( + ws, + createErrorMessage( + "unsubscribe", + 400, + `No subscription found for VIN: ${id}`, + ), + ); } } else { - this._sendMessageToClient(ws, { - error: `No subscription found for VIN: ${id}`, - }); + this._sendMessageToClient( + ws, + createErrorMessage( + "unsubscribe", + 400, + `No subscription found for this client`, + ), + ); } logWithColor( `Subscription removed! Amount Clients: ${this.listeners.size}`, @@ -243,35 +265,94 @@ class RealmDBHandler extends Handler { } /** - * Asynchronously retrieves media element, processes it, and creates an updated message. + * Validates the nodes in a message against the schema of a media element. * - * @param {Object} message - The message object containing the data to be processed. - * @param {WebSocket} ws - The WebSocket connection used for communication. - * @returns {Promise} - A promise that resolves to the updated message object. + * @param {Object} message - The message object containing details for the request. + * @param {WebSocket} ws - The WebSocket object for communication. + * @returns {boolean} - Returns true if all nodes are valid against the schema, otherwise false. + */ + #areNodesValid(message, ws) { + const { type, tree } = message; + const { databaseName } = mediaElementsParams[tree]; + + // Get the schema for the mediaElement to check if fields are valid + const mediaElementSchema = this.realm.schema.find( + (schema) => schema.name === databaseName, + ); + + const errorData = this._validateNodesAgainstSchema( + message, + mediaElementSchema.properties, + ); + + if (errorData) { + logMessage( + `Error validating message nodes against schema: ${JSON.stringify(errorData)}`, + MessageType.ERROR, + ); + this._sendMessageToClient( + ws, + createErrorMessage(`${type}`, 404, errorData), + ); + + return false; + } + return true; + } + + /** + * Asynchronously processes a message to fetch and handle media data. + * + * @param {Object} message - The message object containing details for the request. + * @returns {Promise} - Returns a promise that resolves to an updated message object. + * @throws {Error} - Throws an error if no media element for the message ID is found. * @private */ - async #getMessageData(message, ws) { - const mediaElement = await this.#getMediaElement(message, ws); + async #getMessageData(message) { + const mediaElement = await this.#getMediaElement(message); + + if (!mediaElement) { + throw new Error(`\"No data found with the Id: ${message.id}\"`); + } + logWithColor( `Media Element: \n ${JSON.stringify(mediaElement)}`, COLORS.GREY, ); - if (mediaElement) { - const responseNodes = this.#parseReadResponse(message, mediaElement); - return this._createUpdateMessage(message, responseNodes); - } else { - throw new Error(`No data found with the Id: ${message.id}`); - } + + const responseNodes = this.#parseReadResponse(message, mediaElement); + return this._createUpdateMessage(message, responseNodes); + } + + /** + * Parses the response from a read event. + * + * @param {Object} message - The message object containing node or nodes information. + * @param {Object} queryResponseObj - The query response object containing values to be mapped. + * @returns {Object} - A data object with keys from the message nodes and values from the query response. + * @private + */ + #parseReadResponse(message, queryResponseObj) { + const data = []; + const nodes = message.node ? [message.node] : message.nodes; + nodes.forEach((node) => { + const prop = this._transformDataPointsWithUnderscores(node.name); + data.push({ + name: node.name, + value: queryResponseObj[prop], + }); + }); + return data; } /** * Asynchronously retrieves a media element from the database based on the provided message. * * @param {Object} message - The message containing the id and tree information. - * @param {WebSocket} ws - The WebSocket connection to send error messages if needed. * @returns {Promise} - The media element object from the database. + * @private */ - async #getMediaElement(message, ws) { + async #getMediaElement(message) { try { const { id, tree } = message; const { databaseName, dataPointId } = mediaElementsParams[tree]; @@ -279,7 +360,10 @@ class RealmDBHandler extends Handler { .objects(databaseName) .filtered(`${dataPointId} = '${id}'`)[0]; } catch (error) { - this._sendMessageToClient(ws, { error: "Error reading object" }); + logMessage( + `Error trying to get media element from Realm: ${error.message}`, + MessageType.ERROR, + ); } } @@ -287,7 +371,9 @@ class RealmDBHandler extends Handler { * Handles changes to a media element and sends update messages to clients. * @param {mediaElement} mediaElement - The media element that has changed. * @param {object} changes - An object containing information about the changes. - * @param {messageHeader} messageHeader - The header information for the message. + * @param {{tree, id, uuid}} messageHeader - The header information for the message. + * @param {WebSocket} ws - The WebSocket object for communication. + * @private */ #onMediaElementChange(mediaElement, changes, messageHeader, ws) { logMessage( @@ -311,26 +397,6 @@ class RealmDBHandler extends Handler { } } } - - /** - * Parses the response from a read event. - * - * @param {Object} message - The message object containing node or nodes information. - * @param {Object} queryResponseObj - The query response object containing values to be mapped. - * @returns {Object} - A data object with keys from the message nodes and values from the query response. - */ - #parseReadResponse(message, queryResponseObj) { - const data = []; - const nodes = message.node ? [message.node] : message.nodes; - nodes.forEach((node) => { - const prop = this._transformDatapointsWithUnderscores(node.name); - data.push({ - name: node.name, - value: queryResponseObj[prop], - }); - }); - return data; - } } module.exports = RealmDBHandler; diff --git a/cdsp/information-layer/router/src/websocket-server.js b/cdsp/information-layer/router/src/websocket-server.js index 8bf9c9e..64173b1 100644 --- a/cdsp/information-layer/router/src/websocket-server.js +++ b/cdsp/information-layer/router/src/websocket-server.js @@ -38,16 +38,16 @@ server.on("connection", (ws) => { ws.on("message", (message) => { logMessage(JSON.stringify(message), MessageType.RECEIVED); const validatedMessage = validateMessage(message); + if (validatedMessage instanceof Error) { logMessage( `Invalid message format: ${validatedMessage.message}`, - MessageType.ERROR, - ); - ws.send( - JSON.stringify({ - error: `Invalid message format`, - }), + MessageType.ERROR ); + + JSON.parse(validatedMessage.message).forEach((error) => { + ws.send(JSON.stringify(error)); + }); } else { handler.handleMessage(validatedMessage, ws); } diff --git a/cdsp/information-layer/router/utils/message-validator.js b/cdsp/information-layer/router/utils/message-validator.js index 8948273..ce7ee18 100644 --- a/cdsp/information-layer/router/utils/message-validator.js +++ b/cdsp/information-layer/router/utils/message-validator.js @@ -1,4 +1,6 @@ const Ajv = require("ajv"); +const { createErrorMessage } = require("../../utils/error-message-helper"); + const ajv = new Ajv({ allErrors: true, strict: true, @@ -7,6 +9,12 @@ const ajv = new Ajv({ const itemsHeader = ["type", "tree", "id", "uuid"]; +const standardError = createErrorMessage( + "messageValidation", + 400, + `Received an invalid message.`, +); + const createCommonStructure = (requestType) => ({ type: { type: "string", enum: [requestType] }, tree: { type: "string", enum: ["VSS"] }, @@ -105,9 +113,59 @@ const schemas = { }, }; +const customizeErrorMessage = (errors) => { + return errors.map((err) => { + switch (err.keyword) { + case "required": + return createErrorMessage( + "messageValidation", + 400, + `Missing required field: ${err.params.missingProperty}.`, + ); + case "type": + return createErrorMessage( + "messageValidation", + 400, + `Invalid type for field '${err.instancePath}': expected ${err.params.type}.`, + ); + case "enum": + if (err.instancePath === "/tree") { + return createErrorMessage( + "messageValidation", + 404, + `Unsupported message 'tree': must be one of ${err.params.allowedValues.join(", ")}`, + ); + } else { + return standardError; + } + case "additionalProperties": + return createErrorMessage( + "messageValidation", + 404, + `Unsupported property '${err.params.additionalProperty}' found`, + ); + default: + return createErrorMessage( + "messageValidation", + 400, + `Validation error on field '${err.instancePath}': ${err.message}.`, + ); + } + }); +}; + +/** + * Validates a JSON message against predefined schemas. + * + * @param {string} message - The JSON message to be validated. + * @returns {Object|Error} - Returns the parsed message if valid, otherwise throws an error. + */ const validateMessage = (message) => { try { + // Try to parse the JSON message const parsedMessage = JSON.parse(message); + + // Determine the schema key based on the message type let schemaKey; switch (parsedMessage.type) { case "read": @@ -123,20 +181,40 @@ const validateMessage = (message) => { schemaKey = "unsubscribe"; break; default: - throw new Error(ajv.errorsText(validate.errors)); + const error = JSON.stringify([ + createErrorMessage( + "messageValidation", + 404, + `Unsupported message type (${parsedMessage.type})`, + ), + ]); + throw new Error(error); } - const schema = schemas[schemaKey]; - const validate = ajv.compile(schema); - const valid = validate(parsedMessage); + // Validate the parsed message against the schema + const validate = ajv.compile(schemas[schemaKey]); - if (valid) { - return parsedMessage; - } else { - throw new Error(ajv.errorsText(validate.errors)); + if (!validate(parsedMessage)) { + const customError = customizeErrorMessage(validate.errors); + throw new Error(JSON.stringify(customError)); } + return parsedMessage; } catch (error) { - return new Error(`Invalid JSON message: ${error.message}`); + if (error instanceof SyntaxError) { + // Handle JSON parsing error + + const error = JSON.stringify([ + createErrorMessage( + "messageValidation", + 404, + "The JSON format in the message is not valid.", + ), + ]); + return new Error(error); + } else { + // Handle other errors + return new Error(error.message); + } } }; diff --git a/cdsp/information-layer/utils/error-message-helper.js b/cdsp/information-layer/utils/error-message-helper.js new file mode 100644 index 0000000..9c0252b --- /dev/null +++ b/cdsp/information-layer/utils/error-message-helper.js @@ -0,0 +1,12 @@ +/** + * Creates an error message object. + * @param {string} type - The type of the error. + * @param {number} errorCode - The error code associated with the error. + * @param {string|Object} error - A descriptive error message. + * @returns {Object} An object containing the error details. + */ +function createErrorMessage(type, errorCode, error) { + return { type: `${type}:status`, errorCode, error }; +} + +module.exports = { createErrorMessage }; From 8614c90a812df3b0a8347e0346c7a531e720a288 Mon Sep 17 00:00:00 2001 From: Sebastian Schleemilch Date: Thu, 26 Sep 2024 09:36:28 +0200 Subject: [PATCH 31/48] Vehicle data point knowledge layer configuration Implement functionality to read, validate, and integrate vehicle data points from a configuration file into the knowledge layer, ensuring only supported signals are processed by the system. Signed-off-by: Sebastian Schleemilch --- .../handlers/config/config.js | 4 +- cdsp/knowledge-layer/CMakeLists.txt | 6 + cdsp/knowledge-layer/README.md | 13 +- .../connector/utils/data_types.h | 67 ++++++ .../connector/utils/message_utils.cpp | 193 ++++++++++++++++++ .../connector/utils/message_utils.h | 32 +++ .../connector/websocket-client/CMakeLists.txt | 7 +- .../connector/websocket-client/main.cpp | 85 ++++++-- .../websocket-client/websocket_client.cpp | 106 +++++++--- ...ebsocket_client.hpp => websocket_client.h} | 17 +- .../examples/usecase-model/inputs/README.md | 11 + .../inputs/vss_data_required.txt | 7 + 12 files changed, 495 insertions(+), 53 deletions(-) create mode 100644 cdsp/knowledge-layer/connector/utils/data_types.h create mode 100644 cdsp/knowledge-layer/connector/utils/message_utils.cpp create mode 100644 cdsp/knowledge-layer/connector/utils/message_utils.h rename cdsp/knowledge-layer/connector/websocket-client/{websocket_client.hpp => websocket_client.h} (69%) create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/examples/usecase-model/inputs/README.md create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/examples/usecase-model/inputs/vss_data_required.txt diff --git a/cdsp/information-layer/handlers/config/config.js b/cdsp/information-layer/handlers/config/config.js index 4313b06..7d942bc 100644 --- a/cdsp/information-layer/handlers/config/config.js +++ b/cdsp/information-layer/handlers/config/config.js @@ -30,8 +30,10 @@ const getEnvValue = (envVar) => { * @returns {string} The full path to the data points file. */ const getDataPointsPath = () => { + const endpoints_file = + getEnvValue("DATA_POINTS_SCHEMA_FILE") || ENDPOINTS_FILE; const rootPath = path.resolve(`${__dirname}/schema-files`); - return path.join(rootPath, ENDPOINTS_FILE); + return path.join(rootPath, endpoints_file); }; module.exports = { getDataPointsPath, getEnvValue }; diff --git a/cdsp/knowledge-layer/CMakeLists.txt b/cdsp/knowledge-layer/CMakeLists.txt index f4e70f8..6a44730 100644 --- a/cdsp/knowledge-layer/CMakeLists.txt +++ b/cdsp/knowledge-layer/CMakeLists.txt @@ -20,5 +20,11 @@ FetchContent_MakeAvailable(json) # Output directory for the executable set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) +# Define the project root directory +set(PROJECT_ROOT_DIR "${CMAKE_SOURCE_DIR}") + +# Pass the root directory to your C++ code +add_compile_definitions(PROJECT_ROOT="${PROJECT_ROOT_DIR}") + # Add subdirectory for the websocket-client add_subdirectory(connector/websocket-client) \ No newline at end of file diff --git a/cdsp/knowledge-layer/README.md b/cdsp/knowledge-layer/README.md index f5f9d02..36fc14b 100644 --- a/cdsp/knowledge-layer/README.md +++ b/cdsp/knowledge-layer/README.md @@ -59,14 +59,25 @@ Before setting up the project, make sure you have the following installed: ### Environment Variables -The project expects two environment variables for the WebSocket server’s host and port. By default, the websocket client uses the `information-layer` (host: localhost, port: 8080). See how to configure them [here](../information-layer/README.md). You can use a custom websocket server configuration adding the following ENV variables in `/docker/.env` file: +The project requires certain environment variables to work with the WebSocket server’s host and port. By default, the WebSocket client connects to the `information-layer`. See how to configure these variables [here](../information-layer/README.md). + + +- **HOST_WEBSOCKET_SERVER:** Specifies the hostname of the WebSocket server. The default is `localhost`. +- **PORT_WEBSOCKET_SERVER:** Specifies the port for connecting to the WebSocket server. The default is `8080`. +- **VIN:** The Vehicle Identification Number (VIN) is required to subscribe and retrieve information for a specific vehicle. Use the VIN configured in the [`information-layer`](../information-layer/README.md). +- **REQUIRED_VSS_DATA_POINTS_FILE:** The name of the TXT file containing all the required data points to start the application. See more details [here](symbolic-reasoner/examples/usecase-model/inputs/README.md). The default value is `vss_data_required.txt`. + +You can customize the WebSocket server configuration by adding the following environment variables in the `/docker/.env` file. Below is an example of what the file could look like: ```text ################################## # WEBSOCKET-SERVER CONFIGURATION # ################################## + HOST_WEBSOCKET_SERVER="your_custom_host" PORT_WEBSOCKET_SERVER="your_custom_port" +VIN="VIN_TO_SUBSCRIBE" +REQUIRED_VSS_DATA_POINTS_FILE=vss_data_required.txt ``` ### Start the Websocket Client diff --git a/cdsp/knowledge-layer/connector/utils/data_types.h b/cdsp/knowledge-layer/connector/utils/data_types.h new file mode 100644 index 0000000..f8baf06 --- /dev/null +++ b/cdsp/knowledge-layer/connector/utils/data_types.h @@ -0,0 +1,67 @@ +#ifndef DATA_TYPES_DATA_TYPES_H +#define DATA_TYPES_DATA_TYPES_H + +#include +#include +#include + +struct InitConfig { + std::string uuid; + std::string host_websocket_server; + std::string port_websocket_server; + std::string vin; + std::vector system_vss_data_points; +}; + +struct MessageHeader { + std::string id; + std::string type; + std::string tree; + std::string date_time; + std::string uuid; +}; + +struct Node { + std::string name; + std::string value; +}; + +struct DataMessage { + MessageHeader header; + std::vector nodes; +}; + +struct ErrorNode { + std::string name; + std::string status; +}; + +struct ErrorMessage { + std::string type; + std::variant> error; + int errorCode; +}; + +enum class MessageType { + READ, + WRITE, + SUBSCRIBE, + UNSUBSCRIBE, +}; + +inline std::string messageTypeToString(MessageType type) { + switch (type) { + case MessageType::READ: + return "read"; + case MessageType::WRITE: + return "write"; + case MessageType::SUBSCRIBE: + return "subscribe"; + case MessageType::UNSUBSCRIBE: + return "unsubscribe"; + default: + throw std::runtime_error("Unsupported message type"); + } +} + +#endif // DATA_TYPES_DATA_TYPES_H \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/utils/message_utils.cpp b/cdsp/knowledge-layer/connector/utils/message_utils.cpp new file mode 100644 index 0000000..d754113 --- /dev/null +++ b/cdsp/knowledge-layer/connector/utils/message_utils.cpp @@ -0,0 +1,193 @@ +#include "message_utils.h" + +/** + * @brief Creates a JSON message header with the specified parameters. + * + * @param type The type of the message. + * @param tree The tree identifier for the message. + * @param id The unique identifier for the message. + * @param uuid The unique identifier for the client. + * @return A JSON object containing the message header. + */ +json createMessageHeader(const MessageType& type, const std::string& tree, const std::string& id, + const std::string& uuid) { + json message_header; + message_header["type"] = messageTypeToString(type); + message_header["tree"] = tree; + message_header["id"] = id; + message_header["uuid"] = uuid; + return message_header; +} + +/** + * @brief Creates a subscription message and adds it to the reply messages queue. + * + * This function generates a subscription message header using the provided + * uuid and vin, and then appends this message to the reply messages queue. + * + * @param uuid Used as a client identifier. + * @param vin The vehicle identification number. + * @param reply_messages_queue A reference to the queue where the subscription message will be + * added. + */ +void createSubscription(const std::string& uuid, const std::string& vin, + std::vector& reply_messages_queue) { + reply_messages_queue.push_back(createMessageHeader(MessageType::SUBSCRIBE, "VSS", vin, uuid)); +} + +/** + * @brief Creates a read message and appends it to the reply messages queue. + * + * This function constructs a JSON message with a header and a list of data points, + * then appends the message to the provided reply messages queue. + * + * @param uuid The client identifier. + * @param tree The tree identifier for the message. + * @param vin The vehicle identification number. + * @param data_points A vector of data point names to be included in the message. + * @param reply_messages_queue A reference to the queue where the constructed message will be + * appended. + */ +void createReadMessage(const std::string& uuid, const std::string& tree, const std::string& vin, + const std::vector& data_points, + std::vector& reply_messages_queue) { + auto message = createMessageHeader(MessageType::READ, tree, vin, uuid); + + json nodes = json::array(); + for (const auto& data_point : data_points) { + json node; + node["name"] = data_point; + nodes.push_back(node); + } + message["nodes"] = nodes; + reply_messages_queue.push_back(std::move(message)); +} + +/** + * @brief Parses a JSON message to extract error information and constructs an ErrorMessage object. + * + * This function handles the extraction of error details from a JSON message. The "error" field in + * the JSON message can either be a string or an object. If it is an object, it can contain either a + * single "node" or multiple "nodes". The function constructs the appropriate ErrorMessage object + * based on the content of the JSON message. + * + * @param json_message The JSON message containing error information. + * @return ErrorMessage The constructed ErrorMessage object containing the parsed error details. + */ +ErrorMessage parseErrorMessage(const json& json_message) { + ErrorMessage error_message; + + error_message.type = json_message["type"].get(); + error_message.errorCode = json_message["errorCode"].get(); + + // Handle the "error" field which could be either a string or an object + if (json_message["error"].is_string()) { + error_message.error = json_message["error"].get(); + } else if (json_message["error"].is_object()) { + const auto json_error = json_message["error"]; + if (json_error.contains("node")) { + ErrorNode error_node; + error_node.name = json_error["node"]["name"].get(); + error_node.status = json_error["node"]["status"].get(); + std::vector error_nodes = {error_node}; + error_message.error = error_nodes; + + } else if (json_error.contains("nodes")) { + std::vector error_nodes; + for (const auto& node_item : json_error["nodes"]) { + ErrorNode error_node; + error_node.name = node_item["name"].get(); + error_node.status = node_item["status"].get(); + error_nodes.push_back(error_node); + } + error_message.error = error_nodes; + } + } + + return error_message; +} + +/** + * @brief Converts a node value of a JSON object to its string representation. + * + * This function takes a JSON value of a node and converts it to a string based on its type. + * It supports string, floating-point number, integer, and unsigned integer types. + * If the JSON value is of an unsupported type, it throws a runtime error. + * + * @param json_value The JSON node value to be converted to a string. + * @return A string representation of the JSON value. + * @throws std::runtime_error If the JSON value is of an unsupported type. + */ +std::string nodeValueToString(const json& json_value) { + if (json_value.is_string()) { + return json_value.get(); + } else if (json_value.is_number_float()) { + return std::to_string(json_value.get()); + } else if (json_value.is_number_integer()) { + return std::to_string(json_value.get()); + } else if (json_value.is_number_unsigned()) { + return std::to_string(json_value.get()); + } + throw std::runtime_error("The message contains a node with an unsupported value."); +} + +/** + * @brief Parses a JSON message and constructs a DataMessage object. + * + * This function extracts the header information and node(s) from the provided JSON message + * and constructs a DataMessage object. The JSON message is expected to contain specific fields + * such as "id", "type", "tree", "dateTime", and "uuid" for the header. It may also contain either + * a single "node" or multiple "nodes". + * + * @param json_message The JSON message to be parsed. + * @return DataMessage The constructed DataMessage object containing the parsed data. + */ +DataMessage parseSuccessMessage(const json& json_message) { + MessageHeader header; + + header.id = json_message.at("id").get(); + header.type = json_message.at("type").get(); + header.tree = json_message.at("tree").get(); + header.date_time = json_message.at("dateTime").get(); + header.uuid = json_message.at("uuid").get(); + + DataMessage data_message; + + data_message.header = header; + if (json_message.contains("node")) { + Node node; + node.name = json_message["node"].at("name").get(); + node.value = nodeValueToString(json_message["node"].at("value")); + data_message.nodes.push_back(node); + } else if (json_message.contains("nodes")) { + for (const auto& node_item : json_message["nodes"]) { + Node node; + node.name = node_item.at("name").get(); + node.value = nodeValueToString(node_item.at("value")); + data_message.nodes.push_back(node); + } + } + + return data_message; +} + +/** + * @brief Parses and displays a JSON message, returning either a DataMessage or an ErrorMessage. + * + * This function takes a JSON string, parses it, and prints the parsed JSON to the standard output. + * Depending on the content of the JSON, it will return either a DataMessage or an ErrorMessage. + * + * @param message The JSON string to be parsed and displayed. + * @return std::variant The parsed message, which can be either a + * DataMessage or an ErrorMessage. + */ +std::variant displayAndParseMessage(const std::string& message) { + json json_message = json::parse(message); + std::cout << "Received message: " << json_message.dump() << std::endl << std::endl; + + if (json_message.contains("error")) { + return parseErrorMessage(json_message); + } + + return parseSuccessMessage(json_message); +} \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/utils/message_utils.h b/cdsp/knowledge-layer/connector/utils/message_utils.h new file mode 100644 index 0000000..e6a5c3f --- /dev/null +++ b/cdsp/knowledge-layer/connector/utils/message_utils.h @@ -0,0 +1,32 @@ +#ifndef MESSAGE_UTILS_H +#define MESSAGE_UTILS_H + +#include +#include +#include +#include +#include + +#include "data_types.h" + +using json = nlohmann::json; + +json createMessageHeader(const std::string& type, const std::string& tree, const std::string& id, + const std::string& uuid); + +void createSubscription(const std::string& uuid, const std::string& vin, + std::vector& reply_messages_queue); + +void createReadMessage(const std::string& uuid, const std::string& tree, const std::string& vin, + const std::vector& data_points, + std::vector& reply_messages_queue); + +ErrorMessage parseErrorMessage(const json& json_message); + +std::string nodeValueToString(const json& json_value); + +DataMessage parseSuccessMessage(const json& json_message); + +std::variant displayAndParseMessage(const std::string& message); + +#endif // MESSAGE_UTILS_H \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/websocket-client/CMakeLists.txt b/cdsp/knowledge-layer/connector/websocket-client/CMakeLists.txt index 0737b5d..f9979ea 100644 --- a/cdsp/knowledge-layer/connector/websocket-client/CMakeLists.txt +++ b/cdsp/knowledge-layer/connector/websocket-client/CMakeLists.txt @@ -1,11 +1,10 @@ # Define the WebSocket client target -add_executable(websocket_client main.cpp websocket_client.cpp) +add_executable(websocket_client main.cpp websocket_client.cpp ../utils/message_utils.cpp) -# Link Boost libraries +# Link libraries target_link_libraries(websocket_client Boost::system Boost::filesystem Boost::thread) - -# Link nlohmann/json target_link_libraries(websocket_client nlohmann_json::nlohmann_json) +target_include_directories(websocket_client PRIVATE ${CMAKE_SOURCE_DIR}/connector/utils) # Use defined output directory for the executable set_target_properties(websocket_client PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/websocket-client/main.cpp b/cdsp/knowledge-layer/connector/websocket-client/main.cpp index 134c25e..a4c64b3 100644 --- a/cdsp/knowledge-layer/connector/websocket-client/main.cpp +++ b/cdsp/knowledge-layer/connector/websocket-client/main.cpp @@ -1,25 +1,86 @@ +#include +#include +#include #include +#include #include #include -#include "websocket_client.hpp" +#include "data_types.h" +#include "websocket_client.h" using json = nlohmann::json; +boost::uuids::random_generator uuidGenerator; + std::string DefaultHostWebsocketServer{"127.0.0.1"}; std::string DefaultPortWebSocketServer{"8080"}; +std::string DefaultRequiredVSSDataPointsFile{"vss_data_required.txt"}; -int main() { - // Read the Websocket-Server HOST and PORT from the environment variables - const char* hostEnv = std::getenv("HOST_WEBSOCKET_SERVER"); - const char* portEnv = std::getenv("PORT_WEBSOCKET_SERVER"); +std::string getEnvVariable(const std::string& envVar, const std::string& defaultValue = "") { + const char* valueEnv = std::getenv(envVar.c_str()); + return valueEnv ? std::string(valueEnv) : defaultValue; +} - std::string HostWebsocketServer = hostEnv ? hostEnv : DefaultHostWebsocketServer; - std::string PortWebSocketServer = portEnv ? portEnv : DefaultPortWebSocketServer; +/** + * @brief Reads a file and returns a list of required data points. + * + * This function constructs the full path to the file using the provided file name + * and a predefined project root directory. It then reads the file line by line, + * storing each line as an element in a vector of strings. + * + * @param file_name The name of the file to read. + * @return A vector of strings, each representing a required data point from the file. + * @throws std::runtime_error if the file cannot be opened. + */ +std::vector getClientRequiredDataPoints(std::string file_name) { + std::vector required_data; + std::string root = + std::string(PROJECT_ROOT) + "/symbolic-reasoner/examples/usecase-model/inputs/" + file_name; + std::ifstream file(root); + if (!file) { + throw std::runtime_error("Invalid required Data Points file: " + file_name); + } + std::string line; + while (std::getline(file, line)) { + required_data.push_back(line); + } + return required_data; +} - std::cout << "** Starting client! **" << std::endl; - auto client = std::make_shared(HostWebsocketServer, PortWebSocketServer); - client->run(); +/** + * @brief Initializes and returns an InitConfig object with required configuration variables. + * + * This function creates an InitConfig instance and retrieving values + * from environment variables. If the environment variables are not set, + * default values are used. + * + * @return InitConfig The initialized configuration object. + * @throws std::runtime_error if there is a problem setting a variable. + */ +InitConfig AddInitConfig() { + InitConfig init_config; + init_config.host_websocket_server = + getEnvVariable("HOST_WEBSOCKET_SERVER", DefaultHostWebsocketServer); + init_config.port_websocket_server = + getEnvVariable("PORT_WEBSOCKET_SERVER", DefaultPortWebSocketServer); + init_config.uuid = boost::uuids::to_string(uuidGenerator()); + init_config.vin = getEnvVariable("VIN"); + init_config.system_vss_data_points = getClientRequiredDataPoints( + getEnvVariable("REQUIRED_VSS_DATA_POINTS_FILE", DefaultRequiredVSSDataPointsFile)); + return init_config; +} + +int main() { + try { + InitConfig init_config = AddInitConfig(); + std ::cout << "** Starting client! **" << std::endl; + auto client = std::make_shared(init_config); + client->run(); - return 0; -} \ No newline at end of file + return EXIT_SUCCESS; + } catch (const std::exception& e) { + std::cout << "Error: " << e.what() << std::endl; + return EXIT_FAILURE; + } +} diff --git a/cdsp/knowledge-layer/connector/websocket-client/websocket_client.cpp b/cdsp/knowledge-layer/connector/websocket-client/websocket_client.cpp index fdb1b2c..b095cf0 100644 --- a/cdsp/knowledge-layer/connector/websocket-client/websocket_client.cpp +++ b/cdsp/knowledge-layer/connector/websocket-client/websocket_client.cpp @@ -1,30 +1,35 @@ -#include "websocket_client.hpp" +#include "websocket_client.h" #include +#include namespace { void Fail(beast::error_code error_code, const std::string& what) { std::cerr << what << ": " << error_code.message() << "\n"; } -// [WIP]: createTestMessage is used to test the first knowledge layer implementation. The -// subscription messaging should manage dynamically. -json createTestMessage() { - nlohmann::json message; - message["type"] = "subscribe"; - message["tree"] = "VSS"; - message["id"] = "WBY11CF080CH470711"; - message["uuid"] = "Some_UUID"; - return message; +std::string createLogErrorMessage(ErrorMessage& error) { + std::string errorDetails; + if (std::holds_alternative(error.error)) { + errorDetails = std::get(error.error); + } else { + const std::vector& nodes = std::get>(error.error); + for (const auto& node : nodes) { + errorDetails += "\n - Node: " + node.name + ": " + node.status; + } + } + + return "Received message with error code " + std::to_string(error.errorCode) + " - (" + + error.type + ") " + errorDetails; } } // namespace -WebSocketClient::WebSocketClient(const std::string& host, const std::string& port) - : resolver_(io_context_), ws_(io_context_), server_uri_(host), server_port_(port) {} +WebSocketClient::WebSocketClient(const InitConfig& init_config) + : resolver_(io_context_), ws_(io_context_), init_config_(init_config) {} void WebSocketClient::run() { resolver_.async_resolve( - server_uri_, server_port_, + init_config_.host_websocket_server, init_config_.port_websocket_server, beast::bind_front_handler(&WebSocketClient::onResolve, shared_from_this())); // Run the io_context to process asynchronous events @@ -45,7 +50,7 @@ void WebSocketClient::onConnect(boost::system::error_code ec, return Fail(ec, "Connection failed:"); } - ws_.async_handshake(server_uri_, "/", + ws_.async_handshake(init_config_.host_websocket_server, "/", beast::bind_front_handler(&WebSocketClient::handshake, shared_from_this())); } @@ -53,9 +58,28 @@ void WebSocketClient::handshake(beast::error_code ec) { if (ec) { return Fail(ec, "Handshake failed:"); } - std::cout << "Connected to WebSocket server: " << server_uri_ << std::endl; - json message = createTestMessage(); - sendMessage(message); + std::cout << "Connected to WebSocket server: " << init_config_.host_websocket_server + << std::endl + << std::endl; + + createSubscription(init_config_.uuid, init_config_.vin, reply_messages_queue_); + createReadMessage(init_config_.uuid, "VSS", init_config_.vin, + init_config_.system_vss_data_points, reply_messages_queue_); + writeReplyMessagesOnQueue(); +} + +void WebSocketClient::sendMessage(const json& message) { + ws_.async_write(net::buffer(message.dump()), + beast::bind_front_handler(&WebSocketClient::onSendMessage, shared_from_this())); +} + +void WebSocketClient::onSendMessage(boost::system::error_code ec, std::size_t bytes_transferred) { + if (ec) { + return Fail(ec, "write"); + } + std::cout << "Message send! " << bytes_transferred << " bytes transferred" << std::endl + << std::endl; + receiveMessage(); } void WebSocketClient::receiveMessage() { @@ -68,23 +92,43 @@ void WebSocketClient::onReceiveMessage(beast::error_code ec, std::size_t bytes_t return Fail(ec, "read"); } - std::string received_message = boost::beast::buffers_to_string(buffer_.data()); - json response = json::parse(received_message); - std::cout << "Received message: " << response.dump(4) << std::endl; + const auto received_message = + std::make_shared(boost::beast::buffers_to_string(buffer_.data())); buffer_.consume(bytes_transferred); // Clear the buffer for the next message - receiveMessage(); // Continue receiving + processMessage(received_message); } -void WebSocketClient::sendMessage(const json& message) { - std::cout << "Sending message send:" << message.dump() << std::endl; - ws_.async_write(net::buffer(message.dump()), - beast::bind_front_handler(&WebSocketClient::onSendMessage, shared_from_this())); +void WebSocketClient::processMessage(std::shared_ptr const& message) { + boost::asio::post( + ws_.get_executor(), + beast::bind_front_handler(&WebSocketClient::onProcessMessage, shared_from_this(), message)); } -void WebSocketClient::onSendMessage(boost::system::error_code ec, std::size_t bytes_transferred) { - if (ec) { - return Fail(ec, "write"); +void WebSocketClient::onProcessMessage(std::shared_ptr const& message) { + response_messages_queue_.push_back(message); + + std::string prio_message = *response_messages_queue_.begin()->get(); + response_messages_queue_.erase(response_messages_queue_.begin()); + + const auto parsed_message = displayAndParseMessage(prio_message); + + if (std::holds_alternative(parsed_message)) { + ErrorMessage error = std::get(parsed_message); + throw std::runtime_error(createLogErrorMessage(error)); } - std::cout << "Message send! " << bytes_transferred << " bytes transferred" << std::endl; - receiveMessage(); -} \ No newline at end of file + + DataMessage data_message = std::get(parsed_message); + + if (!reply_messages_queue_.empty()) { + writeReplyMessagesOnQueue(); + } else { + receiveMessage(); + } +} + +void WebSocketClient::writeReplyMessagesOnQueue() { + json reply_message = reply_messages_queue_.front(); + reply_messages_queue_.erase(reply_messages_queue_.begin()); + std::cout << "Sending queue message: " << reply_message.dump() << std::endl; + sendMessage(reply_message); +} diff --git a/cdsp/knowledge-layer/connector/websocket-client/websocket_client.hpp b/cdsp/knowledge-layer/connector/websocket-client/websocket_client.h similarity index 69% rename from cdsp/knowledge-layer/connector/websocket-client/websocket_client.hpp rename to cdsp/knowledge-layer/connector/websocket-client/websocket_client.h index 9eea1bd..8a8922a 100644 --- a/cdsp/knowledge-layer/connector/websocket-client/websocket_client.hpp +++ b/cdsp/knowledge-layer/connector/websocket-client/websocket_client.h @@ -2,8 +2,13 @@ #include #include #include +#include #include #include +#include + +#include "data_types.h" +#include "message_utils.h" namespace beast = boost::beast; namespace websocket = beast::websocket; @@ -13,7 +18,7 @@ using json = nlohmann::json; class WebSocketClient : public std::enable_shared_from_this { public: - WebSocketClient(const std::string& host, const std::string& port); + WebSocketClient(const InitConfig& init_config); void run(); void sendMessage(const json& message); @@ -24,13 +29,17 @@ class WebSocketClient : public std::enable_shared_from_this { void receiveMessage(); void onReceiveMessage(beast::error_code error_code, std::size_t bytes_transferred); void onSendMessage(boost::system::error_code ec, std::size_t bytes_transferred); + void processMessage(std::shared_ptr const& ss); + void onProcessMessage(std::shared_ptr const& ss); - private: + void writeReplyMessagesOnQueue(); + + std::vector reply_messages_queue_{}; + std::vector> response_messages_queue_{}; net::io_context io_context_; websocket::stream ws_; tcp::resolver resolver_; beast::flat_buffer buffer_; - std::string server_uri_; - std::string server_port_; + InitConfig init_config_; }; \ No newline at end of file diff --git a/cdsp/knowledge-layer/symbolic-reasoner/examples/usecase-model/inputs/README.md b/cdsp/knowledge-layer/symbolic-reasoner/examples/usecase-model/inputs/README.md new file mode 100644 index 0000000..78db61a --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/examples/usecase-model/inputs/README.md @@ -0,0 +1,11 @@ +# Configuration Websocket-Client supported Data Points + +This module is responsible for handling the configuration of supported data points in the application. It supports a TXT format for defining the data points. + +The `vss_data_required.txt` in this directory contains the data point definitions that websocket-client will use during the initial connection. + +> [!WARNING] +> +> - Before starting the application, ensure that the desired TXT file is correctly placed in this directory. This file should contain the definitions of the supported data points. The name and extension to use can be configured in the `/docker/.env` file, it uses the ENV variable named `REQUIRED_VSS_DATA_POINTS_FILE`. If it is not specified, it uses `vss_data_required.txt` by default, which is one of the files contained in this repository. . +> - Ensure that the used file is correctly formatted and contains valid data points definitions. +> - **The application will not function correctly if the data points file is missing or incorrectly placed.** \ No newline at end of file diff --git a/cdsp/knowledge-layer/symbolic-reasoner/examples/usecase-model/inputs/vss_data_required.txt b/cdsp/knowledge-layer/symbolic-reasoner/examples/usecase-model/inputs/vss_data_required.txt new file mode 100644 index 0000000..9fba727 --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/examples/usecase-model/inputs/vss_data_required.txt @@ -0,0 +1,7 @@ +Vehicle.Chassis.SteeringWheel.Angle +Vehicle.CurrentLocation.Latitude +Vehicle.CurrentLocation.Longitude +Vehicle.Powertrain.TractionBattery.NominalVoltage +Vehicle.Powertrain.TractionBattery.StateOfCharge.CurrentEnergy +Vehicle.Powertrain.Transmission.CurrentGear +Vehicle.Speed \ No newline at end of file From e68d6bbab816412e9906ee475be7f37ce13eef24 Mon Sep 17 00:00:00 2001 From: Sebastian Schleemilch Date: Fri, 27 Sep 2024 13:16:32 +0200 Subject: [PATCH 32/48] CMake windows support Signed-off-by: Sebastian Schleemilch --- cdsp/knowledge-layer/CMakeLists.txt | 4 ++ cdsp/knowledge-layer/README.md | 50 +++++++++++++++++-- .../connector/websocket-client/CMakeLists.txt | 6 +++ 3 files changed, 57 insertions(+), 3 deletions(-) diff --git a/cdsp/knowledge-layer/CMakeLists.txt b/cdsp/knowledge-layer/CMakeLists.txt index 6a44730..65c8b0e 100644 --- a/cdsp/knowledge-layer/CMakeLists.txt +++ b/cdsp/knowledge-layer/CMakeLists.txt @@ -8,6 +8,10 @@ set(CMAKE_CXX_STANDARD 17) # Find Boost libraries find_package(Boost 1.86.0 REQUIRED COMPONENTS system filesystem thread) +if(WIN32) + include_directories(${Boost_INCLUDE_DIRS}) +endif() + # FetchContent to include nlohmann/json include(FetchContent) FetchContent_Declare( diff --git a/cdsp/knowledge-layer/README.md b/cdsp/knowledge-layer/README.md index 36fc14b..062306e 100644 --- a/cdsp/knowledge-layer/README.md +++ b/cdsp/knowledge-layer/README.md @@ -14,7 +14,25 @@ Before setting up the project, make sure you have the following installed: ### Installing Dependencies -1. **Installing Boost (macOS/Linux)**: +1. **Install g++**: + On windows you may use mingw, e.g. you can install mingw64 with msys64 from here: https://www.msys2.org/ + + Open the MSYS2 MinGW64 Shell. Make sure you're using the MSYS2 MinGW64 Shell (not the regular MSYS2 shell), as this is required for using the 64-bit GCC toolchain. You can find this in the Start menu as MSYS2 MinGW 64-bit. Run the following command: + + ```bash + pacman -Syu # Update MSYS2 packages + pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-make # Install 64-bit GCC and Make + ``` + After the installation, verify that gcc and g++ are installed and accessible in the MSYS2 MinGW64 shell by running: + + ```bash + gcc --version + g++ --version + ``` + You should see the version information for the installed GCC toolchain. + + +2. **Install Boost**: If you're on macOS, you can install Boost using Homebrew: ```bash @@ -27,7 +45,25 @@ Before setting up the project, make sure you have the following installed: sudo apt-get install libboost-all-dev ``` -2. **Install CMake**: + On Windows you can download a zipfile or take an installer, e.g. from here: https://sourceforge.net/projects/boost/files/boost-binaries/. To use all functionality you have to build the boost library with the gcc compiler. + + Open the MSYS2 MinGW64 Shell from the Start menu (not the standard MSYS2 shell), navigate to your Boost directory and build: + + ```bash + cd /c/path/to/boost_1_86_0 + ./bootstrap.sh gcc + ./b2 --with-system --with-filesystem --with-thread + ``` + + Important Note: When you want to build the projekt with cmake later, cmake often expects specific library names. So if it does not find the libraries, you have to rename them, e.g.: + + + **libboost_system-mgw14-mt-x64-1_86.a** to **libboost_system.a** for the release version and + **libboost_system-mgw14-mt-d-x64-1_86.a** tp **libboost_system-d.a** for the debug version. + + And the same for filesystem, thread, atomic and chrono. + +3. **Install CMake**: Ensure you have CMake installed: ```bash @@ -35,11 +71,16 @@ Before setting up the project, make sure you have the following installed: sudo apt-get install cmake # For Linux ``` + On Windows you can get an installer here: https://cmake.org/download/. + + Make sure you have Windows SDK 10 installed. To check start the Visual Studio Installer (https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/) and look for Visual Studio Build Tools. Here look for the component 'Desktop development with C++' and install it if required. + + ## Project Setup **Build the WebSocket Client**: - The WebSocket client is located in the `connector/websocket-client/` directory. To build it from this directory: + The WebSocket client is located in the `cdsp/knowledge_layer/` directory. To build it from this directory: ```bash # Create a build directory @@ -47,7 +88,10 @@ Before setting up the project, make sure you have the following installed: cd build # Run CMake to generate build files + # For Mac: cmake .. + # For Windows you have to specify the location of the boost libraries: + cmake -DBOOST_ROOT= -DBOOST_LIBRARYDIR=/stage/lib .. # Build the project make diff --git a/cdsp/knowledge-layer/connector/websocket-client/CMakeLists.txt b/cdsp/knowledge-layer/connector/websocket-client/CMakeLists.txt index f9979ea..065597b 100644 --- a/cdsp/knowledge-layer/connector/websocket-client/CMakeLists.txt +++ b/cdsp/knowledge-layer/connector/websocket-client/CMakeLists.txt @@ -6,5 +6,11 @@ target_link_libraries(websocket_client Boost::system Boost::filesystem Boost::th target_link_libraries(websocket_client nlohmann_json::nlohmann_json) target_include_directories(websocket_client PRIVATE ${CMAKE_SOURCE_DIR}/connector/utils) + +# On Windows link winsock, too +if(WIN32) + target_link_libraries(websocket_client ws2_32) +endif() + # Use defined output directory for the executable set_target_properties(websocket_client PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) \ No newline at end of file From bbe803f0890b6ed7dcd0bb064f40e71106e51cd2 Mon Sep 17 00:00:00 2001 From: Christian Muehlbauer Date: Wed, 9 Oct 2024 15:13:19 +0200 Subject: [PATCH 33/48] Add --help CLI feature to display configured and default parameters Signed-off-by: Christian Muehlbauer --- cdsp/knowledge-layer/README.md | 6 +++ .../connector/websocket-client/main.cpp | 42 ++++++++++++++++++- 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/cdsp/knowledge-layer/README.md b/cdsp/knowledge-layer/README.md index 062306e..8962b61 100644 --- a/cdsp/knowledge-layer/README.md +++ b/cdsp/knowledge-layer/README.md @@ -130,3 +130,9 @@ After successfully building the client, you can run it with the following comman ```bash ./build/bin/websocket_client ``` + +To display a list of available environment variables and their default values, run the application with the `--help` flag: + +```bash +./websocket_client --help +``` \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/websocket-client/main.cpp b/cdsp/knowledge-layer/connector/websocket-client/main.cpp index a4c64b3..6073056 100644 --- a/cdsp/knowledge-layer/connector/websocket-client/main.cpp +++ b/cdsp/knowledge-layer/connector/websocket-client/main.cpp @@ -22,6 +22,41 @@ std::string getEnvVariable(const std::string& envVar, const std::string& default return valueEnv ? std::string(valueEnv) : defaultValue; } +void displayHelp() { + std::string bold = "\033[1m"; + std::string lightRed = "\033[91m"; + std::string reset = "\033[0m"; + + std::cout << bold << "Usage: websocket_client [--help]\n\n" << reset; + + std::cout << "This table contains a lists environment variables set for the WebSocket client " + "and their descriptions.\n\n"; + // Table header + std::cout << bold << std::left << std::setw(50) << "Variable" << std::setw(50) << "Description" + << "Value" << reset << "\n"; + std::cout << std::string(140, '-') << "\n"; // Line separator + + std::cout << std::left << std::setw(50) << "HOST_WEBSOCKET_SERVER" << std::setw(50) + << "IP address of the WebSocket server" + << getEnvVariable(" - HOST_WEBSOCKET_SERVER", DefaultHostWebsocketServer) << "\n"; + std::cout << std::left << std::setw(50) << "PORT_WEBSOCKET_SERVER" << std::setw(50) + << "Port number of the WebSocket server" + << getEnvVariable(" - PORT_WEBSOCKET_SERVER", DefaultPortWebSocketServer) << "\n"; + std::cout << std::left << std::setw(50) << "VIN" << std::setw(50) + << "Object ID to be used in communication" + << getEnvVariable("VIN", lightRed + "`Not Set (Required)`" + reset) << "\n"; + std::cout << std::left << std::setw(50) << "REQUIRED_VSS_DATA_POINTS_FILE" << std::setw(50) + << "Path to the model configuration file" + << getEnvVariable(" - REQUIRED_VSS_DATA_POINTS_FILE", + DefaultRequiredVSSDataPointsFile) + << "\n"; + + std::cout << "\n" << bold << "Description:\n" << reset; + std::cout << "This client connects to a WebSocket server and processes incoming messages based " + "on the defined input.\n"; + std::cout << "The above environment variables are used to configure the application.\n\n"; +} + /** * @brief Reads a file and returns a list of required data points. * @@ -71,7 +106,12 @@ InitConfig AddInitConfig() { return init_config; } -int main() { +int main(int argc, char* argv[]) { + // Check for --help flag + if (argc > 1 && std::string(argv[1]) == "--help") { + displayHelp(); + return EXIT_SUCCESS; + } try { InitConfig init_config = AddInitConfig(); std ::cout << "** Starting client! **" << std::endl; From 9559d7f4c0c272ee1210f7adb2e32d575da675b7 Mon Sep 17 00:00:00 2001 From: Christian Muehlbauer Date: Wed, 9 Oct 2024 15:28:09 +0200 Subject: [PATCH 34/48] Use configuration file to organize the use case model directory Add helper documentation to system methods and remove outdated README. Fix read message containing data points. Merge remote-tracking branch 'origin/feature/enabling-of-knowledgelay Signed-off-by: Christian Muehlbauer --- cdsp/information-layer/README.md | 12 +- cdsp/knowledge-layer/README.md | 6 +- .../connector/utils/data_types.h | 22 +- .../connector/utils/helper.cpp | 31 ++ cdsp/knowledge-layer/connector/utils/helper.h | 9 + .../connector/utils/message_utils.cpp | 15 +- .../connector/utils/message_utils.h | 4 +- .../connector/utils/model_config.cpp | 193 +++++++++ .../connector/utils/model_config.h | 13 + .../connector/websocket-client/CMakeLists.txt | 2 +- .../connector/websocket-client/main.cpp | 42 +- .../websocket-client/websocket_client.cpp | 13 +- .../examples/use-case/README.md | 106 +++++ .../model}/inputs/vss_data_required.txt | 0 .../examples/use-case/model/model_config.json | 24 ++ .../model/ontologies/example_ontology.ttl | 1 + .../model/output/generated_triples.ttl | 72 ++++ .../query_observation_data_property.rq | 13 + .../query_observation_object_property.rq | 20 + .../vss/query_vss_data_property.rq | 21 + .../vss/query_vss_object_property.rq | 21 + .../model/shacl/observation_shacl.ttl | 24 ++ .../use-case/model/shacl/vss_shacl.ttl | 374 ++++++++++++++++++ .../examples/usecase-model/inputs/README.md | 11 - 24 files changed, 983 insertions(+), 66 deletions(-) create mode 100644 cdsp/knowledge-layer/connector/utils/helper.cpp create mode 100644 cdsp/knowledge-layer/connector/utils/helper.h create mode 100644 cdsp/knowledge-layer/connector/utils/model_config.cpp create mode 100644 cdsp/knowledge-layer/connector/utils/model_config.h create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/README.md rename cdsp/knowledge-layer/symbolic-reasoner/examples/{usecase-model => use-case/model}/inputs/vss_data_required.txt (100%) create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/model_config.json create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/ontologies/example_ontology.ttl create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/output/generated_triples.ttl create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/default/query_observation_data_property.rq create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/default/query_observation_object_property.rq create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/vss/query_vss_data_property.rq create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/vss/query_vss_object_property.rq create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/shacl/observation_shacl.ttl create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/shacl/vss_shacl.ttl delete mode 100644 cdsp/knowledge-layer/symbolic-reasoner/examples/usecase-model/inputs/README.md diff --git a/cdsp/information-layer/README.md b/cdsp/information-layer/README.md index bbeab11..4e94209 100644 --- a/cdsp/information-layer/README.md +++ b/cdsp/information-layer/README.md @@ -89,7 +89,8 @@ $ docker build -t webserver-service . To run `RealmDB` use: -> [!IMPORTANT] See [here](./handlers/src/realmdb/README.md) all the required ENV variables. +> [!IMPORTANT] +> See [here](./handlers/src/realmdb/README.md) all the required ENV variables. ```shell $ docker run --name websocket-service -e HANDLER_TYPE=realmdb [-e required_env_variables] -p 8080:8080 websocket-service @@ -97,7 +98,8 @@ $ docker run --name websocket-service -e HANDLER_TYPE=realmdb [-e required_env_v To run `IoTDB` use: -> [!IMPORTANT] See [here](./handlers/src/iotdb/README.md) all the required ENV variables. These are optional, because by default it uses the local configuration to connect to the `iotdb-service` container. +> [!IMPORTANT] +> See [here](./handlers/src/iotdb/README.md) all the required ENV variables. These are optional, because by default it uses the local configuration to connect to the `iotdb-service` container. ```shell $ docker run --name websocket-service -e HANDLER_TYPE=iotdb --network cdsp_default [-e required_env_variables] -p 8080:8080 websocket-service @@ -117,7 +119,8 @@ To start the websocket-server using `RealmDB` execute the command: To run `RealmDB` use: -> [!IMPORTANT] See [here](./handlers/src/realmdb/README.md) all the required ENV variables. +> [!IMPORTANT] +> See [here](./handlers/src/realmdb/README.md) all the required ENV variables. ```shell $ HANDLER_TYPE=realm [ENV_VARIABLE_NAME required_env_variables] npm start @@ -125,7 +128,8 @@ $ HANDLER_TYPE=realm [ENV_VARIABLE_NAME required_env_variables] npm start To start the websocket-server using `IoTDB` execute the command: -> [!IMPORTANT] See [here](./handlers/src/iotdb/README.md) all the required ENV variables. These are optional, because by default it uses the local configuration to connect to the `iotdb-service` container. +> [!IMPORTANT] +> See [here](./handlers/src/iotdb/README.md) all the required ENV variables. These are optional, because by default it uses the local configuration to connect to the `iotdb-service` container. ```shell $ HANDLER_TYPE=iotdb IOTDB_HOST=localhost [ENV_VARIABLE_NAME required_env_variables] npm start diff --git a/cdsp/knowledge-layer/README.md b/cdsp/knowledge-layer/README.md index 8962b61..621ebe5 100644 --- a/cdsp/knowledge-layer/README.md +++ b/cdsp/knowledge-layer/README.md @@ -108,8 +108,7 @@ The project requires certain environment variables to work with the WebSocket se - **HOST_WEBSOCKET_SERVER:** Specifies the hostname of the WebSocket server. The default is `localhost`. - **PORT_WEBSOCKET_SERVER:** Specifies the port for connecting to the WebSocket server. The default is `8080`. -- **VIN:** The Vehicle Identification Number (VIN) is required to subscribe and retrieve information for a specific vehicle. Use the VIN configured in the [`information-layer`](../information-layer/README.md). -- **REQUIRED_VSS_DATA_POINTS_FILE:** The name of the TXT file containing all the required data points to start the application. See more details [here](symbolic-reasoner/examples/usecase-model/inputs/README.md). The default value is `vss_data_required.txt`. +- **OBJECT_ID:** The object id is required to subscribe and retrieve information for a specific object (e.g. VIN (Vehicle Identification Number) for VSS (Vehicle Signal Specification) data). Use the object id (in this case VIN) configured in the [`information-layer`](../information-layer/README.md). You can customize the WebSocket server configuration by adding the following environment variables in the `/docker/.env` file. Below is an example of what the file could look like: @@ -120,8 +119,7 @@ You can customize the WebSocket server configuration by adding the following env HOST_WEBSOCKET_SERVER="your_custom_host" PORT_WEBSOCKET_SERVER="your_custom_port" -VIN="VIN_TO_SUBSCRIBE" -REQUIRED_VSS_DATA_POINTS_FILE=vss_data_required.txt +OBJECT_ID="OBJECT_ID_TO_SUBSCRIBE" ``` ### Start the Websocket Client diff --git a/cdsp/knowledge-layer/connector/utils/data_types.h b/cdsp/knowledge-layer/connector/utils/data_types.h index f8baf06..008f984 100644 --- a/cdsp/knowledge-layer/connector/utils/data_types.h +++ b/cdsp/knowledge-layer/connector/utils/data_types.h @@ -2,15 +2,33 @@ #define DATA_TYPES_DATA_TYPES_H #include +#include #include #include +struct ReasonerSettings { + std::string inference_engine; + std::string output_format; + std::vector supported_tree_types; +}; + +struct ModelConfig { + std::map> system_data_points; + std::string output_file_path; + std::vector ontology_files; + std::vector shacl_shapes_files; + std::map> triple_assembler_queries_files; + std::string output_queries_path; + std::vector rules_files; + ReasonerSettings reasoner_settings; +}; + struct InitConfig { std::string uuid; std::string host_websocket_server; std::string port_websocket_server; - std::string vin; - std::vector system_vss_data_points; + std::string oid; + ModelConfig model_config; }; struct MessageHeader { diff --git a/cdsp/knowledge-layer/connector/utils/helper.cpp b/cdsp/knowledge-layer/connector/utils/helper.cpp new file mode 100644 index 0000000..c5561a7 --- /dev/null +++ b/cdsp/knowledge-layer/connector/utils/helper.cpp @@ -0,0 +1,31 @@ +#include "helper.h" + +/** + * @brief Converts a given string to lowercase. + * + * This function takes an input string and converts all its characters to lowercase. + * + * @param input The input string to be converted. + * @return A new string with all characters in lowercase. + */ +std::string toLowercase(const std::string& input) { + std::string result = input; + std::transform(result.begin(), result.end(), result.begin(), + [](unsigned char c) { return std::tolower(c); }); + return result; +} + +/** + * @brief Converts a given string to uppercase. + * + * This function takes an input string and converts all its characters to uppercase. + * + * @param input The input string to be converted. + * @return A new string with all characters in uppercase. + */ +std::string toUppercase(const std::string& input) { + std::string result = input; + std::transform(result.begin(), result.end(), result.begin(), + [](unsigned char c) { return std::toupper(c); }); + return result; +} diff --git a/cdsp/knowledge-layer/connector/utils/helper.h b/cdsp/knowledge-layer/connector/utils/helper.h new file mode 100644 index 0000000..91ecaf5 --- /dev/null +++ b/cdsp/knowledge-layer/connector/utils/helper.h @@ -0,0 +1,9 @@ +#ifndef HELPER_H +#define HELPER_H + +#include + +std::string toLowercase(const std::string& input); +std::string toUppercase(const std::string& input); + +#endif // HELPER_H \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/utils/message_utils.cpp b/cdsp/knowledge-layer/connector/utils/message_utils.cpp index d754113..76d1f22 100644 --- a/cdsp/knowledge-layer/connector/utils/message_utils.cpp +++ b/cdsp/knowledge-layer/connector/utils/message_utils.cpp @@ -23,16 +23,17 @@ json createMessageHeader(const MessageType& type, const std::string& tree, const * @brief Creates a subscription message and adds it to the reply messages queue. * * This function generates a subscription message header using the provided - * uuid and vin, and then appends this message to the reply messages queue. + * uuid and oid, and then appends this message to the reply messages queue. * * @param uuid Used as a client identifier. - * @param vin The vehicle identification number. + * @param oid The object identification number. + * @param tree The tree identifier for the message. * @param reply_messages_queue A reference to the queue where the subscription message will be * added. */ -void createSubscription(const std::string& uuid, const std::string& vin, +void createSubscription(const std::string& uuid, const std::string& oid, const std::string& tree, std::vector& reply_messages_queue) { - reply_messages_queue.push_back(createMessageHeader(MessageType::SUBSCRIBE, "VSS", vin, uuid)); + reply_messages_queue.push_back(createMessageHeader(MessageType::SUBSCRIBE, tree, oid, uuid)); } /** @@ -43,15 +44,15 @@ void createSubscription(const std::string& uuid, const std::string& vin, * * @param uuid The client identifier. * @param tree The tree identifier for the message. - * @param vin The vehicle identification number. + * @param oid The object identification number. * @param data_points A vector of data point names to be included in the message. * @param reply_messages_queue A reference to the queue where the constructed message will be * appended. */ -void createReadMessage(const std::string& uuid, const std::string& tree, const std::string& vin, +void createReadMessage(const std::string& uuid, const std::string& tree, const std::string& oid, const std::vector& data_points, std::vector& reply_messages_queue) { - auto message = createMessageHeader(MessageType::READ, tree, vin, uuid); + auto message = createMessageHeader(MessageType::READ, tree, oid, uuid); json nodes = json::array(); for (const auto& data_point : data_points) { diff --git a/cdsp/knowledge-layer/connector/utils/message_utils.h b/cdsp/knowledge-layer/connector/utils/message_utils.h index e6a5c3f..268949f 100644 --- a/cdsp/knowledge-layer/connector/utils/message_utils.h +++ b/cdsp/knowledge-layer/connector/utils/message_utils.h @@ -14,10 +14,10 @@ using json = nlohmann::json; json createMessageHeader(const std::string& type, const std::string& tree, const std::string& id, const std::string& uuid); -void createSubscription(const std::string& uuid, const std::string& vin, +void createSubscription(const std::string& uuid, const std::string& oid, const std::string& tree, std::vector& reply_messages_queue); -void createReadMessage(const std::string& uuid, const std::string& tree, const std::string& vin, +void createReadMessage(const std::string& uuid, const std::string& tree, const std::string& oid, const std::vector& data_points, std::vector& reply_messages_queue); diff --git a/cdsp/knowledge-layer/connector/utils/model_config.cpp b/cdsp/knowledge-layer/connector/utils/model_config.cpp new file mode 100644 index 0000000..cb985db --- /dev/null +++ b/cdsp/knowledge-layer/connector/utils/model_config.cpp @@ -0,0 +1,193 @@ +#include + +#include +#include + +#include "helper.h" +/** + * @brief Reads a file and returns a list of required data points. + * + * This function constructs the full path to the file using the provided file name + * and a predefined project root directory. It then reads the file line by line, + * storing each line as an element in a vector of strings. + * + * @param file_name The name of the file to read. + * @return A vector of strings, each representing a required data point from the file. + * @throws std::runtime_error if the file cannot be opened. + */ +std::vector getClientRequiredDataPoints(std::string file_name) { + std::vector required_data; + std::string root = + std::string(PROJECT_ROOT) + "/symbolic-reasoner/examples/use-case/model/" + file_name; + std::ifstream file(root); + if (!file) { + throw std::runtime_error("Invalid required Data Points file: " + file_name); + } + std::string line; + while (std::getline(file, line)) { + required_data.push_back(line); + } + return required_data; +} + +/** + * @brief Validates the presence of required fields in a JSON configuration. + * + * This function checks for the existence of specific top-level fields and nested fields + * within the provided JSON object. If any required field is missing, it throws a runtime error + * with a descriptive message indicating which field is missing. + * + * @param config_json The JSON object representing the configuration to be validated. + * + * @throws std::runtime_error If any required field is missing in the JSON configuration. + */ +void validateJsonFields(const json& config_json) { + const std::string generic_error_message = + "Error in the model_config.json file. Missing required field"; + // Required top-level fields + if (!config_json.contains("inputs")) { + throw std::runtime_error(generic_error_message + ": 'inputs'"); + } + if (!config_json.contains("ontologies")) { + throw std::runtime_error(generic_error_message + ": 'ontologies'"); + } + if (!config_json.contains("output")) { + throw std::runtime_error(generic_error_message + ": 'output'"); + } + if (!config_json.contains("queries")) { + throw std::runtime_error(generic_error_message + ": 'queries'"); + } + if (!config_json.contains("rules")) { + throw std::runtime_error(generic_error_message + ": 'rules'"); + } + if (!config_json.contains("shacl")) { + throw std::runtime_error(generic_error_message + ": 'shacl'"); + } + if (!config_json.contains("reasoner_settings")) { + throw std::runtime_error(generic_error_message + " 'reasoner_settings'"); + } + + // Validate structure inside "queries" + const auto& queries = config_json["queries"]; + if (!queries.contains("triple_assembler_helper")) { + throw std::runtime_error(generic_error_message + + " in 'queries': 'triple_assembler_helper'"); + } + if (!queries.contains("output")) { + throw std::runtime_error(generic_error_message + " in 'queries': 'output'"); + } + + // Validate structure inside "reasoner_settings" + const auto& reasoner_settings = config_json["reasoner_settings"]; + if (!reasoner_settings.contains("inference_engine")) { + throw std::runtime_error(generic_error_message + + " in 'reasoner_settings': 'inference_engine'"); + } + if (!reasoner_settings.contains("output_format")) { + throw std::runtime_error(generic_error_message + + " in 'reasoner_settings': 'output_format'"); + } + if (!reasoner_settings.contains("supported_tree_types")) { + throw std::runtime_error(generic_error_message + + " in 'reasoner_settings': 'supported_tree_types'"); + } +} + +/** + * @brief Loads the model configuration from a JSON file. + * + * This function reads the model configuration from the specified JSON file and populates + * the provided ModelConfig object with the configuration data. It validates the structure + * of the JSON file and ensures that all required fields are present. + * + * @param config_file The path to the JSON configuration file. + * @param model_config The ModelConfig object to be populated with the configuration data. + * + * @throws std::runtime_error If the configuration file cannot be opened or if required fields are + * missing. + */ +void loadModelConfig(const std::string& config_file, ModelConfig& model_config) { + std::ifstream file(config_file); + if (!file) { + throw std::runtime_error("Could not open the model config file: " + config_file); + } + + json config_json; + file >> config_json; + + // Validate the structure of the JSON + validateJsonFields(config_json); + + if (config_json["reasoner_settings"]["supported_tree_types"].size() > 0) { + const std::string generic_error_message = + "Error in the model_config.json file. Missing required field"; + + for (const auto& tree_type : config_json["reasoner_settings"]["supported_tree_types"]) { + std::string lc_tree_type = toLowercase(tree_type.get()); + + // Read supported tree types + model_config.reasoner_settings.supported_tree_types.push_back( + toUppercase(tree_type.get())); + + // Read system data points for a tree type + if (!config_json["inputs"].contains(lc_tree_type + "_data")) { + throw std::runtime_error(generic_error_message + " in 'inputs': '" + lc_tree_type + + "_data'"); + } + model_config.system_data_points[lc_tree_type] = getClientRequiredDataPoints( + config_json["inputs"][lc_tree_type + "_data"].get()); + + // Read tree type specific triple assembler helpers + if (config_json["queries"]["triple_assembler_helper"].contains(lc_tree_type)) { + std::vector query_list; + for (const auto& query : + config_json["queries"]["triple_assembler_helper"][lc_tree_type]) { + query_list.push_back(query.get()); + } + model_config.triple_assembler_queries_files[lc_tree_type] = query_list; + } else { + std::cout + << (" ** INFO: There is any triple assembler helper for the tree type: '" + + lc_tree_type + "' configured in the model_config.json") + << std::endl + << std::endl; + } + } + } else { + throw std::runtime_error("You need to add some supported tree types in " + config_file); + } + + // Read output file path + model_config.output_file_path = config_json["output"].get(); + + // Read ontologies files + for (const auto& ontology : config_json["ontologies"]) { + model_config.ontology_files.push_back(ontology.get()); + } + + // Read SHACL shapes files + for (const auto& shacl : config_json["shacl"]) { + model_config.shacl_shapes_files.push_back(shacl.get()); + } + + // Read default triple assembler helpers + std::vector query_list; + for (const auto& query : config_json["queries"]["triple_assembler_helper"]["default"]) { + query_list.push_back(query.get()); + } + model_config.triple_assembler_queries_files["default"] = query_list; + + // Read rules paths + for (const auto& rule : config_json["rules"]) { + model_config.rules_files.push_back(rule.get()); + } + + // Read output queries path + model_config.output_queries_path = config_json["queries"]["output"].get(); + + // Read reasoner settings + model_config.reasoner_settings.inference_engine = + config_json["reasoner_settings"]["inference_engine"].get(); + model_config.reasoner_settings.output_format = + config_json["reasoner_settings"]["output_format"].get(); +} diff --git a/cdsp/knowledge-layer/connector/utils/model_config.h b/cdsp/knowledge-layer/connector/utils/model_config.h new file mode 100644 index 0000000..98f866c --- /dev/null +++ b/cdsp/knowledge-layer/connector/utils/model_config.h @@ -0,0 +1,13 @@ +#ifndef MESSAGE_MODEL_CONFIG_H +#define MESSAGE_MODEL_CONFIG_H + +#include + +#include "data_types.h" + +using json = nlohmann::json; + +void validateJsonFields(const json& config_json); +void loadModelConfig(const std::string& config_file, ModelConfig& model_config); + +#endif // MESSAGE_MODE_CONFIG_H \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/websocket-client/CMakeLists.txt b/cdsp/knowledge-layer/connector/websocket-client/CMakeLists.txt index 065597b..a0b2dc9 100644 --- a/cdsp/knowledge-layer/connector/websocket-client/CMakeLists.txt +++ b/cdsp/knowledge-layer/connector/websocket-client/CMakeLists.txt @@ -1,5 +1,5 @@ # Define the WebSocket client target -add_executable(websocket_client main.cpp websocket_client.cpp ../utils/message_utils.cpp) +add_executable(websocket_client main.cpp websocket_client.cpp ../utils/message_utils.cpp ../utils/helper.cpp ../utils/model_config.cpp) # Link libraries target_link_libraries(websocket_client Boost::system Boost::filesystem Boost::thread) diff --git a/cdsp/knowledge-layer/connector/websocket-client/main.cpp b/cdsp/knowledge-layer/connector/websocket-client/main.cpp index 6073056..0d96b29 100644 --- a/cdsp/knowledge-layer/connector/websocket-client/main.cpp +++ b/cdsp/knowledge-layer/connector/websocket-client/main.cpp @@ -1,12 +1,13 @@ +#include +#include + #include #include #include #include -#include #include #include -#include "data_types.h" #include "websocket_client.h" using json = nlohmann::json; @@ -15,7 +16,8 @@ boost::uuids::random_generator uuidGenerator; std::string DefaultHostWebsocketServer{"127.0.0.1"}; std::string DefaultPortWebSocketServer{"8080"}; -std::string DefaultRequiredVSSDataPointsFile{"vss_data_required.txt"}; +std::string ModelConfigurationFile{std::string(PROJECT_ROOT) + + "/symbolic-reasoner/examples/use-case/model/model_config.json"}; std::string getEnvVariable(const std::string& envVar, const std::string& defaultValue = "") { const char* valueEnv = std::getenv(envVar.c_str()); @@ -57,32 +59,6 @@ void displayHelp() { std::cout << "The above environment variables are used to configure the application.\n\n"; } -/** - * @brief Reads a file and returns a list of required data points. - * - * This function constructs the full path to the file using the provided file name - * and a predefined project root directory. It then reads the file line by line, - * storing each line as an element in a vector of strings. - * - * @param file_name The name of the file to read. - * @return A vector of strings, each representing a required data point from the file. - * @throws std::runtime_error if the file cannot be opened. - */ -std::vector getClientRequiredDataPoints(std::string file_name) { - std::vector required_data; - std::string root = - std::string(PROJECT_ROOT) + "/symbolic-reasoner/examples/usecase-model/inputs/" + file_name; - std::ifstream file(root); - if (!file) { - throw std::runtime_error("Invalid required Data Points file: " + file_name); - } - std::string line; - while (std::getline(file, line)) { - required_data.push_back(line); - } - return required_data; -} - /** * @brief Initializes and returns an InitConfig object with required configuration variables. * @@ -94,15 +70,17 @@ std::vector getClientRequiredDataPoints(std::string file_name) { * @throws std::runtime_error if there is a problem setting a variable. */ InitConfig AddInitConfig() { + ModelConfig model_config; + loadModelConfig(ModelConfigurationFile, model_config); + InitConfig init_config; init_config.host_websocket_server = getEnvVariable("HOST_WEBSOCKET_SERVER", DefaultHostWebsocketServer); init_config.port_websocket_server = getEnvVariable("PORT_WEBSOCKET_SERVER", DefaultPortWebSocketServer); init_config.uuid = boost::uuids::to_string(uuidGenerator()); - init_config.vin = getEnvVariable("VIN"); - init_config.system_vss_data_points = getClientRequiredDataPoints( - getEnvVariable("REQUIRED_VSS_DATA_POINTS_FILE", DefaultRequiredVSSDataPointsFile)); + init_config.oid = getEnvVariable("OBJECT_ID"); + init_config.model_config = model_config; return init_config; } diff --git a/cdsp/knowledge-layer/connector/websocket-client/websocket_client.cpp b/cdsp/knowledge-layer/connector/websocket-client/websocket_client.cpp index b095cf0..527a718 100644 --- a/cdsp/knowledge-layer/connector/websocket-client/websocket_client.cpp +++ b/cdsp/knowledge-layer/connector/websocket-client/websocket_client.cpp @@ -3,6 +3,8 @@ #include #include +#include "helper.h" + namespace { void Fail(beast::error_code error_code, const std::string& what) { std::cerr << what << ": " << error_code.message() << "\n"; @@ -62,9 +64,14 @@ void WebSocketClient::handshake(beast::error_code ec) { << std::endl << std::endl; - createSubscription(init_config_.uuid, init_config_.vin, reply_messages_queue_); - createReadMessage(init_config_.uuid, "VSS", init_config_.vin, - init_config_.system_vss_data_points, reply_messages_queue_); + for (const std::string& tree_type : + init_config_.model_config.reasoner_settings.supported_tree_types) { + createSubscription(init_config_.uuid, init_config_.oid, tree_type, reply_messages_queue_); + createReadMessage(init_config_.uuid, tree_type, init_config_.oid, + init_config_.model_config.system_data_points[toLowercase(tree_type)], + reply_messages_queue_); + } + writeReplyMessagesOnQueue(); } diff --git a/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/README.md b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/README.md new file mode 100644 index 0000000..9aa12bd --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/README.md @@ -0,0 +1,106 @@ +Here is a sample `README.md` that explains the structure and usage of the `model_config.json` configuration file. + +--- + +# Model Configuration for Reasoner Application + +This `model_config.json` file provides the configuration necessary to run the reasoner application. The file defines the required inputs, ontologies, output settings, queries, rules, SHACL validation, and reasoning engine options. This document explains the purpose of each section in the configuration. + +## Configuration Overview + +The `model_config.json` is structured to provide: +- Input data points +- Ontology files for the domain schema +- SHACL shapes for data validation +- SPARQL queries for data manipulation +- Reasoning rules +- Reasoner settings +- Output configurations + +### Configuration Sections + +#### Inputs +```json +"inputs": { + "vss_data": "inputs/vss_data_required.txt" +} +``` +- **vss_data**: The field must be called `_data`, in the example we use the VSS tree type (`vss_data`). This field specifies the path to the input data file that contains vehicle signals or data points. This file lists the signals that the reasoner application will work with. It supports a TXT format for defining the data points. + +#### Ontologies +```json +"ontologies": ["ontologies/example_ontology.ttl"] +``` +- **ontologies**: A list of ontology files in Turtle format (.ttl). These define the concepts, relationships, and structure of the data in a semantic format that the reasoner will use to understand and process the input data. + +#### Output +```json +"output": "output/generated_triples.ttl" +``` +- **output**: Defines the path to the file where the reasoner will store the results of the inference process. The output will be generated in the format defined in the [reasoner settings](#reasoner-settings) (in this case a turtle `.ttl`). + +#### Queries +```json +"queries": { + "triple_assembler_helper": { + "vss": [ + "queries/triple_assembler_helper/vss/data_property.rq", + "queries/triple_assembler_helper/vss/object_property.rq" + ], + "default": [ + "queries/triple_assembler_helper/default/data_property.rq", + "queries/triple_assembler_helper/default/object_property.rq" + ] + }, + "output": ["queries/output/"] +} +``` +- **queries**: This section includes SPARQL queries that will be used during the reasoning process to assemble triples or extract results from the reasoned data. + - **triple_assembler_helper**: + Queries specifically designed to assemble data points related to an specific data tree (in this case Vehicle Signal Specification (VSS)) or other specifications used by default, if the tree is not defined, including queries for data and object properties. + - **output**: Queries to retrieve the final inference results after the reasoning process. The queries in this section will typically extract insights from the generated triples. + +#### Rules +```json +"rules": ["rules/insight_rules.ttl"] +``` +- **rules**: A list of rule files in Turtle format. These rules define additional logic for the reasoner to apply during inference. The rules may include custom inferences or insights that the reasoner should derive based on the input data. + +#### SHACL Validation +```json +"shacl": [ + "shacl/vss_shacl.ttl", + "shacl/observation_shacl.ttl" +] +``` +- **shacl**: A list of SHACL (Shapes Constraint Language) files that define the constraints and validation rules for the data. SHACL shapes ensure that the input data conforms to specific structural and semantic rules before it is processed by the reasoner. + +#### Reasoner Settings +```json +"reasoner_settings": { + "inference_engine": "RDFox", + "output_format": "turtle", + "supported_tree_types": ["VSS"] +} +``` +- **reasoner_settings**: Configuration options for the reasoning engine. + - **inference_engine**: Specifies the reasoner to use (in this case, RDFox). + > [!NOTE] Supported engines in this repository + > - `RDFox` + + - **output_format**: Defines the format in which the output will be serialized. The current setting is `turtle` for Turtle format. + > [!NOTE] Supported formats in this repository + > - `turtle` for .ttl files + + - **supported_tree_types**: This field defines the types of data trees that the reasoner application can handle. For the communication with the WebSocket server and definition of the input data, it is required to specify how the tree type will be represented. This tree type will be sent as part of the message header during data transfer and is crucial for reading, interpreting the [input data](#inputs) for the reasoner model, and if exist, specific [triple assembler helpers](#queries). With this tree type definition, the reasoner can ensure compatibility with the input data and properly interpret the data points being processed. + > [!NOTE] Supported tree types this repository + > - `VSS` (Vehicle Signal Specification) + +### Example Usage + +Once the `model_config.json` is configured, the reasoner application will: +1. Read the **input data** from the specified file. +2. Validate the data using the **ontologies** and **SHACL shapes**. +3. Apply the **rules** during inference. +4. Use the **queries** to assemble triples and extract results. +5. Generate an **output** file containing the reasoned data in Turtle format. diff --git a/cdsp/knowledge-layer/symbolic-reasoner/examples/usecase-model/inputs/vss_data_required.txt b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/inputs/vss_data_required.txt similarity index 100% rename from cdsp/knowledge-layer/symbolic-reasoner/examples/usecase-model/inputs/vss_data_required.txt rename to cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/inputs/vss_data_required.txt diff --git a/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/model_config.json b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/model_config.json new file mode 100644 index 0000000..7012fd2 --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/model_config.json @@ -0,0 +1,24 @@ +{ + "inputs": { + "vss_data": "inputs/vss_data_required.txt" + }, + "ontologies": ["ontologies/example_ontology.ttl"], + "output": "output/", + "queries": { + "triple_assembler_helper": { + "vss": [ + "queries/triple_assembler_helper/vss/data_property.rq", + "queries/triple_assembler_helper/vss/object_property.rq" + ], + "default": [] + }, + "output": "queries/output/" + }, + "rules": ["rules/insight_rules.ttl"], + "shacl": ["shacl/vss_shacl.ttl", "shacl/observation_shacl.ttl"], + "reasoner_settings": { + "inference_engine": "RDFox", + "output_format": "turtle", + "supported_tree_types": ["vss"] + } +} diff --git a/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/ontologies/example_ontology.ttl b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/ontologies/example_ontology.ttl new file mode 100644 index 0000000..b44f039 --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/ontologies/example_ontology.ttl @@ -0,0 +1 @@ +#exmaple \ No newline at end of file diff --git a/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/output/generated_triples.ttl b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/output/generated_triples.ttl new file mode 100644 index 0000000..3542e5d --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/output/generated_triples.ttl @@ -0,0 +1,72 @@ +bmw:VehicleWBY11CF080CH470711 a bmw:Vehicle. + + +bmw:ChassisWBY11CF080CH470711 a bmw:Chassis. + +bmw:VehicleWBY11CF080CH470711 bmw:hasPart bmw:ChassisWBY11CF080CH470711. + +bmw:SteeringWheelWBY11CF080CH470711 a bmw:SteeringWheel. +bmw:VehicleWBY11CF080CH470711 bmw:hasPart bmw:SteeringWheelWBY11CF080CH470711. + +bmw:CurrentLocationWBY11CF080CH470711 a bmw:CurrentLocation. +bmw:VehicleWBY11CF080CH470711 bmw:hasSignal bmw:CurrentLocationWBY11CF080CH470711. + + +bmw:PowertrainWBY11CF080CH470711 a bmw:Powertrain. + +bmw:VehicleWBY11CF080CH470711 bmw:hasPart bmw:PowertrainWBY11CF080CH470711. + +bmw:TransmissionWBY11CF080CH470711 a bmw:Transmission. + +bmw:PowertrainWBY11CF080CH470711 bmw:hasPart bmw:TransmissionWBY11CF080CH470711. + +bmw:TractionBatteryWBY11CF080CH470711 a bmw:TractionBattery. + +bmw:PowertrainWBY11CF080CH470711 bmw:hasPart bmw:TractionBatteryWBY11CF080CH470711. + +bmw:StateOfChargeWBY11CF080CH470711 a bmw:StateOfCharge. + +bmw:TractionBatteryWBY11CF080CH470711 bmw:hasSignal bmw:StateOfChargeWBY11CF080CH470711. + + +bmw:Observation20181116155027 a sosa:Observation ; # observation_dateTime + sosa:hasFeatureOfInterest bmw:CurrentLocationWBY11CF080CH470711 ; #last second element of the the data point + sosa:hasSimpleResult "30"^^xsd:double ; # value + sosa:observedProperty bmw:latitude ; #last element of the data point + sosa:phenomenonTime "2018-11-16 15:50:27"^^xsd:dateTime .#dateTime + +bmw:Observation20181116155027 a sosa:Observation ; + sosa:hasFeatureOfInterest bmw:CurrentLocationWBY11CF080CH470711 ; + sosa:hasSimpleResult "50"^^xsd:double ; + sosa:observedProperty bmw:longitude ; + sosa:phenomenonTime "2018-11-16 15:50:27"^^xsd:dateTime . + +bmw:Observation20181116155027 a sosa:Observation ; + sosa:hasFeatureOfInterest bmw:VehicleWBY11CF080CH470711 ; + sosa:hasSimpleResult "50"^^xsd:int ; + sosa:observedProperty bmw:speed ; + sosa:phenomenonTime "2018-11-16 15:50:27"^^xsd:dateTime . + +bmw:Observation20181116155027 a sosa:Observation ; + sosa:hasFeatureOfInterest bmw:SteeringWheelWBY11CF080CH470711 ; + sosa:hasSimpleResult "10"^^xsd:int ; + sosa:observedProperty bmw:angle ; + sosa:phenomenonTime "2018-11-16 15:50:27"^^xsd:dateTime . + +bmw:Observation20181116155027 a sosa:Observation ; + sosa:hasFeatureOfInterest bmw:TransmissionWBY11CF080CH470711 ; + sosa:hasSimpleResult "10"^^xsd:int ; + sosa:observedProperty bmw:currentGear ; + sosa:phenomenonTime "2018-11-16 15:50:27"^^xsd:dateTime . + +bmw:Observation20181116155027 a sosa:Observation ; + sosa:hasFeatureOfInterest bmw:StateOfChargeWBY11CF080CH470711 ; + sosa:hasSimpleResult "98.6"^^xsd:float ; + sosa:observedProperty bmw:CurrentEnergy ; + sosa:phenomenonTime "2018-11-16 15:50:27"^^xsd:dateTime . + +bmw:Observation20181116155027 a sosa:Observation ; + sosa:hasFeatureOfInterest bmw:TractionBatteryWBY11CF080CH470711 ; + sosa:hasSimpleResult "55"^^xsd:int ; + sosa:observedProperty bmw:NominalVoltage ; + sosa:phenomenonTime "2018-11-16 15:50:27"^^xsd:dateTime . \ No newline at end of file diff --git a/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/default/query_observation_data_property.rq b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/default/query_observation_data_property.rq new file mode 100644 index 0000000..d62a449 --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/default/query_observation_data_property.rq @@ -0,0 +1,13 @@ +prefix sh: +prefix val: + + SELECT ?class1 ?data_property ?datatype + WHERE { + val:ObservationShape sh:targetClass ?class1; + sh:property [ + sh:path ?data_property; + sh:datatype ?datatype + ]. + } + + diff --git a/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/default/query_observation_object_property.rq b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/default/query_observation_object_property.rq new file mode 100644 index 0000000..578d806 --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/default/query_observation_object_property.rq @@ -0,0 +1,20 @@ +prefix pdmo: +prefix bmw: +prefix middleware: +prefix sh: +prefix val: +prefix xsd: +prefix ut: + + +SELECT ?class1 ?object_property +WHERE { + val:ObservationShape sh:targetClass ?class1; + sh:property [ + sh:path ?object_property; + sh:nodeKind sh:IRI + ]. + + } + + diff --git a/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/vss/query_vss_data_property.rq b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/vss/query_vss_data_property.rq new file mode 100644 index 0000000..11d85e2 --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/vss/query_vss_data_property.rq @@ -0,0 +1,21 @@ +prefix pdmo: +prefix bmw: +prefix middleware: +prefix sh: +prefix val: +prefix xsd: +prefix ut: + + + SELECT ?class1 ?data_property ?datatype + WHERE { + ?S sh:name "%A%"; + sh:targetClass ?class1; + sh:property [ sh:name ?data_point_name; + sh:path ?data_property; + sh:datatype ?datatype + ]. + FILTER (contains("%B%", ?data_point_name)) #The first value is from the data sigle point + } + + diff --git a/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/vss/query_vss_object_property.rq b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/vss/query_vss_object_property.rq new file mode 100644 index 0000000..4222b3f --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/vss/query_vss_object_property.rq @@ -0,0 +1,21 @@ +prefix pdmo: +prefix bmw: +prefix middleware: +prefix sh: +prefix val: +prefix xsd: +prefix ut: + + +SELECT ?class1 ?object_property ?class2 +WHERE { + ?S sh:name "%A%"; + sh:targetClass ?class1; + sh:property [ sh:name "%B%"; + sh:path ?object_property; + sh:class ?class2; + sh:nodeKind sh:IRI]. + + } + + diff --git a/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/shacl/observation_shacl.ttl b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/shacl/observation_shacl.ttl new file mode 100644 index 0000000..3867fd0 --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/shacl/observation_shacl.ttl @@ -0,0 +1,24 @@ +@prefix sh: . +@prefix sosa: . +@prefix xsd: . +@prefix val: . + +# Shape to validate an Observation +val:ObservationShape a sh:NodeShape ; + sh:targetClass sosa:Observation ; + sh:property [ + sh:path sosa:hasFeatureOfInterest ; + sh:nodeKind sh:IRI ; + ] ; + sh:property [ + sh:path sosa:observedProperty ; + sh:nodeKind sh:IRI ; + ] ; + sh:property [ + sh:path sosa:hasSimpleResult ; + sh:datatype xsd:string ; + ] ; + sh:property [ + sh:path sosa:phenomenonTime ; + sh:datatype xsd:dateTime ; + ] . diff --git a/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/shacl/vss_shacl.ttl b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/shacl/vss_shacl.ttl new file mode 100644 index 0000000..af446be --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/shacl/vss_shacl.ttl @@ -0,0 +1,374 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . +@prefix bmw: . +@prefix val: . + + +val:VehicleShape a sh:NodeShape ; + sh:name "Vehicle" ; + sh:targetClass bmw:Vehicle ; + sh:property [ + sh:name "VIN" ; + sh:path bmw:vin ; + sh:datatype xsd:string ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:name "CurrentLocation" ; + sh:path bmw:hasSignal ; + sh:class bmw:CurrentLocation ; + sh:node val:CurrentLocationShape ; + sh:nodeKind sh:IRI ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:name "Speed" ; + sh:path bmw:speed ; + sh:datatype xsd:float ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:name "PWFStatus" ; + sh:path bmw:PWFStatus ; + sh:datatype xsd:string ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:name "Cabin" ; + sh:path bmw:hasPart ; + sh:class bmw:Cabin ; + sh:node val:CabinShape ; + sh:nodeKind sh:IRI ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:name "Powertrain" ; + sh:path bmw:hasPart ; + sh:class bmw:Powertrain ; + sh:node val:PowertrainShape ; + sh:nodeKind sh:IRI ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:name "Chassis" ; + sh:path bmw:hasPart ; + sh:class bmw:Chassis ; + sh:node val:ChassisShape ; + sh:nodeKind sh:IRI ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] . + +val:ChassisShape a sh:NodeShape; + sh:name "Chassis"; + sh:targetClass bmw:Chassis; + sh:property [ + sh:name "SteeringWheel" ; + sh:path bmw:hasPart ; + sh:class bmw:SteeringWheel ; + sh:node val:SteeringWheelShape ; + sh:nodeKind sh:IRI ; + sh:minCount 1 ; + ] . + +val:SteeringWheelShape a sh:NodeShape; + sh:name "SteeringWheel"; + sh:targetClass bmw:SteeringWheel; + sh:property [ + sh:name "Angle" ; + sh:path bmw:angle ; + sh:datatype xsd:int; + sh:minCount 1 ; + ] . + + +val:CurrentLocationShape a sh:NodeShape ; + sh:name "CurrentLocation" ; + sh:targetClass bmw:CurrentLocation ; + sh:property [ + sh:name "Latitude" ; + sh:path bmw:latitude ; + sh:datatype xsd:double ; + sh:minInclusive -90 ; + sh:maxInclusive 90 ; + val:unit "degrees" ; + sh:description "Current latitude of vehicle in WGS 84 geodetic coordinates." ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:name "Longitude" ; + sh:path bmw:longitude ; + sh:datatype xsd:double ; + sh:minInclusive -180 ; + sh:maxInclusive 180 ; + val:unit "degrees" ; + sh:description "Current longitude of vehicle in WGS 84 geodetic coordinates." ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:name "Timestamp" ; + sh:path bmw:timestamp ; + sh:datatype xsd:long ; + val:unit "iso8601" ; + sh:description "Timestamp from GNSS system for current location, formatted according to ISO 8601 with UTC time zone." ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:name "Heading" ; + sh:path bmw:heading ; + sh:datatype xsd:double ; + sh:minInclusive 0 ; + sh:maxInclusive 360 ; + val:unit "degrees" ; + sh:description "Current heading relative to geographic north. 0 = North, 90 = East, 180 = South, 270 = West." ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] . + +val:PowertrainShape a sh:NodeShape; + sh:name "Powertrain"; + sh:targetClass bmw:Powertrain; + sh:property [ + sh:name "TractionBattery" ; + sh:path bmw:hasPart ; + sh:class bmw:TractionBattery ; + sh:node val:TractionBatteryShape ; + sh:nodeKind sh:IRI ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:name "Transmission" ; + sh:path bmw:hasPart ; + sh:class bmw:Transmission ; + sh:node val:TransmissionShape ; + sh:nodeKind sh:IRI ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] . + +val:TractionBatteryShape a sh:NodeShape; + sh:name "TractionBattery"; + sh:targetClass bmw:TractionBattery ; + sh:property [ + sh:name "NominalVoltage" ; + sh:path bmw:nominalVoltage ; + sh:datatype xsd:int ; + sh:description "Nominal voltage typically refers to voltage of fully charged battery when delivering rated capacity." ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:name "StateOfCharge" ; + sh:path bmw:hasSignal ; + sh:class bmw:StateOfCharge; + sh:node val:StateOfChargeNodeShape; + sh:nodeKind sh:IRI ; + sh:description "Information on the state of charge of the vehicle's high voltage battery." ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] . + +val:StateOfChargeNodeShape a sh:NodeShape ; + sh:name "StateOfCharge" ; + sh:targetClass bmw:StateOfCharge ; + sh:property [ + sh:name "CurrentEnergy" ; + sh:path bmw:currentEnergy ; + sh:datatype xsd:float ; + sh:description "Physical state of charge of high voltage battery expressed in kWh." ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] . + + +val:TransmissionShape a sh:NodeShape ; + sh:name "Transmission" ; + sh:targetClass bmw:Transmission ; + sh:property [ + sh:name "CurrentGear" ; + sh:path bmw:currentGear ; + sh:datatype xsd:int ; + sh:description "Is item open or closed? True = Fully or partially open. False = Fully closed." ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] . + + +val:CabinShape a sh:NodeShape ; + sh:name "Cabin" ; + sh:targetClass bmw:Cabin ; + sh:property [ + sh:name "Light" ; + sh:path bmw:hasPart ; + sh:class bmw:CabinLight ; + sh:node val:CabinLightShape ; + sh:nodeKind sh:IRI ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:name "Door" ; + sh:path bmw:hasPart ; + sh:class bmw:CabinDoor ; + sh:node val:CabinDoorShape ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] . + +val:CabinDoorShape a sh:NodeShape ; + sh:name "Door" ; + sh:targetClass bmw:CabinDoor ; + sh:property [ + sh:path bmw:position ; + sh:name "Row" ; + sh:in ("Row1" "Row2") ; + sh:datatype xsd:string ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:path bmw:position ; + sh:name "Driver" ; + sh:in ("Driver") ; + sh:datatype xsd:string ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:name "Passenger" ; + sh:path bmw:position ; + sh:in ("Passenger") ; + sh:datatype xsd:string ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:name "Window" ; + sh:path bmw:hasPart ; + sh:class bmw:Window ; + sh:node val:WindowShape ; + sh:nodeKind sh:IRI ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] . + +val:WindowShape a sh:NodeShape ; + sh:name "Window" ; + sh:targetClass bmw:Window ; + sh:property [ + sh:name "IsOpen" ; + sh:path bmw:isOpen ; + sh:datatype xsd:boolean ; + sh:description "Is item open or closed? True = Fully or partially open. False = Fully closed." ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:name "Position" ; + sh:path bmw:windowPosition ; + sh:datatype xsd:int ; + sh:minInclusive 0 ; + sh:maxInclusive 100 ; + val:unit "percent" ; + sh:description "Item position. 0 = Start position 100 = End position." ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:name "Switch" ; + sh:path bmw:switch ; + sh:datatype xsd:string ; + sh:in ("INACTIVE" "CLOSE" "OPEN" "ONE_SHOT_CLOSE" "ONE_SHOT_OPEN") ; + sh:description "Switch controlling sliding action such as window, sunroof, or blind." ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] . + +val:CabinLightShape a sh:NodeShape ; + sh:name "Light" ; + sh:targetClass bmw:CabinLight ; + sh:property [ + sh:name "AmbientLight" ; + sh:path bmw:hasPart ; + sh:class bmw:AmbientLight ; + sh:node val:AmbientLightShape ; + sh:nodeKind sh:IRI ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:name "SpotLight" ; + sh:path bmw:hasPart ; + sh:class bmw:SpotLight ; + sh:node val:SpotLightShape ; + sh:nodeKind sh:IRI ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] . + +val:AmbientLightShape a sh:NodeShape ; + sh:name "AmbientLight" ; + sh:targetClass bmw:AmbientLight ; + sh:property [ + sh:path bmw:position ; + sh:name "Row" ; + sh:in ("Row1" "Row2") ; + sh:datatype xsd:string ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:path bmw:position ; + sh:name "Driver" ; + sh:in ("Driver") ; + sh:datatype xsd:string ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:path bmw:position ; + sh:name "Passenger" ; + sh:in ("Passenger") ; + sh:datatype xsd:string ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:name "Colour" ; + sh:path bmw:lightColor ; + sh:datatype xsd:string ; + sh:description "Hexadecimal color code represented as a 3-byte RGB (i.e. Red, Green, and Blue) value preceded by a hash symbol '#'."; + sh:minCount 0 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:name "Intensity" ; + sh:path bmw:lightIntensity ; + sh:datatype xsd:integer ; + sh:minInclusive 1 ; + sh:maxInclusive 100 ; + val:unit "percent" ; + sh:description "How much of the maximum possible brightness of the light is used. 1 = Maximum attenuation, 100 = No attenuation (i.e. full brightness)." ; + sh:minCount 0 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:name "IsLightOn" ; + sh:path bmw:lightIsLightOn ; + sh:datatype xsd:boolean ; + sh:description "Indicates whether the light is turned on. True = On, False = Off." ; + sh:minCount 0 ; + sh:maxCount 1 ; +] . \ No newline at end of file diff --git a/cdsp/knowledge-layer/symbolic-reasoner/examples/usecase-model/inputs/README.md b/cdsp/knowledge-layer/symbolic-reasoner/examples/usecase-model/inputs/README.md deleted file mode 100644 index 78db61a..0000000 --- a/cdsp/knowledge-layer/symbolic-reasoner/examples/usecase-model/inputs/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Configuration Websocket-Client supported Data Points - -This module is responsible for handling the configuration of supported data points in the application. It supports a TXT format for defining the data points. - -The `vss_data_required.txt` in this directory contains the data point definitions that websocket-client will use during the initial connection. - -> [!WARNING] -> -> - Before starting the application, ensure that the desired TXT file is correctly placed in this directory. This file should contain the definitions of the supported data points. The name and extension to use can be configured in the `/docker/.env` file, it uses the ENV variable named `REQUIRED_VSS_DATA_POINTS_FILE`. If it is not specified, it uses `vss_data_required.txt` by default, which is one of the files contained in this repository. . -> - Ensure that the used file is correctly formatted and contains valid data points definitions. -> - **The application will not function correctly if the data points file is missing or incorrectly placed.** \ No newline at end of file From ffce704511a960e9b2a206cdcee549aec31441fd Mon Sep 17 00:00:00 2001 From: Christian Muehlbauer Date: Wed, 9 Oct 2024 15:40:19 +0200 Subject: [PATCH 35/48] =?UTF-8?q?Configure=20RDFox=20environment=20Remove?= =?UTF-8?q?=20unused=20code=20Merge=20remote-tracking=20branch=20'origin/f?= =?UTF-8?q?eature/enabling-of-knowledgelay=E2=80=A6=20Add=20missing=20incl?= =?UTF-8?q?ude=20to=20data=5Ftypes=20header=20Update=20readmes=20Update=20?= =?UTF-8?q?readme=20Fix=20typo=20with=20correct=20RDFox=20licence=20file.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian Muehlbauer --- cdsp/knowledge-layer/CMakeLists.txt | 3 +- cdsp/knowledge-layer/README.md | 4 +- .../connector/utils/data_types.h | 1 + .../symbolic-reasoner/rdfox/README.md | 34 +++- .../rdfox/rdfox-install-test/CMakeLists.txt | 8 + .../rdfox-install-test/rdfox_test_main.cpp | 174 ++++++++++++++++++ docker/.gitignore | 2 + docker/README.md | 53 +++++- docker/docker-compose-cdsp.yml | 35 ++++ 9 files changed, 306 insertions(+), 8 deletions(-) create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-install-test/CMakeLists.txt create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-install-test/rdfox_test_main.cpp diff --git a/cdsp/knowledge-layer/CMakeLists.txt b/cdsp/knowledge-layer/CMakeLists.txt index 65c8b0e..790867c 100644 --- a/cdsp/knowledge-layer/CMakeLists.txt +++ b/cdsp/knowledge-layer/CMakeLists.txt @@ -31,4 +31,5 @@ set(PROJECT_ROOT_DIR "${CMAKE_SOURCE_DIR}") add_compile_definitions(PROJECT_ROOT="${PROJECT_ROOT_DIR}") # Add subdirectory for the websocket-client -add_subdirectory(connector/websocket-client) \ No newline at end of file +add_subdirectory(connector/websocket-client) +add_subdirectory(symbolic-reasoner/rdfox/rdfox-install-test) \ No newline at end of file diff --git a/cdsp/knowledge-layer/README.md b/cdsp/knowledge-layer/README.md index 621ebe5..f06c6e0 100644 --- a/cdsp/knowledge-layer/README.md +++ b/cdsp/knowledge-layer/README.md @@ -123,10 +123,10 @@ OBJECT_ID="OBJECT_ID_TO_SUBSCRIBE" ``` ### Start the Websocket Client -After successfully building the client, you can run it with the following command: +After successfully building the client, you can run it with the following command (VIN is required, if any docker for the knowledge layer is running): ```bash -./build/bin/websocket_client +VIN= ./build/bin/websocket_client ``` To display a list of available environment variables and their default values, run the application with the `--help` flag: diff --git a/cdsp/knowledge-layer/connector/utils/data_types.h b/cdsp/knowledge-layer/connector/utils/data_types.h index 008f984..69a124f 100644 --- a/cdsp/knowledge-layer/connector/utils/data_types.h +++ b/cdsp/knowledge-layer/connector/utils/data_types.h @@ -4,6 +4,7 @@ #include #include #include +#include #include struct ReasonerSettings { diff --git a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/README.md b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/README.md index fd9e641..350b7b5 100644 --- a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/README.md +++ b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/README.md @@ -1 +1,33 @@ -tbd \ No newline at end of file + +# RDFox Integration + +This folder contains the necessary files to interact with RDFox, a high-performance knowledge graph and reasoning engine used in this project. + +## How to Use RDFox + +For instructions on how to start the RDFox service required for this project, see [this guide](../../../../docker/README.md#rdfox-restful-api). + +### Getting Started + +This project includes a small C++ application to verify that the RDFox service has been configured and started correctly. After compiling the project, you should be able to run the application from [`./rdfox-install-test/rdfox_test_main.cpp`](./rdfox-install-test/rdfox_test_main.cpp). The RDFox Test executable will be generated in the `/cdsp/knowledge-layer/build/bin/` directory. You can run it with the following command: + +```bash +$ ./websocket_client + +# Data store list: +# ?Name ?UniqueID ?Persistent ?Online ?Parameters + +# Data store 'family' does not exist. +# Creating a new data store 'family'. +# Data store created. +# Facts added. +# SPARQL query result: +# ?p ?n +# "Peter" +# "Stewie" +# "Chris" +# "Meg" +# "Lois" + +# Data store 'family' deleted successfully. +``` \ No newline at end of file diff --git a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-install-test/CMakeLists.txt b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-install-test/CMakeLists.txt new file mode 100644 index 0000000..46c588d --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-install-test/CMakeLists.txt @@ -0,0 +1,8 @@ +# Define the RDFox test target +add_executable(rdfox_test rdfox_test_main.cpp) + +# Link Boost libraries +target_link_libraries(rdfox_test Boost::system Boost::filesystem Boost::thread) + +# Use defined output directory for the executable +set_target_properties(rdfox_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) \ No newline at end of file diff --git a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-install-test/rdfox_test_main.cpp b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-install-test/rdfox_test_main.cpp new file mode 100644 index 0000000..d452743 --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-install-test/rdfox_test_main.cpp @@ -0,0 +1,174 @@ +#include +#include +#include +#include +#include +#include +#include + +namespace beast = boost::beast; +namespace http = beast::http; +namespace net = boost::asio; +using tcp = net::ip::tcp; + +const std::string RDFOX_SERVER = "localhost"; +const std::string PORT = "12110"; +const std::string AUTH_HEADER = + "Basic cm9vdDphZG1pbg=="; // Example for 'root:admin' encoded in base64 + +// Helper function to handle response status codes +void assert_response_ok(const http::response& res, const std::string& message) { + if (res.result() != http::status::ok && res.result() != http::status::created && + res.result() != http::status::no_content) { + std::cerr << message << "\nStatus: " << res.result_int() << "\n" << res.body() << std::endl; + throw std::runtime_error("Request failed."); + } +} + +// Function to perform a POST request +http::response post_request(tcp::socket& socket, beast::flat_buffer& buffer, + const std::string& target, const std::string& body, + const std::string& content_type) { + try { + http::request req{http::verb::post, target, 11}; + req.set(http::field::host, RDFOX_SERVER); + req.set(http::field::authorization, AUTH_HEADER); + req.set(http::field::content_type, content_type); + req.set(http::field::connection, "keep-alive"); // Keep connection alive + req.body() = body; + req.prepare_payload(); + + http::write(socket, req); + http::response res; + http::read(socket, buffer, res); + + return res; + } catch (const std::exception& e) { + std::cerr << "Error in POST request: " << e.what() << std::endl; + throw; + } +} + +// Function to perform a GET request +http::response get_request(tcp::socket& socket, beast::flat_buffer& buffer, + const std::string& target, + const std::string& accept_type) { + try { + http::request req{http::verb::get, target, 11}; + req.set(http::field::host, RDFOX_SERVER); + req.set(http::field::authorization, AUTH_HEADER); + req.set(http::field::accept, accept_type); + req.set(http::field::connection, "keep-alive"); // Keep connection alive + + http::write(socket, req); + http::response res; + http::read(socket, buffer, res); + + return res; + } catch (const std::exception& e) { + std::cerr << "Error in GET request: " << e.what() << std::endl; + throw; + } +} + +// Function to perform a DELETE request +http::response delete_request(tcp::socket& socket, beast::flat_buffer& buffer, + const std::string& target) { + try { + http::request req{http::verb::delete_, target, 11}; + req.set(http::field::host, RDFOX_SERVER); + req.set(http::field::authorization, AUTH_HEADER); + req.set(http::field::connection, "keep-alive"); // Keep connection alive + + http::write(socket, req); + http::response res; + http::read(socket, buffer, res); + + return res; + } catch (const std::exception& e) { + std::cerr << "Error in DELETE request: " << e.what() << std::endl; + throw; + } +} + +// Main function to use persistent connections +int main() { + try { + net::io_context ioc; + tcp::resolver resolver(ioc); + tcp::socket socket(ioc); + auto const results = resolver.resolve(RDFOX_SERVER, PORT); + net::connect(socket, results.begin(), results.end()); + beast::flat_buffer buffer; + + std::string store_name = "family"; + + // Step 1: Check if the 'family' data store exists and delete it if necessary + auto res = get_request(socket, buffer, "/datastores", "application/json"); + assert_response_ok(res, "Failed to obtain list of datastores."); + std::cout << "Data store list:\n" << res.body() << std::endl; + + if (res.body().find(store_name) != std::string::npos) { + std::cout << "Data store '" << store_name << "' exists. Deleting..." << std::endl; + res = delete_request(socket, buffer, "/datastores/" + store_name); + assert_response_ok(res, "Failed to delete data store."); + std::cout << "Data store '" << store_name << "' deleted successfully." << std::endl; + } else { + std::cout << "Data store '" << store_name << "' does not exist." << std::endl; + } + + // Step 2: Create a new data store + std::cout << "Creating a new data store '" << store_name << "'." << std::endl; + res = post_request(socket, buffer, "/datastores/family?type=parallel-ww", "", + "application/json"); + assert_response_ok(res, "Failed to create datastore."); + std::cout << "Data store created." << std::endl; + + // Step 3: Add facts in Turtle format + std::string turtle_data = R"( + @prefix : . + :peter :forename "Peter" ; + a :Person ; + :marriedTo :lois ; + :gender "male" . + :lois :forename "Lois" ; + a :Person ; + :gender "female" . + :meg :forename "Meg" ; + a :Person ; + :hasParent :lois, :peter ; + :gender "female" . + :chris :forename "Chris" ; + a :Person ; + :hasParent :peter ; + :gender "male" . + :stewie :forename "Stewie" ; + a :Person ; + :hasParent :lois ; + :gender "male" . + :brian :forename "Brian" . + )"; + res = + post_request(socket, buffer, "/datastores/family/content", turtle_data, "text/turtle"); + assert_response_ok(res, "Failed to add facts to data store."); + std::cout << "Facts added." << std::endl; + + // Step 4: Run a SPARQL query + std::string sparql_query = R"( + PREFIX : + SELECT ?p ?n WHERE { ?p a :Person . ?p :forename ?n } + )"; + res = post_request(socket, buffer, "/datastores/family/sparql", sparql_query, + "application/sparql-query"); + assert_response_ok(res, "Failed to run SPARQL query."); + std::cout << "SPARQL query result:\n" << res.body() << std::endl; + + res = delete_request(socket, buffer, "/datastores/" + store_name); + assert_response_ok(res, "Failed to delete data store."); + std::cout << "Data store '" << store_name << "' deleted successfully." << std::endl; + + } catch (const std::exception& e) { + std::cerr << "Exception: " << e.what() << std::endl; + } + return 0; +} \ No newline at end of file diff --git a/docker/.gitignore b/docker/.gitignore index 1881067..ed6d4c4 100644 --- a/docker/.gitignore +++ b/docker/.gitignore @@ -1,6 +1,8 @@ # Docker generated files data/ logs/ +test-model/ +rdfox/ # Enviroment variables containing secrets .env \ No newline at end of file diff --git a/docker/README.md b/docker/README.md index 297d06e..ee1d23c 100644 --- a/docker/README.md +++ b/docker/README.md @@ -6,7 +6,8 @@ The compose file `docker-compose-cdsp.yml` provides a containerized deployment o ## Table of contents - [Docker installation](#docker-installation) - [VISSR docker image build setup](#vissr-docker-image-build-setup) -- [Websocket-Server docker image build setup](#websocket-server-docker-image-build-setup) +- [Websocket-Server (CDSP - information layer) docker image build setup](#websocket-server-cdsp---information-layer-docker-image-build-setup) +- [Websocket-Client (CDSP - knowledge layer) docker image build setup](#websocket-client-cdsp---knowledge-layer-docker-image-build-setup) - [Deploy with Docker Compose](#deploy-with-docker-compose) ## Docker installation @@ -109,8 +110,7 @@ $ sudo docker compose -f docker-compose-cdsp.yml up -d iotdb-service # ✔ Container iotdb-service Running 0.0s ``` -## Websocket-Server docker image build setup - +## Websocket-Server (CDSP - information layer) docker image build setup This guide provides instructions for deploying the Websocket-Server using Docker Compose. You can choose to deploy the server with either RealmDB or IoTDB as the backend service. ### Prerequisites @@ -137,7 +137,8 @@ $ sudo docker compose -f docker-compose-cdsp.yml up -d websocket-service When deploying with IoTDB, ensure that the iotdb-service is up and running before starting the Websocket-Server. -> [!IMPORTANT] If required, ensure that the iotdb-service container is started before running the Websocket-Server. You can also configure your own IoTDB connection. +> [!IMPORTANT] +> If required, ensure that the iotdb-service container is started before running the Websocket-Server. You can also configure your own IoTDB connection. #### Start IoTDB and Websocket-Server @@ -166,6 +167,50 @@ CONTAINER ID IMAGE COMMAND CREATED e16c8ed4ed42 apache/iotdb:1.2.2-standalone "/usr/bin/dumb-init …" 23 minutes ago Up 19 minutes 0.0.0.0:6667->6667/tcp, :::6667->6667/tcp iotdb-service ``` +## Websocket client (CDSP - knowledge layer) docker image build setup + +### RDFox RESTful API + +In order to get access to `RDFox RESTfull API` it is required to build two Docker images (`rdfox-init` and `rdfox-service`). + +### Prerequisites + +- **Running Websocket-Server:** See how to start the information layer [here](#websocket-server-cdsp---information-layer-docker-image-build-setup). +- **RDFox.lic:** this is the license file required by RDFox, containing information that authorizes the use of RDFox, expiry time and usage. **The license file must be provided when running RDFox images to activate the software.**. The path of the file should be provided using the environment variable `RDFOX_LIC_PATH="/RDFox.lic"` in the `.env` file in this folder. The file is generally provided when you acquire a license from [Oxford Semantic Technologies](https://www.oxfordsemantic.tech/). + +#### 1. **Initialization (`rdfox-init` Image)**: +- The `rdfox-init` image is used to set up the RDFox server directory, define roles, and configure persistence. +- It only needs to be run **once** for a fresh setup or if you need to reset the server's configuration (e.g., to initialize roles, passwords, and persistence settings). +- Running this command creates a persistent volume (`rdfox-server-directory`) that stores RDFox's state, including the role configuration, data stores, and settings. + +> [!IMPORTANT] +> The image `rdfox-init` need to run only ones to initialize the RDFox server directory. + +#### 2. **Daemon (`rdfox-service` Image)**: +- The `rdfox-service` image runs the **RDFox server (daemon)**, which continuously serves requests on port 12110. +- Once initialized, you can start this container (as a daemon) and it will use the `rdfox-server-directory` volume created by the `rdfox-init` command. +- You can restart the daemon multiple times using the same persistent volume, and it will retain all previously initialized settings and data. +- The daemon is initialized with a default role `root` and password `admin`. + +> [!WARNING] +> Before build the `rdfox-service`, ensure that the `rdfox-init` were compiled correctly. Only if the logs show successful completion, you can then proceed to start the RDFox daemon. + +Use the following commands to start both images: + +```shell +$ docker compose -f docker-compose-cdsp.yml up -d rdfox-init +# ... +# [+] Running 2/2 +# ✔ Volume "cdsp_rdfox-server-directory" created 0.0s +# ✔ Container rdfox-init Started 0.4s + +$ docker compose -f docker-compose-cdsp.yml up -d rdfox-service +# ... +# [+] Running 2/2 +# ✔ Container rdfox-init Started 0.4s +# ✔ Container rdfox-service Started 0.9s +``` + ## Deploy with Docker Compose ### Start/stop containers Start the containers: diff --git a/docker/docker-compose-cdsp.yml b/docker/docker-compose-cdsp.yml index 5976d11..ef45dfe 100644 --- a/docker/docker-compose-cdsp.yml +++ b/docker/docker-compose-cdsp.yml @@ -42,6 +42,38 @@ services: env_file: - .env + # RDFox Initialization (run once) + rdfox-init: + image: oxfordsemantic/rdfox-init:latest + container_name: rdfox-init + platform: linux/amd64 + volumes: + - ${RDFOX_LIC_PATH}:/opt/RDFox/RDFox.lic # License file on host + - rdfox-server-directory:/home/rdfox/.RDFox + environment: + - RDFOX_ROLE=root + - RDFOX_PASSWORD=admin + command: | + -persistence file + restart: "no" + + # RDFox Daemon (persistent service) + rdfox-service: + image: oxfordsemantic/rdfox:latest + container_name: rdfox-service + platform: linux/amd64 + depends_on: + - rdfox-init + ports: + - "12110:12110" + volumes: + - ${RDFOX_LIC_PATH}:/opt/RDFox/RDFox.lic # License file on host + - rdfox-server-directory:/home/rdfox/.RDFox + environment: + - RDFOX_ROLE=root + - RDFOX_PASSWORD=admin + command: daemon + # VISSR acting as VISS Data Server tmp: @@ -85,3 +117,6 @@ services: - ./logs/vssr:/app/logs volumes_from: - tmp + +volumes: + rdfox-server-directory: From 24b871e4ea683506233ba12b757f78fa0966bf72 Mon Sep 17 00:00:00 2001 From: q632394 Date: Thu, 17 Oct 2024 11:32:28 +0200 Subject: [PATCH 36/48] Develop RDFox adapter for rest api integration Establish Connection to RDFox REST API Data Store Management Data Loading in Turtle Format SPARQL Query Execution Error Handling Unit and Integration Tests Documentation Updates Signed-off-by: Haonan Qiu --- cdsp/knowledge-layer/CMakeLists.txt | 5 +- .../connector/utils/data_types.h | 10 +- .../connector/utils/helper.cpp | 2 + .../connector/websocket-client/CMakeLists.txt | 8 +- .../connector/websocket-client/main.cpp | 38 ++-- .../websocket-client/websocket_client.cpp | 6 +- .../symbolic-reasoner/rdfox/README.md | 6 +- .../rdfox/rdfox-adapter/README.md | 1 - .../CMakeLists.txt | 4 +- .../rdfox_test_main.cpp | 0 .../symbolic-reasoner/rdfox/src/README.md | 25 +++ .../rdfox/src/rdfox-adapter.cpp | 179 ++++++++++++++++ .../rdfox/src/rdfox-adapter.h | 42 ++++ .../rdfox/tests/CMakeLists.txt | 38 ++++ .../tests/test_rdfox_adapter_integration.cpp | 78 +++++++ .../rdfox/tests/test_rdfox_adapter_unit.cpp | 193 ++++++++++++++++++ docker/docker-compose-cdsp.yml | 6 + 17 files changed, 617 insertions(+), 24 deletions(-) delete mode 100644 cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-adapter/README.md rename cdsp/knowledge-layer/symbolic-reasoner/rdfox/{rdfox-install-test => rdfox-service-test}/CMakeLists.txt (84%) rename cdsp/knowledge-layer/symbolic-reasoner/rdfox/{rdfox-install-test => rdfox-service-test}/rdfox_test_main.cpp (100%) create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/README.md create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/rdfox-adapter.cpp create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/rdfox-adapter.h create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/CMakeLists.txt create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/test_rdfox_adapter_integration.cpp create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/test_rdfox_adapter_unit.cpp diff --git a/cdsp/knowledge-layer/CMakeLists.txt b/cdsp/knowledge-layer/CMakeLists.txt index 790867c..e7e16b9 100644 --- a/cdsp/knowledge-layer/CMakeLists.txt +++ b/cdsp/knowledge-layer/CMakeLists.txt @@ -30,6 +30,9 @@ set(PROJECT_ROOT_DIR "${CMAKE_SOURCE_DIR}") # Pass the root directory to your C++ code add_compile_definitions(PROJECT_ROOT="${PROJECT_ROOT_DIR}") +enable_testing() + # Add subdirectory for the websocket-client add_subdirectory(connector/websocket-client) -add_subdirectory(symbolic-reasoner/rdfox/rdfox-install-test) \ No newline at end of file +add_subdirectory(symbolic-reasoner/rdfox/rdfox-service-test) +add_subdirectory(symbolic-reasoner/rdfox/tests) \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/utils/data_types.h b/cdsp/knowledge-layer/connector/utils/data_types.h index 69a124f..2b4950d 100644 --- a/cdsp/knowledge-layer/connector/utils/data_types.h +++ b/cdsp/knowledge-layer/connector/utils/data_types.h @@ -24,10 +24,16 @@ struct ModelConfig { ReasonerSettings reasoner_settings; }; +struct ServerData { + std::string host; + std::string port; + std::string auth_base64; +}; + struct InitConfig { std::string uuid; - std::string host_websocket_server; - std::string port_websocket_server; + ServerData websocket_server; + ServerData rdfox_server; std::string oid; ModelConfig model_config; }; diff --git a/cdsp/knowledge-layer/connector/utils/helper.cpp b/cdsp/knowledge-layer/connector/utils/helper.cpp index c5561a7..6df262b 100644 --- a/cdsp/knowledge-layer/connector/utils/helper.cpp +++ b/cdsp/knowledge-layer/connector/utils/helper.cpp @@ -1,5 +1,7 @@ #include "helper.h" +#include + /** * @brief Converts a given string to lowercase. * diff --git a/cdsp/knowledge-layer/connector/websocket-client/CMakeLists.txt b/cdsp/knowledge-layer/connector/websocket-client/CMakeLists.txt index a0b2dc9..ab27158 100644 --- a/cdsp/knowledge-layer/connector/websocket-client/CMakeLists.txt +++ b/cdsp/knowledge-layer/connector/websocket-client/CMakeLists.txt @@ -1,5 +1,11 @@ # Define the WebSocket client target -add_executable(websocket_client main.cpp websocket_client.cpp ../utils/message_utils.cpp ../utils/helper.cpp ../utils/model_config.cpp) +add_executable( + websocket_client main.cpp + websocket_client.cpp + ../utils/message_utils.cpp + ../utils/helper.cpp + ../utils/model_config.cpp +) # Link libraries target_link_libraries(websocket_client Boost::system Boost::filesystem Boost::thread) diff --git a/cdsp/knowledge-layer/connector/websocket-client/main.cpp b/cdsp/knowledge-layer/connector/websocket-client/main.cpp index 0d96b29..ed0cbeb 100644 --- a/cdsp/knowledge-layer/connector/websocket-client/main.cpp +++ b/cdsp/knowledge-layer/connector/websocket-client/main.cpp @@ -18,6 +18,9 @@ std::string DefaultHostWebsocketServer{"127.0.0.1"}; std::string DefaultPortWebSocketServer{"8080"}; std::string ModelConfigurationFile{std::string(PROJECT_ROOT) + "/symbolic-reasoner/examples/use-case/model/model_config.json"}; +std::string DefaultRDFoxServer{"127.0.0.1"}; +std::string DefaultPortRDFoxServer{"12110"}; +std::string DefaultAuthRDFoxServerBase64{"cm9vdDphZG1pbg=="}; // For 'root:admin' encoded in base64 std::string getEnvVariable(const std::string& envVar, const std::string& defaultValue = "") { const char* valueEnv = std::getenv(envVar.c_str()); @@ -34,24 +37,28 @@ void displayHelp() { std::cout << "This table contains a lists environment variables set for the WebSocket client " "and their descriptions.\n\n"; // Table header - std::cout << bold << std::left << std::setw(50) << "Variable" << std::setw(50) << "Description" + std::cout << bold << std::left << std::setw(35) << "Variable" << std::setw(65) << "Description" << "Value" << reset << "\n"; std::cout << std::string(140, '-') << "\n"; // Line separator - std::cout << std::left << std::setw(50) << "HOST_WEBSOCKET_SERVER" << std::setw(50) + std::cout << std::left << std::setw(35) << "HOST_WEBSOCKET_SERVER" << std::setw(65) << "IP address of the WebSocket server" - << getEnvVariable(" - HOST_WEBSOCKET_SERVER", DefaultHostWebsocketServer) << "\n"; - std::cout << std::left << std::setw(50) << "PORT_WEBSOCKET_SERVER" << std::setw(50) + << getEnvVariable("HOST_WEBSOCKET_SERVER", DefaultHostWebsocketServer) << "\n"; + std::cout << std::left << std::setw(35) << "PORT_WEBSOCKET_SERVER" << std::setw(65) << "Port number of the WebSocket server" - << getEnvVariable(" - PORT_WEBSOCKET_SERVER", DefaultPortWebSocketServer) << "\n"; - std::cout << std::left << std::setw(50) << "VIN" << std::setw(50) + << getEnvVariable("PORT_WEBSOCKET_SERVER", DefaultPortWebSocketServer) << "\n"; + std::cout << std::left << std::setw(35) << "OBJECT_ID" << std::setw(65) << "Object ID to be used in communication" - << getEnvVariable("VIN", lightRed + "`Not Set (Required)`" + reset) << "\n"; - std::cout << std::left << std::setw(50) << "REQUIRED_VSS_DATA_POINTS_FILE" << std::setw(50) - << "Path to the model configuration file" - << getEnvVariable(" - REQUIRED_VSS_DATA_POINTS_FILE", - DefaultRequiredVSSDataPointsFile) - << "\n"; + << getEnvVariable("OBJECT_ID", lightRed + "`Not Set (Required)`" + reset) << "\n"; + std::cout << std::left << std::setw(35) << "HOST_RDFOX_SERVER" << std::setw(65) + << "IP address of the RDFox server" + << getEnvVariable("HOST_RDFOX_SERVER", DefaultRDFoxServer) << "\n"; + std::cout << std::left << std::setw(35) << "PORT_RDFOX_SERVER" << std::setw(65) + << "Port number of the RDFox server" + << getEnvVariable("PORT_RDFOX_SERVER", DefaultPortRDFoxServer) << "\n"; + std::cout << std::left << std::setw(35) << "AUTH_RDFOX_SERVER_BASE64" << std::setw(65) + << "Authentication credentials for RDFox Server encoded in base64" + << getEnvVariable("AUTH_RDFOX_SERVER_BASE64", DefaultAuthRDFoxServerBase64) << "\n"; std::cout << "\n" << bold << "Description:\n" << reset; std::cout << "This client connects to a WebSocket server and processes incoming messages based " @@ -74,13 +81,16 @@ InitConfig AddInitConfig() { loadModelConfig(ModelConfigurationFile, model_config); InitConfig init_config; - init_config.host_websocket_server = + init_config.websocket_server.host = getEnvVariable("HOST_WEBSOCKET_SERVER", DefaultHostWebsocketServer); - init_config.port_websocket_server = + init_config.websocket_server.port = getEnvVariable("PORT_WEBSOCKET_SERVER", DefaultPortWebSocketServer); init_config.uuid = boost::uuids::to_string(uuidGenerator()); init_config.oid = getEnvVariable("OBJECT_ID"); init_config.model_config = model_config; + init_config.rdfox_server.host = getEnvVariable("HOST_RDFOX_SERVER"); + init_config.rdfox_server.port = getEnvVariable("PORT_RDFOX_SERVER"); + init_config.rdfox_server.auth_base64 = getEnvVariable("AUTH_RDFOX_SERVER_BASE64"); return init_config; } diff --git a/cdsp/knowledge-layer/connector/websocket-client/websocket_client.cpp b/cdsp/knowledge-layer/connector/websocket-client/websocket_client.cpp index 527a718..af9f2ad 100644 --- a/cdsp/knowledge-layer/connector/websocket-client/websocket_client.cpp +++ b/cdsp/knowledge-layer/connector/websocket-client/websocket_client.cpp @@ -31,7 +31,7 @@ WebSocketClient::WebSocketClient(const InitConfig& init_config) void WebSocketClient::run() { resolver_.async_resolve( - init_config_.host_websocket_server, init_config_.port_websocket_server, + init_config_.websocket_server.host, init_config_.websocket_server.port, beast::bind_front_handler(&WebSocketClient::onResolve, shared_from_this())); // Run the io_context to process asynchronous events @@ -52,7 +52,7 @@ void WebSocketClient::onConnect(boost::system::error_code ec, return Fail(ec, "Connection failed:"); } - ws_.async_handshake(init_config_.host_websocket_server, "/", + ws_.async_handshake(init_config_.websocket_server.host, "/", beast::bind_front_handler(&WebSocketClient::handshake, shared_from_this())); } @@ -60,7 +60,7 @@ void WebSocketClient::handshake(beast::error_code ec) { if (ec) { return Fail(ec, "Handshake failed:"); } - std::cout << "Connected to WebSocket server: " << init_config_.host_websocket_server + std::cout << "Connected to WebSocket server: " << init_config_.websocket_server.host << std::endl << std::endl; diff --git a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/README.md b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/README.md index 350b7b5..5d8d99d 100644 --- a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/README.md +++ b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/README.md @@ -7,9 +7,13 @@ This folder contains the necessary files to interact with RDFox, a high-performa For instructions on how to start the RDFox service required for this project, see [this guide](../../../../docker/README.md#rdfox-restful-api). +### RDFox Adapter + +See how to interact with the RDFox server using the [RDFox adapter](./src/README.md#rdfoxadapter). + ### Getting Started -This project includes a small C++ application to verify that the RDFox service has been configured and started correctly. After compiling the project, you should be able to run the application from [`./rdfox-install-test/rdfox_test_main.cpp`](./rdfox-install-test/rdfox_test_main.cpp). The RDFox Test executable will be generated in the `/cdsp/knowledge-layer/build/bin/` directory. You can run it with the following command: +This project includes a small C++ application to verify that the RDFox service has been configured and started correctly. After compiling the project, you should be able to run the application from [`./rdfox-service-test/rdfox_test_main.cpp`](./rdfox-service-test/rdfox_test_main.cpp). The RDFox Test executable will be generated in the `/cdsp/knowledge-layer/build/bin/` directory. You can run it with the following command: ```bash $ ./websocket_client diff --git a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-adapter/README.md b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-adapter/README.md deleted file mode 100644 index fd9e641..0000000 --- a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-adapter/README.md +++ /dev/null @@ -1 +0,0 @@ -tbd \ No newline at end of file diff --git a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-install-test/CMakeLists.txt b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-service-test/CMakeLists.txt similarity index 84% rename from cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-install-test/CMakeLists.txt rename to cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-service-test/CMakeLists.txt index 46c588d..2f60cab 100644 --- a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-install-test/CMakeLists.txt +++ b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-service-test/CMakeLists.txt @@ -1,5 +1,7 @@ # Define the RDFox test target -add_executable(rdfox_test rdfox_test_main.cpp) +add_executable( + rdfox_test rdfox_test_main.cpp +) # Link Boost libraries target_link_libraries(rdfox_test Boost::system Boost::filesystem Boost::thread) diff --git a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-install-test/rdfox_test_main.cpp b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-service-test/rdfox_test_main.cpp similarity index 100% rename from cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-install-test/rdfox_test_main.cpp rename to cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-service-test/rdfox_test_main.cpp diff --git a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/README.md b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/README.md new file mode 100644 index 0000000..099f931 --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/README.md @@ -0,0 +1,25 @@ +# RDFoxAdapter + +The RDFoxAdapter class provides an interface for interacting with an RDFox server over HTTP. It enables operations like checking the existence of a datastore, creating a datastore, loading data in Turtle format, querying using SPARQL, and deleting a datastore. + +> [!NOTE] Data store +> When the RDFoxAdapter initializes creates (if is does not exists) a datastore called `vehicle_ds` in the RDFox server. + +## Features + +- **Initialize a Datastore:** Checks if a specified datastore exists on the RDFox server. If not, it creates the datastore. +- **Load Data:** Loads Turtle data into a specified datastore. +- **Query Data:** Executes SPARQL queries against the RDFox datastore and retrieves results. +- **Delete Datastore:** Removes a specified datastore from the RDFox server. +- **Send HTTP Requests:** Supports sending GET and POST HTTP requests to interact with RDFox. + +## Methods + +- **initialize():** Ensures the datastore is present; creates it if missing. +- **loadData(const std::string& ttl_data):** Loads Turtle data into the datastore. +- **queryData(const std::string& sparql_query):** Executes a SPARQL query and returns the result. +- **deleteDataStore():** Deletes the datastore if it exists. + +> [!NOTE] See test +> - [../tests/test_rdfox_adapter_integration.cpp](../tests/test_rdfox_adapter_integration.cpp) +> - [../tests/test_rdfox_adapter_unit.cpp](../tests/test_rdfox_adapter_unit.cpp) \ No newline at end of file diff --git a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/rdfox-adapter.cpp b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/rdfox-adapter.cpp new file mode 100644 index 0000000..cdf2622 --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/rdfox-adapter.cpp @@ -0,0 +1,179 @@ +#include "rdfox-adapter.h" + +#include + +RDFoxAdapter::RDFoxAdapter(const std::string& host, const std::string& port, + const std::string& auth_base64, + const std::string& data_store = "vehicle_ds") + : host_(host), + port_(port), + auth_header_base64_("Basic " + auth_base64), + data_store_(data_store) { + std::cout << "Initializing RDFox adapter..." << std::endl; +} + +/** + * @brief Initializes the RDFoxAdapter by ensuring the data store is created. + * + * This method checks if the data store specified by `data_store_` exists. + * If the data store exists, it logs a message indicating its existence. + * If the data store does not exist, it attempts to create it by sending + * a POST request to the appropriate endpoint. If the creation is successful, + * a success message is logged. Otherwise, an exception is thrown. + * + * @throws std::runtime_error if the data store creation fails. + */ +void RDFoxAdapter::initialize() { + // checks if the data store exists, create it if not + if (checkDataStore()) { + std::cout << "Data store '" + data_store_ + "' is already created." << std::endl; + } else { + std::cout << "Data store '" << data_store_ << "' does not exist. Creating it..." + << std::endl; + // Creates a data store + std::string target = "/datastores/" + data_store_; + if (sendPostRequest(target, "", "application/json")) { + std::cout << "Data store '" << data_store_ << "' created successfully." << std::endl; + } else { + throw std::runtime_error("Failed to create datastore '" + data_store_ + "'"); + } + } +} + +/** + * Loads Turtle data into the RDFox datastore. + * + * @param ttl_data A string containing the Turtle data to be loaded into the datastore. + * @return A boolean value indicating whether the data was successfully loaded. + */ +bool RDFoxAdapter::loadData(const std::string& ttl_data) { + std::string target = "/datastores/" + data_store_ + "/content"; + return sendPostRequest(target, ttl_data, "text/turtle") ? true : false; +}; + +/** + * Executes a SPARQL query against the RDFox datastore. + * + * @param sparql_query The SPARQL query string to be executed. + * @return The response from the datastore as a string if the query is successful, + * otherwise an empty string. + */ +std::string RDFoxAdapter::queryData(const std::string& sparql_query) { + std::string target = "/datastores/" + data_store_ + "/sparql"; + auto response = sendPostRequest(target, sparql_query, "application/sparql-query"); + return response.has_value() ? response.value() : ""; +} + +bool RDFoxAdapter::deleteDataStore() { + if (checkDataStore()) { + std::string target = "/datastores/" + data_store_; + std::string responseBody; + if (sendRequest(http::verb::delete_, target, "", "", "", responseBody)) { + std::cout << "Data store '" + data_store_ + "' have been removed successfully." + << std::endl; + } else { + std::cout << "Data store '" + data_store_ + "' could not be removed." << std::endl; + return false; + } + } else { + std::cout << "Data store '" + data_store_ + "' does not exists anymore." << std::endl; + } + return true; +} + +/** + * @brief Checks if the data store exists on the server. + * + * @return true if the data store is found in the server's response; false otherwise. + */ +bool RDFoxAdapter::checkDataStore() { + std::string target = "/datastores"; + std::string response = sendGetRequest(target, "text/csv; charset=UTF-8"); + if (response.find(data_store_) != std::string::npos) { + return true; + } else { + return false; + } +} + +std::optional RDFoxAdapter::sendPostRequest(const std::string& target, + const std::string& body, + const std::string& contentType) { + std::string responseBody; + if (sendRequest(http::verb::post, target, body, contentType, "", responseBody)) { + return responseBody; + } + return std::nullopt; +} + +std::string RDFoxAdapter::sendGetRequest(const std::string& target, const std::string& acceptType) { + std::string responseBody; + if (sendRequest(http::verb::get, target, "", "", acceptType, responseBody)) { + return responseBody; + } + return ""; +} + +/** + * Sends an HTTP request to a specified target and retrieves the response. + * + * @param method The HTTP method to use for the request (e.g., GET, POST). + * @param target The target URI for the request. + * @param body The body content to send with the request. + * @param contentType The MIME type of the body content. + * @param acceptType The MIME type that the client is willing to accept in the response. + * @param responseBody A reference to a string where the response body will be stored. + * @return True if the request was successful and the response status is OK, Created, or No Content; + * false otherwise. + */ +bool RDFoxAdapter::sendRequest(http::verb method, const std::string& target, + const std::string& body, const std::string& contentType, + const std::string& acceptType, std::string& responseBody) { + net::io_context ioc; + tcp::resolver resolver(ioc); + tcp::socket socket(ioc); + + try { + // Resolve and connect to the host + auto const results = resolver.resolve(host_, port_); + net::connect(socket, results.begin(), results.end()); + + // Set up the HTTP request + http::request req{method, target, 11}; + req.set(http::field::host, host_); + req.set(http::field::authorization, auth_header_base64_); + if (!contentType.empty()) { + req.set(http::field::content_type, contentType); + } + if (!acceptType.empty()) { + req.set(http::field::accept, acceptType); + } + req.body() = body; + req.prepare_payload(); + + // Send the request and receive the response + http::write(socket, req); + beast::flat_buffer buffer; + http::response res; + http::read(socket, buffer, res); + + responseBody = res.body(); + + if (res.result() != http::status::ok && res.result() != http::status::created && + res.result() != http::status::no_content) { + std::cerr << createErrorMessage(res.body(), res.result_int()) << std::endl; + return false; + } + return true; + } catch (const beast::system_error& e) { + std::cerr << "Network error: " << e.what() << std::endl; + return false; + } catch (const std::exception& e) { + std::cerr << "Error in request: " << e.what() << std::endl; + return false; + } +} + +std::string RDFoxAdapter::createErrorMessage(const std::string& error_msg, int error_code) { + return error_msg + " (Code: " + std::to_string(error_code) + ")"; +} diff --git a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/rdfox-adapter.h b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/rdfox-adapter.h new file mode 100644 index 0000000..66bcfb1 --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/rdfox-adapter.h @@ -0,0 +1,42 @@ +#ifndef RDFOX_ADAPTER_H +#define RDFOX_ADAPTER_H + +#include +#include +#include +#include + +namespace beast = boost::beast; +namespace http = beast::http; +namespace net = boost::asio; +using tcp = net::ip::tcp; + +class RDFoxAdapter { + public: + RDFoxAdapter(const std::string& host, const std::string& port, const std::string& auth_base64, + const std::string& data_store); + + void initialize(); + bool loadData(const std::string& ttl_data); + std::string queryData(const std::string& sparql_query); + bool checkDataStore(); + bool deleteDataStore(); + + protected: + virtual bool sendRequest(http::verb method, const std::string& target, const std::string& body, + const std::string& contentType, const std::string& acceptType, + std::string& responseBody); + + private: + std::string sendGetRequest(const std::string& target, const std::string& accept_type); + std::optional sendPostRequest(const std::string& target, const std::string& body, + const std::string& content_type); + + std::string createErrorMessage(const std::string& error_msg, int error_code); + std::string host_; + std::string port_; + std::string auth_header_base64_; + std::string data_store_; +}; + +#endif // RDFOX_ADAPTER_H \ No newline at end of file diff --git a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/CMakeLists.txt b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/CMakeLists.txt new file mode 100644 index 0000000..f52b87c --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/CMakeLists.txt @@ -0,0 +1,38 @@ +# GoogleTest integration +include(FetchContent) +FetchContent_Declare( + googletest + GIT_REPOSITORY https://github.com/google/googletest.git + GIT_TAG v1.15.2 +) +# Disable installing gtest (we don't need to install it) +set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) +FetchContent_MakeAvailable(googletest) + +# Add the RDFox adapter source files +add_library(rdfox_adapter STATIC ../src/rdfox-adapter.cpp) +target_include_directories(rdfox_adapter PUBLIC ../src) +target_link_libraries(rdfox_adapter Boost::system Boost::filesystem Boost::thread nlohmann_json) + +# Add the unit test executable +add_executable(rdfox_unit_tests test_rdfox_adapter_unit.cpp) +target_include_directories(rdfox_unit_tests PUBLIC ../src) +target_link_libraries(rdfox_unit_tests GTest::gtest GTest::gtest_main GTest::gmock rdfox_adapter) + +# Add the integration test executable +add_executable(rdfox_integration_tests test_rdfox_adapter_integration.cpp) +target_include_directories(rdfox_integration_tests PUBLIC ../src) +target_link_libraries(rdfox_integration_tests GTest::gtest GTest::gtest_main rdfox_adapter) + +# Add unit and integration tests to CTest +add_test(NAME RDFoxAdapterUnitTests COMMAND rdfox_unit_tests) +add_test(NAME RDFoxAdapterIntegrationTests COMMAND rdfox_integration_tests) + +# Define custom output directory for test binaries +set_target_properties(rdfox_unit_tests PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") +set_target_properties(rdfox_integration_tests PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") + +# Ensure tests are built with the all target +add_custom_target(tests ALL + DEPENDS rdfox_unit_tests rdfox_integration_tests +) \ No newline at end of file diff --git a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/test_rdfox_adapter_integration.cpp b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/test_rdfox_adapter_integration.cpp new file mode 100644 index 0000000..8cb8a74 --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/test_rdfox_adapter_integration.cpp @@ -0,0 +1,78 @@ +#include + +#include + +#include "../src/rdfox-adapter.h" + +class RDFoxAdapterIntegrationTest : public ::testing::Test { + protected: + RDFoxAdapter* adapter; + + std::string host = "localhost"; + std::string port = "12110"; + std::string auth_base64 = "cm9vdDphZG1pbg=="; // Base64 encoded authorization string + std::string data_store = "test_ds"; + + void SetUp() override { + adapter = new RDFoxAdapter(host, port, auth_base64, data_store); + adapter->initialize(); + + // Initial load to ensure datastore is accessible + if (!adapter->checkDataStore()) { + FAIL() << "Failed to ensure the data store is set up."; + } + } + + void TearDown() override { + // Delete the test data store after all tests have completed + // ASSERT_TRUE(adapter->deleteDataStore()) << "Failed to clean up the test data store."; + adapter->deleteDataStore(); + + // Clean up the adapter instance + delete adapter; + } +}; + +// Integration Test: Ensure RDFoxAdapter can create a data store and retrieve it +TEST_F(RDFoxAdapterIntegrationTest, DataStoreInitializationTest) { + // This test is implicitly done during the setup phase of RDFoxAdapter + // If the data store exists or is created, no error will be thrown + // You can further assert behavior here if needed + SUCCEED(); +} + +TEST_F(RDFoxAdapterIntegrationTest, LoadDataTest) { + std::string ttlData = R"( + @prefix bmw: . + bmw:Vehicle1 a bmw:Vehicle . + )"; + + // Try loading data into the data store + ASSERT_TRUE(adapter->loadData(ttlData)) << "Failed to load Turtle data into the store"; +} + +TEST_F(RDFoxAdapterIntegrationTest, QueryDataTest) { + std::string ttlData = R"( + @prefix bmw: . + bmw:Vehicle1 a bmw:Vehicle . + )"; + ASSERT_TRUE(adapter->loadData(ttlData)) << "Failed to load Turtle data into the store"; + + std::string sparqlQuery = "SELECT ?s ?p ?o WHERE { ?s ?p ?o }"; + std::string result = adapter->queryData(sparqlQuery); + + ASSERT_FALSE(result.empty()) << "SPARQL query returned no results"; + EXPECT_TRUE(result.find("") != std::string::npos) + << "Result does not contain the expected subject."; + EXPECT_TRUE(result.find("") != + std::string::npos) + << "Result does not contain the expected predicate."; + EXPECT_TRUE(result.find("") != std::string::npos) + << "Result does not contain the expected object."; +} + +TEST_F(RDFoxAdapterIntegrationTest, DeleteDataStoreTest) { + ASSERT_TRUE(adapter->checkDataStore()) << "Any data store has been created."; + ASSERT_TRUE(adapter->deleteDataStore()) << "Failed to delete the data store."; + ASSERT_FALSE(adapter->checkDataStore()) << "The datastore might still exist or be recreated."; +} \ No newline at end of file diff --git a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/test_rdfox_adapter_unit.cpp b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/test_rdfox_adapter_unit.cpp new file mode 100644 index 0000000..7834418 --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/test_rdfox_adapter_unit.cpp @@ -0,0 +1,193 @@ +#include +#include + +#include "../src/rdfox-adapter.h" + +class MockRDFoxAdapter : public RDFoxAdapter { + public: + MockRDFoxAdapter() : RDFoxAdapter("localhost", "8080", "test_auth", "test_ds") {} + + MOCK_METHOD6(sendRequest, bool(http::verb, const std::string&, const std::string&, + const std::string&, const std::string&, std::string&)); +}; + +// Test checking nonexistent RDFox datastore. +TEST(RDFoxAdapterTest, CheckNonexistentDatastore) { + MockRDFoxAdapter mock_adapter; + + // Mock the sendRequest for checking nonexistent datastore. + EXPECT_CALL(mock_adapter, sendRequest(http::verb::get, "/datastores", "", "", + "text/csv; charset=UTF-8", testing::_)) + .WillOnce(testing::DoAll(testing::SetArgReferee<5>(""), testing::Return(false))); + + EXPECT_FALSE(mock_adapter.checkDataStore()); +} + +// Test checking existent RDFox datastore. +TEST(RDFoxAdapterTest, CheckExistentDatastore) { + MockRDFoxAdapter mock_adapter; + + // Mock the sendRequest for checking existent datastore. + EXPECT_CALL(mock_adapter, sendRequest(http::verb::get, "/datastores", "", "", + "text/csv; charset=UTF-8", testing::_)) + .WillOnce(testing::DoAll(testing::SetArgReferee<5>("test_ds"), testing::Return(true))); + + EXPECT_TRUE(mock_adapter.checkDataStore()); +} + +// Test the initialization of the RDFoxAdapter and creation of the datastore. +TEST(RDFoxAdapterTest, InitializationCreatesDatastore) { + MockRDFoxAdapter mock_adapter; + + // Mock the sendRequest for checking datastore does not exists. + EXPECT_CALL(mock_adapter, sendRequest(http::verb::get, "/datastores", "", "", + "text/csv; charset=UTF-8", testing::_)) + .WillOnce(testing::DoAll(testing::SetArgReferee<5>(""), testing::Return(false))); + + // Mock the sendRequest for creating the datastore. + EXPECT_CALL(mock_adapter, sendRequest(http::verb::post, "/datastores/test_ds", "", + "application/json", "", testing::_)) + .WillOnce(testing::Return(true)); + + EXPECT_NO_THROW(mock_adapter.initialize()); +} + +// Test the initialization of the RDFoxAdapter when datastore already exists. +TEST(RDFoxAdapterTest, InitializationWithExistingDatastore) { + MockRDFoxAdapter mock_adapter; + + // Mock the sendRequest for checking datastore exists. + EXPECT_CALL(mock_adapter, sendRequest(http::verb::get, "/datastores", "", "", + "text/csv; charset=UTF-8", testing::_)) + .WillOnce(testing::DoAll(testing::SetArgReferee<5>("test_ds"), testing::Return(true))); + + // Ensure that the second call for creating the datastore is not made. + EXPECT_CALL(mock_adapter, sendRequest(http::verb::post, "/datastores/test_ds", "", + "application/json", "", testing::_)) + .Times(0); + + EXPECT_NO_THROW(mock_adapter.initialize()); +} + +// Test loading data into the RDFox datastore. +TEST(RDFoxAdapterTest, LoadDataSuccess) { + MockRDFoxAdapter mock_adapter; + std::string ttl_data = "@prefix : . :test a :Entity ."; + + // Mock the sendRequest for loading data. + EXPECT_CALL(mock_adapter, sendRequest(http::verb::post, "/datastores/test_ds/content", ttl_data, + "text/turtle", "", testing::_)) + .WillOnce(testing::Return(true)); + + EXPECT_TRUE(mock_adapter.loadData(ttl_data)); +} + +// Test querying data from the RDFox datastore. +TEST(RDFoxAdapterTest, QueryDataSuccess) { + MockRDFoxAdapter mock_adapter; + std::string sparql_query = "SELECT ?s WHERE { ?s ?p ?o . }"; + std::string mock_response = ""; + + // Mock the sendRequest for querying data. + EXPECT_CALL(mock_adapter, sendRequest(http::verb::post, "/datastores/test_ds/sparql", + sparql_query, "application/sparql-query", "", testing::_)) + .WillOnce(testing::DoAll(testing::SetArgReferee<5>(mock_response), testing::Return(true))); + + EXPECT_EQ(mock_adapter.queryData(sparql_query), mock_response); +} + +// Test deleting the RDFox datastore. +TEST(RDFoxAdapterTest, DeleteDataStoreSuccess) { + MockRDFoxAdapter mock_adapter; + + // Mock the sendRequest for checking the datastore existence. + EXPECT_CALL(mock_adapter, sendRequest(http::verb::get, "/datastores", "", "", + "text/csv; charset=UTF-8", testing::_)) + .WillOnce(testing::DoAll(testing::SetArgReferee<5>("test_ds"), testing::Return(true))); + + // Mock the sendRequest for deleting the datastore. + EXPECT_CALL(mock_adapter, + sendRequest(http::verb::delete_, "/datastores/test_ds", "", "", "", testing::_)) + .WillOnce(testing::Return(true)); + + EXPECT_TRUE(mock_adapter.deleteDataStore()); +} + +// Test any error deleting the RDFox datastore that does not exists. +TEST(RDFoxAdapterTest, DeleteNonexistentDataStoreSuccess) { + MockRDFoxAdapter mock_adapter; + + // Mock the sendRequest for checking the datastore existence. + EXPECT_CALL(mock_adapter, sendRequest(http::verb::get, "/datastores", "", "", + "text/csv; charset=UTF-8", testing::_)) + .WillOnce(testing::DoAll(testing::SetArgReferee<5>(""), testing::Return(false))); + + // Ensure that the second call for deleting the datastore is not made. + EXPECT_CALL(mock_adapter, + sendRequest(http::verb::delete_, "/datastores/test_ds", "", "", "", testing::_)) + .Times(0); + + EXPECT_TRUE(mock_adapter.deleteDataStore()); +} + +// Test handling a failed request during datastore creation. +TEST(RDFoxAdapterTest, FailedToCreateDataStore) { + MockRDFoxAdapter mock_adapter; + + // Mock the sendRequest for checking the datastore existence. + EXPECT_CALL(mock_adapter, sendRequest(http::verb::get, "/datastores", "", "", + "text/csv; charset=UTF-8", testing::_)) + .WillOnce(testing::DoAll(testing::SetArgReferee<5>(""), testing::Return(true))); + + // Mock the sendRequest for creating the datastore failure. + EXPECT_CALL(mock_adapter, sendRequest(http::verb::post, "/datastores/test_ds", "", + "application/json", "", testing::_)) + .WillOnce(testing::Return(false)); + + // Expect a runtime error when the adapter tries to create the datastore. + EXPECT_THROW(mock_adapter.initialize(), std::runtime_error); +} + +// Test loading data when the request fails. +TEST(RDFoxAdapterTest, LoadDataFailure) { + MockRDFoxAdapter mock_adapter; + std::string ttl_data = "@prefix : . :test a :Entity ."; + + // Mock the sendRequest for loading data failure. + EXPECT_CALL(mock_adapter, sendRequest(http::verb::post, "/datastores/test_ds/content", ttl_data, + "text/turtle", "", testing::_)) + .WillOnce(testing::Return(false)); + + EXPECT_FALSE(mock_adapter.loadData(ttl_data)); +} + +// Test querying data when the request fails. +TEST(RDFoxAdapterTest, QueryDataFailure) { + MockRDFoxAdapter mock_adapter; + std::string sparql_query = "SELECT ?s WHERE { ?s ?p ?o . }"; + + // Mock the sendRequest for querying data failure. + EXPECT_CALL(mock_adapter, sendRequest(http::verb::post, "/datastores/test_ds/sparql", + sparql_query, "application/sparql-query", "", testing::_)) + .WillOnce(testing::Return(false)); + + // Call queryData and expect it to return an empty string. + EXPECT_EQ(mock_adapter.queryData(sparql_query), ""); +} + +// Test deleting the RDFox datastore when delete request fails. +TEST(RDFoxAdapterTest, DeleteDataStoreFailure) { + MockRDFoxAdapter mock_adapter; + + // Mock the sendRequest for checking the datastore existence. + EXPECT_CALL(mock_adapter, sendRequest(http::verb::get, "/datastores", "", "", + "text/csv; charset=UTF-8", testing::_)) + .WillOnce(testing::DoAll(testing::SetArgReferee<5>("test_ds"), testing::Return(true))); + + // Mock the sendRequest for deleting the datastore failure. + EXPECT_CALL(mock_adapter, + sendRequest(http::verb::delete_, "/datastores/test_ds", "", "", "", testing::_)) + .WillOnce(testing::Return(false)); + + EXPECT_FALSE(mock_adapter.deleteDataStore()); +} \ No newline at end of file diff --git a/docker/docker-compose-cdsp.yml b/docker/docker-compose-cdsp.yml index ef45dfe..3796868 100644 --- a/docker/docker-compose-cdsp.yml +++ b/docker/docker-compose-cdsp.yml @@ -73,6 +73,12 @@ services: - RDFOX_ROLE=root - RDFOX_PASSWORD=admin command: daemon + deploy: + resources: + limits: + memory: 8g + cpus: "2.0" + restart: "always" # VISSR acting as VISS Data Server From 1bcadd73c979723478f76a5925ab39205a62e306 Mon Sep 17 00:00:00 2001 From: "Sebastian Schleemilch (ZI-20)" Date: Mon, 21 Oct 2024 09:01:16 +0200 Subject: [PATCH 37/48] Refactored information-layer Docs (#36) Signed-off-by: Sebastian Schleemilch --- cdsp/information-layer/Dockerfile | 38 +- cdsp/information-layer/README.md | 352 +++++++----------- cdsp/information-layer/handlers/README.md | 11 - .../config/schema-files/vss_data_points.json | 108 ------ cdsp/information-layer/router/README.md | 4 - 5 files changed, 144 insertions(+), 369 deletions(-) delete mode 100644 cdsp/information-layer/handlers/README.md delete mode 100644 cdsp/information-layer/handlers/config/schema-files/vss_data_points.json delete mode 100644 cdsp/information-layer/router/README.md diff --git a/cdsp/information-layer/Dockerfile b/cdsp/information-layer/Dockerfile index e0336a0..349690d 100644 --- a/cdsp/information-layer/Dockerfile +++ b/cdsp/information-layer/Dockerfile @@ -1,39 +1,11 @@ -# Base image for Node.js FROM node:22.5.1 -######################### -# GENERAL CONFIGURATION # -######################### - -# HANDLER_TYPE can be initialized with two different values: `realmdb` or `iotdb` -ENV HANDLER_TYPE=${HANDLER_TYPE} - -######################### -# REALMDB CONFIGURATION # -######################### - -# VERSION must be 0 or a positive integer. This is used for versioning the RealmDB configuration schema. -ENV VERSION_REALMDB_SCHEMA=${VERSION_REALMDB_SCHEMA} - -# Access to ATLAS Cloud instance -ENV REALMDB_APP_ID=${REALMDB_APP_ID} -ENV REALMDB_API_KEY=${REALMDB_API_KEY} - -####################### -# IOTDB CONFIGURATION # -####################### - -# Access to iotdb-service -ENV IOTDB_HOST: ${IOTDB_HOST} -ENV IOTDB_PORT: ${IOTDB_PORT} -ENV IOTDB_USER: ${IOTDB_USER} -ENV IOTDB_PASSWORD: ${IOTDB_PASSWORD} -ENV IOTDB_FETCH_SIZE: ${IOTDB_FETCH_SIZE} - -# Set working directory inside the container WORKDIR /app -COPY . ./ +COPY package.json . +COPY handlers ./handlers +COPY utils ./utils +COPY router ./router # Install dependencies, including workspaces RUN npm install --production @@ -42,4 +14,4 @@ RUN npm install --production EXPOSE 8080 # Command to run the WebSocket server -CMD ["node", "router/src/websocket-server.js"] \ No newline at end of file +CMD ["node", "router/src/websocket-server.js"] diff --git a/cdsp/information-layer/README.md b/cdsp/information-layer/README.md index 4e94209..b117028 100644 --- a/cdsp/information-layer/README.md +++ b/cdsp/information-layer/README.md @@ -1,287 +1,213 @@ -# Information Layer Playground components +# Information Layer -This directory contains files related to the [Information Layer](https://en.wikipedia.org/wiki/DIKW_pyramid) of the Central Data Service Playground. +The information layer is responsible for providing a raw data access [API](#api) (read, write, subscribe). +Its intention is to abstract the underlying data storage database technology. -- [Database-Handlers](./handlers/README.md) -- [Database-Router](./router/README.md) +Clients can interact with it using websockets and JSON payload. -# Setting up a CDSP Information Layer -Setting up an information layer in the CDSP involves running a [Database-Router](./router/README.md), which is technically a configurable Websocket server that enables northbound connections for WebSocket clients, such as a [Knowledge Layer Connector](../knowledge-layer/README.md), to read, subscribe, and write data. The WebSocket server is connected to a database, which can be selected before starting the web server. Southbound feeders write data to the database in a predefined semantic format, such as [VSS](https://github.com/COVESA/vehicle_signal_specification). - -## Installation of Database-Handler - -Please follow installation instructions of the chosen [handler](./handlers/README.md). - -# Running "Hello World" example (WIP) - -The Hello World example in our case is quite simple. We feed an updated value for the `CurrentLocation_Longitude` into the database and we check afterwards in the logs if the DB-router creates a Websocket update message for it. +The information-layer consists of two logical components: +- database handler: Interaction with the chosen database, configurable +- router: API provider that connects to the database handler +``` + | CLOUD + +---------+ | +---------+ + | realm_h | <-> | realmDB | ++--------+ +--------+ +----------+ <-> +---------+ | +---------+ +| client | <-> | router | <-> | handlers | ++--------+ +--------+ +----------+ <-> +---------+ +-------+ + | iotdb_h | <-> | iotdb | + +---------+ +-------+ +``` -## Choose and prepare your Database +# Hello World Setup -> [!WARNING] -> Before start the application, ensure that the supported data points are correctly defined and configured. See [how](./handlers/config/README.md). +## Backend Option 1: IoTDB -### Realm +### Start the database -- Ensure that in your [ATLAS cloud](https://cloud.mongodb.com/) app there is a vehicle _document_ with an `Vehicle_VehicleIdentification_VIN` in a collection named _`Vehicles`_. -- Ensure that this document as well contains VSS data. Here you can see the data supported in this repository for a vehicle document within _Vehicles_ that should be reflected in ATLAS: - - ```text - _id: "" (String) - Vehicle_Chassis_SteeringWheel_Angle: (Int32) - Vehicle_CurrentLocation_Latitude: (Double) - Vehicle_CurrentLocation_Longitude: (Double) - Vehicle_Powertrain_TractionBattery_NominalVoltage: (Int32) - Vehicle_Powertrain_TractionBattery_StateOfCharge_CurrentEnergy: (Double) - Vehicle_Powertrain_Transmission_CurrentGear: (Int32) - Vehicle_Speed: (Double) - Vehicle_VehicleIdentification_VIN: "" (String) - ``` - -### IoTDB - -- Ensure to start and run Docker containers defined in a [Docker Compose file](/docker/README.md). -- Ensure that in the IoTDB CLI there is a `root.Vehicles` _database_ like this: - - ```text - IoTDB> show databases; - +-------------+----+-----------------------+---------------------+---------------------+ - | Database| TTL|SchemaReplicationFactor|DataReplicationFactor|TimePartitionInterval| - +-------------+----+-----------------------+---------------------+---------------------+ - |root.Vehicles|null| 1| 1| 604800000| - +-------------+----+-----------------------+---------------------+---------------------+ - Total line number = 1 - It costs 0.004s - ``` - -- Create two _timeseries_ with the `root.Vehicles.Vehicle_VehicleIdentification_VIN` and some VSS data. Here you can see an example how the vehicle document within the _Vehicles_ should look like in IoTDB CLI: - - ```text - IoTDB> show timeseries; - +----------------------------------------------------------------------------+-----+-------------+--------+--------+-----------+----+----------+--------+------------------+--------+ - | Timeseries|Alias| Database|DataType|Encoding|Compression|Tags|Attributes|Deadband|DeadbandParameters|ViewType| - +----------------------------------------------------------------------------+-----+-------------+--------+--------+-----------+----+----------+--------+------------------+--------+ - | root.Vehicles.Vehicle_VehicleIdentification_VIN| null|root.Vehicles| TEXT| PLAIN| LZ4|null| null| null| null| BASE| - | root.Vehicles.Vehicle_CurrentLocation_Latitude| null|root.Vehicles| DOUBLE| RLE| LZ4|null| null| null| null| BASE| - | root.Vehicles.Vehicle_CurrentLocation_Longitude| null|root.Vehicles| DOUBLE| RLE| LZ4|null| null| null| null| BASE| - | root.Vehicles.Vehicle_Speed| null|root.Vehicles| FLOAT| RLE| LZ4|null| null| null| null| BASE| - | root.Vehicles.Vehicle_Chassis_SteeringWheel_Angle| null|root.Vehicles| INT32| RLE| LZ4|null| null| null| null| BASE| - | root.Vehicles.Vehicle_Powertrain_Transmission_CurrentGear| null|root.Vehicles| INT32| RLE| LZ4|null| null| null| null| BASE| - |root.Vehicles.Vehicle_Powertrain_TractionBattery_StateOfCharge_CurrentEnergy| null|root.Vehicles| FLOAT| RLE| LZ4|null| null| null| null| BASE| - | root.Vehicles.Vehicle_Powertrain_TractionBattery_NominalVoltage| null|root.Vehicles| INT32| RLE| LZ4|null| null| null| null| BASE| - +----------------------------------------------------------------------------+-----+-------------+--------+--------+-----------+----+----------+--------+------------------+--------+ - ``` - -## Start the Database Router - -### Using Docker Compose - -See [here](/docker/README.md) how to start the services using Docker. - -### Using Docker directly from Dockerfile in information-layer - -Go to `covesa.cdsp/cdsp/information-layer` and run in CLI: - -```shell -$ docker build -t webserver-service . +Start the db: +```bash +docker run -d --rm --name iotdb -p 6667:6667 -p 9003:9003 apache/iotdb:latest +``` +Connect to it via cli: +```bash +docker exec -it iotdb ./start-cli.sh -h 127.0.0.1 -p 6667 -u root -pw root ``` +Create a database +```bash +create database root.Vehicles +``` +Create desired timeseries -To run `RealmDB` use: +```bash +create timeseries root.Vehicles.Vehicle_TraveledDistance WITH DATATYPE=FLOAT, ENCODING=RLE +create timeseries root.Vehicles.Vehicle_Speed WITH DATATYPE=FLOAT, ENCODING=RLE +``` -> [!IMPORTANT] -> See [here](./handlers/src/realmdb/README.md) all the required ENV variables. +### Start router -```shell -$ docker run --name websocket-service -e HANDLER_TYPE=realmdb [-e required_env_variables] -p 8080:8080 websocket-service +Build the router image +```bash +docker build -t router . +``` +Run the router +```bash +# Docker +docker run --rm --name router -p 8080:8080 -e HANDLER_TYPE=iotdb -e IOTDB_HOST=host.docker.internal router +# OR natively +npm install +HANDLER_TYPE=iotdb IOTDB_HOST=localhost npm start ``` -To run `IoTDB` use: +## Backend Option 2: RealmDB -> [!IMPORTANT] -> See [here](./handlers/src/iotdb/README.md) all the required ENV variables. These are optional, because by default it uses the local configuration to connect to the `iotdb-service` container. -```shell -$ docker run --name websocket-service -e HANDLER_TYPE=iotdb --network cdsp_default [-e required_env_variables] -p 8080:8080 websocket-service -``` +### Prepare cloud -### Using Node.js +- Ensure that in your [ATLAS cloud](https://cloud.mongodb.com/) app there is a vehicle _document_ with an `Vehicle_VehicleIdentification_VIN` in a collection named _`Vehicles`_. +- Ensure that this document as well contains VSS data. Here you can see the data supported in this repository for a vehicle document within _Vehicles_ that should be reflected in ATLAS: -#### Install +``` +_id: "" (String) +Vehicle_Speed: (Double) +Vehicle_TraveledDistance: "" (Double) +``` -Execute in this directory: +### Start router -```shell +Build the router image +```bash +docker build -t router . +``` +Run the router +```bash +# Docker +docker run --rm --name router -p 8080:8080 -e HANDLER_TYPE=realmdb -e VERSION_REALMDB_SCHEMA=0 -e REALM_APP_ID= -e REALM_API_KEY= router +# OR natively npm install +HANDLER_TYPE=realmdb VERSION_REALMDB_SCHEMA=0 REALM_APP_ID= REALM_API_KEY= npm start ``` -To start the websocket-server using `RealmDB` execute the command: +## Usage -To run `RealmDB` use: +See [api](#api) how to interact with the router. -> [!IMPORTANT] -> See [here](./handlers/src/realmdb/README.md) all the required ENV variables. - -```shell -$ HANDLER_TYPE=realm [ENV_VARIABLE_NAME required_env_variables] npm start -``` - -To start the websocket-server using `IoTDB` execute the command: +# API -> [!IMPORTANT] -> See [here](./handlers/src/iotdb/README.md) all the required ENV variables. These are optional, because by default it uses the local configuration to connect to the `iotdb-service` container. +Connect your own websocket client by connecting to `ws://localhost:8080`. -```shell -$ HANDLER_TYPE=iotdb IOTDB_HOST=localhost [ENV_VARIABLE_NAME required_env_variables] npm start -``` +The examples use [websocat](https://github.com/vi/websocat) and [jq](https://github.com/jqlang/jq) -## Look out for the Websocket Server message in the console +## Read -If the handler is running, and you are [subscribed](#subscribing-to-changes) to an element, when you change the value of `CurrentLocation_Longitude` in ATLAS cloud (let's say `-157845.68200000003`), you should immediately see this line in console: +Schema: +```jsonc +{ + "type": "read", + "tree": "VSS", + "id": "123", // The VIN + "uuid": "testClient", // The unique client ID + // For reading one + "node": { "name": "Vehicle_Speed" }, + // For reading N + "nodes": [{ "name": "Vehicle_Speed" },{ "name": "Vehicle_TraveledDistance" }] +} +``` +Example: +```bash +echo '{ "type": "read", "tree": "VSS", "id": "123", "uuid": "testClient", "node": { "name": "Vehicle.Speed" } }' | websocat ws://localhost:8080 | jq +``` ```json { "type": "update", "tree": "VSS", - "id": "", - "dateTime": "", - "uuid": "", - "node": { "name": "CurrentLocation_Longitude", "value": "-157845.68200000003" } + "id": "123", + "dateTime": "2024-10-16T12:09:13.084Z", + "uuid": "test", + "node": { + "name": "Vehicle.Speed", + "value": 300 + } } ``` -If the handler response with some error during any request, the client may get error response similar to this (with the same format): +## Write -```json +Schema: +```jsonc { - "type": ":status", - "errorCode": 404, - "error": "" + "type": "write", + "tree": "VSS", + "id": "123", // The VIN + "uuid": "testClient", // The unique client ID + // For writing one + "node": { "name": "Vehicle_Speed", "value": 300 }, + // For writing N + "nodes": [{ "name": "Vehicle_Speed", "value": 300 },{ "name": "Vehicle_TraveledDistance", "value": 100000 }] } ``` - -# Connect your own Websocket Client - -Connect your own websocket client by connecting to `ws://localhost:8080` - -The examples use the VIN (Vehicle Identification Number) as object identifier. - -### Reading data - -To read data, send a message with the type of request and VIN as object ID: - -- Example for one Node: - ```json - { - "type": "read", - "tree": "VSS", - "id": "", - "uuid": "", - "node": { - "name": "" - } - } - ``` -- Example for multiple Nodes: - ```json - { - "type": "read", - "tree": "VSS", - "id": "", - "uuid": "", - "nodes": [ - { - "name": "" - }, - { - "name": "" - } - ] - } - ``` - -### Writing data - -To write data, send a message with the type of request and VIN as object ID (at this moment only with IoTDB available): - -- Example for one Node: - ```json - { - "type": "write", - "tree": "VSS", - "id": "", - "uuid": "", - "node": { - "name": "", - "value": "" - } - } - ``` -- Example for multiple Nodes: - ```json - { - "type": "write", - "tree": "VSS", - "id": "", - "uuid": "", - "nodes": [ - { - "name": "", - "value": "" - }, - { - "name": "", - "value": "" - } - ] +Example: +```bash +echo '{ "type": "write", "tree": "VSS", "id": "123", "uuid": "testClient", "node": { "name": "Vehicle.Speed", "value": 300 } }' | websocat ws://localhost:8080 | jq +``` +```json +{ + "type": "update", + "tree": "VSS", + "id": "123", + "dateTime": "2024-10-16T12:09:13.084Z", + "uuid": "test", + "node": { + "name": "Vehicle.Speed", + "value": 300 } - ``` - -### Subscribing to changes +} +``` -To subscribe to changes in a specific object, send a message with the type of request and VIN as object ID (at this moment only with RealmDB available): +## Subscribe (Realm Only) +Schema: ```json { "type": "subscribe", "tree": "VSS", - "id": "", - "uuid": "" + "id": "123", + "uuid": "testClient" } ``` -If the subscription succeed, the server will respond with the following message: - +On success: ```json { "type": "subscribe:status", "tree": "VSS", - "id": "", + "id": "123", "dateTime": "2024-09-12T15:50:17.232Z", - "uuid": "", + "uuid": "testClient", "status": "succeed" } ``` -### Unsubscribing to changes - -To unsubscribe to changes in a specific object, send a message with the type of request and VIN as object ID (at this moment only with RealmDB available): +## Unsubscribe ```json { "type": "unsubscribe", "tree": "VSS", - "id": "", - "uuid": "" + "id": "123", + "uuid": "testClient" } ``` -If the unsubscription succeed, the server will respond with the following message: + +On success: ```json { "type": "unsubscribe:status", "tree": "VSS", - "id": "WBY11CF080CH470711", + "id": "123", "dateTime": "2024-09-12T17:40:00.754Z", - "uuid": "CLIENT_1_SUBS", + "uuid": "testClient", "status": "succeed" } ``` diff --git a/cdsp/information-layer/handlers/README.md b/cdsp/information-layer/handlers/README.md deleted file mode 100644 index a2a20a0..0000000 --- a/cdsp/information-layer/handlers/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Handlers - -We support two different databases. For each of them is required to configure the corresponding ENV variables in `/docker/.env` file. - -- [IotDB](./src/iotdb/README.md) -- [RealmDB](./src/realmdb/README.md) - -> [!WARNING] -> Before start working with any of them, ensure that the supported data points are correctly defined and configured. See [how](./handlers/config/README.md). - -See [here](../../information-layer/README.md) how to install and start the Websocket-Server. diff --git a/cdsp/information-layer/handlers/config/schema-files/vss_data_points.json b/cdsp/information-layer/handlers/config/schema-files/vss_data_points.json deleted file mode 100644 index 5792bca..0000000 --- a/cdsp/information-layer/handlers/config/schema-files/vss_data_points.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "Vehicle": { - "children": { - "Chassis": { - "children": { - "SteeringWheel": { - "children": { - "Angle": { - "datatype": "int16", - "description": "Steering wheel angle. Positive = degrees to the left. Negative = degrees to the right.", - "type": "sensor", - "unit": "degrees" - } - }, - "description": "Steering wheel signals", - "type": "branch" - } - }, - "description": "All data concerning steering, suspension, wheels, and brakes.", - "type": "branch" - }, - "CurrentLocation": { - "children": { - "Latitude": { - "datatype": "double", - "description": "Current latitude of vehicle in WGS 84 geodetic coordinates, as measured at the position of GNSS receiver antenna.", - "max": 90, - "min": -90, - "type": "sensor", - "unit": "degrees" - }, - "Longitude": { - "datatype": "double", - "description": "Current longitude of vehicle in WGS 84 geodetic coordinates, as measured at the position of GNSS receiver antenna.", - "max": 180, - "min": -180, - "type": "sensor", - "unit": "degrees" - } - }, - "description": "The current latitude and longitude of the vehicle.", - "type": "branch" - }, - "Powertrain": { - "children": { - "TractionBattery": { - "children": { - "NominalVoltage": { - "comment": "Nominal voltage typically refers to voltage of fully charged battery when delivering rated capacity.", - "datatype": "uint16", - "description": "Nominal Voltage of the battery.", - "type": "attribute", - "unit": "V" - }, - "StateOfCharge": { - "children": { - "CurrentEnergy": { - "comment": "Current energy could be calculated as .StateOfCharge.Current * .NetCapacity.", - "datatype": "float", - "description": "Physical state of charge of high voltage battery expressed in kWh.", - "type": "sensor", - "unit": "kWh" - } - }, - "description": "Information on the state of charge of the vehicle's high voltage battery.", - "type": "branch" - } - }, - "description": "Battery Management data.", - "type": "branch" - }, - "Transmission": { - "children": { - "CurrentGear": { - "datatype": "int8", - "description": "The current gear. 0=Neutral, 1/2/..=Forward, -1/-2/..=Reverse.", - "type": "sensor" - } - }, - "description": "Transmission-specific data, stopping at the drive shafts.", - "type": "branch" - } - }, - "description": "Powertrain data for battery management, etc.", - "type": "branch" - }, - "Speed": { - "datatype": "float", - "description": "Vehicle speed.", - "type": "sensor", - "unit": "km/h" - }, - "VehicleIdentification": { - "children": { - "VIN": { - "datatype": "string", - "description": "17-character Vehicle Identification Number (VIN) as defined by ISO 3779.", - "type": "attribute" - } - }, - "description": "Attributes that identify a vehicle.", - "type": "branch" - } - }, - "description": "High-level vehicle data.", - "type": "branch" - } -} diff --git a/cdsp/information-layer/router/README.md b/cdsp/information-layer/router/README.md deleted file mode 100644 index 38ff920..0000000 --- a/cdsp/information-layer/router/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Websocket-Server - -This project is a [WebSocket server](src/websocket-server.js) that dynamically integrates different database handlers (e.g., RealmDB, IoTDB) based on the [configuration](../handlers/README.md). It listens for incoming WebSocket connections, processes messages according to the specified handler, and broadcasts messages to connected clients. - From 7ae2fb46d6f00542e229966093e6c832d8f4d2e1 Mon Sep 17 00:00:00 2001 From: "Andre Wendel (Q290938)" Date: Mon, 21 Oct 2024 11:25:52 +0200 Subject: [PATCH 38/48] - Migrate JS to TypeScript Signed-off-by: Andre Wendel --- cdsp/information-layer/.gitignore | 4 +- cdsp/information-layer/eslint.config.mjs | 38 + .../handlers/config/config.js | 39 - .../handlers/config/config.ts | 39 + .../information-layer/handlers/src/.gitignore | 3 - .../handlers/src/HandlerBase.ts | 235 + cdsp/information-layer/handlers/src/README.md | 10 +- .../information-layer/handlers/src/handler.js | 227 - .../handlers/src/iotdb/.gitignore | 4 - .../src/iotdb/config/data-points-type.js | 46 - .../src/iotdb/config/database-params.js | 51 - .../src/iotdb/config/database-params.ts | 54 + .../handlers/src/iotdb/config/iotdb-config.ts | 62 + .../iotdb/gen-nodejs/IClientRPCService.d.ts | 33 + .../src/iotdb/gen-nodejs/IClientRPCService.js | 12900 +--------------- .../iotdb/gen-nodejs/IClientRPCService.thrift | 65 + .../gen-nodejs/IClientRPCService_types.d.ts | 110 + .../gen-nodejs/IClientRPCService_types.js | 829 + .../src/iotdb/gen-nodejs/client_types.js | 7961 ---------- .../src/iotdb/gen-nodejs/common_types.js | 2627 ---- .../handlers/src/iotdb/package.json | 10 - .../handlers/src/iotdb/src/IoTDBHandler.ts | 553 + .../handlers/src/iotdb/src/iotdb-handler.js | 473 - .../handlers/src/iotdb/utils/Int64.ts | 44 + ...interpreter.js => IoTDBDataInterpreter.ts} | 74 +- .../src/iotdb/utils/IoTDBRpcDataSet.ts | 223 + .../src/iotdb/utils/SessionDataSet.ts | 111 + .../src/iotdb/utils/iotdb-constants.js | 21 - .../src/iotdb/utils/iotdb-constants.ts | 21 + .../src/iotdb/utils/iotdb-rpc-data-sets.js | 271 - .../src/iotdb/utils/session-data-set.js | 135 - .../handlers/src/package.json | 8 - .../handlers/src/realmdb/.gitignore | 3 - .../src/realmdb/config/database-params.js | 46 - .../src/realmdb/config/database-params.ts | 51 + .../src/realmdb/config/realm-config.ts | 113 + .../src/realmdb/config/realm-configuration.js | 78 - .../handlers/src/realmdb/package.json | 10 - .../src/realmdb/src/RealmDbHandler.ts | 463 + .../src/realmdb/src/realmdb-handler.js | 402 - .../handlers/utils/data_types.ts | 52 + cdsp/information-layer/package-lock.json | 6741 ++++++++ cdsp/information-layer/package.json | 40 +- cdsp/information-layer/router/.gitignore | 7 - cdsp/information-layer/router/README.md | 4 + .../information-layer/router/config/config.js | 14 - .../information-layer/router/config/config.ts | 13 + cdsp/information-layer/router/package.json | 13 - .../router/src/websocket-server.js | 74 - .../router/src/websocket-server.ts | 96 + ...sage-validator.js => message-validator.ts} | 101 +- cdsp/information-layer/tsconfig.json | 115 + .../utils/error-message-helper.js | 12 - .../utils/error-message-helper.ts | 19 + cdsp/information-layer/utils/logger.js | 51 - cdsp/information-layer/utils/logger.ts | 104 + package-lock.json | 6 + 57 files changed, 10759 insertions(+), 25150 deletions(-) create mode 100644 cdsp/information-layer/eslint.config.mjs delete mode 100644 cdsp/information-layer/handlers/config/config.js create mode 100644 cdsp/information-layer/handlers/config/config.ts delete mode 100644 cdsp/information-layer/handlers/src/.gitignore create mode 100644 cdsp/information-layer/handlers/src/HandlerBase.ts delete mode 100644 cdsp/information-layer/handlers/src/handler.js delete mode 100644 cdsp/information-layer/handlers/src/iotdb/config/data-points-type.js delete mode 100644 cdsp/information-layer/handlers/src/iotdb/config/database-params.js create mode 100644 cdsp/information-layer/handlers/src/iotdb/config/database-params.ts create mode 100644 cdsp/information-layer/handlers/src/iotdb/config/iotdb-config.ts create mode 100644 cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService.d.ts create mode 100644 cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService.thrift create mode 100644 cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService_types.d.ts create mode 100644 cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService_types.js delete mode 100644 cdsp/information-layer/handlers/src/iotdb/gen-nodejs/client_types.js delete mode 100644 cdsp/information-layer/handlers/src/iotdb/gen-nodejs/common_types.js delete mode 100644 cdsp/information-layer/handlers/src/iotdb/package.json create mode 100644 cdsp/information-layer/handlers/src/iotdb/src/IoTDBHandler.ts delete mode 100644 cdsp/information-layer/handlers/src/iotdb/src/iotdb-handler.js create mode 100644 cdsp/information-layer/handlers/src/iotdb/utils/Int64.ts rename cdsp/information-layer/handlers/src/iotdb/utils/{iotdb-data-interpreter.js => IoTDBDataInterpreter.ts} (58%) create mode 100644 cdsp/information-layer/handlers/src/iotdb/utils/IoTDBRpcDataSet.ts create mode 100644 cdsp/information-layer/handlers/src/iotdb/utils/SessionDataSet.ts delete mode 100644 cdsp/information-layer/handlers/src/iotdb/utils/iotdb-constants.js create mode 100644 cdsp/information-layer/handlers/src/iotdb/utils/iotdb-constants.ts delete mode 100644 cdsp/information-layer/handlers/src/iotdb/utils/iotdb-rpc-data-sets.js delete mode 100644 cdsp/information-layer/handlers/src/iotdb/utils/session-data-set.js delete mode 100644 cdsp/information-layer/handlers/src/package.json delete mode 100644 cdsp/information-layer/handlers/src/realmdb/.gitignore delete mode 100644 cdsp/information-layer/handlers/src/realmdb/config/database-params.js create mode 100644 cdsp/information-layer/handlers/src/realmdb/config/database-params.ts create mode 100644 cdsp/information-layer/handlers/src/realmdb/config/realm-config.ts delete mode 100644 cdsp/information-layer/handlers/src/realmdb/config/realm-configuration.js delete mode 100644 cdsp/information-layer/handlers/src/realmdb/package.json create mode 100644 cdsp/information-layer/handlers/src/realmdb/src/RealmDbHandler.ts delete mode 100644 cdsp/information-layer/handlers/src/realmdb/src/realmdb-handler.js create mode 100644 cdsp/information-layer/handlers/utils/data_types.ts create mode 100644 cdsp/information-layer/package-lock.json create mode 100644 cdsp/information-layer/router/README.md delete mode 100644 cdsp/information-layer/router/config/config.js create mode 100644 cdsp/information-layer/router/config/config.ts delete mode 100644 cdsp/information-layer/router/package.json delete mode 100644 cdsp/information-layer/router/src/websocket-server.js create mode 100644 cdsp/information-layer/router/src/websocket-server.ts rename cdsp/information-layer/router/utils/{message-validator.js => message-validator.ts} (64%) create mode 100644 cdsp/information-layer/tsconfig.json delete mode 100644 cdsp/information-layer/utils/error-message-helper.js create mode 100644 cdsp/information-layer/utils/error-message-helper.ts delete mode 100644 cdsp/information-layer/utils/logger.js create mode 100644 cdsp/information-layer/utils/logger.ts create mode 100644 package-lock.json diff --git a/cdsp/information-layer/.gitignore b/cdsp/information-layer/.gitignore index 79ef773..060b123 100644 --- a/cdsp/information-layer/.gitignore +++ b/cdsp/information-layer/.gitignore @@ -3,4 +3,6 @@ mongodb-realm/ # Node.js node_modules/ -package-lock.json + +# typescript migration +dist \ No newline at end of file diff --git a/cdsp/information-layer/eslint.config.mjs b/cdsp/information-layer/eslint.config.mjs new file mode 100644 index 0000000..0ee2f92 --- /dev/null +++ b/cdsp/information-layer/eslint.config.mjs @@ -0,0 +1,38 @@ +// @ts-check + +import eslint from "@eslint/js"; +import pluginPrettier from "eslint-plugin-prettier"; +import prettierConfig from "eslint-config-prettier"; +import tseslint, { parser } from "typescript-eslint"; + +export default tseslint.config( + { + ignores: ["coverage/**", "**/dist/**", "node_modules/**"], + }, + { + files: ["./**/*.{ts,tsx}"], + extends: [eslint.configs.recommended, ...tseslint.configs.strict], + plugins: { + prettier: pluginPrettier, + //"@typescript-eslint": ESLintPlugin, + }, + languageOptions: { + parser: parser, + parserOptions: { + project: "./tsconfig.json", // Ensure it points to your tsconfig + }, + }, + rules: { + "max-depth": ["error", 3], + "@/no-console": "error", + "@typescript-eslint/no-unnecessary-condition": "error", + "@typescript-eslint/no-floating-promises": "error", + "no-shadow": "off", + "@typescript-eslint/no-shadow": "error", + "@typescript-eslint/naming-convention": "error", + "@no-nested-ternary": "warn", + "prettier/prettier": "error", + ...prettierConfig.rules, + }, + } +); diff --git a/cdsp/information-layer/handlers/config/config.js b/cdsp/information-layer/handlers/config/config.js deleted file mode 100644 index 7d942bc..0000000 --- a/cdsp/information-layer/handlers/config/config.js +++ /dev/null @@ -1,39 +0,0 @@ -const path = require("path"); -const dotenv = require("dotenv"); -dotenv.config(); -/** - * This file contains the description of the supported data points. - * It supports JSON, YAML or YML format. - */ -const ENDPOINTS_FILE = "vss_data_points.yaml"; - -/** - * Retrieves the value of an environment variable. - * - * @param {string} envVar - The environment variable to retrieve. - * @returns {string|null} - The value of the environment variable. - */ -const getEnvValue = (envVar) => { - if (!process.env[envVar]) { - console.info(`${envVar} environment variable is not set in .env file.`); - return null; - } - return process.env[envVar]; -}; - -/** - * Retrieves the full path to the data points file. - * - * This function resolves the schema-files directory path of the current module - * and joins it with the ENDPOINTS_FILE constant to form the full path. - * - * @returns {string} The full path to the data points file. - */ -const getDataPointsPath = () => { - const endpoints_file = - getEnvValue("DATA_POINTS_SCHEMA_FILE") || ENDPOINTS_FILE; - const rootPath = path.resolve(`${__dirname}/schema-files`); - return path.join(rootPath, endpoints_file); -}; - -module.exports = { getDataPointsPath, getEnvValue }; diff --git a/cdsp/information-layer/handlers/config/config.ts b/cdsp/information-layer/handlers/config/config.ts new file mode 100644 index 0000000..6cd2c9d --- /dev/null +++ b/cdsp/information-layer/handlers/config/config.ts @@ -0,0 +1,39 @@ +import path from "path"; +import dotenv from "dotenv"; +import { logMessage } from "../../utils/logger"; + +// Load environment variables from the .env file +dotenv.config(); + +/** + * This file contains the description of the supported data points. + * It supports JSON, YAML or YML format. + */ +const ENDPOINTS_FILE: string = "vss_data_points.yaml"; + +/** + * Retrieves the value of an environment variable. + * + * @param envVar - The environment variable to retrieve. + * @returns The value of the environment variable or null if not set. + */ +export const getEnvValue = (envVar: string): string | null => { + if (!process.env[envVar]) { + logMessage(`${envVar} environment variable is not set in .env file.`); + return null; + } + return process.env[envVar]!; +}; + +/** + * Retrieves the full path to the data points file. + * + * This function resolves the schema-files directory path of the current module + * and joins it with the ENDPOINTS_FILE constant to form the full path. + * + * @returns The full path to the data points file. + */ +export const getDataPointsPath = (): string => { + const rootPath = path.resolve(`${__dirname}/schema-files`); + return path.join(rootPath, ENDPOINTS_FILE); +}; diff --git a/cdsp/information-layer/handlers/src/.gitignore b/cdsp/information-layer/handlers/src/.gitignore deleted file mode 100644 index 645f5bd..0000000 --- a/cdsp/information-layer/handlers/src/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Node.js -node_modules/ -package-lock.json \ No newline at end of file diff --git a/cdsp/information-layer/handlers/src/HandlerBase.ts b/cdsp/information-layer/handlers/src/HandlerBase.ts new file mode 100644 index 0000000..4b7b00b --- /dev/null +++ b/cdsp/information-layer/handlers/src/HandlerBase.ts @@ -0,0 +1,235 @@ +import fs from "fs"; +import yaml from "js-yaml"; +import { + Message, + WebSocket, + DataPointSchema, + MessageBase, + ErrorMessage, +} from "../utils/data_types"; +import { getDataPointsPath } from "../config/config"; +import { logMessage, MessageType } from "../../utils/logger"; + +export abstract class HandlerBase { + // Default implementations of required functions + authenticateAndConnect(sendMessageToClients: (message: any) => void): void { + logMessage( + "authenticateAndConnect() is not implemented", + MessageType.WARNING + ); + } + + protected read(message: Message, ws: WebSocket): void { + logMessage("read() is not implemented", MessageType.WARNING); + } + + protected write(message: Message, ws: WebSocket): void { + logMessage("write() is not implemented", MessageType.WARNING); + } + + protected subscribe(message: Message, ws: WebSocket): void { + logMessage("subscribe() is not implemented", MessageType.WARNING); + } + + protected unsubscribe(message: Message, ws: WebSocket): void { + logMessage("unsubscribe() is not implemented", MessageType.WARNING); + } + + unsubscribe_client(ws: WebSocket): void { + logMessage("unsubscribe_client() is not implemented", MessageType.WARNING); + } + + handleMessage(message: Message, ws: WebSocket): void { + try { + switch (message.type) { + case "read": + this.read(message, ws); + break; + case "write": + this.write(message, ws); + break; + case "subscribe": + this.subscribe(message, ws); + break; + case "unsubscribe": + this.unsubscribe(message, ws); + break; + default: + ws.send(JSON.stringify({ error: "Unknown message type" })); + } + } catch (error: unknown) { + const errMsg = error instanceof Error ? error.message : "Unknown error"; + ws.send(errMsg); + } + } + + /** + * Sends a message to the client. + */ + protected sendMessageToClient( + ws: WebSocket, + message: Message | MessageBase | ErrorMessage + ): void { + logMessage(JSON.stringify(message), MessageType.SENT); + ws.send(JSON.stringify(message)); + } + + /** + * Generic function to create an update message. + * @param message - The original message from client. + * @param nodes - The nodes to be included in the message. + * @returns - The transformed message. + */ + protected createUpdateMessage( + message: Pick, + nodes: Array<{ name: string; value: any }> + ): Message { + const { id, tree, uuid } = message; + return { + type: "update", + tree, + id, + dateTime: new Date().toISOString(), + uuid, + ...(nodes.length === 1 + ? { node: nodes[0] } // Return single node as 'node' + : { nodes }), // Return array as 'nodes' } as Message; + }; + } + + /** + * Generic function to create or remove a subscription message. + * @param type - Type of subscription message. + * @param message - The original message from client. + * @param status - The status of the subscription. + * @returns - The transformed message. + */ + protected createSubscribeMessage( + type: "subscribe" | "unsubscribe", + message: Pick, + status: string + ): MessageBase { + const { id, tree, uuid } = message; + return { + type: `${type}:status` as MessageBase["type"], + tree, + id, + dateTime: new Date().toISOString(), + uuid, + status: status, + }; + } + + /** + * Transforms a message node by replacing dots with underscores. + * @param node - The message node to transform. + * @returns - The transformed message node with dots replaced by underscores. + */ + protected transformDataPointsWithUnderscores(node: string): string { + return node.replace(/\./g, "_"); + } + + /** + * Transforms a database field name by replacing underscores with dots. + * @param field - The database filed to transform. + * @returns - The transformed to message node replacing underscores by dots. + */ + protected transformDataPointsWithDots(field: string): string { + return field.replace(/\_/g, "."); + } + + /** + * Reads and parses a data points file in either JSON, YML, or YAML format. + */ + private readDataPointsFile(filePath: string): object { + const fileContent = fs.readFileSync(filePath, "utf8"); + const filePathLower = filePath.toLowerCase(); + if (filePathLower.endsWith(".json")) { + return JSON.parse(fileContent); + } else if ( + filePathLower.endsWith(".yaml") || + filePathLower.endsWith(".yml") + ) { + const result = yaml.load(fileContent); + if (typeof result === "object" && result !== null) { + return result; + } else { + throw new Error("YAML content is not a valid object"); + } + } else { + throw new Error("Unsupported data points file format"); + } + } + + /** + * Extracts data types from a data point object. + */ + private extractDataTypes( + dataPointsObj: any, + parentKey = "", + result: { [key: string]: any } = {} + ): { [key: string]: any } { + for (const key in dataPointsObj) { + if (dataPointsObj.hasOwnProperty(key)) { + const value = dataPointsObj[key]; + const newKey = parentKey ? `${parentKey}.${key}` : key; + const isObject = value && typeof value === "object"; + if (isObject && value.datatype) { + result[newKey] = value.datatype; + } else if (isObject) { + this.extractDataTypes(value.children || value, newKey, result); + } + } + } + return result; + } + + /** + * Retrieves and processes supported data points. + * This method reads the data points configuration file, extracts the data types, + * and transforms the data point names to use underscores. It returns an object + * with the transformed data point names as keys and their corresponding data types. + * @returns An object containing the supported data points with transformed names and data types. + */ + protected getSupportedDataPoints(): object { + const dataPointPath = getDataPointsPath(); + const dataPointObj = this.readDataPointsFile(dataPointPath); + const supportedDataPoints = this.extractDataTypes(dataPointObj); + const result: { [key: string]: any } = {}; + Object.entries(supportedDataPoints).forEach(([node, value]) => { + const underscored_node = this.transformDataPointsWithUnderscores(node); + if (value !== null) { + result[underscored_node] = value; + } + }); + return result; + } + + /** + * Validates nodes against a given schema. + * + * @param message - The message containing nodes to be validated. + * @param dataPointsSchema - The schema against which nodes are validated. + * @returns An object containing error details if validation fails, otherwise null. + */ + protected validateNodesAgainstSchema( + message: Message, + dataPointsSchema: DataPointSchema + ): object | null { + const nodes = message.node ? [message.node] : message.nodes || []; + + const unknownFields = nodes.filter(({ name }) => { + const transformedName = this.transformDataPointsWithUnderscores(name); + return !dataPointsSchema.hasOwnProperty(transformedName); + }); + + if (unknownFields.length > 0) { + const errors = unknownFields.map(({ name }) => ({ + name, + status: "Parent object or node not found.", + })); + return errors.length === 1 ? { node: errors[0] } : { nodes: errors }; + } + return null; + } +} diff --git a/cdsp/information-layer/handlers/src/README.md b/cdsp/information-layer/handlers/src/README.md index 5a06db3..56ad64a 100644 --- a/cdsp/information-layer/handlers/src/README.md +++ b/cdsp/information-layer/handlers/src/README.md @@ -78,9 +78,9 @@ OPTIONAL_CUSTOM_VARIABLES="value" > [!WARNING] > Do not commit this file to GitHub! -In order to work with your custom database handler, it is required to initialize it in the [websocket-server.js](../../router/src/websocket-server.js). +In order to work with your custom database handler, it is required to initialize it in the [websocket-server.ts](../../router/src/websocket-server.ts). -```js +```ts switch (handlerType) { case "realmdb": handler = new RealmDBHandler(); @@ -102,7 +102,7 @@ Run the WebSocket server, and connect with your handler by sending WebSocket mes ### Existing Handlers You can check the following examples to understand how to structure your new handler: -- **RealmDB Handler**: [RealmHandler](./realmdb/src/realmdb-handler.js) provides an example of how to interact with RealmDB. -- **IoTDB Handler**: A similar implementation can be followed for [IoTDBHandler](./iotdb/src/iotdb-handler.js) . +- **RealmDB Handler**: [RealmHandler](./realmdb/src/realmdb-handler.ts) provides an example of how to interact with RealmDB. +- **IoTDB Handler**: A similar implementation can be followed for [IoTDBHandler](./iotdb/src/iotdb-handler.ts). -For additional logging, you can utilize the `logMessage` function from [logger.js](../../utils/logger.js). \ No newline at end of file +For additional logging, you can utilize the `logMessage` function from [logger.ts](../../utils/logger.ts). \ No newline at end of file diff --git a/cdsp/information-layer/handlers/src/handler.js b/cdsp/information-layer/handlers/src/handler.js deleted file mode 100644 index 303c044..0000000 --- a/cdsp/information-layer/handlers/src/handler.js +++ /dev/null @@ -1,227 +0,0 @@ -const config = require("../config/config"); -const fs = require("fs"); -const yaml = require("js-yaml"); -const { logMessage, MessageType } = require("../../utils/logger"); -/** - * Reads and parses a data points file in either JSON, YML or YAML format. - * - * @param {string} filePath - The path to the data points file. - * @returns {Object} The parsed content of the data points file. - * @throws {Error} If the file format is unsupported. - */ -function readDataPointsFile(filePath) { - const fileContent = fs.readFileSync(filePath, "utf8"); - if (filePath.endsWith(".json")) { - return JSON.parse(fileContent); - } else if (filePath.endsWith(".yaml") || filePath.endsWith(".yml")) { - return yaml.load(fileContent); - } else { - throw new Error("Unsupported data points file format"); - } -} - -/** - * Recursively extracts data types from a data point object. - * - * @param {Object} dataPointsObj - The object containing data point definitions. - * @param {string} [parentKey=""] - The parent key used to build the nested key path. - * @param {Object} [result={}] - The object to store the extracted data types. - * @returns {Object} An object mapping data point keys to their data types. - */ -function extractDataTypes(dataPointsObj, parentKey = "", result = {}) { - for (const key in dataPointsObj) { - if (dataPointsObj.hasOwnProperty(key)) { - const value = dataPointsObj[key]; - const newKey = parentKey ? `${parentKey}.${key}` : key; - if (value && typeof value === "object") { - if (value.datatype) { - result[newKey] = value.datatype; - } else { - extractDataTypes(value.children || value, newKey, result); - } - } - } - } - return result; -} - -class Handler { - handleMessage(message, ws) { - try { - switch (message.type) { - case "read": - this.read(message, ws); - break; - case "write": - this.write(message, ws); - break; - case "subscribe": - this.subscribe(message, ws); - break; - case "unsubscribe": - this.unsubscribe(message, ws); - break; - default: - ws.send(JSON.stringify({ error: "Unknown message type" })); - } - } catch (error) { - ws.send(JSON.stringify({ error: error.message })); - } - } - - authenticateAndConnect(sendMessageToClients) { - throw new Error("Method 'authenticateAndConnect' must be implemented."); - } - - read(message, ws) { - throw new Error("Read method not implemented yet!"); - } - - write(message, ws) { - throw new Error("Write method not implemented yet!"); - } - - subscribe(message, ws) { - throw new Error("Subscribe method not implemented yet!"); - } - - unsubscribe(message, ws) { - throw new Error("Unsubscribe method not implemented yet!"); - } - - unsubscribe_client(uuid) { - throw new Error("Unsubscribe client method not implemented yet!"); - } - - /** - * Utility functions for handling messages and data structures common to IoTDB and RealmDB. - */ - - /** - * Sends a message to the client - * @param {WebSocket} ws - The WebSocket connection to send the response to. - * @param {Object} message - The message to be sent to the client. - */ - _sendMessageToClient = (ws, message) => { - logMessage(JSON.stringify(message), MessageType.SENT); - ws.send(JSON.stringify(message)); - }; - - /** - * Generic function to create an update message. - * @param {Object} message - The original message from client. - * @param {Array} nodes - The nodes to be included in the message. - * @returns {Object} - The transformed message. - */ - _createUpdateMessage(message, nodes) { - const { id, tree, uuid } = message; - let newMessage = { - type: "update", - tree, - id, - dateTime: new Date().toISOString(), - uuid, - }; - if (nodes.length === 1) { - newMessage["node"] = nodes[0]; - } else { - newMessage["nodes"] = nodes; - } - return newMessage; - } - - /** - * Generic function to create or remove a subscription message. - * @param {{"subscribe", "unsubscribe"}} type - Type of subscription message. - * @param {Object} message - The original message from client. - * @param {String} status - The status of the subscription. - * @returns {Object} - The transformed message. - */ - _createSubscribeMessage(type, message, status) { - const { id, tree, uuid } = message; - return { - type: `${type}:status`, - tree, - id, - dateTime: new Date().toISOString(), - uuid, - status: status, - }; - } - - /** - * Transforms a message node by replacing all dots with underscores. - * - * @param {string} node - The message node to transform. - * @returns {string} - The transformed message node with dots replaced by underscores. - */ - _transformDataPointsWithUnderscores(node) { - return `${node}`.replace(/\./g, "_"); - } - - /** - * Transforms a database field name by replacing underscores with all dots. - * - * @param {string} field - The database filed to transform. - * @returns {string} - The transformed to message node replacing underscores by dots. - */ - _transformDataPointsWithDots(field) { - return `${field}`.replace(/\_/g, "."); - } - - /** - * Retrieves and processes supported data points. - * - * This method reads the data points configuration file, extracts the data types, - * and transforms the data point names to use underscores. It returns an object - * with the transformed data point names as keys and their corresponding data types. - * - * @returns {Object} An object containing the supported data points with transformed names and data types. - */ - _getSupportedDataPoints() { - const datapointPath = config.getDataPointsPath(); - const dataPointObj = readDataPointsFile(datapointPath); - const supportedDataPoints = extractDataTypes(dataPointObj); - let result = {}; - Object.entries(supportedDataPoints).forEach(([node, value]) => { - const underscored_node = this._transformDataPointsWithUnderscores(node); - if (value !== null) { - result[underscored_node] = value; - } - }); - return result; - } - - /** - * Validates nodes against a given schema. - * - * @param {Object} message - The message containing nodes to be validated. - * @param {Object} dataPointsSchema - The schema against which nodes are validated. - * @returns {Object|null} An object containing error details if validation fails, otherwise null. - */ - _validateNodesAgainstSchema(message, dataPointsSchema) { - const { type } = message; - let nodes = message.node ? [message.node] : message.nodes; - - // Check if all nodes are valid based on the schema - const unknownFields = nodes.filter(({ name }) => { - const transformedName = this._transformDataPointsWithUnderscores(name); - return !dataPointsSchema.hasOwnProperty(transformedName); - }); - - if (unknownFields.length > 0) { - let errors = unknownFields.map(({ name }) => ({ - name: name, - status: "Parent object or node not found.", - })); - - const errorData = - errors.length === 1 ? { node: errors.at(0) } : { nodes: errors }; - - return errorData; - } - return null; - } -} - -module.exports = Handler; diff --git a/cdsp/information-layer/handlers/src/iotdb/.gitignore b/cdsp/information-layer/handlers/src/iotdb/.gitignore index 473d609..71aa67b 100644 --- a/cdsp/information-layer/handlers/src/iotdb/.gitignore +++ b/cdsp/information-layer/handlers/src/iotdb/.gitignore @@ -1,6 +1,2 @@ -# Node.js -node_modules/ -package-lock.json - # MAC **/.DS_Store diff --git a/cdsp/information-layer/handlers/src/iotdb/config/data-points-type.js b/cdsp/information-layer/handlers/src/iotdb/config/data-points-type.js deleted file mode 100644 index d4de5b3..0000000 --- a/cdsp/information-layer/handlers/src/iotdb/config/data-points-type.js +++ /dev/null @@ -1,46 +0,0 @@ -const { SupportedMessageDataTypes } = require("../utils/iotdb-constants"); - -class DataPointsSchema { - constructor(supportedDataPoints) { - const properties = {}; - - Object.entries(supportedDataPoints).forEach(([key, value]) => { - if (SupportedMessageDataTypes.hasOwnProperty(value)) { - properties[key] = value; - } else { - throw new Error( - `The initialized data points contains an unsupported data type: ${value}`, - ); - } - }); - - this.dataPointsSchema = properties; - Object.freeze(this.dataPointsSchema); - } - - getDataPointsSchema() { - return this.dataPointsSchema; - } -} - -// Singleton instance holder -let dataPointsSchemaInstance = null; - -/** - * Creates and returns a singleton instance of DataPointsSchema. - * If the instance does not already exist, it initializes it with the provided supported data points - * and freezes the instance to prevent further modifications. - * - * @param {Object} supportedEndpoints - An object of supported data points to initialize the schema. - * @returns {Object} The data points schema instance. - */ -function createDataPointsSchema(supportedEndpoints) { - if (!dataPointsSchemaInstance) { - dataPointsSchemaInstance = new DataPointsSchema(supportedEndpoints); - Object.freeze(dataPointsSchemaInstance); - } - - return dataPointsSchemaInstance.getDataPointsSchema(); -} - -module.exports = { createDataPointsSchema }; diff --git a/cdsp/information-layer/handlers/src/iotdb/config/database-params.js b/cdsp/information-layer/handlers/src/iotdb/config/database-params.js deleted file mode 100644 index 3edff12..0000000 --- a/cdsp/information-layer/handlers/src/iotdb/config/database-params.js +++ /dev/null @@ -1,51 +0,0 @@ -const { getEnvValue } = require("../../../config/config"); - -/* - * Contains the definition of the database name and its identifier data point for each catalog. - */ -const databaseParams = Object.freeze({ - VSS: { - databaseName: "root.Vehicles", // name of the configured IoTDB for the VSS database - dataPointId: "Vehicle_VehicleIdentification_VIN", // data point used as element ID - }, -}); - -const useDefaultValue = (defaultValue) => { - console.info(`Using default: ${defaultValue}`); - return defaultValue; -}; - -/** - * Retrieves the database configuration for IoTDB. - * - * This function gathers configuration values for connecting to an IoTDB instance. - * It first attempts to get the values from environment variables. If the environment - * variables are not set, it uses default values. - * - * @returns {Object} An object containing the IoTDB configuration. - */ -const getDatabaseConfig = () => { - const iotdb_config = {}; - - let default_timeZoneId = Intl.DateTimeFormat().resolvedOptions().timeZone; - - iotdb_config["iotdbHost"] = - getEnvValue("IOTDB_HOST") || useDefaultValue("iotdb-service"); - iotdb_config["iotdbPort"] = - getEnvValue("IOTDB_PORT") || useDefaultValue(6667); - iotdb_config["iotdbUser"] = - getEnvValue("IOTDB_USER") || useDefaultValue("root"); - iotdb_config["iotdbPassword"] = - getEnvValue("IOTDB_PASSWORD") || useDefaultValue("root"); - iotdb_config["fetchSize"] = - getEnvValue("IOTDB_FETCH_SIZE") || useDefaultValue(10000); - iotdb_config["timeZoneId"] = - getEnvValue("IOTDB_TIME_ZONE_ID") || useDefaultValue(default_timeZoneId); - - return Object.freeze(iotdb_config); -}; - -const databaseConfig = - getEnvValue("HANDLER_TYPE") === "iotdb" ? getDatabaseConfig() : {}; - -module.exports = { databaseParams, databaseConfig }; diff --git a/cdsp/information-layer/handlers/src/iotdb/config/database-params.ts b/cdsp/information-layer/handlers/src/iotdb/config/database-params.ts new file mode 100644 index 0000000..22f8e90 --- /dev/null +++ b/cdsp/information-layer/handlers/src/iotdb/config/database-params.ts @@ -0,0 +1,54 @@ +import { getEnvValue } from "../../../config/config"; +import { DatabaseParamsRecord } from "../../../utils/data_types"; + +/** + * Defines the shape of the IoTDB configuration object. + */ +interface IotDBConfig { + iotdbHost: string; + iotdbPort: number; + iotdbUser: string; + iotdbPassword: string; + fetchSize: number; + timeZoneId: string; +} + +/* + * Contains the definition of the database name and its identifier data point for each catalog. + */ +export const databaseParams: Readonly = { + VSS: { + databaseName: "root.Vehicles", // name of the configured IoTDB for the VSS database + dataPointId: "Vehicle_VehicleIdentification_VIN", // data point used as element ID + }, +}; + +/** + * Retrieves the database configuration for IoTDB. + * + * This function gathers configuration values for connecting to an IoTDB instance. + * It first attempts to get the values from environment variables. If the environment + * variables are not set, it uses default values. + * + * @returns {IotDBConfig} An object containing the IoTDB configuration. + */ +const getDatabaseConfig = (): Readonly => { + const iotdb_config: IotDBConfig = { + iotdbHost: getEnvValue("IOTDB_HOST") || "iotdb-service", + iotdbPort: Number(getEnvValue("IOTDB_PORT")) || 6667, + iotdbUser: getEnvValue("IOTDB_USER") || "root", + iotdbPassword: getEnvValue("IOTDB_PASSWORD") || "root", + fetchSize: Number(getEnvValue("IOTDB_FETCH_SIZE")) || 10000, + timeZoneId: + getEnvValue("IOTDB_TIME_ZONE_ID") || + Intl.DateTimeFormat().resolvedOptions().timeZone, + }; + + return iotdb_config; +}; + +/** + * If the HANDLER_TYPE is set to 'iotdb', the IoTDB configuration is used. + */ +export const databaseConfig: Readonly | undefined = + getEnvValue("HANDLER_TYPE") === "iotdb" ? getDatabaseConfig() : undefined; diff --git a/cdsp/information-layer/handlers/src/iotdb/config/iotdb-config.ts b/cdsp/information-layer/handlers/src/iotdb/config/iotdb-config.ts new file mode 100644 index 0000000..a52572e --- /dev/null +++ b/cdsp/information-layer/handlers/src/iotdb/config/iotdb-config.ts @@ -0,0 +1,62 @@ +import { SupportedMessageDataTypes } from "../utils/iotdb-constants"; + +export interface SupportedDataPoints { + [key: string]: keyof typeof SupportedMessageDataTypes; +} + +/** + * Validates and creates the data points schema. + * Ensures only supported data types are included. + * + * @param supportedDataPoints - An object containing the supported data points. + * @returns The validated and immutable data points schema. + */ +function buildSchema( + supportedDataPoints: SupportedDataPoints, +): SupportedDataPoints { + const properties: SupportedDataPoints = {}; + + Object.entries(supportedDataPoints).forEach(([key, value]) => { + if (isSupportedDataPoint(value)) { + properties[key] = value; + } else { + throw new Error( + `The initialized data points contains an unsupported data type: ${value}`, + ); + } + }); + + return Object.freeze(properties); +} +/** + * Type guard to check if a data type is supported by SupportedMessageDataTypes. + * + * @param type - The data type to check. + * @returns A boolean indicating whether the type is valid. + */ +export function isSupportedDataPoint( + type: string, +): type is keyof typeof SupportedMessageDataTypes { + return type in SupportedMessageDataTypes; +} + +// Singleton instance holder +let dataPointsSchemaInstance: SupportedDataPoints | null = null; + +/** + * Creates and returns a singleton instance of DataPointsSchema. + * If the instance does not already exist, it initializes it with the provided supported data points + * and freezes the instance to prevent further modifications. + * + * @param supportedEndpoints - An object of supported data points to initialize the schema. + * @returns The data points schema instance. + */ +export function createDataPointsSchema( + supportedEndpoints: SupportedDataPoints, +): SupportedDataPoints { + if (!dataPointsSchemaInstance) { + dataPointsSchemaInstance = buildSchema(supportedEndpoints); + } + + return dataPointsSchemaInstance; +} diff --git a/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService.d.ts b/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService.d.ts new file mode 100644 index 0000000..d8d786a --- /dev/null +++ b/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService.d.ts @@ -0,0 +1,33 @@ +import * as IClientRPCService from './IClientRPCService_types'; +import { + TSOpenSessionReq, + TSOpenSessionResp, + TSCloseSessionReq, + TSExecuteStatementReq, + TSExecuteStatementResp, + TSInsertRecordReq, +} from './IClientRPCService_types'; +type Callback = (err: E, resp: T) => void; + +interface Int64 { + constructor(o?: number | string): this; + toString(): string; + toJson(): string; +} + +export class Client { + openSession(req: TSOpenSessionReq, callback: Callback): void; + openSession(req: TSOpenSessionReq): Promise; + + closeSession(req: TSCloseSessionReq, callback: Callback): void; + closeSession(req: TSCloseSessionReq): Promise; + + executeQueryStatement(req: TSExecuteStatementReq, callback: Callback): void; + executeQueryStatement(req: TSExecuteStatementReq): Promise; + + requestStatementId(sessionId: Int64, callback: Callback): void; + requestStatementId(sessionId: Int64): Promise; + + insertRecord(req: TSInsertRecordReq, callback: Callback): void; + insertRecord(req: TSInsertRecordReq): Promise; +} diff --git a/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService.js b/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService.js index b7deb43..86724e1 100644 --- a/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService.js +++ b/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService.js @@ -1,5 +1,5 @@ // -// Autogenerated by Thrift Compiler (0.14.1) +// Autogenerated by Thrift Compiler (0.22.0) // // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING // @@ -10,22 +10,20 @@ var Thrift = thrift.Thrift; var Q = thrift.Q; var Int64 = require('node-int64'); -var common_ttypes = require('./common_types'); - -var ttypes = require('./client_types'); +var ttypes = require('./IClientRPCService_types'); //HELPER FUNCTIONS AND STRUCTURES -var IClientRPCService_executeQueryStatementV2_args = function(args) { +var IClientRPCService_openSession_args = function(args) { this.req = null; if (args) { if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSExecuteStatementReq(args.req); + this.req = new ttypes.TSOpenSessionReq(args.req); } } }; -IClientRPCService_executeQueryStatementV2_args.prototype = {}; -IClientRPCService_executeQueryStatementV2_args.prototype.read = function(input) { +IClientRPCService_openSession_args.prototype = {}; +IClientRPCService_openSession_args.prototype[Symbol.for("read")] = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); @@ -37,8 +35,8 @@ IClientRPCService_executeQueryStatementV2_args.prototype.read = function(input) switch (fid) { case 1: if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSExecuteStatementReq(); - this.req.read(input); + this.req = new ttypes.TSOpenSessionReq(); + this.req[Symbol.for("read")](input); } else { input.skip(ftype); } @@ -55,11 +53,11 @@ IClientRPCService_executeQueryStatementV2_args.prototype.read = function(input) return; }; -IClientRPCService_executeQueryStatementV2_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeQueryStatementV2_args'); +IClientRPCService_openSession_args.prototype[Symbol.for("write")] = function(output) { + output.writeStructBegin('IClientRPCService_openSession_args'); if (this.req !== null && this.req !== undefined) { output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); + this.req[Symbol.for("write")](output); output.writeFieldEnd(); } output.writeFieldStop(); @@ -67,16 +65,16 @@ IClientRPCService_executeQueryStatementV2_args.prototype.write = function(output return; }; -var IClientRPCService_executeQueryStatementV2_result = function(args) { +var IClientRPCService_openSession_result = function(args) { this.success = null; if (args) { if (args.success !== undefined && args.success !== null) { - this.success = new ttypes.TSExecuteStatementResp(args.success); + this.success = new ttypes.TSOpenSessionResp(args.success); } } }; -IClientRPCService_executeQueryStatementV2_result.prototype = {}; -IClientRPCService_executeQueryStatementV2_result.prototype.read = function(input) { +IClientRPCService_openSession_result.prototype = {}; +IClientRPCService_openSession_result.prototype[Symbol.for("read")] = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); @@ -88,8 +86,8 @@ IClientRPCService_executeQueryStatementV2_result.prototype.read = function(input switch (fid) { case 0: if (ftype == Thrift.Type.STRUCT) { - this.success = new ttypes.TSExecuteStatementResp(); - this.success.read(input); + this.success = new ttypes.TSOpenSessionResp(); + this.success[Symbol.for("read")](input); } else { input.skip(ftype); } @@ -106,11 +104,11 @@ IClientRPCService_executeQueryStatementV2_result.prototype.read = function(input return; }; -IClientRPCService_executeQueryStatementV2_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeQueryStatementV2_result'); +IClientRPCService_openSession_result.prototype[Symbol.for("write")] = function(output) { + output.writeStructBegin('IClientRPCService_openSession_result'); if (this.success !== null && this.success !== undefined) { output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); + this.success[Symbol.for("write")](output); output.writeFieldEnd(); } output.writeFieldStop(); @@ -118,16 +116,16 @@ IClientRPCService_executeQueryStatementV2_result.prototype.write = function(outp return; }; -var IClientRPCService_executeUpdateStatementV2_args = function(args) { +var IClientRPCService_closeSession_args = function(args) { this.req = null; if (args) { if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSExecuteStatementReq(args.req); + this.req = new ttypes.TSCloseSessionReq(args.req); } } }; -IClientRPCService_executeUpdateStatementV2_args.prototype = {}; -IClientRPCService_executeUpdateStatementV2_args.prototype.read = function(input) { +IClientRPCService_closeSession_args.prototype = {}; +IClientRPCService_closeSession_args.prototype[Symbol.for("read")] = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); @@ -139,8 +137,8 @@ IClientRPCService_executeUpdateStatementV2_args.prototype.read = function(input) switch (fid) { case 1: if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSExecuteStatementReq(); - this.req.read(input); + this.req = new ttypes.TSCloseSessionReq(); + this.req[Symbol.for("read")](input); } else { input.skip(ftype); } @@ -157,11 +155,11 @@ IClientRPCService_executeUpdateStatementV2_args.prototype.read = function(input) return; }; -IClientRPCService_executeUpdateStatementV2_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeUpdateStatementV2_args'); +IClientRPCService_closeSession_args.prototype[Symbol.for("write")] = function(output) { + output.writeStructBegin('IClientRPCService_closeSession_args'); if (this.req !== null && this.req !== undefined) { output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); + this.req[Symbol.for("write")](output); output.writeFieldEnd(); } output.writeFieldStop(); @@ -169,58 +167,32 @@ IClientRPCService_executeUpdateStatementV2_args.prototype.write = function(outpu return; }; -var IClientRPCService_executeUpdateStatementV2_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new ttypes.TSExecuteStatementResp(args.success); - } - } +var IClientRPCService_closeSession_result = function(args) { }; -IClientRPCService_executeUpdateStatementV2_result.prototype = {}; -IClientRPCService_executeUpdateStatementV2_result.prototype.read = function(input) { +IClientRPCService_closeSession_result.prototype = {}; +IClientRPCService_closeSession_result.prototype[Symbol.for("read")] = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var ftype = ret.ftype; - var fid = ret.fid; if (ftype == Thrift.Type.STOP) { break; } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new ttypes.TSExecuteStatementResp(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } + input.skip(ftype); input.readFieldEnd(); } input.readStructEnd(); return; }; -IClientRPCService_executeUpdateStatementV2_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeUpdateStatementV2_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } +IClientRPCService_closeSession_result.prototype[Symbol.for("write")] = function(output) { + output.writeStructBegin('IClientRPCService_closeSession_result'); output.writeFieldStop(); output.writeStructEnd(); return; }; -var IClientRPCService_executeStatementV2_args = function(args) { +var IClientRPCService_executeQueryStatement_args = function(args) { this.req = null; if (args) { if (args.req !== undefined && args.req !== null) { @@ -228,8 +200,8 @@ var IClientRPCService_executeStatementV2_args = function(args) { } } }; -IClientRPCService_executeStatementV2_args.prototype = {}; -IClientRPCService_executeStatementV2_args.prototype.read = function(input) { +IClientRPCService_executeQueryStatement_args.prototype = {}; +IClientRPCService_executeQueryStatement_args.prototype[Symbol.for("read")] = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); @@ -242,7 +214,7 @@ IClientRPCService_executeStatementV2_args.prototype.read = function(input) { case 1: if (ftype == Thrift.Type.STRUCT) { this.req = new ttypes.TSExecuteStatementReq(); - this.req.read(input); + this.req[Symbol.for("read")](input); } else { input.skip(ftype); } @@ -259,11 +231,11 @@ IClientRPCService_executeStatementV2_args.prototype.read = function(input) { return; }; -IClientRPCService_executeStatementV2_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeStatementV2_args'); +IClientRPCService_executeQueryStatement_args.prototype[Symbol.for("write")] = function(output) { + output.writeStructBegin('IClientRPCService_executeQueryStatement_args'); if (this.req !== null && this.req !== undefined) { output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); + this.req[Symbol.for("write")](output); output.writeFieldEnd(); } output.writeFieldStop(); @@ -271,7 +243,7 @@ IClientRPCService_executeStatementV2_args.prototype.write = function(output) { return; }; -var IClientRPCService_executeStatementV2_result = function(args) { +var IClientRPCService_executeQueryStatement_result = function(args) { this.success = null; if (args) { if (args.success !== undefined && args.success !== null) { @@ -279,8 +251,8 @@ var IClientRPCService_executeStatementV2_result = function(args) { } } }; -IClientRPCService_executeStatementV2_result.prototype = {}; -IClientRPCService_executeStatementV2_result.prototype.read = function(input) { +IClientRPCService_executeQueryStatement_result.prototype = {}; +IClientRPCService_executeQueryStatement_result.prototype[Symbol.for("read")] = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); @@ -293,7 +265,7 @@ IClientRPCService_executeStatementV2_result.prototype.read = function(input) { case 0: if (ftype == Thrift.Type.STRUCT) { this.success = new ttypes.TSExecuteStatementResp(); - this.success.read(input); + this.success[Symbol.for("read")](input); } else { input.skip(ftype); } @@ -310,11 +282,11 @@ IClientRPCService_executeStatementV2_result.prototype.read = function(input) { return; }; -IClientRPCService_executeStatementV2_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeStatementV2_result'); +IClientRPCService_executeQueryStatement_result.prototype[Symbol.for("write")] = function(output) { + output.writeStructBegin('IClientRPCService_executeQueryStatement_result'); if (this.success !== null && this.success !== undefined) { output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); + this.success[Symbol.for("write")](output); output.writeFieldEnd(); } output.writeFieldStop(); @@ -322,16 +294,16 @@ IClientRPCService_executeStatementV2_result.prototype.write = function(output) { return; }; -var IClientRPCService_executeRawDataQueryV2_args = function(args) { - this.req = null; +var IClientRPCService_requestStatementId_args = function(args) { + this.sessionId = null; if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSRawDataQueryReq(args.req); + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; } } }; -IClientRPCService_executeRawDataQueryV2_args.prototype = {}; -IClientRPCService_executeRawDataQueryV2_args.prototype.read = function(input) { +IClientRPCService_requestStatementId_args.prototype = {}; +IClientRPCService_requestStatementId_args.prototype[Symbol.for("read")] = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); @@ -342,9 +314,8 @@ IClientRPCService_executeRawDataQueryV2_args.prototype.read = function(input) { } switch (fid) { case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSRawDataQueryReq(); - this.req.read(input); + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); } else { input.skip(ftype); } @@ -361,11 +332,11 @@ IClientRPCService_executeRawDataQueryV2_args.prototype.read = function(input) { return; }; -IClientRPCService_executeRawDataQueryV2_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeRawDataQueryV2_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); +IClientRPCService_requestStatementId_args.prototype[Symbol.for("write")] = function(output) { + output.writeStructBegin('IClientRPCService_requestStatementId_args'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); output.writeFieldEnd(); } output.writeFieldStop(); @@ -373,16 +344,16 @@ IClientRPCService_executeRawDataQueryV2_args.prototype.write = function(output) return; }; -var IClientRPCService_executeRawDataQueryV2_result = function(args) { +var IClientRPCService_requestStatementId_result = function(args) { this.success = null; if (args) { if (args.success !== undefined && args.success !== null) { - this.success = new ttypes.TSExecuteStatementResp(args.success); + this.success = args.success; } } }; -IClientRPCService_executeRawDataQueryV2_result.prototype = {}; -IClientRPCService_executeRawDataQueryV2_result.prototype.read = function(input) { +IClientRPCService_requestStatementId_result.prototype = {}; +IClientRPCService_requestStatementId_result.prototype[Symbol.for("read")] = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); @@ -393,9 +364,8 @@ IClientRPCService_executeRawDataQueryV2_result.prototype.read = function(input) } switch (fid) { case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new ttypes.TSExecuteStatementResp(); - this.success.read(input); + if (ftype == Thrift.Type.I64) { + this.success = input.readI64(); } else { input.skip(ftype); } @@ -412,11 +382,11 @@ IClientRPCService_executeRawDataQueryV2_result.prototype.read = function(input) return; }; -IClientRPCService_executeRawDataQueryV2_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeRawDataQueryV2_result'); +IClientRPCService_requestStatementId_result.prototype[Symbol.for("write")] = function(output) { + output.writeStructBegin('IClientRPCService_requestStatementId_result'); if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); + output.writeFieldBegin('success', Thrift.Type.I64, 0); + output.writeI64(this.success); output.writeFieldEnd(); } output.writeFieldStop(); @@ -424,16 +394,16 @@ IClientRPCService_executeRawDataQueryV2_result.prototype.write = function(output return; }; -var IClientRPCService_executeLastDataQueryV2_args = function(args) { +var IClientRPCService_insertRecord_args = function(args) { this.req = null; if (args) { if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSLastDataQueryReq(args.req); + this.req = new ttypes.TSInsertRecordReq(args.req); } } }; -IClientRPCService_executeLastDataQueryV2_args.prototype = {}; -IClientRPCService_executeLastDataQueryV2_args.prototype.read = function(input) { +IClientRPCService_insertRecord_args.prototype = {}; +IClientRPCService_insertRecord_args.prototype[Symbol.for("read")] = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); @@ -445,8 +415,8 @@ IClientRPCService_executeLastDataQueryV2_args.prototype.read = function(input) { switch (fid) { case 1: if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSLastDataQueryReq(); - this.req.read(input); + this.req = new ttypes.TSInsertRecordReq(); + this.req[Symbol.for("read")](input); } else { input.skip(ftype); } @@ -463,11 +433,11 @@ IClientRPCService_executeLastDataQueryV2_args.prototype.read = function(input) { return; }; -IClientRPCService_executeLastDataQueryV2_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeLastDataQueryV2_args'); +IClientRPCService_insertRecord_args.prototype[Symbol.for("write")] = function(output) { + output.writeStructBegin('IClientRPCService_insertRecord_args'); if (this.req !== null && this.req !== undefined) { output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); + this.req[Symbol.for("write")](output); output.writeFieldEnd(); } output.writeFieldStop(); @@ -475,16 +445,16 @@ IClientRPCService_executeLastDataQueryV2_args.prototype.write = function(output) return; }; -var IClientRPCService_executeLastDataQueryV2_result = function(args) { +var IClientRPCService_insertRecord_result = function(args) { this.success = null; if (args) { if (args.success !== undefined && args.success !== null) { - this.success = new ttypes.TSExecuteStatementResp(args.success); + this.success = args.success; } } }; -IClientRPCService_executeLastDataQueryV2_result.prototype = {}; -IClientRPCService_executeLastDataQueryV2_result.prototype.read = function(input) { +IClientRPCService_insertRecord_result.prototype = {}; +IClientRPCService_insertRecord_result.prototype[Symbol.for("read")] = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); @@ -495,9 +465,8 @@ IClientRPCService_executeLastDataQueryV2_result.prototype.read = function(input) } switch (fid) { case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new ttypes.TSExecuteStatementResp(); - this.success.read(input); + if (ftype == Thrift.Type.I32) { + this.success = input.readI32(); } else { input.skip(ftype); } @@ -514,11 +483,11 @@ IClientRPCService_executeLastDataQueryV2_result.prototype.read = function(input) return; }; -IClientRPCService_executeLastDataQueryV2_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeLastDataQueryV2_result'); +IClientRPCService_insertRecord_result.prototype[Symbol.for("write")] = function(output) { + output.writeStructBegin('IClientRPCService_insertRecord_result'); if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); + output.writeFieldBegin('success', Thrift.Type.I32, 0); + output.writeI32(this.success); output.writeFieldEnd(); } output.writeFieldStop(); @@ -526,12517 +495,504 @@ IClientRPCService_executeLastDataQueryV2_result.prototype.write = function(outpu return; }; -var IClientRPCService_executeFastLastDataQueryForOneDeviceV2_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSFastLastDataQueryForOneDeviceReq(args.req); - } - } +var IClientRPCServiceClient = exports.Client = function(output, pClass) { + this.output = output; + this.pClass = pClass; + this._seqid = 0; + this._reqs = {}; }; -IClientRPCService_executeFastLastDataQueryForOneDeviceV2_args.prototype = {}; -IClientRPCService_executeFastLastDataQueryForOneDeviceV2_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSFastLastDataQueryForOneDeviceReq(); - this.req.read(input); +IClientRPCServiceClient.prototype = {}; +IClientRPCServiceClient.prototype.seqid = function() { return this._seqid; }; +IClientRPCServiceClient.prototype.new_seqid = function() { return this._seqid += 1; }; + +IClientRPCServiceClient.prototype.openSession = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); } else { - input.skip(ftype); + _defer.resolve(result); } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); + }; + this.send_openSession(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_openSession(req); } - input.readStructEnd(); - return; }; -IClientRPCService_executeFastLastDataQueryForOneDeviceV2_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeFastLastDataQueryForOneDeviceV2_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); +IClientRPCServiceClient.prototype.send_openSession = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_openSession_args(params); + try { + output.writeMessageBegin('openSession', Thrift.MessageType.CALL, this.seqid()); + args[Symbol.for("write")](output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; } - output.writeFieldStop(); - output.writeStructEnd(); - return; }; -var IClientRPCService_executeFastLastDataQueryForOneDeviceV2_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new ttypes.TSExecuteStatementResp(args.success); - } +IClientRPCServiceClient.prototype.recv_openSession = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x[Symbol.for("read")](input); + input.readMessageEnd(); + return callback(x); } + var result = new IClientRPCService_openSession_result(); + result[Symbol.for("read")](input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('openSession failed: unknown result'); }; -IClientRPCService_executeFastLastDataQueryForOneDeviceV2_result.prototype = {}; -IClientRPCService_executeFastLastDataQueryForOneDeviceV2_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new ttypes.TSExecuteStatementResp(); - this.success.read(input); + +IClientRPCServiceClient.prototype.closeSession = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); } else { - input.skip(ftype); + _defer.resolve(result); } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); + }; + this.send_closeSession(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_closeSession(req); } - input.readStructEnd(); - return; }; -IClientRPCService_executeFastLastDataQueryForOneDeviceV2_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeFastLastDataQueryForOneDeviceV2_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); +IClientRPCServiceClient.prototype.send_closeSession = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_closeSession_args(params); + try { + output.writeMessageBegin('closeSession', Thrift.MessageType.CALL, this.seqid()); + args[Symbol.for("write")](output); + output.writeMessageEnd(); + return this.output.flush(); } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_executeAggregationQueryV2_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSAggregationQueryReq(args.req); + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); } + throw e; } }; -IClientRPCService_executeAggregationQueryV2_args.prototype = {}; -IClientRPCService_executeAggregationQueryV2_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSAggregationQueryReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_executeAggregationQueryV2_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeAggregationQueryV2_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; -var IClientRPCService_executeAggregationQueryV2_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new ttypes.TSExecuteStatementResp(args.success); - } - } -}; -IClientRPCService_executeAggregationQueryV2_result.prototype = {}; -IClientRPCService_executeAggregationQueryV2_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new ttypes.TSExecuteStatementResp(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); +IClientRPCServiceClient.prototype.recv_closeSession = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x[Symbol.for("read")](input); + input.readMessageEnd(); + return callback(x); } - input.readStructEnd(); - return; -}; + var result = new IClientRPCService_closeSession_result(); + result[Symbol.for("read")](input); + input.readMessageEnd(); -IClientRPCService_executeAggregationQueryV2_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeAggregationQueryV2_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; + callback(null); }; -var IClientRPCService_executeGroupByQueryIntervalQuery_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSGroupByQueryIntervalReq(args.req); - } - } -}; -IClientRPCService_executeGroupByQueryIntervalQuery_args.prototype = {}; -IClientRPCService_executeGroupByQueryIntervalQuery_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSGroupByQueryIntervalReq(); - this.req.read(input); +IClientRPCServiceClient.prototype.executeQueryStatement = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); } else { - input.skip(ftype); + _defer.resolve(result); } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_executeGroupByQueryIntervalQuery_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeGroupByQueryIntervalQuery_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); + }; + this.send_executeQueryStatement(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeQueryStatement(req); } - output.writeFieldStop(); - output.writeStructEnd(); - return; }; -var IClientRPCService_executeGroupByQueryIntervalQuery_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new ttypes.TSExecuteStatementResp(args.success); - } +IClientRPCServiceClient.prototype.send_executeQueryStatement = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeQueryStatement_args(params); + try { + output.writeMessageBegin('executeQueryStatement', Thrift.MessageType.CALL, this.seqid()); + args[Symbol.for("write")](output); + output.writeMessageEnd(); + return this.output.flush(); } -}; -IClientRPCService_executeGroupByQueryIntervalQuery_result.prototype = {}; -IClientRPCService_executeGroupByQueryIntervalQuery_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new ttypes.TSExecuteStatementResp(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_executeGroupByQueryIntervalQuery_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeGroupByQueryIntervalQuery_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); + throw e; } - output.writeFieldStop(); - output.writeStructEnd(); - return; }; -var IClientRPCService_fetchResultsV2_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSFetchResultsReq(args.req); - } - } -}; -IClientRPCService_fetchResultsV2_args.prototype = {}; -IClientRPCService_fetchResultsV2_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSFetchResultsReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); +IClientRPCServiceClient.prototype.recv_executeQueryStatement = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x[Symbol.for("read")](input); + input.readMessageEnd(); + return callback(x); } - input.readStructEnd(); - return; -}; + var result = new IClientRPCService_executeQueryStatement_result(); + result[Symbol.for("read")](input); + input.readMessageEnd(); -IClientRPCService_fetchResultsV2_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_fetchResultsV2_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); + if (null !== result.success) { + return callback(null, result.success); } - output.writeFieldStop(); - output.writeStructEnd(); - return; + return callback('executeQueryStatement failed: unknown result'); }; -var IClientRPCService_fetchResultsV2_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new ttypes.TSFetchResultsResp(args.success); - } - } -}; -IClientRPCService_fetchResultsV2_result.prototype = {}; -IClientRPCService_fetchResultsV2_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new ttypes.TSFetchResultsResp(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_fetchResultsV2_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_fetchResultsV2_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_openSession_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSOpenSessionReq(args.req); - } - } -}; -IClientRPCService_openSession_args.prototype = {}; -IClientRPCService_openSession_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSOpenSessionReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_openSession_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_openSession_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_openSession_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new ttypes.TSOpenSessionResp(args.success); - } - } -}; -IClientRPCService_openSession_result.prototype = {}; -IClientRPCService_openSession_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new ttypes.TSOpenSessionResp(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_openSession_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_openSession_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_closeSession_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSCloseSessionReq(args.req); - } - } -}; -IClientRPCService_closeSession_args.prototype = {}; -IClientRPCService_closeSession_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSCloseSessionReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_closeSession_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_closeSession_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_closeSession_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_closeSession_result.prototype = {}; -IClientRPCService_closeSession_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_closeSession_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_closeSession_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_executeStatement_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSExecuteStatementReq(args.req); - } - } -}; -IClientRPCService_executeStatement_args.prototype = {}; -IClientRPCService_executeStatement_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSExecuteStatementReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_executeStatement_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeStatement_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_executeStatement_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new ttypes.TSExecuteStatementResp(args.success); - } - } -}; -IClientRPCService_executeStatement_result.prototype = {}; -IClientRPCService_executeStatement_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new ttypes.TSExecuteStatementResp(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_executeStatement_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeStatement_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_executeBatchStatement_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSExecuteBatchStatementReq(args.req); - } - } -}; -IClientRPCService_executeBatchStatement_args.prototype = {}; -IClientRPCService_executeBatchStatement_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSExecuteBatchStatementReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_executeBatchStatement_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeBatchStatement_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_executeBatchStatement_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_executeBatchStatement_result.prototype = {}; -IClientRPCService_executeBatchStatement_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_executeBatchStatement_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeBatchStatement_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_executeQueryStatement_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSExecuteStatementReq(args.req); - } - } -}; -IClientRPCService_executeQueryStatement_args.prototype = {}; -IClientRPCService_executeQueryStatement_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSExecuteStatementReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_executeQueryStatement_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeQueryStatement_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_executeQueryStatement_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new ttypes.TSExecuteStatementResp(args.success); - } - } -}; -IClientRPCService_executeQueryStatement_result.prototype = {}; -IClientRPCService_executeQueryStatement_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new ttypes.TSExecuteStatementResp(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_executeQueryStatement_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeQueryStatement_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_executeUpdateStatement_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSExecuteStatementReq(args.req); - } - } -}; -IClientRPCService_executeUpdateStatement_args.prototype = {}; -IClientRPCService_executeUpdateStatement_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSExecuteStatementReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_executeUpdateStatement_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeUpdateStatement_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_executeUpdateStatement_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new ttypes.TSExecuteStatementResp(args.success); - } - } -}; -IClientRPCService_executeUpdateStatement_result.prototype = {}; -IClientRPCService_executeUpdateStatement_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new ttypes.TSExecuteStatementResp(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_executeUpdateStatement_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeUpdateStatement_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_fetchResults_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSFetchResultsReq(args.req); - } - } -}; -IClientRPCService_fetchResults_args.prototype = {}; -IClientRPCService_fetchResults_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSFetchResultsReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_fetchResults_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_fetchResults_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_fetchResults_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new ttypes.TSFetchResultsResp(args.success); - } - } -}; -IClientRPCService_fetchResults_result.prototype = {}; -IClientRPCService_fetchResults_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new ttypes.TSFetchResultsResp(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_fetchResults_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_fetchResults_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_fetchMetadata_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSFetchMetadataReq(args.req); - } - } -}; -IClientRPCService_fetchMetadata_args.prototype = {}; -IClientRPCService_fetchMetadata_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSFetchMetadataReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_fetchMetadata_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_fetchMetadata_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_fetchMetadata_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new ttypes.TSFetchMetadataResp(args.success); - } - } -}; -IClientRPCService_fetchMetadata_result.prototype = {}; -IClientRPCService_fetchMetadata_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new ttypes.TSFetchMetadataResp(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_fetchMetadata_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_fetchMetadata_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_cancelOperation_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSCancelOperationReq(args.req); - } - } -}; -IClientRPCService_cancelOperation_args.prototype = {}; -IClientRPCService_cancelOperation_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSCancelOperationReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_cancelOperation_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_cancelOperation_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_cancelOperation_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_cancelOperation_result.prototype = {}; -IClientRPCService_cancelOperation_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_cancelOperation_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_cancelOperation_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_closeOperation_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSCloseOperationReq(args.req); - } - } -}; -IClientRPCService_closeOperation_args.prototype = {}; -IClientRPCService_closeOperation_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSCloseOperationReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_closeOperation_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_closeOperation_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_closeOperation_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_closeOperation_result.prototype = {}; -IClientRPCService_closeOperation_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_closeOperation_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_closeOperation_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_getTimeZone_args = function(args) { - this.sessionId = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } - } -}; -IClientRPCService_getTimeZone_args.prototype = {}; -IClientRPCService_getTimeZone_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_getTimeZone_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_getTimeZone_args'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_getTimeZone_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new ttypes.TSGetTimeZoneResp(args.success); - } - } -}; -IClientRPCService_getTimeZone_result.prototype = {}; -IClientRPCService_getTimeZone_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new ttypes.TSGetTimeZoneResp(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_getTimeZone_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_getTimeZone_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_setTimeZone_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSSetTimeZoneReq(args.req); - } - } -}; -IClientRPCService_setTimeZone_args.prototype = {}; -IClientRPCService_setTimeZone_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSSetTimeZoneReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_setTimeZone_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_setTimeZone_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_setTimeZone_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_setTimeZone_result.prototype = {}; -IClientRPCService_setTimeZone_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_setTimeZone_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_setTimeZone_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_getProperties_args = function(args) { -}; -IClientRPCService_getProperties_args.prototype = {}; -IClientRPCService_getProperties_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - if (ftype == Thrift.Type.STOP) { - break; - } - input.skip(ftype); - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_getProperties_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_getProperties_args'); - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_getProperties_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new ttypes.ServerProperties(args.success); - } - } -}; -IClientRPCService_getProperties_result.prototype = {}; -IClientRPCService_getProperties_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new ttypes.ServerProperties(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_getProperties_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_getProperties_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_setStorageGroup_args = function(args) { - this.sessionId = null; - this.storageGroup = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } - if (args.storageGroup !== undefined && args.storageGroup !== null) { - this.storageGroup = args.storageGroup; - } - } -}; -IClientRPCService_setStorageGroup_args.prototype = {}; -IClientRPCService_setStorageGroup_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.storageGroup = input.readString(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_setStorageGroup_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_setStorageGroup_args'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.storageGroup !== null && this.storageGroup !== undefined) { - output.writeFieldBegin('storageGroup', Thrift.Type.STRING, 2); - output.writeString(this.storageGroup); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_setStorageGroup_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_setStorageGroup_result.prototype = {}; -IClientRPCService_setStorageGroup_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_setStorageGroup_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_setStorageGroup_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_createTimeseries_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSCreateTimeseriesReq(args.req); - } - } -}; -IClientRPCService_createTimeseries_args.prototype = {}; -IClientRPCService_createTimeseries_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSCreateTimeseriesReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_createTimeseries_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_createTimeseries_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_createTimeseries_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_createTimeseries_result.prototype = {}; -IClientRPCService_createTimeseries_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_createTimeseries_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_createTimeseries_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_createAlignedTimeseries_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSCreateAlignedTimeseriesReq(args.req); - } - } -}; -IClientRPCService_createAlignedTimeseries_args.prototype = {}; -IClientRPCService_createAlignedTimeseries_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSCreateAlignedTimeseriesReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_createAlignedTimeseries_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_createAlignedTimeseries_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_createAlignedTimeseries_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_createAlignedTimeseries_result.prototype = {}; -IClientRPCService_createAlignedTimeseries_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_createAlignedTimeseries_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_createAlignedTimeseries_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_createMultiTimeseries_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSCreateMultiTimeseriesReq(args.req); - } - } -}; -IClientRPCService_createMultiTimeseries_args.prototype = {}; -IClientRPCService_createMultiTimeseries_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSCreateMultiTimeseriesReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_createMultiTimeseries_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_createMultiTimeseries_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_createMultiTimeseries_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_createMultiTimeseries_result.prototype = {}; -IClientRPCService_createMultiTimeseries_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_createMultiTimeseries_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_createMultiTimeseries_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_deleteTimeseries_args = function(args) { - this.sessionId = null; - this.path = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } - if (args.path !== undefined && args.path !== null) { - this.path = Thrift.copyList(args.path, [null]); - } - } -}; -IClientRPCService_deleteTimeseries_args.prototype = {}; -IClientRPCService_deleteTimeseries_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.LIST) { - this.path = []; - var _rtmp3463 = input.readListBegin(); - var _size462 = _rtmp3463.size || 0; - for (var _i464 = 0; _i464 < _size462; ++_i464) { - var elem465 = null; - elem465 = input.readString(); - this.path.push(elem465); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_deleteTimeseries_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_deleteTimeseries_args'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.path !== null && this.path !== undefined) { - output.writeFieldBegin('path', Thrift.Type.LIST, 2); - output.writeListBegin(Thrift.Type.STRING, this.path.length); - for (var iter466 in this.path) { - if (this.path.hasOwnProperty(iter466)) { - iter466 = this.path[iter466]; - output.writeString(iter466); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_deleteTimeseries_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_deleteTimeseries_result.prototype = {}; -IClientRPCService_deleteTimeseries_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_deleteTimeseries_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_deleteTimeseries_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_deleteStorageGroups_args = function(args) { - this.sessionId = null; - this.storageGroup = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } - if (args.storageGroup !== undefined && args.storageGroup !== null) { - this.storageGroup = Thrift.copyList(args.storageGroup, [null]); - } - } -}; -IClientRPCService_deleteStorageGroups_args.prototype = {}; -IClientRPCService_deleteStorageGroups_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.LIST) { - this.storageGroup = []; - var _rtmp3468 = input.readListBegin(); - var _size467 = _rtmp3468.size || 0; - for (var _i469 = 0; _i469 < _size467; ++_i469) { - var elem470 = null; - elem470 = input.readString(); - this.storageGroup.push(elem470); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_deleteStorageGroups_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_deleteStorageGroups_args'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.storageGroup !== null && this.storageGroup !== undefined) { - output.writeFieldBegin('storageGroup', Thrift.Type.LIST, 2); - output.writeListBegin(Thrift.Type.STRING, this.storageGroup.length); - for (var iter471 in this.storageGroup) { - if (this.storageGroup.hasOwnProperty(iter471)) { - iter471 = this.storageGroup[iter471]; - output.writeString(iter471); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_deleteStorageGroups_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_deleteStorageGroups_result.prototype = {}; -IClientRPCService_deleteStorageGroups_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_deleteStorageGroups_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_deleteStorageGroups_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_insertRecord_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSInsertRecordReq(args.req); - } - } -}; -IClientRPCService_insertRecord_args.prototype = {}; -IClientRPCService_insertRecord_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSInsertRecordReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_insertRecord_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_insertRecord_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_insertRecord_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_insertRecord_result.prototype = {}; -IClientRPCService_insertRecord_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_insertRecord_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_insertRecord_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_insertStringRecord_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSInsertStringRecordReq(args.req); - } - } -}; -IClientRPCService_insertStringRecord_args.prototype = {}; -IClientRPCService_insertStringRecord_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSInsertStringRecordReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_insertStringRecord_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_insertStringRecord_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_insertStringRecord_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_insertStringRecord_result.prototype = {}; -IClientRPCService_insertStringRecord_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_insertStringRecord_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_insertStringRecord_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_insertTablet_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSInsertTabletReq(args.req); - } - } -}; -IClientRPCService_insertTablet_args.prototype = {}; -IClientRPCService_insertTablet_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSInsertTabletReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_insertTablet_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_insertTablet_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_insertTablet_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_insertTablet_result.prototype = {}; -IClientRPCService_insertTablet_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_insertTablet_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_insertTablet_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_insertTablets_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSInsertTabletsReq(args.req); - } - } -}; -IClientRPCService_insertTablets_args.prototype = {}; -IClientRPCService_insertTablets_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSInsertTabletsReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_insertTablets_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_insertTablets_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_insertTablets_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_insertTablets_result.prototype = {}; -IClientRPCService_insertTablets_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_insertTablets_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_insertTablets_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_insertRecords_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSInsertRecordsReq(args.req); - } - } -}; -IClientRPCService_insertRecords_args.prototype = {}; -IClientRPCService_insertRecords_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSInsertRecordsReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_insertRecords_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_insertRecords_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_insertRecords_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_insertRecords_result.prototype = {}; -IClientRPCService_insertRecords_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_insertRecords_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_insertRecords_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_insertRecordsOfOneDevice_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSInsertRecordsOfOneDeviceReq(args.req); - } - } -}; -IClientRPCService_insertRecordsOfOneDevice_args.prototype = {}; -IClientRPCService_insertRecordsOfOneDevice_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSInsertRecordsOfOneDeviceReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_insertRecordsOfOneDevice_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_insertRecordsOfOneDevice_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_insertRecordsOfOneDevice_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_insertRecordsOfOneDevice_result.prototype = {}; -IClientRPCService_insertRecordsOfOneDevice_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_insertRecordsOfOneDevice_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_insertRecordsOfOneDevice_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_insertStringRecordsOfOneDevice_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSInsertStringRecordsOfOneDeviceReq(args.req); - } - } -}; -IClientRPCService_insertStringRecordsOfOneDevice_args.prototype = {}; -IClientRPCService_insertStringRecordsOfOneDevice_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSInsertStringRecordsOfOneDeviceReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_insertStringRecordsOfOneDevice_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_insertStringRecordsOfOneDevice_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_insertStringRecordsOfOneDevice_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_insertStringRecordsOfOneDevice_result.prototype = {}; -IClientRPCService_insertStringRecordsOfOneDevice_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_insertStringRecordsOfOneDevice_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_insertStringRecordsOfOneDevice_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_insertStringRecords_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSInsertStringRecordsReq(args.req); - } - } -}; -IClientRPCService_insertStringRecords_args.prototype = {}; -IClientRPCService_insertStringRecords_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSInsertStringRecordsReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_insertStringRecords_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_insertStringRecords_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_insertStringRecords_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_insertStringRecords_result.prototype = {}; -IClientRPCService_insertStringRecords_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_insertStringRecords_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_insertStringRecords_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_testInsertTablet_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSInsertTabletReq(args.req); - } - } -}; -IClientRPCService_testInsertTablet_args.prototype = {}; -IClientRPCService_testInsertTablet_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSInsertTabletReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_testInsertTablet_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_testInsertTablet_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_testInsertTablet_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_testInsertTablet_result.prototype = {}; -IClientRPCService_testInsertTablet_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_testInsertTablet_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_testInsertTablet_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_testInsertTablets_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSInsertTabletsReq(args.req); - } - } -}; -IClientRPCService_testInsertTablets_args.prototype = {}; -IClientRPCService_testInsertTablets_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSInsertTabletsReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_testInsertTablets_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_testInsertTablets_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_testInsertTablets_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_testInsertTablets_result.prototype = {}; -IClientRPCService_testInsertTablets_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_testInsertTablets_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_testInsertTablets_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_testInsertRecord_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSInsertRecordReq(args.req); - } - } -}; -IClientRPCService_testInsertRecord_args.prototype = {}; -IClientRPCService_testInsertRecord_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSInsertRecordReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_testInsertRecord_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_testInsertRecord_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_testInsertRecord_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_testInsertRecord_result.prototype = {}; -IClientRPCService_testInsertRecord_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_testInsertRecord_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_testInsertRecord_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_testInsertStringRecord_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSInsertStringRecordReq(args.req); - } - } -}; -IClientRPCService_testInsertStringRecord_args.prototype = {}; -IClientRPCService_testInsertStringRecord_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSInsertStringRecordReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_testInsertStringRecord_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_testInsertStringRecord_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_testInsertStringRecord_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_testInsertStringRecord_result.prototype = {}; -IClientRPCService_testInsertStringRecord_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_testInsertStringRecord_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_testInsertStringRecord_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_testInsertRecords_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSInsertRecordsReq(args.req); - } - } -}; -IClientRPCService_testInsertRecords_args.prototype = {}; -IClientRPCService_testInsertRecords_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSInsertRecordsReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_testInsertRecords_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_testInsertRecords_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_testInsertRecords_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_testInsertRecords_result.prototype = {}; -IClientRPCService_testInsertRecords_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_testInsertRecords_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_testInsertRecords_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_testInsertRecordsOfOneDevice_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSInsertRecordsOfOneDeviceReq(args.req); - } - } -}; -IClientRPCService_testInsertRecordsOfOneDevice_args.prototype = {}; -IClientRPCService_testInsertRecordsOfOneDevice_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSInsertRecordsOfOneDeviceReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_testInsertRecordsOfOneDevice_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_testInsertRecordsOfOneDevice_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_testInsertRecordsOfOneDevice_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_testInsertRecordsOfOneDevice_result.prototype = {}; -IClientRPCService_testInsertRecordsOfOneDevice_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_testInsertRecordsOfOneDevice_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_testInsertRecordsOfOneDevice_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_testInsertStringRecords_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSInsertStringRecordsReq(args.req); - } - } -}; -IClientRPCService_testInsertStringRecords_args.prototype = {}; -IClientRPCService_testInsertStringRecords_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSInsertStringRecordsReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_testInsertStringRecords_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_testInsertStringRecords_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_testInsertStringRecords_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_testInsertStringRecords_result.prototype = {}; -IClientRPCService_testInsertStringRecords_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_testInsertStringRecords_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_testInsertStringRecords_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_deleteData_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSDeleteDataReq(args.req); - } - } -}; -IClientRPCService_deleteData_args.prototype = {}; -IClientRPCService_deleteData_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSDeleteDataReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_deleteData_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_deleteData_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_deleteData_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_deleteData_result.prototype = {}; -IClientRPCService_deleteData_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_deleteData_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_deleteData_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_executeRawDataQuery_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSRawDataQueryReq(args.req); - } - } -}; -IClientRPCService_executeRawDataQuery_args.prototype = {}; -IClientRPCService_executeRawDataQuery_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSRawDataQueryReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_executeRawDataQuery_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeRawDataQuery_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_executeRawDataQuery_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new ttypes.TSExecuteStatementResp(args.success); - } - } -}; -IClientRPCService_executeRawDataQuery_result.prototype = {}; -IClientRPCService_executeRawDataQuery_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new ttypes.TSExecuteStatementResp(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_executeRawDataQuery_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeRawDataQuery_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_executeLastDataQuery_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSLastDataQueryReq(args.req); - } - } -}; -IClientRPCService_executeLastDataQuery_args.prototype = {}; -IClientRPCService_executeLastDataQuery_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSLastDataQueryReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_executeLastDataQuery_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeLastDataQuery_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_executeLastDataQuery_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new ttypes.TSExecuteStatementResp(args.success); - } - } -}; -IClientRPCService_executeLastDataQuery_result.prototype = {}; -IClientRPCService_executeLastDataQuery_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new ttypes.TSExecuteStatementResp(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_executeLastDataQuery_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeLastDataQuery_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_executeAggregationQuery_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSAggregationQueryReq(args.req); - } - } -}; -IClientRPCService_executeAggregationQuery_args.prototype = {}; -IClientRPCService_executeAggregationQuery_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSAggregationQueryReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_executeAggregationQuery_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeAggregationQuery_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_executeAggregationQuery_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new ttypes.TSExecuteStatementResp(args.success); - } - } -}; -IClientRPCService_executeAggregationQuery_result.prototype = {}; -IClientRPCService_executeAggregationQuery_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new ttypes.TSExecuteStatementResp(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_executeAggregationQuery_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_executeAggregationQuery_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_requestStatementId_args = function(args) { - this.sessionId = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } - } -}; -IClientRPCService_requestStatementId_args.prototype = {}; -IClientRPCService_requestStatementId_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_requestStatementId_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_requestStatementId_args'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_requestStatementId_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = args.success; - } - } -}; -IClientRPCService_requestStatementId_result.prototype = {}; -IClientRPCService_requestStatementId_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.I64) { - this.success = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_requestStatementId_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_requestStatementId_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.I64, 0); - output.writeI64(this.success); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_createSchemaTemplate_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSCreateSchemaTemplateReq(args.req); - } - } -}; -IClientRPCService_createSchemaTemplate_args.prototype = {}; -IClientRPCService_createSchemaTemplate_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSCreateSchemaTemplateReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_createSchemaTemplate_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_createSchemaTemplate_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_createSchemaTemplate_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_createSchemaTemplate_result.prototype = {}; -IClientRPCService_createSchemaTemplate_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_createSchemaTemplate_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_createSchemaTemplate_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_appendSchemaTemplate_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSAppendSchemaTemplateReq(args.req); - } - } -}; -IClientRPCService_appendSchemaTemplate_args.prototype = {}; -IClientRPCService_appendSchemaTemplate_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSAppendSchemaTemplateReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_appendSchemaTemplate_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_appendSchemaTemplate_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_appendSchemaTemplate_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_appendSchemaTemplate_result.prototype = {}; -IClientRPCService_appendSchemaTemplate_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_appendSchemaTemplate_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_appendSchemaTemplate_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_pruneSchemaTemplate_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSPruneSchemaTemplateReq(args.req); - } - } -}; -IClientRPCService_pruneSchemaTemplate_args.prototype = {}; -IClientRPCService_pruneSchemaTemplate_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSPruneSchemaTemplateReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_pruneSchemaTemplate_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_pruneSchemaTemplate_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_pruneSchemaTemplate_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_pruneSchemaTemplate_result.prototype = {}; -IClientRPCService_pruneSchemaTemplate_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_pruneSchemaTemplate_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_pruneSchemaTemplate_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_querySchemaTemplate_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSQueryTemplateReq(args.req); - } - } -}; -IClientRPCService_querySchemaTemplate_args.prototype = {}; -IClientRPCService_querySchemaTemplate_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSQueryTemplateReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_querySchemaTemplate_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_querySchemaTemplate_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_querySchemaTemplate_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new ttypes.TSQueryTemplateResp(args.success); - } - } -}; -IClientRPCService_querySchemaTemplate_result.prototype = {}; -IClientRPCService_querySchemaTemplate_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new ttypes.TSQueryTemplateResp(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_querySchemaTemplate_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_querySchemaTemplate_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_showConfigurationTemplate_args = function(args) { -}; -IClientRPCService_showConfigurationTemplate_args.prototype = {}; -IClientRPCService_showConfigurationTemplate_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - if (ftype == Thrift.Type.STOP) { - break; - } - input.skip(ftype); - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_showConfigurationTemplate_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_showConfigurationTemplate_args'); - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_showConfigurationTemplate_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TShowConfigurationTemplateResp(args.success); - } - } -}; -IClientRPCService_showConfigurationTemplate_result.prototype = {}; -IClientRPCService_showConfigurationTemplate_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TShowConfigurationTemplateResp(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_showConfigurationTemplate_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_showConfigurationTemplate_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_showConfiguration_args = function(args) { - this.nodeId = null; - if (args) { - if (args.nodeId !== undefined && args.nodeId !== null) { - this.nodeId = args.nodeId; - } - } -}; -IClientRPCService_showConfiguration_args.prototype = {}; -IClientRPCService_showConfiguration_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I32) { - this.nodeId = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_showConfiguration_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_showConfiguration_args'); - if (this.nodeId !== null && this.nodeId !== undefined) { - output.writeFieldBegin('nodeId', Thrift.Type.I32, 1); - output.writeI32(this.nodeId); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_showConfiguration_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TShowConfigurationResp(args.success); - } - } -}; -IClientRPCService_showConfiguration_result.prototype = {}; -IClientRPCService_showConfiguration_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TShowConfigurationResp(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_showConfiguration_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_showConfiguration_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_setSchemaTemplate_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSSetSchemaTemplateReq(args.req); - } - } -}; -IClientRPCService_setSchemaTemplate_args.prototype = {}; -IClientRPCService_setSchemaTemplate_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSSetSchemaTemplateReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_setSchemaTemplate_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_setSchemaTemplate_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_setSchemaTemplate_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_setSchemaTemplate_result.prototype = {}; -IClientRPCService_setSchemaTemplate_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_setSchemaTemplate_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_setSchemaTemplate_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_unsetSchemaTemplate_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSUnsetSchemaTemplateReq(args.req); - } - } -}; -IClientRPCService_unsetSchemaTemplate_args.prototype = {}; -IClientRPCService_unsetSchemaTemplate_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSUnsetSchemaTemplateReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_unsetSchemaTemplate_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_unsetSchemaTemplate_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_unsetSchemaTemplate_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_unsetSchemaTemplate_result.prototype = {}; -IClientRPCService_unsetSchemaTemplate_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_unsetSchemaTemplate_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_unsetSchemaTemplate_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_dropSchemaTemplate_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSDropSchemaTemplateReq(args.req); - } - } -}; -IClientRPCService_dropSchemaTemplate_args.prototype = {}; -IClientRPCService_dropSchemaTemplate_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSDropSchemaTemplateReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_dropSchemaTemplate_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_dropSchemaTemplate_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_dropSchemaTemplate_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_dropSchemaTemplate_result.prototype = {}; -IClientRPCService_dropSchemaTemplate_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_dropSchemaTemplate_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_dropSchemaTemplate_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_createTimeseriesUsingSchemaTemplate_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TCreateTimeseriesUsingSchemaTemplateReq(args.req); - } - } -}; -IClientRPCService_createTimeseriesUsingSchemaTemplate_args.prototype = {}; -IClientRPCService_createTimeseriesUsingSchemaTemplate_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TCreateTimeseriesUsingSchemaTemplateReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_createTimeseriesUsingSchemaTemplate_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_createTimeseriesUsingSchemaTemplate_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_createTimeseriesUsingSchemaTemplate_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_createTimeseriesUsingSchemaTemplate_result.prototype = {}; -IClientRPCService_createTimeseriesUsingSchemaTemplate_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_createTimeseriesUsingSchemaTemplate_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_createTimeseriesUsingSchemaTemplate_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_handshake_args = function(args) { - this.info = null; - if (args) { - if (args.info !== undefined && args.info !== null) { - this.info = new ttypes.TSyncIdentityInfo(args.info); - } - } -}; -IClientRPCService_handshake_args.prototype = {}; -IClientRPCService_handshake_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case -1: - if (ftype == Thrift.Type.STRUCT) { - this.info = new ttypes.TSyncIdentityInfo(); - this.info.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_handshake_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_handshake_args'); - if (this.info !== null && this.info !== undefined) { - output.writeFieldBegin('info', Thrift.Type.STRUCT, -1); - this.info.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_handshake_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_handshake_result.prototype = {}; -IClientRPCService_handshake_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_handshake_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_handshake_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_sendPipeData_args = function(args) { - this.buff = null; - if (args) { - if (args.buff !== undefined && args.buff !== null) { - this.buff = args.buff; - } - } -}; -IClientRPCService_sendPipeData_args.prototype = {}; -IClientRPCService_sendPipeData_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRING) { - this.buff = input.readBinary(); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_sendPipeData_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_sendPipeData_args'); - if (this.buff !== null && this.buff !== undefined) { - output.writeFieldBegin('buff', Thrift.Type.STRING, 1); - output.writeBinary(this.buff); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_sendPipeData_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_sendPipeData_result.prototype = {}; -IClientRPCService_sendPipeData_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_sendPipeData_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_sendPipeData_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_sendFile_args = function(args) { - this.metaInfo = null; - this.buff = null; - if (args) { - if (args.metaInfo !== undefined && args.metaInfo !== null) { - this.metaInfo = new ttypes.TSyncTransportMetaInfo(args.metaInfo); - } - if (args.buff !== undefined && args.buff !== null) { - this.buff = args.buff; - } - } -}; -IClientRPCService_sendFile_args.prototype = {}; -IClientRPCService_sendFile_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.metaInfo = new ttypes.TSyncTransportMetaInfo(); - this.metaInfo.read(input); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.buff = input.readBinary(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_sendFile_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_sendFile_args'); - if (this.metaInfo !== null && this.metaInfo !== undefined) { - output.writeFieldBegin('metaInfo', Thrift.Type.STRUCT, 1); - this.metaInfo.write(output); - output.writeFieldEnd(); - } - if (this.buff !== null && this.buff !== undefined) { - output.writeFieldBegin('buff', Thrift.Type.STRING, 2); - output.writeBinary(this.buff); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_sendFile_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_sendFile_result.prototype = {}; -IClientRPCService_sendFile_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_sendFile_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_sendFile_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_pipeTransfer_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TPipeTransferReq(args.req); - } - } -}; -IClientRPCService_pipeTransfer_args.prototype = {}; -IClientRPCService_pipeTransfer_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case -1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TPipeTransferReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_pipeTransfer_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_pipeTransfer_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, -1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_pipeTransfer_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new ttypes.TPipeTransferResp(args.success); - } - } -}; -IClientRPCService_pipeTransfer_result.prototype = {}; -IClientRPCService_pipeTransfer_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new ttypes.TPipeTransferResp(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_pipeTransfer_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_pipeTransfer_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_pipeSubscribe_args = function(args) { - this.req = null; - if (args) { - if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TPipeSubscribeReq(args.req); - } - } -}; -IClientRPCService_pipeSubscribe_args.prototype = {}; -IClientRPCService_pipeSubscribe_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case -1: - if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TPipeSubscribeReq(); - this.req.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_pipeSubscribe_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_pipeSubscribe_args'); - if (this.req !== null && this.req !== undefined) { - output.writeFieldBegin('req', Thrift.Type.STRUCT, -1); - this.req.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_pipeSubscribe_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new ttypes.TPipeSubscribeResp(args.success); - } - } -}; -IClientRPCService_pipeSubscribe_result.prototype = {}; -IClientRPCService_pipeSubscribe_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new ttypes.TPipeSubscribeResp(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_pipeSubscribe_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_pipeSubscribe_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_getBackupConfiguration_args = function(args) { -}; -IClientRPCService_getBackupConfiguration_args.prototype = {}; -IClientRPCService_getBackupConfiguration_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - if (ftype == Thrift.Type.STOP) { - break; - } - input.skip(ftype); - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_getBackupConfiguration_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_getBackupConfiguration_args'); - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_getBackupConfiguration_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new ttypes.TSBackupConfigurationResp(args.success); - } - } -}; -IClientRPCService_getBackupConfiguration_result.prototype = {}; -IClientRPCService_getBackupConfiguration_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new ttypes.TSBackupConfigurationResp(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_getBackupConfiguration_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_getBackupConfiguration_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_fetchAllConnectionsInfo_args = function(args) { -}; -IClientRPCService_fetchAllConnectionsInfo_args.prototype = {}; -IClientRPCService_fetchAllConnectionsInfo_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - if (ftype == Thrift.Type.STOP) { - break; - } - input.skip(ftype); - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_fetchAllConnectionsInfo_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_fetchAllConnectionsInfo_args'); - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_fetchAllConnectionsInfo_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new ttypes.TSConnectionInfoResp(args.success); - } - } -}; -IClientRPCService_fetchAllConnectionsInfo_result.prototype = {}; -IClientRPCService_fetchAllConnectionsInfo_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new ttypes.TSConnectionInfoResp(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_fetchAllConnectionsInfo_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_fetchAllConnectionsInfo_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_testConnectionEmptyRPC_args = function(args) { -}; -IClientRPCService_testConnectionEmptyRPC_args.prototype = {}; -IClientRPCService_testConnectionEmptyRPC_args.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - if (ftype == Thrift.Type.STOP) { - break; - } - input.skip(ftype); - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_testConnectionEmptyRPC_args.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_testConnectionEmptyRPC_args'); - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCService_testConnectionEmptyRPC_result = function(args) { - this.success = null; - if (args) { - if (args.success !== undefined && args.success !== null) { - this.success = new common_ttypes.TSStatus(args.success); - } - } -}; -IClientRPCService_testConnectionEmptyRPC_result.prototype = {}; -IClientRPCService_testConnectionEmptyRPC_result.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 0: - if (ftype == Thrift.Type.STRUCT) { - this.success = new common_ttypes.TSStatus(); - this.success.read(input); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -IClientRPCService_testConnectionEmptyRPC_result.prototype.write = function(output) { - output.writeStructBegin('IClientRPCService_testConnectionEmptyRPC_result'); - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var IClientRPCServiceClient = exports.Client = function(output, pClass) { - this.output = output; - this.pClass = pClass; - this._seqid = 0; - this._reqs = {}; -}; -IClientRPCServiceClient.prototype = {}; -IClientRPCServiceClient.prototype.seqid = function() { return this._seqid; }; -IClientRPCServiceClient.prototype.new_seqid = function() { return this._seqid += 1; }; - -IClientRPCServiceClient.prototype.executeQueryStatementV2 = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_executeQueryStatementV2(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_executeQueryStatementV2(req); - } -}; - -IClientRPCServiceClient.prototype.send_executeQueryStatementV2 = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_executeQueryStatementV2_args(params); - try { - output.writeMessageBegin('executeQueryStatementV2', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_executeQueryStatementV2 = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_executeQueryStatementV2_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('executeQueryStatementV2 failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.executeUpdateStatementV2 = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_executeUpdateStatementV2(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_executeUpdateStatementV2(req); - } -}; - -IClientRPCServiceClient.prototype.send_executeUpdateStatementV2 = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_executeUpdateStatementV2_args(params); - try { - output.writeMessageBegin('executeUpdateStatementV2', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_executeUpdateStatementV2 = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_executeUpdateStatementV2_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('executeUpdateStatementV2 failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.executeStatementV2 = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_executeStatementV2(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_executeStatementV2(req); - } -}; - -IClientRPCServiceClient.prototype.send_executeStatementV2 = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_executeStatementV2_args(params); - try { - output.writeMessageBegin('executeStatementV2', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_executeStatementV2 = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_executeStatementV2_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('executeStatementV2 failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.executeRawDataQueryV2 = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_executeRawDataQueryV2(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_executeRawDataQueryV2(req); - } -}; - -IClientRPCServiceClient.prototype.send_executeRawDataQueryV2 = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_executeRawDataQueryV2_args(params); - try { - output.writeMessageBegin('executeRawDataQueryV2', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_executeRawDataQueryV2 = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_executeRawDataQueryV2_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('executeRawDataQueryV2 failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.executeLastDataQueryV2 = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_executeLastDataQueryV2(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_executeLastDataQueryV2(req); - } -}; - -IClientRPCServiceClient.prototype.send_executeLastDataQueryV2 = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_executeLastDataQueryV2_args(params); - try { - output.writeMessageBegin('executeLastDataQueryV2', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_executeLastDataQueryV2 = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_executeLastDataQueryV2_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('executeLastDataQueryV2 failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.executeFastLastDataQueryForOneDeviceV2 = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_executeFastLastDataQueryForOneDeviceV2(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_executeFastLastDataQueryForOneDeviceV2(req); - } -}; - -IClientRPCServiceClient.prototype.send_executeFastLastDataQueryForOneDeviceV2 = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_executeFastLastDataQueryForOneDeviceV2_args(params); - try { - output.writeMessageBegin('executeFastLastDataQueryForOneDeviceV2', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_executeFastLastDataQueryForOneDeviceV2 = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_executeFastLastDataQueryForOneDeviceV2_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('executeFastLastDataQueryForOneDeviceV2 failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.executeAggregationQueryV2 = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_executeAggregationQueryV2(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_executeAggregationQueryV2(req); - } -}; - -IClientRPCServiceClient.prototype.send_executeAggregationQueryV2 = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_executeAggregationQueryV2_args(params); - try { - output.writeMessageBegin('executeAggregationQueryV2', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_executeAggregationQueryV2 = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_executeAggregationQueryV2_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('executeAggregationQueryV2 failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.executeGroupByQueryIntervalQuery = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_executeGroupByQueryIntervalQuery(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_executeGroupByQueryIntervalQuery(req); - } -}; - -IClientRPCServiceClient.prototype.send_executeGroupByQueryIntervalQuery = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_executeGroupByQueryIntervalQuery_args(params); - try { - output.writeMessageBegin('executeGroupByQueryIntervalQuery', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_executeGroupByQueryIntervalQuery = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_executeGroupByQueryIntervalQuery_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('executeGroupByQueryIntervalQuery failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.fetchResultsV2 = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_fetchResultsV2(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_fetchResultsV2(req); - } -}; - -IClientRPCServiceClient.prototype.send_fetchResultsV2 = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_fetchResultsV2_args(params); - try { - output.writeMessageBegin('fetchResultsV2', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_fetchResultsV2 = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_fetchResultsV2_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('fetchResultsV2 failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.openSession = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_openSession(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_openSession(req); - } -}; - -IClientRPCServiceClient.prototype.send_openSession = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_openSession_args(params); - try { - output.writeMessageBegin('openSession', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_openSession = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_openSession_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('openSession failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.closeSession = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_closeSession(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_closeSession(req); - } -}; - -IClientRPCServiceClient.prototype.send_closeSession = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_closeSession_args(params); - try { - output.writeMessageBegin('closeSession', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_closeSession = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_closeSession_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('closeSession failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.executeStatement = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_executeStatement(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_executeStatement(req); - } -}; - -IClientRPCServiceClient.prototype.send_executeStatement = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_executeStatement_args(params); - try { - output.writeMessageBegin('executeStatement', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_executeStatement = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_executeStatement_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('executeStatement failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.executeBatchStatement = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_executeBatchStatement(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_executeBatchStatement(req); - } -}; - -IClientRPCServiceClient.prototype.send_executeBatchStatement = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_executeBatchStatement_args(params); - try { - output.writeMessageBegin('executeBatchStatement', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_executeBatchStatement = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_executeBatchStatement_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('executeBatchStatement failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.executeQueryStatement = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_executeQueryStatement(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_executeQueryStatement(req); - } -}; - -IClientRPCServiceClient.prototype.send_executeQueryStatement = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_executeQueryStatement_args(params); - try { - output.writeMessageBegin('executeQueryStatement', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_executeQueryStatement = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_executeQueryStatement_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('executeQueryStatement failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.executeUpdateStatement = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_executeUpdateStatement(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_executeUpdateStatement(req); - } -}; - -IClientRPCServiceClient.prototype.send_executeUpdateStatement = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_executeUpdateStatement_args(params); - try { - output.writeMessageBegin('executeUpdateStatement', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_executeUpdateStatement = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_executeUpdateStatement_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('executeUpdateStatement failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.fetchResults = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_fetchResults(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_fetchResults(req); - } -}; - -IClientRPCServiceClient.prototype.send_fetchResults = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_fetchResults_args(params); - try { - output.writeMessageBegin('fetchResults', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_fetchResults = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_fetchResults_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('fetchResults failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.fetchMetadata = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_fetchMetadata(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_fetchMetadata(req); - } -}; - -IClientRPCServiceClient.prototype.send_fetchMetadata = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_fetchMetadata_args(params); - try { - output.writeMessageBegin('fetchMetadata', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_fetchMetadata = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_fetchMetadata_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('fetchMetadata failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.cancelOperation = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_cancelOperation(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_cancelOperation(req); - } -}; - -IClientRPCServiceClient.prototype.send_cancelOperation = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_cancelOperation_args(params); - try { - output.writeMessageBegin('cancelOperation', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_cancelOperation = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_cancelOperation_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('cancelOperation failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.closeOperation = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_closeOperation(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_closeOperation(req); - } -}; - -IClientRPCServiceClient.prototype.send_closeOperation = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_closeOperation_args(params); - try { - output.writeMessageBegin('closeOperation', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_closeOperation = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_closeOperation_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('closeOperation failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.getTimeZone = function(sessionId, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_getTimeZone(sessionId); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_getTimeZone(sessionId); - } -}; - -IClientRPCServiceClient.prototype.send_getTimeZone = function(sessionId) { - var output = new this.pClass(this.output); - var params = { - sessionId: sessionId - }; - var args = new IClientRPCService_getTimeZone_args(params); - try { - output.writeMessageBegin('getTimeZone', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_getTimeZone = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_getTimeZone_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('getTimeZone failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.setTimeZone = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_setTimeZone(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_setTimeZone(req); - } -}; - -IClientRPCServiceClient.prototype.send_setTimeZone = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_setTimeZone_args(params); - try { - output.writeMessageBegin('setTimeZone', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_setTimeZone = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_setTimeZone_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('setTimeZone failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.getProperties = function(callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_getProperties(); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_getProperties(); - } -}; - -IClientRPCServiceClient.prototype.send_getProperties = function() { - var output = new this.pClass(this.output); - var args = new IClientRPCService_getProperties_args(); - try { - output.writeMessageBegin('getProperties', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_getProperties = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_getProperties_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('getProperties failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.setStorageGroup = function(sessionId, storageGroup, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_setStorageGroup(sessionId, storageGroup); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_setStorageGroup(sessionId, storageGroup); - } -}; - -IClientRPCServiceClient.prototype.send_setStorageGroup = function(sessionId, storageGroup) { - var output = new this.pClass(this.output); - var params = { - sessionId: sessionId, - storageGroup: storageGroup - }; - var args = new IClientRPCService_setStorageGroup_args(params); - try { - output.writeMessageBegin('setStorageGroup', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_setStorageGroup = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_setStorageGroup_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('setStorageGroup failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.createTimeseries = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_createTimeseries(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_createTimeseries(req); - } -}; - -IClientRPCServiceClient.prototype.send_createTimeseries = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_createTimeseries_args(params); - try { - output.writeMessageBegin('createTimeseries', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_createTimeseries = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_createTimeseries_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('createTimeseries failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.createAlignedTimeseries = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_createAlignedTimeseries(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_createAlignedTimeseries(req); - } -}; - -IClientRPCServiceClient.prototype.send_createAlignedTimeseries = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_createAlignedTimeseries_args(params); - try { - output.writeMessageBegin('createAlignedTimeseries', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_createAlignedTimeseries = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_createAlignedTimeseries_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('createAlignedTimeseries failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.createMultiTimeseries = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_createMultiTimeseries(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_createMultiTimeseries(req); - } -}; - -IClientRPCServiceClient.prototype.send_createMultiTimeseries = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_createMultiTimeseries_args(params); - try { - output.writeMessageBegin('createMultiTimeseries', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_createMultiTimeseries = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_createMultiTimeseries_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('createMultiTimeseries failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.deleteTimeseries = function(sessionId, path, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_deleteTimeseries(sessionId, path); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_deleteTimeseries(sessionId, path); - } -}; - -IClientRPCServiceClient.prototype.send_deleteTimeseries = function(sessionId, path) { - var output = new this.pClass(this.output); - var params = { - sessionId: sessionId, - path: path - }; - var args = new IClientRPCService_deleteTimeseries_args(params); - try { - output.writeMessageBegin('deleteTimeseries', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_deleteTimeseries = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_deleteTimeseries_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('deleteTimeseries failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.deleteStorageGroups = function(sessionId, storageGroup, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_deleteStorageGroups(sessionId, storageGroup); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_deleteStorageGroups(sessionId, storageGroup); - } -}; - -IClientRPCServiceClient.prototype.send_deleteStorageGroups = function(sessionId, storageGroup) { - var output = new this.pClass(this.output); - var params = { - sessionId: sessionId, - storageGroup: storageGroup - }; - var args = new IClientRPCService_deleteStorageGroups_args(params); - try { - output.writeMessageBegin('deleteStorageGroups', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_deleteStorageGroups = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_deleteStorageGroups_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('deleteStorageGroups failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.insertRecord = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_insertRecord(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_insertRecord(req); - } -}; - -IClientRPCServiceClient.prototype.send_insertRecord = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_insertRecord_args(params); - try { - output.writeMessageBegin('insertRecord', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_insertRecord = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_insertRecord_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('insertRecord failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.insertStringRecord = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_insertStringRecord(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_insertStringRecord(req); - } -}; - -IClientRPCServiceClient.prototype.send_insertStringRecord = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_insertStringRecord_args(params); - try { - output.writeMessageBegin('insertStringRecord', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_insertStringRecord = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_insertStringRecord_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('insertStringRecord failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.insertTablet = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_insertTablet(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_insertTablet(req); - } -}; - -IClientRPCServiceClient.prototype.send_insertTablet = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_insertTablet_args(params); - try { - output.writeMessageBegin('insertTablet', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_insertTablet = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_insertTablet_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('insertTablet failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.insertTablets = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_insertTablets(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_insertTablets(req); - } -}; - -IClientRPCServiceClient.prototype.send_insertTablets = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_insertTablets_args(params); - try { - output.writeMessageBegin('insertTablets', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_insertTablets = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_insertTablets_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('insertTablets failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.insertRecords = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_insertRecords(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_insertRecords(req); - } -}; - -IClientRPCServiceClient.prototype.send_insertRecords = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_insertRecords_args(params); - try { - output.writeMessageBegin('insertRecords', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_insertRecords = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_insertRecords_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('insertRecords failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.insertRecordsOfOneDevice = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_insertRecordsOfOneDevice(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_insertRecordsOfOneDevice(req); - } -}; - -IClientRPCServiceClient.prototype.send_insertRecordsOfOneDevice = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_insertRecordsOfOneDevice_args(params); - try { - output.writeMessageBegin('insertRecordsOfOneDevice', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_insertRecordsOfOneDevice = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_insertRecordsOfOneDevice_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('insertRecordsOfOneDevice failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.insertStringRecordsOfOneDevice = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_insertStringRecordsOfOneDevice(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_insertStringRecordsOfOneDevice(req); - } -}; - -IClientRPCServiceClient.prototype.send_insertStringRecordsOfOneDevice = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_insertStringRecordsOfOneDevice_args(params); - try { - output.writeMessageBegin('insertStringRecordsOfOneDevice', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_insertStringRecordsOfOneDevice = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_insertStringRecordsOfOneDevice_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('insertStringRecordsOfOneDevice failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.insertStringRecords = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_insertStringRecords(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_insertStringRecords(req); - } -}; - -IClientRPCServiceClient.prototype.send_insertStringRecords = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_insertStringRecords_args(params); - try { - output.writeMessageBegin('insertStringRecords', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_insertStringRecords = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_insertStringRecords_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('insertStringRecords failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.testInsertTablet = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_testInsertTablet(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_testInsertTablet(req); - } -}; - -IClientRPCServiceClient.prototype.send_testInsertTablet = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_testInsertTablet_args(params); - try { - output.writeMessageBegin('testInsertTablet', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_testInsertTablet = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_testInsertTablet_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('testInsertTablet failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.testInsertTablets = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_testInsertTablets(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_testInsertTablets(req); - } -}; - -IClientRPCServiceClient.prototype.send_testInsertTablets = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_testInsertTablets_args(params); - try { - output.writeMessageBegin('testInsertTablets', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_testInsertTablets = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_testInsertTablets_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('testInsertTablets failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.testInsertRecord = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_testInsertRecord(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_testInsertRecord(req); - } -}; - -IClientRPCServiceClient.prototype.send_testInsertRecord = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_testInsertRecord_args(params); - try { - output.writeMessageBegin('testInsertRecord', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_testInsertRecord = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_testInsertRecord_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('testInsertRecord failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.testInsertStringRecord = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_testInsertStringRecord(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_testInsertStringRecord(req); - } -}; - -IClientRPCServiceClient.prototype.send_testInsertStringRecord = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_testInsertStringRecord_args(params); - try { - output.writeMessageBegin('testInsertStringRecord', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_testInsertStringRecord = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_testInsertStringRecord_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('testInsertStringRecord failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.testInsertRecords = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_testInsertRecords(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_testInsertRecords(req); - } -}; - -IClientRPCServiceClient.prototype.send_testInsertRecords = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_testInsertRecords_args(params); - try { - output.writeMessageBegin('testInsertRecords', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_testInsertRecords = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_testInsertRecords_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('testInsertRecords failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.testInsertRecordsOfOneDevice = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_testInsertRecordsOfOneDevice(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_testInsertRecordsOfOneDevice(req); - } -}; - -IClientRPCServiceClient.prototype.send_testInsertRecordsOfOneDevice = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_testInsertRecordsOfOneDevice_args(params); - try { - output.writeMessageBegin('testInsertRecordsOfOneDevice', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_testInsertRecordsOfOneDevice = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_testInsertRecordsOfOneDevice_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('testInsertRecordsOfOneDevice failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.testInsertStringRecords = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_testInsertStringRecords(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_testInsertStringRecords(req); - } -}; - -IClientRPCServiceClient.prototype.send_testInsertStringRecords = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_testInsertStringRecords_args(params); - try { - output.writeMessageBegin('testInsertStringRecords', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_testInsertStringRecords = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_testInsertStringRecords_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('testInsertStringRecords failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.deleteData = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_deleteData(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_deleteData(req); - } -}; - -IClientRPCServiceClient.prototype.send_deleteData = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_deleteData_args(params); - try { - output.writeMessageBegin('deleteData', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_deleteData = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_deleteData_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('deleteData failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.executeRawDataQuery = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_executeRawDataQuery(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_executeRawDataQuery(req); - } -}; - -IClientRPCServiceClient.prototype.send_executeRawDataQuery = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_executeRawDataQuery_args(params); - try { - output.writeMessageBegin('executeRawDataQuery', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_executeRawDataQuery = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_executeRawDataQuery_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('executeRawDataQuery failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.executeLastDataQuery = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_executeLastDataQuery(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_executeLastDataQuery(req); - } -}; - -IClientRPCServiceClient.prototype.send_executeLastDataQuery = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_executeLastDataQuery_args(params); - try { - output.writeMessageBegin('executeLastDataQuery', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_executeLastDataQuery = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_executeLastDataQuery_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('executeLastDataQuery failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.executeAggregationQuery = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_executeAggregationQuery(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_executeAggregationQuery(req); - } -}; - -IClientRPCServiceClient.prototype.send_executeAggregationQuery = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_executeAggregationQuery_args(params); - try { - output.writeMessageBegin('executeAggregationQuery', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_executeAggregationQuery = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_executeAggregationQuery_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('executeAggregationQuery failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.requestStatementId = function(sessionId, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_requestStatementId(sessionId); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_requestStatementId(sessionId); - } -}; - -IClientRPCServiceClient.prototype.send_requestStatementId = function(sessionId) { - var output = new this.pClass(this.output); - var params = { - sessionId: sessionId - }; - var args = new IClientRPCService_requestStatementId_args(params); - try { - output.writeMessageBegin('requestStatementId', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_requestStatementId = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_requestStatementId_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('requestStatementId failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.createSchemaTemplate = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_createSchemaTemplate(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_createSchemaTemplate(req); - } -}; - -IClientRPCServiceClient.prototype.send_createSchemaTemplate = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_createSchemaTemplate_args(params); - try { - output.writeMessageBegin('createSchemaTemplate', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_createSchemaTemplate = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_createSchemaTemplate_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('createSchemaTemplate failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.appendSchemaTemplate = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_appendSchemaTemplate(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_appendSchemaTemplate(req); - } -}; - -IClientRPCServiceClient.prototype.send_appendSchemaTemplate = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_appendSchemaTemplate_args(params); - try { - output.writeMessageBegin('appendSchemaTemplate', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_appendSchemaTemplate = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_appendSchemaTemplate_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('appendSchemaTemplate failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.pruneSchemaTemplate = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_pruneSchemaTemplate(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_pruneSchemaTemplate(req); - } -}; - -IClientRPCServiceClient.prototype.send_pruneSchemaTemplate = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_pruneSchemaTemplate_args(params); - try { - output.writeMessageBegin('pruneSchemaTemplate', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_pruneSchemaTemplate = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_pruneSchemaTemplate_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('pruneSchemaTemplate failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.querySchemaTemplate = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_querySchemaTemplate(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_querySchemaTemplate(req); - } -}; - -IClientRPCServiceClient.prototype.send_querySchemaTemplate = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_querySchemaTemplate_args(params); - try { - output.writeMessageBegin('querySchemaTemplate', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_querySchemaTemplate = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_querySchemaTemplate_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('querySchemaTemplate failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.showConfigurationTemplate = function(callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_showConfigurationTemplate(); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_showConfigurationTemplate(); - } -}; - -IClientRPCServiceClient.prototype.send_showConfigurationTemplate = function() { - var output = new this.pClass(this.output); - var args = new IClientRPCService_showConfigurationTemplate_args(); - try { - output.writeMessageBegin('showConfigurationTemplate', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_showConfigurationTemplate = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_showConfigurationTemplate_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('showConfigurationTemplate failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.showConfiguration = function(nodeId, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_showConfiguration(nodeId); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_showConfiguration(nodeId); - } -}; - -IClientRPCServiceClient.prototype.send_showConfiguration = function(nodeId) { - var output = new this.pClass(this.output); - var params = { - nodeId: nodeId - }; - var args = new IClientRPCService_showConfiguration_args(params); - try { - output.writeMessageBegin('showConfiguration', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_showConfiguration = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_showConfiguration_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('showConfiguration failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.setSchemaTemplate = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_setSchemaTemplate(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_setSchemaTemplate(req); - } -}; - -IClientRPCServiceClient.prototype.send_setSchemaTemplate = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_setSchemaTemplate_args(params); - try { - output.writeMessageBegin('setSchemaTemplate', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_setSchemaTemplate = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_setSchemaTemplate_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('setSchemaTemplate failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.unsetSchemaTemplate = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_unsetSchemaTemplate(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_unsetSchemaTemplate(req); - } -}; - -IClientRPCServiceClient.prototype.send_unsetSchemaTemplate = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_unsetSchemaTemplate_args(params); - try { - output.writeMessageBegin('unsetSchemaTemplate', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_unsetSchemaTemplate = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_unsetSchemaTemplate_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('unsetSchemaTemplate failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.dropSchemaTemplate = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_dropSchemaTemplate(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_dropSchemaTemplate(req); - } -}; - -IClientRPCServiceClient.prototype.send_dropSchemaTemplate = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_dropSchemaTemplate_args(params); - try { - output.writeMessageBegin('dropSchemaTemplate', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_dropSchemaTemplate = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_dropSchemaTemplate_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('dropSchemaTemplate failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.createTimeseriesUsingSchemaTemplate = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_createTimeseriesUsingSchemaTemplate(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_createTimeseriesUsingSchemaTemplate(req); - } -}; - -IClientRPCServiceClient.prototype.send_createTimeseriesUsingSchemaTemplate = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_createTimeseriesUsingSchemaTemplate_args(params); - try { - output.writeMessageBegin('createTimeseriesUsingSchemaTemplate', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_createTimeseriesUsingSchemaTemplate = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_createTimeseriesUsingSchemaTemplate_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('createTimeseriesUsingSchemaTemplate failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.handshake = function(info, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_handshake(info); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_handshake(info); - } -}; - -IClientRPCServiceClient.prototype.send_handshake = function(info) { - var output = new this.pClass(this.output); - var params = { - info: info - }; - var args = new IClientRPCService_handshake_args(params); - try { - output.writeMessageBegin('handshake', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_handshake = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_handshake_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('handshake failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.sendPipeData = function(buff, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_sendPipeData(buff); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_sendPipeData(buff); - } -}; - -IClientRPCServiceClient.prototype.send_sendPipeData = function(buff) { - var output = new this.pClass(this.output); - var params = { - buff: buff - }; - var args = new IClientRPCService_sendPipeData_args(params); - try { - output.writeMessageBegin('sendPipeData', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_sendPipeData = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_sendPipeData_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('sendPipeData failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.sendFile = function(metaInfo, buff, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_sendFile(metaInfo, buff); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_sendFile(metaInfo, buff); - } -}; - -IClientRPCServiceClient.prototype.send_sendFile = function(metaInfo, buff) { - var output = new this.pClass(this.output); - var params = { - metaInfo: metaInfo, - buff: buff - }; - var args = new IClientRPCService_sendFile_args(params); - try { - output.writeMessageBegin('sendFile', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_sendFile = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_sendFile_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('sendFile failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.pipeTransfer = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_pipeTransfer(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_pipeTransfer(req); - } -}; - -IClientRPCServiceClient.prototype.send_pipeTransfer = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_pipeTransfer_args(params); - try { - output.writeMessageBegin('pipeTransfer', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_pipeTransfer = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_pipeTransfer_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('pipeTransfer failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.pipeSubscribe = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_pipeSubscribe(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_pipeSubscribe(req); - } -}; - -IClientRPCServiceClient.prototype.send_pipeSubscribe = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_pipeSubscribe_args(params); - try { - output.writeMessageBegin('pipeSubscribe', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_pipeSubscribe = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_pipeSubscribe_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('pipeSubscribe failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.getBackupConfiguration = function(callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_getBackupConfiguration(); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_getBackupConfiguration(); - } -}; - -IClientRPCServiceClient.prototype.send_getBackupConfiguration = function() { - var output = new this.pClass(this.output); - var args = new IClientRPCService_getBackupConfiguration_args(); - try { - output.writeMessageBegin('getBackupConfiguration', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_getBackupConfiguration = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_getBackupConfiguration_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('getBackupConfiguration failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.fetchAllConnectionsInfo = function(callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_fetchAllConnectionsInfo(); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_fetchAllConnectionsInfo(); - } -}; - -IClientRPCServiceClient.prototype.send_fetchAllConnectionsInfo = function() { - var output = new this.pClass(this.output); - var args = new IClientRPCService_fetchAllConnectionsInfo_args(); - try { - output.writeMessageBegin('fetchAllConnectionsInfo', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_fetchAllConnectionsInfo = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_fetchAllConnectionsInfo_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('fetchAllConnectionsInfo failed: unknown result'); -}; - -IClientRPCServiceClient.prototype.testConnectionEmptyRPC = function(callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); - } else { - _defer.resolve(result); - } - }; - this.send_testConnectionEmptyRPC(); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_testConnectionEmptyRPC(); - } -}; - -IClientRPCServiceClient.prototype.send_testConnectionEmptyRPC = function() { - var output = new this.pClass(this.output); - var args = new IClientRPCService_testConnectionEmptyRPC_args(); - try { - output.writeMessageBegin('testConnectionEmptyRPC', Thrift.MessageType.CALL, this.seqid()); - args.write(output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; - } -}; - -IClientRPCServiceClient.prototype.recv_testConnectionEmptyRPC = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x.read(input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_testConnectionEmptyRPC_result(); - result.read(input); - input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); - } - return callback('testConnectionEmptyRPC failed: unknown result'); -}; -var IClientRPCServiceProcessor = exports.Processor = function(handler) { - this._handler = handler; -}; -IClientRPCServiceProcessor.prototype.process = function(input, output) { - var r = input.readMessageBegin(); - if (this['process_' + r.fname]) { - return this['process_' + r.fname].call(this, r.rseqid, input, output); - } else { - input.skip(Thrift.Type.STRUCT); - input.readMessageEnd(); - var x = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN_METHOD, 'Unknown function ' + r.fname); - output.writeMessageBegin(r.fname, Thrift.MessageType.EXCEPTION, r.rseqid); - x.write(output); - output.writeMessageEnd(); - output.flush(); - } -}; -IClientRPCServiceProcessor.prototype.process_executeQueryStatementV2 = function(seqid, input, output) { - var args = new IClientRPCService_executeQueryStatementV2_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.executeQueryStatementV2.length === 1) { - Q.fcall(this._handler.executeQueryStatementV2.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_executeQueryStatementV2_result({success: result}); - output.writeMessageBegin("executeQueryStatementV2", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeQueryStatementV2", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.executeQueryStatementV2(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_executeQueryStatementV2_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("executeQueryStatementV2", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeQueryStatementV2", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_executeUpdateStatementV2 = function(seqid, input, output) { - var args = new IClientRPCService_executeUpdateStatementV2_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.executeUpdateStatementV2.length === 1) { - Q.fcall(this._handler.executeUpdateStatementV2.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_executeUpdateStatementV2_result({success: result}); - output.writeMessageBegin("executeUpdateStatementV2", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeUpdateStatementV2", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.executeUpdateStatementV2(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_executeUpdateStatementV2_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("executeUpdateStatementV2", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeUpdateStatementV2", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_executeStatementV2 = function(seqid, input, output) { - var args = new IClientRPCService_executeStatementV2_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.executeStatementV2.length === 1) { - Q.fcall(this._handler.executeStatementV2.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_executeStatementV2_result({success: result}); - output.writeMessageBegin("executeStatementV2", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeStatementV2", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.executeStatementV2(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_executeStatementV2_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("executeStatementV2", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeStatementV2", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_executeRawDataQueryV2 = function(seqid, input, output) { - var args = new IClientRPCService_executeRawDataQueryV2_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.executeRawDataQueryV2.length === 1) { - Q.fcall(this._handler.executeRawDataQueryV2.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_executeRawDataQueryV2_result({success: result}); - output.writeMessageBegin("executeRawDataQueryV2", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeRawDataQueryV2", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.executeRawDataQueryV2(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_executeRawDataQueryV2_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("executeRawDataQueryV2", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeRawDataQueryV2", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_executeLastDataQueryV2 = function(seqid, input, output) { - var args = new IClientRPCService_executeLastDataQueryV2_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.executeLastDataQueryV2.length === 1) { - Q.fcall(this._handler.executeLastDataQueryV2.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_executeLastDataQueryV2_result({success: result}); - output.writeMessageBegin("executeLastDataQueryV2", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeLastDataQueryV2", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.executeLastDataQueryV2(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_executeLastDataQueryV2_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("executeLastDataQueryV2", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeLastDataQueryV2", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_executeFastLastDataQueryForOneDeviceV2 = function(seqid, input, output) { - var args = new IClientRPCService_executeFastLastDataQueryForOneDeviceV2_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.executeFastLastDataQueryForOneDeviceV2.length === 1) { - Q.fcall(this._handler.executeFastLastDataQueryForOneDeviceV2.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_executeFastLastDataQueryForOneDeviceV2_result({success: result}); - output.writeMessageBegin("executeFastLastDataQueryForOneDeviceV2", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeFastLastDataQueryForOneDeviceV2", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.executeFastLastDataQueryForOneDeviceV2(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_executeFastLastDataQueryForOneDeviceV2_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("executeFastLastDataQueryForOneDeviceV2", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeFastLastDataQueryForOneDeviceV2", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_executeAggregationQueryV2 = function(seqid, input, output) { - var args = new IClientRPCService_executeAggregationQueryV2_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.executeAggregationQueryV2.length === 1) { - Q.fcall(this._handler.executeAggregationQueryV2.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_executeAggregationQueryV2_result({success: result}); - output.writeMessageBegin("executeAggregationQueryV2", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeAggregationQueryV2", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.executeAggregationQueryV2(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_executeAggregationQueryV2_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("executeAggregationQueryV2", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeAggregationQueryV2", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_executeGroupByQueryIntervalQuery = function(seqid, input, output) { - var args = new IClientRPCService_executeGroupByQueryIntervalQuery_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.executeGroupByQueryIntervalQuery.length === 1) { - Q.fcall(this._handler.executeGroupByQueryIntervalQuery.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_executeGroupByQueryIntervalQuery_result({success: result}); - output.writeMessageBegin("executeGroupByQueryIntervalQuery", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeGroupByQueryIntervalQuery", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.executeGroupByQueryIntervalQuery(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_executeGroupByQueryIntervalQuery_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("executeGroupByQueryIntervalQuery", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeGroupByQueryIntervalQuery", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_fetchResultsV2 = function(seqid, input, output) { - var args = new IClientRPCService_fetchResultsV2_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.fetchResultsV2.length === 1) { - Q.fcall(this._handler.fetchResultsV2.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_fetchResultsV2_result({success: result}); - output.writeMessageBegin("fetchResultsV2", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("fetchResultsV2", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.fetchResultsV2(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_fetchResultsV2_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("fetchResultsV2", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("fetchResultsV2", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_openSession = function(seqid, input, output) { - var args = new IClientRPCService_openSession_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.openSession.length === 1) { - Q.fcall(this._handler.openSession.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_openSession_result({success: result}); - output.writeMessageBegin("openSession", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("openSession", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.openSession(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_openSession_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("openSession", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("openSession", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_closeSession = function(seqid, input, output) { - var args = new IClientRPCService_closeSession_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.closeSession.length === 1) { - Q.fcall(this._handler.closeSession.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_closeSession_result({success: result}); - output.writeMessageBegin("closeSession", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("closeSession", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.closeSession(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_closeSession_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("closeSession", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("closeSession", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_executeStatement = function(seqid, input, output) { - var args = new IClientRPCService_executeStatement_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.executeStatement.length === 1) { - Q.fcall(this._handler.executeStatement.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_executeStatement_result({success: result}); - output.writeMessageBegin("executeStatement", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeStatement", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.executeStatement(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_executeStatement_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("executeStatement", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeStatement", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_executeBatchStatement = function(seqid, input, output) { - var args = new IClientRPCService_executeBatchStatement_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.executeBatchStatement.length === 1) { - Q.fcall(this._handler.executeBatchStatement.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_executeBatchStatement_result({success: result}); - output.writeMessageBegin("executeBatchStatement", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeBatchStatement", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.executeBatchStatement(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_executeBatchStatement_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("executeBatchStatement", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeBatchStatement", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_executeQueryStatement = function(seqid, input, output) { - var args = new IClientRPCService_executeQueryStatement_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.executeQueryStatement.length === 1) { - Q.fcall(this._handler.executeQueryStatement.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_executeQueryStatement_result({success: result}); - output.writeMessageBegin("executeQueryStatement", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeQueryStatement", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.executeQueryStatement(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_executeQueryStatement_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("executeQueryStatement", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeQueryStatement", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_executeUpdateStatement = function(seqid, input, output) { - var args = new IClientRPCService_executeUpdateStatement_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.executeUpdateStatement.length === 1) { - Q.fcall(this._handler.executeUpdateStatement.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_executeUpdateStatement_result({success: result}); - output.writeMessageBegin("executeUpdateStatement", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeUpdateStatement", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.executeUpdateStatement(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_executeUpdateStatement_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("executeUpdateStatement", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeUpdateStatement", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_fetchResults = function(seqid, input, output) { - var args = new IClientRPCService_fetchResults_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.fetchResults.length === 1) { - Q.fcall(this._handler.fetchResults.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_fetchResults_result({success: result}); - output.writeMessageBegin("fetchResults", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("fetchResults", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.fetchResults(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_fetchResults_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("fetchResults", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("fetchResults", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_fetchMetadata = function(seqid, input, output) { - var args = new IClientRPCService_fetchMetadata_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.fetchMetadata.length === 1) { - Q.fcall(this._handler.fetchMetadata.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_fetchMetadata_result({success: result}); - output.writeMessageBegin("fetchMetadata", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("fetchMetadata", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.fetchMetadata(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_fetchMetadata_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("fetchMetadata", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("fetchMetadata", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_cancelOperation = function(seqid, input, output) { - var args = new IClientRPCService_cancelOperation_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.cancelOperation.length === 1) { - Q.fcall(this._handler.cancelOperation.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_cancelOperation_result({success: result}); - output.writeMessageBegin("cancelOperation", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("cancelOperation", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.cancelOperation(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_cancelOperation_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("cancelOperation", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("cancelOperation", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_closeOperation = function(seqid, input, output) { - var args = new IClientRPCService_closeOperation_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.closeOperation.length === 1) { - Q.fcall(this._handler.closeOperation.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_closeOperation_result({success: result}); - output.writeMessageBegin("closeOperation", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("closeOperation", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.closeOperation(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_closeOperation_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("closeOperation", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("closeOperation", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_getTimeZone = function(seqid, input, output) { - var args = new IClientRPCService_getTimeZone_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.getTimeZone.length === 1) { - Q.fcall(this._handler.getTimeZone.bind(this._handler), - args.sessionId - ).then(function(result) { - var result_obj = new IClientRPCService_getTimeZone_result({success: result}); - output.writeMessageBegin("getTimeZone", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("getTimeZone", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.getTimeZone(args.sessionId, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_getTimeZone_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("getTimeZone", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("getTimeZone", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_setTimeZone = function(seqid, input, output) { - var args = new IClientRPCService_setTimeZone_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.setTimeZone.length === 1) { - Q.fcall(this._handler.setTimeZone.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_setTimeZone_result({success: result}); - output.writeMessageBegin("setTimeZone", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("setTimeZone", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.setTimeZone(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_setTimeZone_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("setTimeZone", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("setTimeZone", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_getProperties = function(seqid, input, output) { - var args = new IClientRPCService_getProperties_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.getProperties.length === 0) { - Q.fcall(this._handler.getProperties.bind(this._handler) - ).then(function(result) { - var result_obj = new IClientRPCService_getProperties_result({success: result}); - output.writeMessageBegin("getProperties", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("getProperties", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.getProperties(function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_getProperties_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("getProperties", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("getProperties", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_setStorageGroup = function(seqid, input, output) { - var args = new IClientRPCService_setStorageGroup_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.setStorageGroup.length === 2) { - Q.fcall(this._handler.setStorageGroup.bind(this._handler), - args.sessionId, - args.storageGroup - ).then(function(result) { - var result_obj = new IClientRPCService_setStorageGroup_result({success: result}); - output.writeMessageBegin("setStorageGroup", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("setStorageGroup", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.setStorageGroup(args.sessionId, args.storageGroup, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_setStorageGroup_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("setStorageGroup", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("setStorageGroup", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_createTimeseries = function(seqid, input, output) { - var args = new IClientRPCService_createTimeseries_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.createTimeseries.length === 1) { - Q.fcall(this._handler.createTimeseries.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_createTimeseries_result({success: result}); - output.writeMessageBegin("createTimeseries", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("createTimeseries", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.createTimeseries(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_createTimeseries_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("createTimeseries", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("createTimeseries", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_createAlignedTimeseries = function(seqid, input, output) { - var args = new IClientRPCService_createAlignedTimeseries_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.createAlignedTimeseries.length === 1) { - Q.fcall(this._handler.createAlignedTimeseries.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_createAlignedTimeseries_result({success: result}); - output.writeMessageBegin("createAlignedTimeseries", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("createAlignedTimeseries", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.createAlignedTimeseries(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_createAlignedTimeseries_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("createAlignedTimeseries", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("createAlignedTimeseries", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_createMultiTimeseries = function(seqid, input, output) { - var args = new IClientRPCService_createMultiTimeseries_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.createMultiTimeseries.length === 1) { - Q.fcall(this._handler.createMultiTimeseries.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_createMultiTimeseries_result({success: result}); - output.writeMessageBegin("createMultiTimeseries", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("createMultiTimeseries", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.createMultiTimeseries(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_createMultiTimeseries_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("createMultiTimeseries", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("createMultiTimeseries", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_deleteTimeseries = function(seqid, input, output) { - var args = new IClientRPCService_deleteTimeseries_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.deleteTimeseries.length === 2) { - Q.fcall(this._handler.deleteTimeseries.bind(this._handler), - args.sessionId, - args.path - ).then(function(result) { - var result_obj = new IClientRPCService_deleteTimeseries_result({success: result}); - output.writeMessageBegin("deleteTimeseries", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("deleteTimeseries", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.deleteTimeseries(args.sessionId, args.path, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_deleteTimeseries_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("deleteTimeseries", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("deleteTimeseries", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_deleteStorageGroups = function(seqid, input, output) { - var args = new IClientRPCService_deleteStorageGroups_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.deleteStorageGroups.length === 2) { - Q.fcall(this._handler.deleteStorageGroups.bind(this._handler), - args.sessionId, - args.storageGroup - ).then(function(result) { - var result_obj = new IClientRPCService_deleteStorageGroups_result({success: result}); - output.writeMessageBegin("deleteStorageGroups", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("deleteStorageGroups", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.deleteStorageGroups(args.sessionId, args.storageGroup, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_deleteStorageGroups_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("deleteStorageGroups", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("deleteStorageGroups", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_insertRecord = function(seqid, input, output) { - var args = new IClientRPCService_insertRecord_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.insertRecord.length === 1) { - Q.fcall(this._handler.insertRecord.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_insertRecord_result({success: result}); - output.writeMessageBegin("insertRecord", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("insertRecord", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.insertRecord(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_insertRecord_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("insertRecord", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("insertRecord", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_insertStringRecord = function(seqid, input, output) { - var args = new IClientRPCService_insertStringRecord_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.insertStringRecord.length === 1) { - Q.fcall(this._handler.insertStringRecord.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_insertStringRecord_result({success: result}); - output.writeMessageBegin("insertStringRecord", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("insertStringRecord", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.insertStringRecord(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_insertStringRecord_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("insertStringRecord", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("insertStringRecord", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_insertTablet = function(seqid, input, output) { - var args = new IClientRPCService_insertTablet_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.insertTablet.length === 1) { - Q.fcall(this._handler.insertTablet.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_insertTablet_result({success: result}); - output.writeMessageBegin("insertTablet", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("insertTablet", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.insertTablet(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_insertTablet_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("insertTablet", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("insertTablet", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_insertTablets = function(seqid, input, output) { - var args = new IClientRPCService_insertTablets_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.insertTablets.length === 1) { - Q.fcall(this._handler.insertTablets.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_insertTablets_result({success: result}); - output.writeMessageBegin("insertTablets", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("insertTablets", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.insertTablets(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_insertTablets_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("insertTablets", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("insertTablets", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_insertRecords = function(seqid, input, output) { - var args = new IClientRPCService_insertRecords_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.insertRecords.length === 1) { - Q.fcall(this._handler.insertRecords.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_insertRecords_result({success: result}); - output.writeMessageBegin("insertRecords", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("insertRecords", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.insertRecords(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_insertRecords_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("insertRecords", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("insertRecords", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_insertRecordsOfOneDevice = function(seqid, input, output) { - var args = new IClientRPCService_insertRecordsOfOneDevice_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.insertRecordsOfOneDevice.length === 1) { - Q.fcall(this._handler.insertRecordsOfOneDevice.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_insertRecordsOfOneDevice_result({success: result}); - output.writeMessageBegin("insertRecordsOfOneDevice", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("insertRecordsOfOneDevice", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.insertRecordsOfOneDevice(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_insertRecordsOfOneDevice_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("insertRecordsOfOneDevice", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("insertRecordsOfOneDevice", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_insertStringRecordsOfOneDevice = function(seqid, input, output) { - var args = new IClientRPCService_insertStringRecordsOfOneDevice_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.insertStringRecordsOfOneDevice.length === 1) { - Q.fcall(this._handler.insertStringRecordsOfOneDevice.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_insertStringRecordsOfOneDevice_result({success: result}); - output.writeMessageBegin("insertStringRecordsOfOneDevice", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("insertStringRecordsOfOneDevice", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.insertStringRecordsOfOneDevice(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_insertStringRecordsOfOneDevice_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("insertStringRecordsOfOneDevice", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("insertStringRecordsOfOneDevice", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_insertStringRecords = function(seqid, input, output) { - var args = new IClientRPCService_insertStringRecords_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.insertStringRecords.length === 1) { - Q.fcall(this._handler.insertStringRecords.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_insertStringRecords_result({success: result}); - output.writeMessageBegin("insertStringRecords", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("insertStringRecords", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.insertStringRecords(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_insertStringRecords_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("insertStringRecords", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("insertStringRecords", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_testInsertTablet = function(seqid, input, output) { - var args = new IClientRPCService_testInsertTablet_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.testInsertTablet.length === 1) { - Q.fcall(this._handler.testInsertTablet.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_testInsertTablet_result({success: result}); - output.writeMessageBegin("testInsertTablet", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("testInsertTablet", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.testInsertTablet(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_testInsertTablet_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("testInsertTablet", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("testInsertTablet", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_testInsertTablets = function(seqid, input, output) { - var args = new IClientRPCService_testInsertTablets_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.testInsertTablets.length === 1) { - Q.fcall(this._handler.testInsertTablets.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_testInsertTablets_result({success: result}); - output.writeMessageBegin("testInsertTablets", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("testInsertTablets", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.testInsertTablets(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_testInsertTablets_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("testInsertTablets", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("testInsertTablets", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_testInsertRecord = function(seqid, input, output) { - var args = new IClientRPCService_testInsertRecord_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.testInsertRecord.length === 1) { - Q.fcall(this._handler.testInsertRecord.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_testInsertRecord_result({success: result}); - output.writeMessageBegin("testInsertRecord", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("testInsertRecord", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.testInsertRecord(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_testInsertRecord_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("testInsertRecord", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("testInsertRecord", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_testInsertStringRecord = function(seqid, input, output) { - var args = new IClientRPCService_testInsertStringRecord_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.testInsertStringRecord.length === 1) { - Q.fcall(this._handler.testInsertStringRecord.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_testInsertStringRecord_result({success: result}); - output.writeMessageBegin("testInsertStringRecord", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("testInsertStringRecord", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.testInsertStringRecord(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_testInsertStringRecord_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("testInsertStringRecord", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("testInsertStringRecord", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_testInsertRecords = function(seqid, input, output) { - var args = new IClientRPCService_testInsertRecords_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.testInsertRecords.length === 1) { - Q.fcall(this._handler.testInsertRecords.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_testInsertRecords_result({success: result}); - output.writeMessageBegin("testInsertRecords", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("testInsertRecords", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.testInsertRecords(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_testInsertRecords_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("testInsertRecords", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("testInsertRecords", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_testInsertRecordsOfOneDevice = function(seqid, input, output) { - var args = new IClientRPCService_testInsertRecordsOfOneDevice_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.testInsertRecordsOfOneDevice.length === 1) { - Q.fcall(this._handler.testInsertRecordsOfOneDevice.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_testInsertRecordsOfOneDevice_result({success: result}); - output.writeMessageBegin("testInsertRecordsOfOneDevice", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("testInsertRecordsOfOneDevice", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.testInsertRecordsOfOneDevice(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_testInsertRecordsOfOneDevice_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("testInsertRecordsOfOneDevice", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("testInsertRecordsOfOneDevice", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_testInsertStringRecords = function(seqid, input, output) { - var args = new IClientRPCService_testInsertStringRecords_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.testInsertStringRecords.length === 1) { - Q.fcall(this._handler.testInsertStringRecords.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_testInsertStringRecords_result({success: result}); - output.writeMessageBegin("testInsertStringRecords", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("testInsertStringRecords", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.testInsertStringRecords(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_testInsertStringRecords_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("testInsertStringRecords", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("testInsertStringRecords", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_deleteData = function(seqid, input, output) { - var args = new IClientRPCService_deleteData_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.deleteData.length === 1) { - Q.fcall(this._handler.deleteData.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_deleteData_result({success: result}); - output.writeMessageBegin("deleteData", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("deleteData", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.deleteData(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_deleteData_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("deleteData", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("deleteData", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_executeRawDataQuery = function(seqid, input, output) { - var args = new IClientRPCService_executeRawDataQuery_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.executeRawDataQuery.length === 1) { - Q.fcall(this._handler.executeRawDataQuery.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_executeRawDataQuery_result({success: result}); - output.writeMessageBegin("executeRawDataQuery", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeRawDataQuery", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.executeRawDataQuery(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_executeRawDataQuery_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("executeRawDataQuery", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeRawDataQuery", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_executeLastDataQuery = function(seqid, input, output) { - var args = new IClientRPCService_executeLastDataQuery_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.executeLastDataQuery.length === 1) { - Q.fcall(this._handler.executeLastDataQuery.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_executeLastDataQuery_result({success: result}); - output.writeMessageBegin("executeLastDataQuery", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeLastDataQuery", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.executeLastDataQuery(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_executeLastDataQuery_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("executeLastDataQuery", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeLastDataQuery", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_executeAggregationQuery = function(seqid, input, output) { - var args = new IClientRPCService_executeAggregationQuery_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.executeAggregationQuery.length === 1) { - Q.fcall(this._handler.executeAggregationQuery.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_executeAggregationQuery_result({success: result}); - output.writeMessageBegin("executeAggregationQuery", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeAggregationQuery", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.executeAggregationQuery(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_executeAggregationQuery_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("executeAggregationQuery", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeAggregationQuery", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_requestStatementId = function(seqid, input, output) { - var args = new IClientRPCService_requestStatementId_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.requestStatementId.length === 1) { - Q.fcall(this._handler.requestStatementId.bind(this._handler), - args.sessionId - ).then(function(result) { - var result_obj = new IClientRPCService_requestStatementId_result({success: result}); - output.writeMessageBegin("requestStatementId", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("requestStatementId", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.requestStatementId(args.sessionId, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_requestStatementId_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("requestStatementId", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("requestStatementId", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_createSchemaTemplate = function(seqid, input, output) { - var args = new IClientRPCService_createSchemaTemplate_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.createSchemaTemplate.length === 1) { - Q.fcall(this._handler.createSchemaTemplate.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_createSchemaTemplate_result({success: result}); - output.writeMessageBegin("createSchemaTemplate", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("createSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.createSchemaTemplate(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_createSchemaTemplate_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("createSchemaTemplate", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("createSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_appendSchemaTemplate = function(seqid, input, output) { - var args = new IClientRPCService_appendSchemaTemplate_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.appendSchemaTemplate.length === 1) { - Q.fcall(this._handler.appendSchemaTemplate.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_appendSchemaTemplate_result({success: result}); - output.writeMessageBegin("appendSchemaTemplate", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("appendSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.appendSchemaTemplate(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_appendSchemaTemplate_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("appendSchemaTemplate", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("appendSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_pruneSchemaTemplate = function(seqid, input, output) { - var args = new IClientRPCService_pruneSchemaTemplate_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.pruneSchemaTemplate.length === 1) { - Q.fcall(this._handler.pruneSchemaTemplate.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_pruneSchemaTemplate_result({success: result}); - output.writeMessageBegin("pruneSchemaTemplate", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("pruneSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.pruneSchemaTemplate(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_pruneSchemaTemplate_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("pruneSchemaTemplate", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("pruneSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_querySchemaTemplate = function(seqid, input, output) { - var args = new IClientRPCService_querySchemaTemplate_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.querySchemaTemplate.length === 1) { - Q.fcall(this._handler.querySchemaTemplate.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_querySchemaTemplate_result({success: result}); - output.writeMessageBegin("querySchemaTemplate", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("querySchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.querySchemaTemplate(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_querySchemaTemplate_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("querySchemaTemplate", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("querySchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_showConfigurationTemplate = function(seqid, input, output) { - var args = new IClientRPCService_showConfigurationTemplate_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.showConfigurationTemplate.length === 0) { - Q.fcall(this._handler.showConfigurationTemplate.bind(this._handler) - ).then(function(result) { - var result_obj = new IClientRPCService_showConfigurationTemplate_result({success: result}); - output.writeMessageBegin("showConfigurationTemplate", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("showConfigurationTemplate", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.showConfigurationTemplate(function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_showConfigurationTemplate_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("showConfigurationTemplate", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("showConfigurationTemplate", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_showConfiguration = function(seqid, input, output) { - var args = new IClientRPCService_showConfiguration_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.showConfiguration.length === 1) { - Q.fcall(this._handler.showConfiguration.bind(this._handler), - args.nodeId - ).then(function(result) { - var result_obj = new IClientRPCService_showConfiguration_result({success: result}); - output.writeMessageBegin("showConfiguration", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("showConfiguration", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.showConfiguration(args.nodeId, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_showConfiguration_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("showConfiguration", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("showConfiguration", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_setSchemaTemplate = function(seqid, input, output) { - var args = new IClientRPCService_setSchemaTemplate_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.setSchemaTemplate.length === 1) { - Q.fcall(this._handler.setSchemaTemplate.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_setSchemaTemplate_result({success: result}); - output.writeMessageBegin("setSchemaTemplate", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("setSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.setSchemaTemplate(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_setSchemaTemplate_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("setSchemaTemplate", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("setSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } -}; -IClientRPCServiceProcessor.prototype.process_unsetSchemaTemplate = function(seqid, input, output) { - var args = new IClientRPCService_unsetSchemaTemplate_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.unsetSchemaTemplate.length === 1) { - Q.fcall(this._handler.unsetSchemaTemplate.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_unsetSchemaTemplate_result({success: result}); - output.writeMessageBegin("unsetSchemaTemplate", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("unsetSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.unsetSchemaTemplate(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_unsetSchemaTemplate_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("unsetSchemaTemplate", Thrift.MessageType.REPLY, seqid); +IClientRPCServiceClient.prototype.requestStatementId = function(sessionId, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("unsetSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + _defer.resolve(result); } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); + }; + this.send_requestStatementId(sessionId); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_requestStatementId(sessionId); } }; -IClientRPCServiceProcessor.prototype.process_dropSchemaTemplate = function(seqid, input, output) { - var args = new IClientRPCService_dropSchemaTemplate_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.dropSchemaTemplate.length === 1) { - Q.fcall(this._handler.dropSchemaTemplate.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_dropSchemaTemplate_result({success: result}); - output.writeMessageBegin("dropSchemaTemplate", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("dropSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.dropSchemaTemplate(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_dropSchemaTemplate_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("dropSchemaTemplate", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("dropSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); + +IClientRPCServiceClient.prototype.send_requestStatementId = function(sessionId) { + var output = new this.pClass(this.output); + var params = { + sessionId: sessionId + }; + var args = new IClientRPCService_requestStatementId_args(params); + try { + output.writeMessageBegin('requestStatementId', Thrift.MessageType.CALL, this.seqid()); + args[Symbol.for("write")](output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; } }; -IClientRPCServiceProcessor.prototype.process_createTimeseriesUsingSchemaTemplate = function(seqid, input, output) { - var args = new IClientRPCService_createTimeseriesUsingSchemaTemplate_args(); - args.read(input); + +IClientRPCServiceClient.prototype.recv_requestStatementId = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x[Symbol.for("read")](input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_requestStatementId_result(); + result[Symbol.for("read")](input); input.readMessageEnd(); - if (this._handler.createTimeseriesUsingSchemaTemplate.length === 1) { - Q.fcall(this._handler.createTimeseriesUsingSchemaTemplate.bind(this._handler), - args.req - ).then(function(result) { - var result_obj = new IClientRPCService_createTimeseriesUsingSchemaTemplate_result({success: result}); - output.writeMessageBegin("createTimeseriesUsingSchemaTemplate", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("createTimeseriesUsingSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.createTimeseriesUsingSchemaTemplate(args.req, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_createTimeseriesUsingSchemaTemplate_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("createTimeseriesUsingSchemaTemplate", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("createTimeseriesUsingSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); + + if (null !== result.success) { + return callback(null, result.success); } + return callback('requestStatementId failed: unknown result'); }; -IClientRPCServiceProcessor.prototype.process_handshake = function(seqid, input, output) { - var args = new IClientRPCService_handshake_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.handshake.length === 1) { - Q.fcall(this._handler.handshake.bind(this._handler), - args.info - ).then(function(result) { - var result_obj = new IClientRPCService_handshake_result({success: result}); - output.writeMessageBegin("handshake", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("handshake", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.handshake(args.info, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_handshake_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("handshake", Thrift.MessageType.REPLY, seqid); + +IClientRPCServiceClient.prototype.insertRecord = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("handshake", Thrift.MessageType.EXCEPTION, seqid); + _defer.resolve(result); } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); + }; + this.send_insertRecord(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_insertRecord(req); } }; -IClientRPCServiceProcessor.prototype.process_sendPipeData = function(seqid, input, output) { - var args = new IClientRPCService_sendPipeData_args(); - args.read(input); - input.readMessageEnd(); - if (this._handler.sendPipeData.length === 1) { - Q.fcall(this._handler.sendPipeData.bind(this._handler), - args.buff - ).then(function(result) { - var result_obj = new IClientRPCService_sendPipeData_result({success: result}); - output.writeMessageBegin("sendPipeData", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("sendPipeData", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); - } else { - this._handler.sendPipeData(args.buff, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_sendPipeData_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("sendPipeData", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("sendPipeData", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); + +IClientRPCServiceClient.prototype.send_insertRecord = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_insertRecord_args(params); + try { + output.writeMessageBegin('insertRecord', Thrift.MessageType.CALL, this.seqid()); + args[Symbol.for("write")](output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; } }; -IClientRPCServiceProcessor.prototype.process_sendFile = function(seqid, input, output) { - var args = new IClientRPCService_sendFile_args(); - args.read(input); + +IClientRPCServiceClient.prototype.recv_insertRecord = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x[Symbol.for("read")](input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_insertRecord_result(); + result[Symbol.for("read")](input); input.readMessageEnd(); - if (this._handler.sendFile.length === 2) { - Q.fcall(this._handler.sendFile.bind(this._handler), - args.metaInfo, - args.buff - ).then(function(result) { - var result_obj = new IClientRPCService_sendFile_result({success: result}); - output.writeMessageBegin("sendFile", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }).catch(function (err) { - var result; - result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("sendFile", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); - output.writeMessageEnd(); - output.flush(); - }); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('insertRecord failed: unknown result'); +}; +var IClientRPCServiceProcessor = exports.Processor = function(handler) { + this._handler = handler; +}; +IClientRPCServiceProcessor.prototype.process = function(input, output) { + var r = input.readMessageBegin(); + if (this['process_' + r.fname]) { + return this['process_' + r.fname].call(this, r.rseqid, input, output); } else { - this._handler.sendFile(args.metaInfo, args.buff, function (err, result) { - var result_obj; - if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_sendFile_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("sendFile", Thrift.MessageType.REPLY, seqid); - } else { - result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("sendFile", Thrift.MessageType.EXCEPTION, seqid); - } - result_obj.write(output); - output.writeMessageEnd(); - output.flush(); - }); + input.skip(Thrift.Type.STRUCT); + input.readMessageEnd(); + var x = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN_METHOD, 'Unknown function ' + r.fname); + output.writeMessageBegin(r.fname, Thrift.MessageType.EXCEPTION, r.rseqid); + x[Symbol.for("write")](output); + output.writeMessageEnd(); + output.flush(); } }; -IClientRPCServiceProcessor.prototype.process_pipeTransfer = function(seqid, input, output) { - var args = new IClientRPCService_pipeTransfer_args(); - args.read(input); +IClientRPCServiceProcessor.prototype.process_openSession = function(seqid, input, output) { + var args = new IClientRPCService_openSession_args(); + args[Symbol.for("read")](input); input.readMessageEnd(); - if (this._handler.pipeTransfer.length === 1) { - Q.fcall(this._handler.pipeTransfer.bind(this._handler), + if (this._handler.openSession.length === 1) { + Q.fcall(this._handler.openSession.bind(this._handler), args.req ).then(function(result) { - var result_obj = new IClientRPCService_pipeTransfer_result({success: result}); - output.writeMessageBegin("pipeTransfer", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); + var result_obj = new IClientRPCService_openSession_result({success: result}); + output.writeMessageBegin("openSession", Thrift.MessageType.REPLY, seqid); + result_obj[Symbol.for("write")](output); output.writeMessageEnd(); output.flush(); }).catch(function (err) { var result; result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("pipeTransfer", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); + output.writeMessageBegin("openSession", Thrift.MessageType.EXCEPTION, seqid); + result[Symbol.for("write")](output); output.writeMessageEnd(); output.flush(); }); } else { - this._handler.pipeTransfer(args.req, function (err, result) { + this._handler.openSession(args.req, function (err, result) { var result_obj; if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_pipeTransfer_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("pipeTransfer", Thrift.MessageType.REPLY, seqid); + result_obj = new IClientRPCService_openSession_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("openSession", Thrift.MessageType.REPLY, seqid); } else { result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("pipeTransfer", Thrift.MessageType.EXCEPTION, seqid); + output.writeMessageBegin("openSession", Thrift.MessageType.EXCEPTION, seqid); } - result_obj.write(output); + result_obj[Symbol.for("write")](output); output.writeMessageEnd(); output.flush(); }); } }; -IClientRPCServiceProcessor.prototype.process_pipeSubscribe = function(seqid, input, output) { - var args = new IClientRPCService_pipeSubscribe_args(); - args.read(input); +IClientRPCServiceProcessor.prototype.process_closeSession = function(seqid, input, output) { + var args = new IClientRPCService_closeSession_args(); + args[Symbol.for("read")](input); input.readMessageEnd(); - if (this._handler.pipeSubscribe.length === 1) { - Q.fcall(this._handler.pipeSubscribe.bind(this._handler), + if (this._handler.closeSession.length === 1) { + Q.fcall(this._handler.closeSession.bind(this._handler), args.req ).then(function(result) { - var result_obj = new IClientRPCService_pipeSubscribe_result({success: result}); - output.writeMessageBegin("pipeSubscribe", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); + var result_obj = new IClientRPCService_closeSession_result({success: result}); + output.writeMessageBegin("closeSession", Thrift.MessageType.REPLY, seqid); + result_obj[Symbol.for("write")](output); output.writeMessageEnd(); output.flush(); }).catch(function (err) { var result; result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("pipeSubscribe", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); + output.writeMessageBegin("closeSession", Thrift.MessageType.EXCEPTION, seqid); + result[Symbol.for("write")](output); output.writeMessageEnd(); output.flush(); }); } else { - this._handler.pipeSubscribe(args.req, function (err, result) { + this._handler.closeSession(args.req, function (err, result) { var result_obj; if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_pipeSubscribe_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("pipeSubscribe", Thrift.MessageType.REPLY, seqid); + result_obj = new IClientRPCService_closeSession_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("closeSession", Thrift.MessageType.REPLY, seqid); } else { result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("pipeSubscribe", Thrift.MessageType.EXCEPTION, seqid); + output.writeMessageBegin("closeSession", Thrift.MessageType.EXCEPTION, seqid); } - result_obj.write(output); + result_obj[Symbol.for("write")](output); output.writeMessageEnd(); output.flush(); }); } }; -IClientRPCServiceProcessor.prototype.process_getBackupConfiguration = function(seqid, input, output) { - var args = new IClientRPCService_getBackupConfiguration_args(); - args.read(input); +IClientRPCServiceProcessor.prototype.process_executeQueryStatement = function(seqid, input, output) { + var args = new IClientRPCService_executeQueryStatement_args(); + args[Symbol.for("read")](input); input.readMessageEnd(); - if (this._handler.getBackupConfiguration.length === 0) { - Q.fcall(this._handler.getBackupConfiguration.bind(this._handler) + if (this._handler.executeQueryStatement.length === 1) { + Q.fcall(this._handler.executeQueryStatement.bind(this._handler), + args.req ).then(function(result) { - var result_obj = new IClientRPCService_getBackupConfiguration_result({success: result}); - output.writeMessageBegin("getBackupConfiguration", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); + var result_obj = new IClientRPCService_executeQueryStatement_result({success: result}); + output.writeMessageBegin("executeQueryStatement", Thrift.MessageType.REPLY, seqid); + result_obj[Symbol.for("write")](output); output.writeMessageEnd(); output.flush(); }).catch(function (err) { var result; result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("getBackupConfiguration", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); + output.writeMessageBegin("executeQueryStatement", Thrift.MessageType.EXCEPTION, seqid); + result[Symbol.for("write")](output); output.writeMessageEnd(); output.flush(); }); } else { - this._handler.getBackupConfiguration(function (err, result) { + this._handler.executeQueryStatement(args.req, function (err, result) { var result_obj; if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_getBackupConfiguration_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("getBackupConfiguration", Thrift.MessageType.REPLY, seqid); + result_obj = new IClientRPCService_executeQueryStatement_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeQueryStatement", Thrift.MessageType.REPLY, seqid); } else { result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("getBackupConfiguration", Thrift.MessageType.EXCEPTION, seqid); + output.writeMessageBegin("executeQueryStatement", Thrift.MessageType.EXCEPTION, seqid); } - result_obj.write(output); + result_obj[Symbol.for("write")](output); output.writeMessageEnd(); output.flush(); }); } }; -IClientRPCServiceProcessor.prototype.process_fetchAllConnectionsInfo = function(seqid, input, output) { - var args = new IClientRPCService_fetchAllConnectionsInfo_args(); - args.read(input); +IClientRPCServiceProcessor.prototype.process_requestStatementId = function(seqid, input, output) { + var args = new IClientRPCService_requestStatementId_args(); + args[Symbol.for("read")](input); input.readMessageEnd(); - if (this._handler.fetchAllConnectionsInfo.length === 0) { - Q.fcall(this._handler.fetchAllConnectionsInfo.bind(this._handler) + if (this._handler.requestStatementId.length === 1) { + Q.fcall(this._handler.requestStatementId.bind(this._handler), + args.sessionId ).then(function(result) { - var result_obj = new IClientRPCService_fetchAllConnectionsInfo_result({success: result}); - output.writeMessageBegin("fetchAllConnectionsInfo", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); + var result_obj = new IClientRPCService_requestStatementId_result({success: result}); + output.writeMessageBegin("requestStatementId", Thrift.MessageType.REPLY, seqid); + result_obj[Symbol.for("write")](output); output.writeMessageEnd(); output.flush(); }).catch(function (err) { var result; result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("fetchAllConnectionsInfo", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); + output.writeMessageBegin("requestStatementId", Thrift.MessageType.EXCEPTION, seqid); + result[Symbol.for("write")](output); output.writeMessageEnd(); output.flush(); }); } else { - this._handler.fetchAllConnectionsInfo(function (err, result) { + this._handler.requestStatementId(args.sessionId, function (err, result) { var result_obj; if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_fetchAllConnectionsInfo_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("fetchAllConnectionsInfo", Thrift.MessageType.REPLY, seqid); + result_obj = new IClientRPCService_requestStatementId_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("requestStatementId", Thrift.MessageType.REPLY, seqid); } else { result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("fetchAllConnectionsInfo", Thrift.MessageType.EXCEPTION, seqid); + output.writeMessageBegin("requestStatementId", Thrift.MessageType.EXCEPTION, seqid); } - result_obj.write(output); + result_obj[Symbol.for("write")](output); output.writeMessageEnd(); output.flush(); }); } }; -IClientRPCServiceProcessor.prototype.process_testConnectionEmptyRPC = function(seqid, input, output) { - var args = new IClientRPCService_testConnectionEmptyRPC_args(); - args.read(input); +IClientRPCServiceProcessor.prototype.process_insertRecord = function(seqid, input, output) { + var args = new IClientRPCService_insertRecord_args(); + args[Symbol.for("read")](input); input.readMessageEnd(); - if (this._handler.testConnectionEmptyRPC.length === 0) { - Q.fcall(this._handler.testConnectionEmptyRPC.bind(this._handler) + if (this._handler.insertRecord.length === 1) { + Q.fcall(this._handler.insertRecord.bind(this._handler), + args.req ).then(function(result) { - var result_obj = new IClientRPCService_testConnectionEmptyRPC_result({success: result}); - output.writeMessageBegin("testConnectionEmptyRPC", Thrift.MessageType.REPLY, seqid); - result_obj.write(output); + var result_obj = new IClientRPCService_insertRecord_result({success: result}); + output.writeMessageBegin("insertRecord", Thrift.MessageType.REPLY, seqid); + result_obj[Symbol.for("write")](output); output.writeMessageEnd(); output.flush(); }).catch(function (err) { var result; result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("testConnectionEmptyRPC", Thrift.MessageType.EXCEPTION, seqid); - result.write(output); + output.writeMessageBegin("insertRecord", Thrift.MessageType.EXCEPTION, seqid); + result[Symbol.for("write")](output); output.writeMessageEnd(); output.flush(); }); } else { - this._handler.testConnectionEmptyRPC(function (err, result) { + this._handler.insertRecord(args.req, function (err, result) { var result_obj; if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_testConnectionEmptyRPC_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("testConnectionEmptyRPC", Thrift.MessageType.REPLY, seqid); + result_obj = new IClientRPCService_insertRecord_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("insertRecord", Thrift.MessageType.REPLY, seqid); } else { result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("testConnectionEmptyRPC", Thrift.MessageType.EXCEPTION, seqid); + output.writeMessageBegin("insertRecord", Thrift.MessageType.EXCEPTION, seqid); } - result_obj.write(output); + result_obj[Symbol.for("write")](output); output.writeMessageEnd(); output.flush(); }); diff --git a/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService.thrift b/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService.thrift new file mode 100644 index 0000000..aa087f5 --- /dev/null +++ b/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService.thrift @@ -0,0 +1,65 @@ +namespace js IClientRPCService +namespace java IClientRPCService + +enum TSProtocolVersion { + IOTDB_SERVICE_PROTOCOL_V1 = 1, + IOTDB_SERVICE_PROTOCOL_V2 = 2, + IOTDB_SERVICE_PROTOCOL_V3 = 3 +} + +struct TSOpenSessionReq { + 1: optional string username + 2: optional string password + 3: optional i32 client_protocol + 4: optional string zoneId + 5: optional map configuration +} + +struct TSCloseSessionReq { + 1: required i64 sessionId +} + +struct TSExecuteStatementReq { + 1: required i64 sessionId + 2: required string statement + 3: required i64 statementId + 4: required i32 fetchSize + 5: optional i32 timeout +} + +struct TSInsertRecordReq { + 1: required i64 sessionId + 2: required string prefixPath + 3: required list measurements + 4: required binary values + 5: required i64 timestamp + 6: optional bool isAligned +} + +struct TSOpenSessionResp { + 1: required i64 sessionId + 2: required i32 serverProtocolVersion +} + +struct TSExecuteStatementResp { + 1: optional list columns + 2: optional list dataTypeList + 3: optional map columnNameIndexMap + 4: optional i64 queryId + 5: optional QueryDataSet queryDataSet + 6: optional bool ignoreTimeStamp +} + +struct QueryDataSet { + 1: required list valueList + 2: required list bitmapList + 3: required binary time +} + +service IClientRPCService { + TSOpenSessionResp openSession(1: TSOpenSessionReq req) + void closeSession(1: TSCloseSessionReq req) + TSExecuteStatementResp executeQueryStatement(1: TSExecuteStatementReq req) + i64 requestStatementId(1: i64 sessionId) + i32 insertRecord(1: TSInsertRecordReq req) +} diff --git a/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService_types.d.ts b/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService_types.d.ts new file mode 100644 index 0000000..4cb465b --- /dev/null +++ b/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService_types.d.ts @@ -0,0 +1,110 @@ +interface Int64 { + constructor(o?: number | string): this; + toString(): string; + toJson(): string; +} + +export enum TSProtocolVersion { + IOTDB_SERVICE_PROTOCOL_V1 = 1, + IOTDB_SERVICE_PROTOCOL_V2 = 2, + IOTDB_SERVICE_PROTOCOL_V3 = 3, +} + +export class TSOpenSessionReq { + username?: string; + password?: string; + client_protocol?: number; + zoneId?: string; + configuration?: Map; + + constructor(arg?: { + username?: string; + password?: string; + client_protocol?: number; + zoneId?: string; + configuration?: Map; + }) +} + +export class TSCloseSessionReq { + sessionId: Int64; + + constructor(arg?: { + sessionId: Int64; + }) +} + +export class TSExecuteStatementReq { + sessionId: Int64; + statement: string; + statementId: Int64; + fetchSize: number; + timeout?: number; + + constructor(arg?: { + sessionId: Int64; + statement: string; + statementId: Int64; + fetchSize: number; + timeout?: number; + }) +} + +export class TSInsertRecordReq { + sessionId: Int64; + prefixPath: string; + measurements: string[]; + values: Buffer; + timestamp: Int64; + isAligned?: boolean; + + constructor(arg?: { + sessionId: Int64; + prefixPath: string; + measurements: string[]; + values: Buffer; + timestamp: Int64; + isAligned?: boolean; + }) +} + +export class TSOpenSessionResp { + sessionId: Int64; + serverProtocolVersion: number; + + constructor(arg?: { + sessionId: Int64; + serverProtocolVersion: number; + }) +} + +export class TSExecuteStatementResp { + columns?: string[]; + dataTypeList?: number[]; + columnNameIndexMap?: Map; + queryId?: Int64; + queryDataSet?: QueryDataSet; + ignoreTimeStamp?: boolean; + + constructor(arg?: { + columns?: string[]; + dataTypeList?: number[]; + columnNameIndexMap?: Map; + queryId?: Int64; + queryDataSet?: QueryDataSet; + ignoreTimeStamp?: boolean; + }) +} + +export class QueryDataSet { + valueList: Buffer[]; + bitmapList: Buffer[]; + time: Buffer; + + constructor(arg?: { + valueList: Buffer[]; + bitmapList: Buffer[]; + time: Buffer; + }) +} + diff --git a/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService_types.js b/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService_types.js new file mode 100644 index 0000000..1e491d3 --- /dev/null +++ b/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService_types.js @@ -0,0 +1,829 @@ +// +// Autogenerated by Thrift Compiler (0.22.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 Int64 = require('node-int64'); + + +var ttypes = module.exports = {}; +ttypes.TSProtocolVersion = { + 'IOTDB_SERVICE_PROTOCOL_V1' : 1, + 'IOTDB_SERVICE_PROTOCOL_V2' : 2, + 'IOTDB_SERVICE_PROTOCOL_V3' : 3 +}; +var TSOpenSessionReq = module.exports.TSOpenSessionReq = function(args) { + this.username = null; + this.password = null; + this.client_protocol = null; + this.zoneId = null; + this.configuration = null; + if (args) { + if (args.username !== undefined && args.username !== null) { + this.username = args.username; + } + if (args.password !== undefined && args.password !== null) { + this.password = args.password; + } + if (args.client_protocol !== undefined && args.client_protocol !== null) { + this.client_protocol = args.client_protocol; + } + if (args.zoneId !== undefined && args.zoneId !== null) { + this.zoneId = args.zoneId; + } + if (args.configuration !== undefined && args.configuration !== null) { + this.configuration = Thrift.copyMap(args.configuration, [null]); + } + } +}; +TSOpenSessionReq.prototype = {}; +TSOpenSessionReq.prototype[Symbol.for("read")] = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.username = input.readString(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.password = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I32) { + this.client_protocol = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRING) { + this.zoneId = input.readString(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.MAP) { + this.configuration = {}; + var _rtmp31 = input.readMapBegin(); + var _size0 = _rtmp31.size || 0; + for (var _i2 = 0; _i2 < _size0; ++_i2) { + var key3 = null; + var val4 = null; + key3 = input.readString(); + val4 = input.readString(); + this.configuration[key3] = val4; + } + input.readMapEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSOpenSessionReq.prototype[Symbol.for("write")] = function(output) { + output.writeStructBegin('TSOpenSessionReq'); + if (this.username !== null && this.username !== undefined) { + output.writeFieldBegin('username', Thrift.Type.STRING, 1); + output.writeString(this.username); + output.writeFieldEnd(); + } + if (this.password !== null && this.password !== undefined) { + output.writeFieldBegin('password', Thrift.Type.STRING, 2); + output.writeString(this.password); + output.writeFieldEnd(); + } + if (this.client_protocol !== null && this.client_protocol !== undefined) { + output.writeFieldBegin('client_protocol', Thrift.Type.I32, 3); + output.writeI32(this.client_protocol); + output.writeFieldEnd(); + } + if (this.zoneId !== null && this.zoneId !== undefined) { + output.writeFieldBegin('zoneId', Thrift.Type.STRING, 4); + output.writeString(this.zoneId); + output.writeFieldEnd(); + } + if (this.configuration !== null && this.configuration !== undefined) { + output.writeFieldBegin('configuration', Thrift.Type.MAP, 5); + output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.configuration)); + for (var kiter5 in this.configuration) { + if (this.configuration.hasOwnProperty(kiter5)) { + var viter6 = this.configuration[kiter5]; + output.writeString(kiter5); + output.writeString(viter6); + } + } + output.writeMapEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSCloseSessionReq = module.exports.TSCloseSessionReq = function(args) { + this.sessionId = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + } +}; +TSCloseSessionReq.prototype = {}; +TSCloseSessionReq.prototype[Symbol.for("read")] = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSCloseSessionReq.prototype[Symbol.for("write")] = function(output) { + output.writeStructBegin('TSCloseSessionReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSExecuteStatementReq = module.exports.TSExecuteStatementReq = function(args) { + this.sessionId = null; + this.statement = null; + this.statementId = null; + this.fetchSize = null; + this.timeout = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.statement !== undefined && args.statement !== null) { + this.statement = args.statement; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statement is unset!'); + } + if (args.statementId !== undefined && args.statementId !== null) { + this.statementId = args.statementId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statementId is unset!'); + } + if (args.fetchSize !== undefined && args.fetchSize !== null) { + this.fetchSize = args.fetchSize; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field fetchSize is unset!'); + } + if (args.timeout !== undefined && args.timeout !== null) { + this.timeout = args.timeout; + } + } +}; +TSExecuteStatementReq.prototype = {}; +TSExecuteStatementReq.prototype[Symbol.for("read")] = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.statement = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I64) { + this.statementId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.I32) { + this.fetchSize = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I32) { + this.timeout = input.readI32(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSExecuteStatementReq.prototype[Symbol.for("write")] = function(output) { + output.writeStructBegin('TSExecuteStatementReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.statement !== null && this.statement !== undefined) { + output.writeFieldBegin('statement', Thrift.Type.STRING, 2); + output.writeString(this.statement); + output.writeFieldEnd(); + } + if (this.statementId !== null && this.statementId !== undefined) { + output.writeFieldBegin('statementId', Thrift.Type.I64, 3); + output.writeI64(this.statementId); + output.writeFieldEnd(); + } + if (this.fetchSize !== null && this.fetchSize !== undefined) { + output.writeFieldBegin('fetchSize', Thrift.Type.I32, 4); + output.writeI32(this.fetchSize); + output.writeFieldEnd(); + } + if (this.timeout !== null && this.timeout !== undefined) { + output.writeFieldBegin('timeout', Thrift.Type.I32, 5); + output.writeI32(this.timeout); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSInsertRecordReq = module.exports.TSInsertRecordReq = function(args) { + this.sessionId = null; + this.prefixPath = null; + this.measurements = null; + this.values = null; + this.timestamp = null; + this.isAligned = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.prefixPath !== undefined && args.prefixPath !== null) { + this.prefixPath = args.prefixPath; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPath is unset!'); + } + if (args.measurements !== undefined && args.measurements !== null) { + this.measurements = Thrift.copyList(args.measurements, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurements is unset!'); + } + if (args.values !== undefined && args.values !== null) { + this.values = args.values; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field values is unset!'); + } + if (args.timestamp !== undefined && args.timestamp !== null) { + this.timestamp = args.timestamp; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestamp is unset!'); + } + if (args.isAligned !== undefined && args.isAligned !== null) { + this.isAligned = args.isAligned; + } + } +}; +TSInsertRecordReq.prototype = {}; +TSInsertRecordReq.prototype[Symbol.for("read")] = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.prefixPath = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.measurements = []; + var _rtmp38 = input.readListBegin(); + var _size7 = _rtmp38.size || 0; + for (var _i9 = 0; _i9 < _size7; ++_i9) { + var elem10 = null; + elem10 = input.readString(); + this.measurements.push(elem10); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRING) { + this.values = input.readBinary(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I64) { + this.timestamp = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.BOOL) { + this.isAligned = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSInsertRecordReq.prototype[Symbol.for("write")] = function(output) { + output.writeStructBegin('TSInsertRecordReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.prefixPath !== null && this.prefixPath !== undefined) { + output.writeFieldBegin('prefixPath', Thrift.Type.STRING, 2); + output.writeString(this.prefixPath); + output.writeFieldEnd(); + } + if (this.measurements !== null && this.measurements !== undefined) { + output.writeFieldBegin('measurements', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.STRING, this.measurements.length); + for (var iter11 in this.measurements) { + if (this.measurements.hasOwnProperty(iter11)) { + iter11 = this.measurements[iter11]; + output.writeString(iter11); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.values !== null && this.values !== undefined) { + output.writeFieldBegin('values', Thrift.Type.STRING, 4); + output.writeBinary(this.values); + output.writeFieldEnd(); + } + if (this.timestamp !== null && this.timestamp !== undefined) { + output.writeFieldBegin('timestamp', Thrift.Type.I64, 5); + output.writeI64(this.timestamp); + output.writeFieldEnd(); + } + if (this.isAligned !== null && this.isAligned !== undefined) { + output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 6); + output.writeBool(this.isAligned); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSOpenSessionResp = module.exports.TSOpenSessionResp = function(args) { + this.sessionId = null; + this.serverProtocolVersion = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.serverProtocolVersion !== undefined && args.serverProtocolVersion !== null) { + this.serverProtocolVersion = args.serverProtocolVersion; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field serverProtocolVersion is unset!'); + } + } +}; +TSOpenSessionResp.prototype = {}; +TSOpenSessionResp.prototype[Symbol.for("read")] = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I32) { + this.serverProtocolVersion = input.readI32(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSOpenSessionResp.prototype[Symbol.for("write")] = function(output) { + output.writeStructBegin('TSOpenSessionResp'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.serverProtocolVersion !== null && this.serverProtocolVersion !== undefined) { + output.writeFieldBegin('serverProtocolVersion', Thrift.Type.I32, 2); + output.writeI32(this.serverProtocolVersion); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSExecuteStatementResp = module.exports.TSExecuteStatementResp = function(args) { + this.columns = null; + this.dataTypeList = null; + this.columnNameIndexMap = null; + this.queryId = null; + this.queryDataSet = null; + this.ignoreTimeStamp = null; + if (args) { + if (args.columns !== undefined && args.columns !== null) { + this.columns = Thrift.copyList(args.columns, [null]); + } + if (args.dataTypeList !== undefined && args.dataTypeList !== null) { + this.dataTypeList = Thrift.copyList(args.dataTypeList, [null]); + } + if (args.columnNameIndexMap !== undefined && args.columnNameIndexMap !== null) { + this.columnNameIndexMap = Thrift.copyMap(args.columnNameIndexMap, [null]); + } + if (args.queryId !== undefined && args.queryId !== null) { + this.queryId = args.queryId; + } + if (args.queryDataSet !== undefined && args.queryDataSet !== null) { + this.queryDataSet = new ttypes.QueryDataSet(args.queryDataSet); + } + if (args.ignoreTimeStamp !== undefined && args.ignoreTimeStamp !== null) { + this.ignoreTimeStamp = args.ignoreTimeStamp; + } + } +}; +TSExecuteStatementResp.prototype = {}; +TSExecuteStatementResp.prototype[Symbol.for("read")] = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.LIST) { + this.columns = []; + var _rtmp313 = input.readListBegin(); + var _size12 = _rtmp313.size || 0; + for (var _i14 = 0; _i14 < _size12; ++_i14) { + var elem15 = null; + elem15 = input.readString(); + this.columns.push(elem15); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.dataTypeList = []; + var _rtmp317 = input.readListBegin(); + var _size16 = _rtmp317.size || 0; + for (var _i18 = 0; _i18 < _size16; ++_i18) { + var elem19 = null; + elem19 = input.readI32(); + this.dataTypeList.push(elem19); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.MAP) { + this.columnNameIndexMap = {}; + var _rtmp321 = input.readMapBegin(); + var _size20 = _rtmp321.size || 0; + for (var _i22 = 0; _i22 < _size20; ++_i22) { + var key23 = null; + var val24 = null; + key23 = input.readString(); + val24 = input.readI32(); + this.columnNameIndexMap[key23] = val24; + } + input.readMapEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.I64) { + this.queryId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.STRUCT) { + this.queryDataSet = new ttypes.QueryDataSet(); + this.queryDataSet[Symbol.for("read")](input); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.BOOL) { + this.ignoreTimeStamp = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSExecuteStatementResp.prototype[Symbol.for("write")] = function(output) { + output.writeStructBegin('TSExecuteStatementResp'); + if (this.columns !== null && this.columns !== undefined) { + output.writeFieldBegin('columns', Thrift.Type.LIST, 1); + output.writeListBegin(Thrift.Type.STRING, this.columns.length); + for (var iter25 in this.columns) { + if (this.columns.hasOwnProperty(iter25)) { + iter25 = this.columns[iter25]; + output.writeString(iter25); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.dataTypeList !== null && this.dataTypeList !== undefined) { + output.writeFieldBegin('dataTypeList', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.I32, this.dataTypeList.length); + for (var iter26 in this.dataTypeList) { + if (this.dataTypeList.hasOwnProperty(iter26)) { + iter26 = this.dataTypeList[iter26]; + output.writeI32(iter26); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.columnNameIndexMap !== null && this.columnNameIndexMap !== undefined) { + output.writeFieldBegin('columnNameIndexMap', Thrift.Type.MAP, 3); + output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.I32, Thrift.objectLength(this.columnNameIndexMap)); + for (var kiter27 in this.columnNameIndexMap) { + if (this.columnNameIndexMap.hasOwnProperty(kiter27)) { + var viter28 = this.columnNameIndexMap[kiter27]; + output.writeString(kiter27); + output.writeI32(viter28); + } + } + output.writeMapEnd(); + output.writeFieldEnd(); + } + if (this.queryId !== null && this.queryId !== undefined) { + output.writeFieldBegin('queryId', Thrift.Type.I64, 4); + output.writeI64(this.queryId); + output.writeFieldEnd(); + } + if (this.queryDataSet !== null && this.queryDataSet !== undefined) { + output.writeFieldBegin('queryDataSet', Thrift.Type.STRUCT, 5); + this.queryDataSet[Symbol.for("write")](output); + output.writeFieldEnd(); + } + if (this.ignoreTimeStamp !== null && this.ignoreTimeStamp !== undefined) { + output.writeFieldBegin('ignoreTimeStamp', Thrift.Type.BOOL, 6); + output.writeBool(this.ignoreTimeStamp); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var QueryDataSet = module.exports.QueryDataSet = function(args) { + this.valueList = null; + this.bitmapList = null; + this.time = null; + if (args) { + if (args.valueList !== undefined && args.valueList !== null) { + this.valueList = Thrift.copyList(args.valueList, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field valueList is unset!'); + } + if (args.bitmapList !== undefined && args.bitmapList !== null) { + this.bitmapList = Thrift.copyList(args.bitmapList, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field bitmapList is unset!'); + } + if (args.time !== undefined && args.time !== null) { + this.time = args.time; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field time is unset!'); + } + } +}; +QueryDataSet.prototype = {}; +QueryDataSet.prototype[Symbol.for("read")] = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.LIST) { + this.valueList = []; + var _rtmp330 = input.readListBegin(); + var _size29 = _rtmp330.size || 0; + for (var _i31 = 0; _i31 < _size29; ++_i31) { + var elem32 = null; + elem32 = input.readBinary(); + this.valueList.push(elem32); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.bitmapList = []; + var _rtmp334 = input.readListBegin(); + var _size33 = _rtmp334.size || 0; + for (var _i35 = 0; _i35 < _size33; ++_i35) { + var elem36 = null; + elem36 = input.readBinary(); + this.bitmapList.push(elem36); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.time = input.readBinary(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +QueryDataSet.prototype[Symbol.for("write")] = function(output) { + output.writeStructBegin('QueryDataSet'); + if (this.valueList !== null && this.valueList !== undefined) { + output.writeFieldBegin('valueList', Thrift.Type.LIST, 1); + output.writeListBegin(Thrift.Type.STRING, this.valueList.length); + for (var iter37 in this.valueList) { + if (this.valueList.hasOwnProperty(iter37)) { + iter37 = this.valueList[iter37]; + output.writeBinary(iter37); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.bitmapList !== null && this.bitmapList !== undefined) { + output.writeFieldBegin('bitmapList', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.bitmapList.length); + for (var iter38 in this.bitmapList) { + if (this.bitmapList.hasOwnProperty(iter38)) { + iter38 = this.bitmapList[iter38]; + output.writeBinary(iter38); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.time !== null && this.time !== undefined) { + output.writeFieldBegin('time', Thrift.Type.STRING, 3); + output.writeBinary(this.time); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + diff --git a/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/client_types.js b/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/client_types.js deleted file mode 100644 index 018aec1..0000000 --- a/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/client_types.js +++ /dev/null @@ -1,7961 +0,0 @@ -// -// Autogenerated by Thrift Compiler (0.14.1) -// -// 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 Int64 = require('node-int64'); - -var common_ttypes = require('./common_types'); - - -var ttypes = module.exports = {}; -ttypes.TSProtocolVersion = { - 'IOTDB_SERVICE_PROTOCOL_V1' : 0, - 'IOTDB_SERVICE_PROTOCOL_V2' : 1, - 'IOTDB_SERVICE_PROTOCOL_V3' : 2 -}; -ttypes.TSConnectionType = { - 'THRIFT_BASED' : 0, - 'MQTT_BASED' : 1, - 'INTERNAL' : 2, - 'REST_BASED' : 3 -}; -var TSQueryDataSet = module.exports.TSQueryDataSet = function(args) { - this.time = null; - this.valueList = null; - this.bitmapList = null; - if (args) { - if (args.time !== undefined && args.time !== null) { - this.time = args.time; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field time is unset!'); - } - if (args.valueList !== undefined && args.valueList !== null) { - this.valueList = Thrift.copyList(args.valueList, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field valueList is unset!'); - } - if (args.bitmapList !== undefined && args.bitmapList !== null) { - this.bitmapList = Thrift.copyList(args.bitmapList, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field bitmapList is unset!'); - } - } -}; -TSQueryDataSet.prototype = {}; -TSQueryDataSet.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRING) { - this.time = input.readBinary(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.LIST) { - this.valueList = []; - var _rtmp31 = input.readListBegin(); - var _size0 = _rtmp31.size || 0; - for (var _i2 = 0; _i2 < _size0; ++_i2) { - var elem3 = null; - elem3 = input.readBinary(); - this.valueList.push(elem3); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.LIST) { - this.bitmapList = []; - var _rtmp35 = input.readListBegin(); - var _size4 = _rtmp35.size || 0; - for (var _i6 = 0; _i6 < _size4; ++_i6) { - var elem7 = null; - elem7 = input.readBinary(); - this.bitmapList.push(elem7); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSQueryDataSet.prototype.write = function(output) { - output.writeStructBegin('TSQueryDataSet'); - if (this.time !== null && this.time !== undefined) { - output.writeFieldBegin('time', Thrift.Type.STRING, 1); - output.writeBinary(this.time); - output.writeFieldEnd(); - } - if (this.valueList !== null && this.valueList !== undefined) { - output.writeFieldBegin('valueList', Thrift.Type.LIST, 2); - output.writeListBegin(Thrift.Type.STRING, this.valueList.length); - for (var iter8 in this.valueList) { - if (this.valueList.hasOwnProperty(iter8)) { - iter8 = this.valueList[iter8]; - output.writeBinary(iter8); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.bitmapList !== null && this.bitmapList !== undefined) { - output.writeFieldBegin('bitmapList', Thrift.Type.LIST, 3); - output.writeListBegin(Thrift.Type.STRING, this.bitmapList.length); - for (var iter9 in this.bitmapList) { - if (this.bitmapList.hasOwnProperty(iter9)) { - iter9 = this.bitmapList[iter9]; - output.writeBinary(iter9); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSQueryNonAlignDataSet = module.exports.TSQueryNonAlignDataSet = function(args) { - this.timeList = null; - this.valueList = null; - if (args) { - if (args.timeList !== undefined && args.timeList !== null) { - this.timeList = Thrift.copyList(args.timeList, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timeList is unset!'); - } - if (args.valueList !== undefined && args.valueList !== null) { - this.valueList = Thrift.copyList(args.valueList, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field valueList is unset!'); - } - } -}; -TSQueryNonAlignDataSet.prototype = {}; -TSQueryNonAlignDataSet.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.LIST) { - this.timeList = []; - var _rtmp311 = input.readListBegin(); - var _size10 = _rtmp311.size || 0; - for (var _i12 = 0; _i12 < _size10; ++_i12) { - var elem13 = null; - elem13 = input.readBinary(); - this.timeList.push(elem13); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.LIST) { - this.valueList = []; - var _rtmp315 = input.readListBegin(); - var _size14 = _rtmp315.size || 0; - for (var _i16 = 0; _i16 < _size14; ++_i16) { - var elem17 = null; - elem17 = input.readBinary(); - this.valueList.push(elem17); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSQueryNonAlignDataSet.prototype.write = function(output) { - output.writeStructBegin('TSQueryNonAlignDataSet'); - if (this.timeList !== null && this.timeList !== undefined) { - output.writeFieldBegin('timeList', Thrift.Type.LIST, 1); - output.writeListBegin(Thrift.Type.STRING, this.timeList.length); - for (var iter18 in this.timeList) { - if (this.timeList.hasOwnProperty(iter18)) { - iter18 = this.timeList[iter18]; - output.writeBinary(iter18); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.valueList !== null && this.valueList !== undefined) { - output.writeFieldBegin('valueList', Thrift.Type.LIST, 2); - output.writeListBegin(Thrift.Type.STRING, this.valueList.length); - for (var iter19 in this.valueList) { - if (this.valueList.hasOwnProperty(iter19)) { - iter19 = this.valueList[iter19]; - output.writeBinary(iter19); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSTracingInfo = module.exports.TSTracingInfo = function(args) { - this.activityList = null; - this.elapsedTimeList = null; - this.seriesPathNum = null; - this.seqFileNum = null; - this.unSeqFileNum = null; - this.sequenceChunkNum = null; - this.sequenceChunkPointNum = null; - this.unsequenceChunkNum = null; - this.unsequenceChunkPointNum = null; - this.totalPageNum = null; - this.overlappedPageNum = null; - if (args) { - if (args.activityList !== undefined && args.activityList !== null) { - this.activityList = Thrift.copyList(args.activityList, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field activityList is unset!'); - } - if (args.elapsedTimeList !== undefined && args.elapsedTimeList !== null) { - this.elapsedTimeList = Thrift.copyList(args.elapsedTimeList, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field elapsedTimeList is unset!'); - } - if (args.seriesPathNum !== undefined && args.seriesPathNum !== null) { - this.seriesPathNum = args.seriesPathNum; - } - if (args.seqFileNum !== undefined && args.seqFileNum !== null) { - this.seqFileNum = args.seqFileNum; - } - if (args.unSeqFileNum !== undefined && args.unSeqFileNum !== null) { - this.unSeqFileNum = args.unSeqFileNum; - } - if (args.sequenceChunkNum !== undefined && args.sequenceChunkNum !== null) { - this.sequenceChunkNum = args.sequenceChunkNum; - } - if (args.sequenceChunkPointNum !== undefined && args.sequenceChunkPointNum !== null) { - this.sequenceChunkPointNum = args.sequenceChunkPointNum; - } - if (args.unsequenceChunkNum !== undefined && args.unsequenceChunkNum !== null) { - this.unsequenceChunkNum = args.unsequenceChunkNum; - } - if (args.unsequenceChunkPointNum !== undefined && args.unsequenceChunkPointNum !== null) { - this.unsequenceChunkPointNum = args.unsequenceChunkPointNum; - } - if (args.totalPageNum !== undefined && args.totalPageNum !== null) { - this.totalPageNum = args.totalPageNum; - } - if (args.overlappedPageNum !== undefined && args.overlappedPageNum !== null) { - this.overlappedPageNum = args.overlappedPageNum; - } - } -}; -TSTracingInfo.prototype = {}; -TSTracingInfo.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.LIST) { - this.activityList = []; - var _rtmp321 = input.readListBegin(); - var _size20 = _rtmp321.size || 0; - for (var _i22 = 0; _i22 < _size20; ++_i22) { - var elem23 = null; - elem23 = input.readString(); - this.activityList.push(elem23); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.LIST) { - this.elapsedTimeList = []; - var _rtmp325 = input.readListBegin(); - var _size24 = _rtmp325.size || 0; - for (var _i26 = 0; _i26 < _size24; ++_i26) { - var elem27 = null; - elem27 = input.readI64(); - this.elapsedTimeList.push(elem27); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.I32) { - this.seriesPathNum = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.I32) { - this.seqFileNum = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.I32) { - this.unSeqFileNum = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.I32) { - this.sequenceChunkNum = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 7: - if (ftype == Thrift.Type.I64) { - this.sequenceChunkPointNum = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 8: - if (ftype == Thrift.Type.I32) { - this.unsequenceChunkNum = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 9: - if (ftype == Thrift.Type.I64) { - this.unsequenceChunkPointNum = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 10: - if (ftype == Thrift.Type.I32) { - this.totalPageNum = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 11: - if (ftype == Thrift.Type.I32) { - this.overlappedPageNum = input.readI32(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSTracingInfo.prototype.write = function(output) { - output.writeStructBegin('TSTracingInfo'); - if (this.activityList !== null && this.activityList !== undefined) { - output.writeFieldBegin('activityList', Thrift.Type.LIST, 1); - output.writeListBegin(Thrift.Type.STRING, this.activityList.length); - for (var iter28 in this.activityList) { - if (this.activityList.hasOwnProperty(iter28)) { - iter28 = this.activityList[iter28]; - output.writeString(iter28); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.elapsedTimeList !== null && this.elapsedTimeList !== undefined) { - output.writeFieldBegin('elapsedTimeList', Thrift.Type.LIST, 2); - output.writeListBegin(Thrift.Type.I64, this.elapsedTimeList.length); - for (var iter29 in this.elapsedTimeList) { - if (this.elapsedTimeList.hasOwnProperty(iter29)) { - iter29 = this.elapsedTimeList[iter29]; - output.writeI64(iter29); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.seriesPathNum !== null && this.seriesPathNum !== undefined) { - output.writeFieldBegin('seriesPathNum', Thrift.Type.I32, 3); - output.writeI32(this.seriesPathNum); - output.writeFieldEnd(); - } - if (this.seqFileNum !== null && this.seqFileNum !== undefined) { - output.writeFieldBegin('seqFileNum', Thrift.Type.I32, 4); - output.writeI32(this.seqFileNum); - output.writeFieldEnd(); - } - if (this.unSeqFileNum !== null && this.unSeqFileNum !== undefined) { - output.writeFieldBegin('unSeqFileNum', Thrift.Type.I32, 5); - output.writeI32(this.unSeqFileNum); - output.writeFieldEnd(); - } - if (this.sequenceChunkNum !== null && this.sequenceChunkNum !== undefined) { - output.writeFieldBegin('sequenceChunkNum', Thrift.Type.I32, 6); - output.writeI32(this.sequenceChunkNum); - output.writeFieldEnd(); - } - if (this.sequenceChunkPointNum !== null && this.sequenceChunkPointNum !== undefined) { - output.writeFieldBegin('sequenceChunkPointNum', Thrift.Type.I64, 7); - output.writeI64(this.sequenceChunkPointNum); - output.writeFieldEnd(); - } - if (this.unsequenceChunkNum !== null && this.unsequenceChunkNum !== undefined) { - output.writeFieldBegin('unsequenceChunkNum', Thrift.Type.I32, 8); - output.writeI32(this.unsequenceChunkNum); - output.writeFieldEnd(); - } - if (this.unsequenceChunkPointNum !== null && this.unsequenceChunkPointNum !== undefined) { - output.writeFieldBegin('unsequenceChunkPointNum', Thrift.Type.I64, 9); - output.writeI64(this.unsequenceChunkPointNum); - output.writeFieldEnd(); - } - if (this.totalPageNum !== null && this.totalPageNum !== undefined) { - output.writeFieldBegin('totalPageNum', Thrift.Type.I32, 10); - output.writeI32(this.totalPageNum); - output.writeFieldEnd(); - } - if (this.overlappedPageNum !== null && this.overlappedPageNum !== undefined) { - output.writeFieldBegin('overlappedPageNum', Thrift.Type.I32, 11); - output.writeI32(this.overlappedPageNum); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSExecuteStatementResp = module.exports.TSExecuteStatementResp = function(args) { - this.status = null; - this.queryId = null; - this.columns = null; - this.operationType = null; - this.ignoreTimeStamp = null; - this.dataTypeList = null; - this.queryDataSet = null; - this.nonAlignQueryDataSet = null; - this.columnNameIndexMap = null; - this.sgColumns = null; - this.aliasColumns = null; - this.tracingInfo = null; - this.queryResult = null; - this.moreData = null; - if (args) { - if (args.status !== undefined && args.status !== null) { - this.status = new common_ttypes.TSStatus(args.status); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); - } - if (args.queryId !== undefined && args.queryId !== null) { - this.queryId = args.queryId; - } - if (args.columns !== undefined && args.columns !== null) { - this.columns = Thrift.copyList(args.columns, [null]); - } - if (args.operationType !== undefined && args.operationType !== null) { - this.operationType = args.operationType; - } - if (args.ignoreTimeStamp !== undefined && args.ignoreTimeStamp !== null) { - this.ignoreTimeStamp = args.ignoreTimeStamp; - } - if (args.dataTypeList !== undefined && args.dataTypeList !== null) { - this.dataTypeList = Thrift.copyList(args.dataTypeList, [null]); - } - if (args.queryDataSet !== undefined && args.queryDataSet !== null) { - this.queryDataSet = new ttypes.TSQueryDataSet(args.queryDataSet); - } - if (args.nonAlignQueryDataSet !== undefined && args.nonAlignQueryDataSet !== null) { - this.nonAlignQueryDataSet = new ttypes.TSQueryNonAlignDataSet(args.nonAlignQueryDataSet); - } - if (args.columnNameIndexMap !== undefined && args.columnNameIndexMap !== null) { - this.columnNameIndexMap = Thrift.copyMap(args.columnNameIndexMap, [null]); - } - if (args.sgColumns !== undefined && args.sgColumns !== null) { - this.sgColumns = Thrift.copyList(args.sgColumns, [null]); - } - if (args.aliasColumns !== undefined && args.aliasColumns !== null) { - this.aliasColumns = Thrift.copyList(args.aliasColumns, [null]); - } - if (args.tracingInfo !== undefined && args.tracingInfo !== null) { - this.tracingInfo = new ttypes.TSTracingInfo(args.tracingInfo); - } - if (args.queryResult !== undefined && args.queryResult !== null) { - this.queryResult = Thrift.copyList(args.queryResult, [null]); - } - if (args.moreData !== undefined && args.moreData !== null) { - this.moreData = args.moreData; - } - } -}; -TSExecuteStatementResp.prototype = {}; -TSExecuteStatementResp.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.status = new common_ttypes.TSStatus(); - this.status.read(input); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.I64) { - this.queryId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.LIST) { - this.columns = []; - var _rtmp331 = input.readListBegin(); - var _size30 = _rtmp331.size || 0; - for (var _i32 = 0; _i32 < _size30; ++_i32) { - var elem33 = null; - elem33 = input.readString(); - this.columns.push(elem33); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.STRING) { - this.operationType = input.readString(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.BOOL) { - this.ignoreTimeStamp = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.LIST) { - this.dataTypeList = []; - var _rtmp335 = input.readListBegin(); - var _size34 = _rtmp335.size || 0; - for (var _i36 = 0; _i36 < _size34; ++_i36) { - var elem37 = null; - elem37 = input.readString(); - this.dataTypeList.push(elem37); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 7: - if (ftype == Thrift.Type.STRUCT) { - this.queryDataSet = new ttypes.TSQueryDataSet(); - this.queryDataSet.read(input); - } else { - input.skip(ftype); - } - break; - case 8: - if (ftype == Thrift.Type.STRUCT) { - this.nonAlignQueryDataSet = new ttypes.TSQueryNonAlignDataSet(); - this.nonAlignQueryDataSet.read(input); - } else { - input.skip(ftype); - } - break; - case 9: - if (ftype == Thrift.Type.MAP) { - this.columnNameIndexMap = {}; - var _rtmp339 = input.readMapBegin(); - var _size38 = _rtmp339.size || 0; - for (var _i40 = 0; _i40 < _size38; ++_i40) { - var key41 = null; - var val42 = null; - key41 = input.readString(); - val42 = input.readI32(); - this.columnNameIndexMap[key41] = val42; - } - input.readMapEnd(); - } else { - input.skip(ftype); - } - break; - case 10: - if (ftype == Thrift.Type.LIST) { - this.sgColumns = []; - var _rtmp344 = input.readListBegin(); - var _size43 = _rtmp344.size || 0; - for (var _i45 = 0; _i45 < _size43; ++_i45) { - var elem46 = null; - elem46 = input.readString(); - this.sgColumns.push(elem46); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 11: - if (ftype == Thrift.Type.LIST) { - this.aliasColumns = []; - var _rtmp348 = input.readListBegin(); - var _size47 = _rtmp348.size || 0; - for (var _i49 = 0; _i49 < _size47; ++_i49) { - var elem50 = null; - elem50 = input.readByte(); - this.aliasColumns.push(elem50); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 12: - if (ftype == Thrift.Type.STRUCT) { - this.tracingInfo = new ttypes.TSTracingInfo(); - this.tracingInfo.read(input); - } else { - input.skip(ftype); - } - break; - case 13: - if (ftype == Thrift.Type.LIST) { - this.queryResult = []; - var _rtmp352 = input.readListBegin(); - var _size51 = _rtmp352.size || 0; - for (var _i53 = 0; _i53 < _size51; ++_i53) { - var elem54 = null; - elem54 = input.readBinary(); - this.queryResult.push(elem54); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 14: - if (ftype == Thrift.Type.BOOL) { - this.moreData = input.readBool(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSExecuteStatementResp.prototype.write = function(output) { - output.writeStructBegin('TSExecuteStatementResp'); - if (this.status !== null && this.status !== undefined) { - output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); - this.status.write(output); - output.writeFieldEnd(); - } - if (this.queryId !== null && this.queryId !== undefined) { - output.writeFieldBegin('queryId', Thrift.Type.I64, 2); - output.writeI64(this.queryId); - output.writeFieldEnd(); - } - if (this.columns !== null && this.columns !== undefined) { - output.writeFieldBegin('columns', Thrift.Type.LIST, 3); - output.writeListBegin(Thrift.Type.STRING, this.columns.length); - for (var iter55 in this.columns) { - if (this.columns.hasOwnProperty(iter55)) { - iter55 = this.columns[iter55]; - output.writeString(iter55); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.operationType !== null && this.operationType !== undefined) { - output.writeFieldBegin('operationType', Thrift.Type.STRING, 4); - output.writeString(this.operationType); - output.writeFieldEnd(); - } - if (this.ignoreTimeStamp !== null && this.ignoreTimeStamp !== undefined) { - output.writeFieldBegin('ignoreTimeStamp', Thrift.Type.BOOL, 5); - output.writeBool(this.ignoreTimeStamp); - output.writeFieldEnd(); - } - if (this.dataTypeList !== null && this.dataTypeList !== undefined) { - output.writeFieldBegin('dataTypeList', Thrift.Type.LIST, 6); - output.writeListBegin(Thrift.Type.STRING, this.dataTypeList.length); - for (var iter56 in this.dataTypeList) { - if (this.dataTypeList.hasOwnProperty(iter56)) { - iter56 = this.dataTypeList[iter56]; - output.writeString(iter56); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.queryDataSet !== null && this.queryDataSet !== undefined) { - output.writeFieldBegin('queryDataSet', Thrift.Type.STRUCT, 7); - this.queryDataSet.write(output); - output.writeFieldEnd(); - } - if (this.nonAlignQueryDataSet !== null && this.nonAlignQueryDataSet !== undefined) { - output.writeFieldBegin('nonAlignQueryDataSet', Thrift.Type.STRUCT, 8); - this.nonAlignQueryDataSet.write(output); - output.writeFieldEnd(); - } - if (this.columnNameIndexMap !== null && this.columnNameIndexMap !== undefined) { - output.writeFieldBegin('columnNameIndexMap', Thrift.Type.MAP, 9); - output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.I32, Thrift.objectLength(this.columnNameIndexMap)); - for (var kiter57 in this.columnNameIndexMap) { - if (this.columnNameIndexMap.hasOwnProperty(kiter57)) { - var viter58 = this.columnNameIndexMap[kiter57]; - output.writeString(kiter57); - output.writeI32(viter58); - } - } - output.writeMapEnd(); - output.writeFieldEnd(); - } - if (this.sgColumns !== null && this.sgColumns !== undefined) { - output.writeFieldBegin('sgColumns', Thrift.Type.LIST, 10); - output.writeListBegin(Thrift.Type.STRING, this.sgColumns.length); - for (var iter59 in this.sgColumns) { - if (this.sgColumns.hasOwnProperty(iter59)) { - iter59 = this.sgColumns[iter59]; - output.writeString(iter59); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.aliasColumns !== null && this.aliasColumns !== undefined) { - output.writeFieldBegin('aliasColumns', Thrift.Type.LIST, 11); - output.writeListBegin(Thrift.Type.BYTE, this.aliasColumns.length); - for (var iter60 in this.aliasColumns) { - if (this.aliasColumns.hasOwnProperty(iter60)) { - iter60 = this.aliasColumns[iter60]; - output.writeByte(iter60); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.tracingInfo !== null && this.tracingInfo !== undefined) { - output.writeFieldBegin('tracingInfo', Thrift.Type.STRUCT, 12); - this.tracingInfo.write(output); - output.writeFieldEnd(); - } - if (this.queryResult !== null && this.queryResult !== undefined) { - output.writeFieldBegin('queryResult', Thrift.Type.LIST, 13); - output.writeListBegin(Thrift.Type.STRING, this.queryResult.length); - for (var iter61 in this.queryResult) { - if (this.queryResult.hasOwnProperty(iter61)) { - iter61 = this.queryResult[iter61]; - output.writeBinary(iter61); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.moreData !== null && this.moreData !== undefined) { - output.writeFieldBegin('moreData', Thrift.Type.BOOL, 14); - output.writeBool(this.moreData); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSOpenSessionResp = module.exports.TSOpenSessionResp = function(args) { - this.status = null; - this.serverProtocolVersion = 0; - this.sessionId = null; - this.configuration = null; - if (args) { - if (args.status !== undefined && args.status !== null) { - this.status = new common_ttypes.TSStatus(args.status); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); - } - if (args.serverProtocolVersion !== undefined && args.serverProtocolVersion !== null) { - this.serverProtocolVersion = args.serverProtocolVersion; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field serverProtocolVersion is unset!'); - } - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } - if (args.configuration !== undefined && args.configuration !== null) { - this.configuration = Thrift.copyMap(args.configuration, [null]); - } - } -}; -TSOpenSessionResp.prototype = {}; -TSOpenSessionResp.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.status = new common_ttypes.TSStatus(); - this.status.read(input); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.I32) { - this.serverProtocolVersion = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.MAP) { - this.configuration = {}; - var _rtmp363 = input.readMapBegin(); - var _size62 = _rtmp363.size || 0; - for (var _i64 = 0; _i64 < _size62; ++_i64) { - var key65 = null; - var val66 = null; - key65 = input.readString(); - val66 = input.readString(); - this.configuration[key65] = val66; - } - input.readMapEnd(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSOpenSessionResp.prototype.write = function(output) { - output.writeStructBegin('TSOpenSessionResp'); - if (this.status !== null && this.status !== undefined) { - output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); - this.status.write(output); - output.writeFieldEnd(); - } - if (this.serverProtocolVersion !== null && this.serverProtocolVersion !== undefined) { - output.writeFieldBegin('serverProtocolVersion', Thrift.Type.I32, 2); - output.writeI32(this.serverProtocolVersion); - output.writeFieldEnd(); - } - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 3); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.configuration !== null && this.configuration !== undefined) { - output.writeFieldBegin('configuration', Thrift.Type.MAP, 4); - output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.configuration)); - for (var kiter67 in this.configuration) { - if (this.configuration.hasOwnProperty(kiter67)) { - var viter68 = this.configuration[kiter67]; - output.writeString(kiter67); - output.writeString(viter68); - } - } - output.writeMapEnd(); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSOpenSessionReq = module.exports.TSOpenSessionReq = function(args) { - this.client_protocol = 2; - this.zoneId = null; - this.username = null; - this.password = null; - this.configuration = null; - if (args) { - if (args.client_protocol !== undefined && args.client_protocol !== null) { - this.client_protocol = args.client_protocol; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field client_protocol is unset!'); - } - if (args.zoneId !== undefined && args.zoneId !== null) { - this.zoneId = args.zoneId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field zoneId is unset!'); - } - if (args.username !== undefined && args.username !== null) { - this.username = args.username; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field username is unset!'); - } - if (args.password !== undefined && args.password !== null) { - this.password = args.password; - } - if (args.configuration !== undefined && args.configuration !== null) { - this.configuration = Thrift.copyMap(args.configuration, [null]); - } - } -}; -TSOpenSessionReq.prototype = {}; -TSOpenSessionReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I32) { - this.client_protocol = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.zoneId = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.STRING) { - this.username = input.readString(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.STRING) { - this.password = input.readString(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.MAP) { - this.configuration = {}; - var _rtmp370 = input.readMapBegin(); - var _size69 = _rtmp370.size || 0; - for (var _i71 = 0; _i71 < _size69; ++_i71) { - var key72 = null; - var val73 = null; - key72 = input.readString(); - val73 = input.readString(); - this.configuration[key72] = val73; - } - input.readMapEnd(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSOpenSessionReq.prototype.write = function(output) { - output.writeStructBegin('TSOpenSessionReq'); - if (this.client_protocol !== null && this.client_protocol !== undefined) { - output.writeFieldBegin('client_protocol', Thrift.Type.I32, 1); - output.writeI32(this.client_protocol); - output.writeFieldEnd(); - } - if (this.zoneId !== null && this.zoneId !== undefined) { - output.writeFieldBegin('zoneId', Thrift.Type.STRING, 2); - output.writeString(this.zoneId); - output.writeFieldEnd(); - } - if (this.username !== null && this.username !== undefined) { - output.writeFieldBegin('username', Thrift.Type.STRING, 3); - output.writeString(this.username); - output.writeFieldEnd(); - } - if (this.password !== null && this.password !== undefined) { - output.writeFieldBegin('password', Thrift.Type.STRING, 4); - output.writeString(this.password); - output.writeFieldEnd(); - } - if (this.configuration !== null && this.configuration !== undefined) { - output.writeFieldBegin('configuration', Thrift.Type.MAP, 5); - output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.configuration)); - for (var kiter74 in this.configuration) { - if (this.configuration.hasOwnProperty(kiter74)) { - var viter75 = this.configuration[kiter74]; - output.writeString(kiter74); - output.writeString(viter75); - } - } - output.writeMapEnd(); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSCloseSessionReq = module.exports.TSCloseSessionReq = function(args) { - this.sessionId = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - } -}; -TSCloseSessionReq.prototype = {}; -TSCloseSessionReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSCloseSessionReq.prototype.write = function(output) { - output.writeStructBegin('TSCloseSessionReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSExecuteStatementReq = module.exports.TSExecuteStatementReq = function(args) { - this.sessionId = null; - this.statement = null; - this.statementId = null; - this.fetchSize = null; - this.timeout = null; - this.enableRedirectQuery = null; - this.jdbcQuery = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.statement !== undefined && args.statement !== null) { - this.statement = args.statement; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statement is unset!'); - } - if (args.statementId !== undefined && args.statementId !== null) { - this.statementId = args.statementId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statementId is unset!'); - } - if (args.fetchSize !== undefined && args.fetchSize !== null) { - this.fetchSize = args.fetchSize; - } - if (args.timeout !== undefined && args.timeout !== null) { - this.timeout = args.timeout; - } - if (args.enableRedirectQuery !== undefined && args.enableRedirectQuery !== null) { - this.enableRedirectQuery = args.enableRedirectQuery; - } - if (args.jdbcQuery !== undefined && args.jdbcQuery !== null) { - this.jdbcQuery = args.jdbcQuery; - } - } -}; -TSExecuteStatementReq.prototype = {}; -TSExecuteStatementReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.statement = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.I64) { - this.statementId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.I32) { - this.fetchSize = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.I64) { - this.timeout = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.BOOL) { - this.enableRedirectQuery = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 7: - if (ftype == Thrift.Type.BOOL) { - this.jdbcQuery = input.readBool(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSExecuteStatementReq.prototype.write = function(output) { - output.writeStructBegin('TSExecuteStatementReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.statement !== null && this.statement !== undefined) { - output.writeFieldBegin('statement', Thrift.Type.STRING, 2); - output.writeString(this.statement); - output.writeFieldEnd(); - } - if (this.statementId !== null && this.statementId !== undefined) { - output.writeFieldBegin('statementId', Thrift.Type.I64, 3); - output.writeI64(this.statementId); - output.writeFieldEnd(); - } - if (this.fetchSize !== null && this.fetchSize !== undefined) { - output.writeFieldBegin('fetchSize', Thrift.Type.I32, 4); - output.writeI32(this.fetchSize); - output.writeFieldEnd(); - } - if (this.timeout !== null && this.timeout !== undefined) { - output.writeFieldBegin('timeout', Thrift.Type.I64, 5); - output.writeI64(this.timeout); - output.writeFieldEnd(); - } - if (this.enableRedirectQuery !== null && this.enableRedirectQuery !== undefined) { - output.writeFieldBegin('enableRedirectQuery', Thrift.Type.BOOL, 6); - output.writeBool(this.enableRedirectQuery); - output.writeFieldEnd(); - } - if (this.jdbcQuery !== null && this.jdbcQuery !== undefined) { - output.writeFieldBegin('jdbcQuery', Thrift.Type.BOOL, 7); - output.writeBool(this.jdbcQuery); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSExecuteBatchStatementReq = module.exports.TSExecuteBatchStatementReq = function(args) { - this.sessionId = null; - this.statements = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.statements !== undefined && args.statements !== null) { - this.statements = Thrift.copyList(args.statements, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statements is unset!'); - } - } -}; -TSExecuteBatchStatementReq.prototype = {}; -TSExecuteBatchStatementReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.LIST) { - this.statements = []; - var _rtmp377 = input.readListBegin(); - var _size76 = _rtmp377.size || 0; - for (var _i78 = 0; _i78 < _size76; ++_i78) { - var elem79 = null; - elem79 = input.readString(); - this.statements.push(elem79); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSExecuteBatchStatementReq.prototype.write = function(output) { - output.writeStructBegin('TSExecuteBatchStatementReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.statements !== null && this.statements !== undefined) { - output.writeFieldBegin('statements', Thrift.Type.LIST, 2); - output.writeListBegin(Thrift.Type.STRING, this.statements.length); - for (var iter80 in this.statements) { - if (this.statements.hasOwnProperty(iter80)) { - iter80 = this.statements[iter80]; - output.writeString(iter80); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSGetOperationStatusReq = module.exports.TSGetOperationStatusReq = function(args) { - this.sessionId = null; - this.queryId = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.queryId !== undefined && args.queryId !== null) { - this.queryId = args.queryId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field queryId is unset!'); - } - } -}; -TSGetOperationStatusReq.prototype = {}; -TSGetOperationStatusReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.I64) { - this.queryId = input.readI64(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSGetOperationStatusReq.prototype.write = function(output) { - output.writeStructBegin('TSGetOperationStatusReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.queryId !== null && this.queryId !== undefined) { - output.writeFieldBegin('queryId', Thrift.Type.I64, 2); - output.writeI64(this.queryId); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSCancelOperationReq = module.exports.TSCancelOperationReq = function(args) { - this.sessionId = null; - this.queryId = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.queryId !== undefined && args.queryId !== null) { - this.queryId = args.queryId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field queryId is unset!'); - } - } -}; -TSCancelOperationReq.prototype = {}; -TSCancelOperationReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.I64) { - this.queryId = input.readI64(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSCancelOperationReq.prototype.write = function(output) { - output.writeStructBegin('TSCancelOperationReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.queryId !== null && this.queryId !== undefined) { - output.writeFieldBegin('queryId', Thrift.Type.I64, 2); - output.writeI64(this.queryId); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSCloseOperationReq = module.exports.TSCloseOperationReq = function(args) { - this.sessionId = null; - this.queryId = null; - this.statementId = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.queryId !== undefined && args.queryId !== null) { - this.queryId = args.queryId; - } - if (args.statementId !== undefined && args.statementId !== null) { - this.statementId = args.statementId; - } - } -}; -TSCloseOperationReq.prototype = {}; -TSCloseOperationReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.I64) { - this.queryId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.I64) { - this.statementId = input.readI64(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSCloseOperationReq.prototype.write = function(output) { - output.writeStructBegin('TSCloseOperationReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.queryId !== null && this.queryId !== undefined) { - output.writeFieldBegin('queryId', Thrift.Type.I64, 2); - output.writeI64(this.queryId); - output.writeFieldEnd(); - } - if (this.statementId !== null && this.statementId !== undefined) { - output.writeFieldBegin('statementId', Thrift.Type.I64, 3); - output.writeI64(this.statementId); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSFetchResultsReq = module.exports.TSFetchResultsReq = function(args) { - this.sessionId = null; - this.statement = null; - this.fetchSize = null; - this.queryId = null; - this.isAlign = null; - this.timeout = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.statement !== undefined && args.statement !== null) { - this.statement = args.statement; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statement is unset!'); - } - if (args.fetchSize !== undefined && args.fetchSize !== null) { - this.fetchSize = args.fetchSize; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field fetchSize is unset!'); - } - if (args.queryId !== undefined && args.queryId !== null) { - this.queryId = args.queryId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field queryId is unset!'); - } - if (args.isAlign !== undefined && args.isAlign !== null) { - this.isAlign = args.isAlign; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field isAlign is unset!'); - } - if (args.timeout !== undefined && args.timeout !== null) { - this.timeout = args.timeout; - } - } -}; -TSFetchResultsReq.prototype = {}; -TSFetchResultsReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.statement = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.I32) { - this.fetchSize = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.I64) { - this.queryId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.BOOL) { - this.isAlign = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.I64) { - this.timeout = input.readI64(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSFetchResultsReq.prototype.write = function(output) { - output.writeStructBegin('TSFetchResultsReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.statement !== null && this.statement !== undefined) { - output.writeFieldBegin('statement', Thrift.Type.STRING, 2); - output.writeString(this.statement); - output.writeFieldEnd(); - } - if (this.fetchSize !== null && this.fetchSize !== undefined) { - output.writeFieldBegin('fetchSize', Thrift.Type.I32, 3); - output.writeI32(this.fetchSize); - output.writeFieldEnd(); - } - if (this.queryId !== null && this.queryId !== undefined) { - output.writeFieldBegin('queryId', Thrift.Type.I64, 4); - output.writeI64(this.queryId); - output.writeFieldEnd(); - } - if (this.isAlign !== null && this.isAlign !== undefined) { - output.writeFieldBegin('isAlign', Thrift.Type.BOOL, 5); - output.writeBool(this.isAlign); - output.writeFieldEnd(); - } - if (this.timeout !== null && this.timeout !== undefined) { - output.writeFieldBegin('timeout', Thrift.Type.I64, 6); - output.writeI64(this.timeout); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSFetchResultsResp = module.exports.TSFetchResultsResp = function(args) { - this.status = null; - this.hasResultSet = null; - this.isAlign = null; - this.queryDataSet = null; - this.nonAlignQueryDataSet = null; - this.queryResult = null; - this.moreData = null; - if (args) { - if (args.status !== undefined && args.status !== null) { - this.status = new common_ttypes.TSStatus(args.status); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); - } - if (args.hasResultSet !== undefined && args.hasResultSet !== null) { - this.hasResultSet = args.hasResultSet; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field hasResultSet is unset!'); - } - if (args.isAlign !== undefined && args.isAlign !== null) { - this.isAlign = args.isAlign; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field isAlign is unset!'); - } - if (args.queryDataSet !== undefined && args.queryDataSet !== null) { - this.queryDataSet = new ttypes.TSQueryDataSet(args.queryDataSet); - } - if (args.nonAlignQueryDataSet !== undefined && args.nonAlignQueryDataSet !== null) { - this.nonAlignQueryDataSet = new ttypes.TSQueryNonAlignDataSet(args.nonAlignQueryDataSet); - } - if (args.queryResult !== undefined && args.queryResult !== null) { - this.queryResult = Thrift.copyList(args.queryResult, [null]); - } - if (args.moreData !== undefined && args.moreData !== null) { - this.moreData = args.moreData; - } - } -}; -TSFetchResultsResp.prototype = {}; -TSFetchResultsResp.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.status = new common_ttypes.TSStatus(); - this.status.read(input); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.BOOL) { - this.hasResultSet = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.BOOL) { - this.isAlign = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.STRUCT) { - this.queryDataSet = new ttypes.TSQueryDataSet(); - this.queryDataSet.read(input); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.STRUCT) { - this.nonAlignQueryDataSet = new ttypes.TSQueryNonAlignDataSet(); - this.nonAlignQueryDataSet.read(input); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.LIST) { - this.queryResult = []; - var _rtmp382 = input.readListBegin(); - var _size81 = _rtmp382.size || 0; - for (var _i83 = 0; _i83 < _size81; ++_i83) { - var elem84 = null; - elem84 = input.readBinary(); - this.queryResult.push(elem84); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 7: - if (ftype == Thrift.Type.BOOL) { - this.moreData = input.readBool(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSFetchResultsResp.prototype.write = function(output) { - output.writeStructBegin('TSFetchResultsResp'); - if (this.status !== null && this.status !== undefined) { - output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); - this.status.write(output); - output.writeFieldEnd(); - } - if (this.hasResultSet !== null && this.hasResultSet !== undefined) { - output.writeFieldBegin('hasResultSet', Thrift.Type.BOOL, 2); - output.writeBool(this.hasResultSet); - output.writeFieldEnd(); - } - if (this.isAlign !== null && this.isAlign !== undefined) { - output.writeFieldBegin('isAlign', Thrift.Type.BOOL, 3); - output.writeBool(this.isAlign); - output.writeFieldEnd(); - } - if (this.queryDataSet !== null && this.queryDataSet !== undefined) { - output.writeFieldBegin('queryDataSet', Thrift.Type.STRUCT, 4); - this.queryDataSet.write(output); - output.writeFieldEnd(); - } - if (this.nonAlignQueryDataSet !== null && this.nonAlignQueryDataSet !== undefined) { - output.writeFieldBegin('nonAlignQueryDataSet', Thrift.Type.STRUCT, 5); - this.nonAlignQueryDataSet.write(output); - output.writeFieldEnd(); - } - if (this.queryResult !== null && this.queryResult !== undefined) { - output.writeFieldBegin('queryResult', Thrift.Type.LIST, 6); - output.writeListBegin(Thrift.Type.STRING, this.queryResult.length); - for (var iter85 in this.queryResult) { - if (this.queryResult.hasOwnProperty(iter85)) { - iter85 = this.queryResult[iter85]; - output.writeBinary(iter85); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.moreData !== null && this.moreData !== undefined) { - output.writeFieldBegin('moreData', Thrift.Type.BOOL, 7); - output.writeBool(this.moreData); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSFetchMetadataResp = module.exports.TSFetchMetadataResp = function(args) { - this.status = null; - this.metadataInJson = null; - this.columnsList = null; - this.dataType = null; - if (args) { - if (args.status !== undefined && args.status !== null) { - this.status = new common_ttypes.TSStatus(args.status); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); - } - if (args.metadataInJson !== undefined && args.metadataInJson !== null) { - this.metadataInJson = args.metadataInJson; - } - if (args.columnsList !== undefined && args.columnsList !== null) { - this.columnsList = Thrift.copyList(args.columnsList, [null]); - } - if (args.dataType !== undefined && args.dataType !== null) { - this.dataType = args.dataType; - } - } -}; -TSFetchMetadataResp.prototype = {}; -TSFetchMetadataResp.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.status = new common_ttypes.TSStatus(); - this.status.read(input); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.metadataInJson = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.LIST) { - this.columnsList = []; - var _rtmp387 = input.readListBegin(); - var _size86 = _rtmp387.size || 0; - for (var _i88 = 0; _i88 < _size86; ++_i88) { - var elem89 = null; - elem89 = input.readString(); - this.columnsList.push(elem89); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.STRING) { - this.dataType = input.readString(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSFetchMetadataResp.prototype.write = function(output) { - output.writeStructBegin('TSFetchMetadataResp'); - if (this.status !== null && this.status !== undefined) { - output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); - this.status.write(output); - output.writeFieldEnd(); - } - if (this.metadataInJson !== null && this.metadataInJson !== undefined) { - output.writeFieldBegin('metadataInJson', Thrift.Type.STRING, 2); - output.writeString(this.metadataInJson); - output.writeFieldEnd(); - } - if (this.columnsList !== null && this.columnsList !== undefined) { - output.writeFieldBegin('columnsList', Thrift.Type.LIST, 3); - output.writeListBegin(Thrift.Type.STRING, this.columnsList.length); - for (var iter90 in this.columnsList) { - if (this.columnsList.hasOwnProperty(iter90)) { - iter90 = this.columnsList[iter90]; - output.writeString(iter90); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.dataType !== null && this.dataType !== undefined) { - output.writeFieldBegin('dataType', Thrift.Type.STRING, 4); - output.writeString(this.dataType); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSFetchMetadataReq = module.exports.TSFetchMetadataReq = function(args) { - this.sessionId = null; - this.type = null; - this.columnPath = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.type !== undefined && args.type !== null) { - this.type = args.type; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field type is unset!'); - } - if (args.columnPath !== undefined && args.columnPath !== null) { - this.columnPath = args.columnPath; - } - } -}; -TSFetchMetadataReq.prototype = {}; -TSFetchMetadataReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.type = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.STRING) { - this.columnPath = input.readString(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSFetchMetadataReq.prototype.write = function(output) { - output.writeStructBegin('TSFetchMetadataReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.type !== null && this.type !== undefined) { - output.writeFieldBegin('type', Thrift.Type.STRING, 2); - output.writeString(this.type); - output.writeFieldEnd(); - } - if (this.columnPath !== null && this.columnPath !== undefined) { - output.writeFieldBegin('columnPath', Thrift.Type.STRING, 3); - output.writeString(this.columnPath); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSGetTimeZoneResp = module.exports.TSGetTimeZoneResp = function(args) { - this.status = null; - this.timeZone = null; - if (args) { - if (args.status !== undefined && args.status !== null) { - this.status = new common_ttypes.TSStatus(args.status); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); - } - if (args.timeZone !== undefined && args.timeZone !== null) { - this.timeZone = args.timeZone; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timeZone is unset!'); - } - } -}; -TSGetTimeZoneResp.prototype = {}; -TSGetTimeZoneResp.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.status = new common_ttypes.TSStatus(); - this.status.read(input); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.timeZone = input.readString(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSGetTimeZoneResp.prototype.write = function(output) { - output.writeStructBegin('TSGetTimeZoneResp'); - if (this.status !== null && this.status !== undefined) { - output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); - this.status.write(output); - output.writeFieldEnd(); - } - if (this.timeZone !== null && this.timeZone !== undefined) { - output.writeFieldBegin('timeZone', Thrift.Type.STRING, 2); - output.writeString(this.timeZone); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSSetTimeZoneReq = module.exports.TSSetTimeZoneReq = function(args) { - this.sessionId = null; - this.timeZone = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.timeZone !== undefined && args.timeZone !== null) { - this.timeZone = args.timeZone; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timeZone is unset!'); - } - } -}; -TSSetTimeZoneReq.prototype = {}; -TSSetTimeZoneReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.timeZone = input.readString(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSSetTimeZoneReq.prototype.write = function(output) { - output.writeStructBegin('TSSetTimeZoneReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.timeZone !== null && this.timeZone !== undefined) { - output.writeFieldBegin('timeZone', Thrift.Type.STRING, 2); - output.writeString(this.timeZone); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSInsertRecordReq = module.exports.TSInsertRecordReq = function(args) { - this.sessionId = null; - this.prefixPath = null; - this.measurements = null; - this.values = null; - this.timestamp = null; - this.isAligned = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.prefixPath !== undefined && args.prefixPath !== null) { - this.prefixPath = args.prefixPath; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPath is unset!'); - } - if (args.measurements !== undefined && args.measurements !== null) { - this.measurements = Thrift.copyList(args.measurements, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurements is unset!'); - } - if (args.values !== undefined && args.values !== null) { - this.values = args.values; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field values is unset!'); - } - if (args.timestamp !== undefined && args.timestamp !== null) { - this.timestamp = args.timestamp; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestamp is unset!'); - } - if (args.isAligned !== undefined && args.isAligned !== null) { - this.isAligned = args.isAligned; - } - } -}; -TSInsertRecordReq.prototype = {}; -TSInsertRecordReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.prefixPath = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.LIST) { - this.measurements = []; - var _rtmp392 = input.readListBegin(); - var _size91 = _rtmp392.size || 0; - for (var _i93 = 0; _i93 < _size91; ++_i93) { - var elem94 = null; - elem94 = input.readString(); - this.measurements.push(elem94); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.STRING) { - this.values = input.readBinary(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.I64) { - this.timestamp = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.BOOL) { - this.isAligned = input.readBool(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSInsertRecordReq.prototype.write = function(output) { - output.writeStructBegin('TSInsertRecordReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.prefixPath !== null && this.prefixPath !== undefined) { - output.writeFieldBegin('prefixPath', Thrift.Type.STRING, 2); - output.writeString(this.prefixPath); - output.writeFieldEnd(); - } - if (this.measurements !== null && this.measurements !== undefined) { - output.writeFieldBegin('measurements', Thrift.Type.LIST, 3); - output.writeListBegin(Thrift.Type.STRING, this.measurements.length); - for (var iter95 in this.measurements) { - if (this.measurements.hasOwnProperty(iter95)) { - iter95 = this.measurements[iter95]; - output.writeString(iter95); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.values !== null && this.values !== undefined) { - output.writeFieldBegin('values', Thrift.Type.STRING, 4); - output.writeBinary(this.values); - output.writeFieldEnd(); - } - if (this.timestamp !== null && this.timestamp !== undefined) { - output.writeFieldBegin('timestamp', Thrift.Type.I64, 5); - output.writeI64(this.timestamp); - output.writeFieldEnd(); - } - if (this.isAligned !== null && this.isAligned !== undefined) { - output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 6); - output.writeBool(this.isAligned); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSInsertStringRecordReq = module.exports.TSInsertStringRecordReq = function(args) { - this.sessionId = null; - this.prefixPath = null; - this.measurements = null; - this.values = null; - this.timestamp = null; - this.isAligned = null; - this.timeout = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.prefixPath !== undefined && args.prefixPath !== null) { - this.prefixPath = args.prefixPath; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPath is unset!'); - } - if (args.measurements !== undefined && args.measurements !== null) { - this.measurements = Thrift.copyList(args.measurements, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurements is unset!'); - } - if (args.values !== undefined && args.values !== null) { - this.values = Thrift.copyList(args.values, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field values is unset!'); - } - if (args.timestamp !== undefined && args.timestamp !== null) { - this.timestamp = args.timestamp; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestamp is unset!'); - } - if (args.isAligned !== undefined && args.isAligned !== null) { - this.isAligned = args.isAligned; - } - if (args.timeout !== undefined && args.timeout !== null) { - this.timeout = args.timeout; - } - } -}; -TSInsertStringRecordReq.prototype = {}; -TSInsertStringRecordReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.prefixPath = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.LIST) { - this.measurements = []; - var _rtmp397 = input.readListBegin(); - var _size96 = _rtmp397.size || 0; - for (var _i98 = 0; _i98 < _size96; ++_i98) { - var elem99 = null; - elem99 = input.readString(); - this.measurements.push(elem99); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.LIST) { - this.values = []; - var _rtmp3101 = input.readListBegin(); - var _size100 = _rtmp3101.size || 0; - for (var _i102 = 0; _i102 < _size100; ++_i102) { - var elem103 = null; - elem103 = input.readString(); - this.values.push(elem103); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.I64) { - this.timestamp = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.BOOL) { - this.isAligned = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 7: - if (ftype == Thrift.Type.I64) { - this.timeout = input.readI64(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSInsertStringRecordReq.prototype.write = function(output) { - output.writeStructBegin('TSInsertStringRecordReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.prefixPath !== null && this.prefixPath !== undefined) { - output.writeFieldBegin('prefixPath', Thrift.Type.STRING, 2); - output.writeString(this.prefixPath); - output.writeFieldEnd(); - } - if (this.measurements !== null && this.measurements !== undefined) { - output.writeFieldBegin('measurements', Thrift.Type.LIST, 3); - output.writeListBegin(Thrift.Type.STRING, this.measurements.length); - for (var iter104 in this.measurements) { - if (this.measurements.hasOwnProperty(iter104)) { - iter104 = this.measurements[iter104]; - output.writeString(iter104); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.values !== null && this.values !== undefined) { - output.writeFieldBegin('values', Thrift.Type.LIST, 4); - output.writeListBegin(Thrift.Type.STRING, this.values.length); - for (var iter105 in this.values) { - if (this.values.hasOwnProperty(iter105)) { - iter105 = this.values[iter105]; - output.writeString(iter105); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.timestamp !== null && this.timestamp !== undefined) { - output.writeFieldBegin('timestamp', Thrift.Type.I64, 5); - output.writeI64(this.timestamp); - output.writeFieldEnd(); - } - if (this.isAligned !== null && this.isAligned !== undefined) { - output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 6); - output.writeBool(this.isAligned); - output.writeFieldEnd(); - } - if (this.timeout !== null && this.timeout !== undefined) { - output.writeFieldBegin('timeout', Thrift.Type.I64, 7); - output.writeI64(this.timeout); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSInsertTabletReq = module.exports.TSInsertTabletReq = function(args) { - this.sessionId = null; - this.prefixPath = null; - this.measurements = null; - this.values = null; - this.timestamps = null; - this.types = null; - this.size = null; - this.isAligned = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.prefixPath !== undefined && args.prefixPath !== null) { - this.prefixPath = args.prefixPath; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPath is unset!'); - } - if (args.measurements !== undefined && args.measurements !== null) { - this.measurements = Thrift.copyList(args.measurements, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurements is unset!'); - } - if (args.values !== undefined && args.values !== null) { - this.values = args.values; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field values is unset!'); - } - if (args.timestamps !== undefined && args.timestamps !== null) { - this.timestamps = args.timestamps; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestamps is unset!'); - } - if (args.types !== undefined && args.types !== null) { - this.types = Thrift.copyList(args.types, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field types is unset!'); - } - if (args.size !== undefined && args.size !== null) { - this.size = args.size; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field size is unset!'); - } - if (args.isAligned !== undefined && args.isAligned !== null) { - this.isAligned = args.isAligned; - } - } -}; -TSInsertTabletReq.prototype = {}; -TSInsertTabletReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.prefixPath = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.LIST) { - this.measurements = []; - var _rtmp3107 = input.readListBegin(); - var _size106 = _rtmp3107.size || 0; - for (var _i108 = 0; _i108 < _size106; ++_i108) { - var elem109 = null; - elem109 = input.readString(); - this.measurements.push(elem109); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.STRING) { - this.values = input.readBinary(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.STRING) { - this.timestamps = input.readBinary(); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.LIST) { - this.types = []; - var _rtmp3111 = input.readListBegin(); - var _size110 = _rtmp3111.size || 0; - for (var _i112 = 0; _i112 < _size110; ++_i112) { - var elem113 = null; - elem113 = input.readI32(); - this.types.push(elem113); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 7: - if (ftype == Thrift.Type.I32) { - this.size = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 8: - if (ftype == Thrift.Type.BOOL) { - this.isAligned = input.readBool(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSInsertTabletReq.prototype.write = function(output) { - output.writeStructBegin('TSInsertTabletReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.prefixPath !== null && this.prefixPath !== undefined) { - output.writeFieldBegin('prefixPath', Thrift.Type.STRING, 2); - output.writeString(this.prefixPath); - output.writeFieldEnd(); - } - if (this.measurements !== null && this.measurements !== undefined) { - output.writeFieldBegin('measurements', Thrift.Type.LIST, 3); - output.writeListBegin(Thrift.Type.STRING, this.measurements.length); - for (var iter114 in this.measurements) { - if (this.measurements.hasOwnProperty(iter114)) { - iter114 = this.measurements[iter114]; - output.writeString(iter114); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.values !== null && this.values !== undefined) { - output.writeFieldBegin('values', Thrift.Type.STRING, 4); - output.writeBinary(this.values); - output.writeFieldEnd(); - } - if (this.timestamps !== null && this.timestamps !== undefined) { - output.writeFieldBegin('timestamps', Thrift.Type.STRING, 5); - output.writeBinary(this.timestamps); - output.writeFieldEnd(); - } - if (this.types !== null && this.types !== undefined) { - output.writeFieldBegin('types', Thrift.Type.LIST, 6); - output.writeListBegin(Thrift.Type.I32, this.types.length); - for (var iter115 in this.types) { - if (this.types.hasOwnProperty(iter115)) { - iter115 = this.types[iter115]; - output.writeI32(iter115); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.size !== null && this.size !== undefined) { - output.writeFieldBegin('size', Thrift.Type.I32, 7); - output.writeI32(this.size); - output.writeFieldEnd(); - } - if (this.isAligned !== null && this.isAligned !== undefined) { - output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 8); - output.writeBool(this.isAligned); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSInsertTabletsReq = module.exports.TSInsertTabletsReq = function(args) { - this.sessionId = null; - this.prefixPaths = null; - this.measurementsList = null; - this.valuesList = null; - this.timestampsList = null; - this.typesList = null; - this.sizeList = null; - this.isAligned = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.prefixPaths !== undefined && args.prefixPaths !== null) { - this.prefixPaths = Thrift.copyList(args.prefixPaths, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPaths is unset!'); - } - if (args.measurementsList !== undefined && args.measurementsList !== null) { - this.measurementsList = Thrift.copyList(args.measurementsList, [Thrift.copyList, null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurementsList is unset!'); - } - if (args.valuesList !== undefined && args.valuesList !== null) { - this.valuesList = Thrift.copyList(args.valuesList, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field valuesList is unset!'); - } - if (args.timestampsList !== undefined && args.timestampsList !== null) { - this.timestampsList = Thrift.copyList(args.timestampsList, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestampsList is unset!'); - } - if (args.typesList !== undefined && args.typesList !== null) { - this.typesList = Thrift.copyList(args.typesList, [Thrift.copyList, null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field typesList is unset!'); - } - if (args.sizeList !== undefined && args.sizeList !== null) { - this.sizeList = Thrift.copyList(args.sizeList, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sizeList is unset!'); - } - if (args.isAligned !== undefined && args.isAligned !== null) { - this.isAligned = args.isAligned; - } - } -}; -TSInsertTabletsReq.prototype = {}; -TSInsertTabletsReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.LIST) { - this.prefixPaths = []; - var _rtmp3117 = input.readListBegin(); - var _size116 = _rtmp3117.size || 0; - for (var _i118 = 0; _i118 < _size116; ++_i118) { - var elem119 = null; - elem119 = input.readString(); - this.prefixPaths.push(elem119); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.LIST) { - this.measurementsList = []; - var _rtmp3121 = input.readListBegin(); - var _size120 = _rtmp3121.size || 0; - for (var _i122 = 0; _i122 < _size120; ++_i122) { - var elem123 = null; - elem123 = []; - var _rtmp3125 = input.readListBegin(); - var _size124 = _rtmp3125.size || 0; - for (var _i126 = 0; _i126 < _size124; ++_i126) { - var elem127 = null; - elem127 = input.readString(); - elem123.push(elem127); - } - input.readListEnd(); - this.measurementsList.push(elem123); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.LIST) { - this.valuesList = []; - var _rtmp3129 = input.readListBegin(); - var _size128 = _rtmp3129.size || 0; - for (var _i130 = 0; _i130 < _size128; ++_i130) { - var elem131 = null; - elem131 = input.readBinary(); - this.valuesList.push(elem131); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.LIST) { - this.timestampsList = []; - var _rtmp3133 = input.readListBegin(); - var _size132 = _rtmp3133.size || 0; - for (var _i134 = 0; _i134 < _size132; ++_i134) { - var elem135 = null; - elem135 = input.readBinary(); - this.timestampsList.push(elem135); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.LIST) { - this.typesList = []; - var _rtmp3137 = input.readListBegin(); - var _size136 = _rtmp3137.size || 0; - for (var _i138 = 0; _i138 < _size136; ++_i138) { - var elem139 = null; - elem139 = []; - var _rtmp3141 = input.readListBegin(); - var _size140 = _rtmp3141.size || 0; - for (var _i142 = 0; _i142 < _size140; ++_i142) { - var elem143 = null; - elem143 = input.readI32(); - elem139.push(elem143); - } - input.readListEnd(); - this.typesList.push(elem139); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 7: - if (ftype == Thrift.Type.LIST) { - this.sizeList = []; - var _rtmp3145 = input.readListBegin(); - var _size144 = _rtmp3145.size || 0; - for (var _i146 = 0; _i146 < _size144; ++_i146) { - var elem147 = null; - elem147 = input.readI32(); - this.sizeList.push(elem147); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 8: - if (ftype == Thrift.Type.BOOL) { - this.isAligned = input.readBool(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSInsertTabletsReq.prototype.write = function(output) { - output.writeStructBegin('TSInsertTabletsReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.prefixPaths !== null && this.prefixPaths !== undefined) { - output.writeFieldBegin('prefixPaths', Thrift.Type.LIST, 2); - output.writeListBegin(Thrift.Type.STRING, this.prefixPaths.length); - for (var iter148 in this.prefixPaths) { - if (this.prefixPaths.hasOwnProperty(iter148)) { - iter148 = this.prefixPaths[iter148]; - output.writeString(iter148); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.measurementsList !== null && this.measurementsList !== undefined) { - output.writeFieldBegin('measurementsList', Thrift.Type.LIST, 3); - output.writeListBegin(Thrift.Type.LIST, this.measurementsList.length); - for (var iter149 in this.measurementsList) { - if (this.measurementsList.hasOwnProperty(iter149)) { - iter149 = this.measurementsList[iter149]; - output.writeListBegin(Thrift.Type.STRING, iter149.length); - for (var iter150 in iter149) { - if (iter149.hasOwnProperty(iter150)) { - iter150 = iter149[iter150]; - output.writeString(iter150); - } - } - output.writeListEnd(); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.valuesList !== null && this.valuesList !== undefined) { - output.writeFieldBegin('valuesList', Thrift.Type.LIST, 4); - output.writeListBegin(Thrift.Type.STRING, this.valuesList.length); - for (var iter151 in this.valuesList) { - if (this.valuesList.hasOwnProperty(iter151)) { - iter151 = this.valuesList[iter151]; - output.writeBinary(iter151); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.timestampsList !== null && this.timestampsList !== undefined) { - output.writeFieldBegin('timestampsList', Thrift.Type.LIST, 5); - output.writeListBegin(Thrift.Type.STRING, this.timestampsList.length); - for (var iter152 in this.timestampsList) { - if (this.timestampsList.hasOwnProperty(iter152)) { - iter152 = this.timestampsList[iter152]; - output.writeBinary(iter152); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.typesList !== null && this.typesList !== undefined) { - output.writeFieldBegin('typesList', Thrift.Type.LIST, 6); - output.writeListBegin(Thrift.Type.LIST, this.typesList.length); - for (var iter153 in this.typesList) { - if (this.typesList.hasOwnProperty(iter153)) { - iter153 = this.typesList[iter153]; - output.writeListBegin(Thrift.Type.I32, iter153.length); - for (var iter154 in iter153) { - if (iter153.hasOwnProperty(iter154)) { - iter154 = iter153[iter154]; - output.writeI32(iter154); - } - } - output.writeListEnd(); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.sizeList !== null && this.sizeList !== undefined) { - output.writeFieldBegin('sizeList', Thrift.Type.LIST, 7); - output.writeListBegin(Thrift.Type.I32, this.sizeList.length); - for (var iter155 in this.sizeList) { - if (this.sizeList.hasOwnProperty(iter155)) { - iter155 = this.sizeList[iter155]; - output.writeI32(iter155); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.isAligned !== null && this.isAligned !== undefined) { - output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 8); - output.writeBool(this.isAligned); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSInsertRecordsReq = module.exports.TSInsertRecordsReq = function(args) { - this.sessionId = null; - this.prefixPaths = null; - this.measurementsList = null; - this.valuesList = null; - this.timestamps = null; - this.isAligned = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.prefixPaths !== undefined && args.prefixPaths !== null) { - this.prefixPaths = Thrift.copyList(args.prefixPaths, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPaths is unset!'); - } - if (args.measurementsList !== undefined && args.measurementsList !== null) { - this.measurementsList = Thrift.copyList(args.measurementsList, [Thrift.copyList, null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurementsList is unset!'); - } - if (args.valuesList !== undefined && args.valuesList !== null) { - this.valuesList = Thrift.copyList(args.valuesList, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field valuesList is unset!'); - } - if (args.timestamps !== undefined && args.timestamps !== null) { - this.timestamps = Thrift.copyList(args.timestamps, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestamps is unset!'); - } - if (args.isAligned !== undefined && args.isAligned !== null) { - this.isAligned = args.isAligned; - } - } -}; -TSInsertRecordsReq.prototype = {}; -TSInsertRecordsReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.LIST) { - this.prefixPaths = []; - var _rtmp3157 = input.readListBegin(); - var _size156 = _rtmp3157.size || 0; - for (var _i158 = 0; _i158 < _size156; ++_i158) { - var elem159 = null; - elem159 = input.readString(); - this.prefixPaths.push(elem159); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.LIST) { - this.measurementsList = []; - var _rtmp3161 = input.readListBegin(); - var _size160 = _rtmp3161.size || 0; - for (var _i162 = 0; _i162 < _size160; ++_i162) { - var elem163 = null; - elem163 = []; - var _rtmp3165 = input.readListBegin(); - var _size164 = _rtmp3165.size || 0; - for (var _i166 = 0; _i166 < _size164; ++_i166) { - var elem167 = null; - elem167 = input.readString(); - elem163.push(elem167); - } - input.readListEnd(); - this.measurementsList.push(elem163); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.LIST) { - this.valuesList = []; - var _rtmp3169 = input.readListBegin(); - var _size168 = _rtmp3169.size || 0; - for (var _i170 = 0; _i170 < _size168; ++_i170) { - var elem171 = null; - elem171 = input.readBinary(); - this.valuesList.push(elem171); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.LIST) { - this.timestamps = []; - var _rtmp3173 = input.readListBegin(); - var _size172 = _rtmp3173.size || 0; - for (var _i174 = 0; _i174 < _size172; ++_i174) { - var elem175 = null; - elem175 = input.readI64(); - this.timestamps.push(elem175); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.BOOL) { - this.isAligned = input.readBool(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSInsertRecordsReq.prototype.write = function(output) { - output.writeStructBegin('TSInsertRecordsReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.prefixPaths !== null && this.prefixPaths !== undefined) { - output.writeFieldBegin('prefixPaths', Thrift.Type.LIST, 2); - output.writeListBegin(Thrift.Type.STRING, this.prefixPaths.length); - for (var iter176 in this.prefixPaths) { - if (this.prefixPaths.hasOwnProperty(iter176)) { - iter176 = this.prefixPaths[iter176]; - output.writeString(iter176); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.measurementsList !== null && this.measurementsList !== undefined) { - output.writeFieldBegin('measurementsList', Thrift.Type.LIST, 3); - output.writeListBegin(Thrift.Type.LIST, this.measurementsList.length); - for (var iter177 in this.measurementsList) { - if (this.measurementsList.hasOwnProperty(iter177)) { - iter177 = this.measurementsList[iter177]; - output.writeListBegin(Thrift.Type.STRING, iter177.length); - for (var iter178 in iter177) { - if (iter177.hasOwnProperty(iter178)) { - iter178 = iter177[iter178]; - output.writeString(iter178); - } - } - output.writeListEnd(); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.valuesList !== null && this.valuesList !== undefined) { - output.writeFieldBegin('valuesList', Thrift.Type.LIST, 4); - output.writeListBegin(Thrift.Type.STRING, this.valuesList.length); - for (var iter179 in this.valuesList) { - if (this.valuesList.hasOwnProperty(iter179)) { - iter179 = this.valuesList[iter179]; - output.writeBinary(iter179); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.timestamps !== null && this.timestamps !== undefined) { - output.writeFieldBegin('timestamps', Thrift.Type.LIST, 5); - output.writeListBegin(Thrift.Type.I64, this.timestamps.length); - for (var iter180 in this.timestamps) { - if (this.timestamps.hasOwnProperty(iter180)) { - iter180 = this.timestamps[iter180]; - output.writeI64(iter180); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.isAligned !== null && this.isAligned !== undefined) { - output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 6); - output.writeBool(this.isAligned); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSInsertRecordsOfOneDeviceReq = module.exports.TSInsertRecordsOfOneDeviceReq = function(args) { - this.sessionId = null; - this.prefixPath = null; - this.measurementsList = null; - this.valuesList = null; - this.timestamps = null; - this.isAligned = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.prefixPath !== undefined && args.prefixPath !== null) { - this.prefixPath = args.prefixPath; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPath is unset!'); - } - if (args.measurementsList !== undefined && args.measurementsList !== null) { - this.measurementsList = Thrift.copyList(args.measurementsList, [Thrift.copyList, null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurementsList is unset!'); - } - if (args.valuesList !== undefined && args.valuesList !== null) { - this.valuesList = Thrift.copyList(args.valuesList, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field valuesList is unset!'); - } - if (args.timestamps !== undefined && args.timestamps !== null) { - this.timestamps = Thrift.copyList(args.timestamps, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestamps is unset!'); - } - if (args.isAligned !== undefined && args.isAligned !== null) { - this.isAligned = args.isAligned; - } - } -}; -TSInsertRecordsOfOneDeviceReq.prototype = {}; -TSInsertRecordsOfOneDeviceReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.prefixPath = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.LIST) { - this.measurementsList = []; - var _rtmp3182 = input.readListBegin(); - var _size181 = _rtmp3182.size || 0; - for (var _i183 = 0; _i183 < _size181; ++_i183) { - var elem184 = null; - elem184 = []; - var _rtmp3186 = input.readListBegin(); - var _size185 = _rtmp3186.size || 0; - for (var _i187 = 0; _i187 < _size185; ++_i187) { - var elem188 = null; - elem188 = input.readString(); - elem184.push(elem188); - } - input.readListEnd(); - this.measurementsList.push(elem184); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.LIST) { - this.valuesList = []; - var _rtmp3190 = input.readListBegin(); - var _size189 = _rtmp3190.size || 0; - for (var _i191 = 0; _i191 < _size189; ++_i191) { - var elem192 = null; - elem192 = input.readBinary(); - this.valuesList.push(elem192); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.LIST) { - this.timestamps = []; - var _rtmp3194 = input.readListBegin(); - var _size193 = _rtmp3194.size || 0; - for (var _i195 = 0; _i195 < _size193; ++_i195) { - var elem196 = null; - elem196 = input.readI64(); - this.timestamps.push(elem196); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.BOOL) { - this.isAligned = input.readBool(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSInsertRecordsOfOneDeviceReq.prototype.write = function(output) { - output.writeStructBegin('TSInsertRecordsOfOneDeviceReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.prefixPath !== null && this.prefixPath !== undefined) { - output.writeFieldBegin('prefixPath', Thrift.Type.STRING, 2); - output.writeString(this.prefixPath); - output.writeFieldEnd(); - } - if (this.measurementsList !== null && this.measurementsList !== undefined) { - output.writeFieldBegin('measurementsList', Thrift.Type.LIST, 3); - output.writeListBegin(Thrift.Type.LIST, this.measurementsList.length); - for (var iter197 in this.measurementsList) { - if (this.measurementsList.hasOwnProperty(iter197)) { - iter197 = this.measurementsList[iter197]; - output.writeListBegin(Thrift.Type.STRING, iter197.length); - for (var iter198 in iter197) { - if (iter197.hasOwnProperty(iter198)) { - iter198 = iter197[iter198]; - output.writeString(iter198); - } - } - output.writeListEnd(); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.valuesList !== null && this.valuesList !== undefined) { - output.writeFieldBegin('valuesList', Thrift.Type.LIST, 4); - output.writeListBegin(Thrift.Type.STRING, this.valuesList.length); - for (var iter199 in this.valuesList) { - if (this.valuesList.hasOwnProperty(iter199)) { - iter199 = this.valuesList[iter199]; - output.writeBinary(iter199); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.timestamps !== null && this.timestamps !== undefined) { - output.writeFieldBegin('timestamps', Thrift.Type.LIST, 5); - output.writeListBegin(Thrift.Type.I64, this.timestamps.length); - for (var iter200 in this.timestamps) { - if (this.timestamps.hasOwnProperty(iter200)) { - iter200 = this.timestamps[iter200]; - output.writeI64(iter200); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.isAligned !== null && this.isAligned !== undefined) { - output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 6); - output.writeBool(this.isAligned); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSInsertStringRecordsOfOneDeviceReq = module.exports.TSInsertStringRecordsOfOneDeviceReq = function(args) { - this.sessionId = null; - this.prefixPath = null; - this.measurementsList = null; - this.valuesList = null; - this.timestamps = null; - this.isAligned = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.prefixPath !== undefined && args.prefixPath !== null) { - this.prefixPath = args.prefixPath; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPath is unset!'); - } - if (args.measurementsList !== undefined && args.measurementsList !== null) { - this.measurementsList = Thrift.copyList(args.measurementsList, [Thrift.copyList, null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurementsList is unset!'); - } - if (args.valuesList !== undefined && args.valuesList !== null) { - this.valuesList = Thrift.copyList(args.valuesList, [Thrift.copyList, null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field valuesList is unset!'); - } - if (args.timestamps !== undefined && args.timestamps !== null) { - this.timestamps = Thrift.copyList(args.timestamps, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestamps is unset!'); - } - if (args.isAligned !== undefined && args.isAligned !== null) { - this.isAligned = args.isAligned; - } - } -}; -TSInsertStringRecordsOfOneDeviceReq.prototype = {}; -TSInsertStringRecordsOfOneDeviceReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.prefixPath = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.LIST) { - this.measurementsList = []; - var _rtmp3202 = input.readListBegin(); - var _size201 = _rtmp3202.size || 0; - for (var _i203 = 0; _i203 < _size201; ++_i203) { - var elem204 = null; - elem204 = []; - var _rtmp3206 = input.readListBegin(); - var _size205 = _rtmp3206.size || 0; - for (var _i207 = 0; _i207 < _size205; ++_i207) { - var elem208 = null; - elem208 = input.readString(); - elem204.push(elem208); - } - input.readListEnd(); - this.measurementsList.push(elem204); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.LIST) { - this.valuesList = []; - var _rtmp3210 = input.readListBegin(); - var _size209 = _rtmp3210.size || 0; - for (var _i211 = 0; _i211 < _size209; ++_i211) { - var elem212 = null; - elem212 = []; - var _rtmp3214 = input.readListBegin(); - var _size213 = _rtmp3214.size || 0; - for (var _i215 = 0; _i215 < _size213; ++_i215) { - var elem216 = null; - elem216 = input.readString(); - elem212.push(elem216); - } - input.readListEnd(); - this.valuesList.push(elem212); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.LIST) { - this.timestamps = []; - var _rtmp3218 = input.readListBegin(); - var _size217 = _rtmp3218.size || 0; - for (var _i219 = 0; _i219 < _size217; ++_i219) { - var elem220 = null; - elem220 = input.readI64(); - this.timestamps.push(elem220); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.BOOL) { - this.isAligned = input.readBool(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSInsertStringRecordsOfOneDeviceReq.prototype.write = function(output) { - output.writeStructBegin('TSInsertStringRecordsOfOneDeviceReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.prefixPath !== null && this.prefixPath !== undefined) { - output.writeFieldBegin('prefixPath', Thrift.Type.STRING, 2); - output.writeString(this.prefixPath); - output.writeFieldEnd(); - } - if (this.measurementsList !== null && this.measurementsList !== undefined) { - output.writeFieldBegin('measurementsList', Thrift.Type.LIST, 3); - output.writeListBegin(Thrift.Type.LIST, this.measurementsList.length); - for (var iter221 in this.measurementsList) { - if (this.measurementsList.hasOwnProperty(iter221)) { - iter221 = this.measurementsList[iter221]; - output.writeListBegin(Thrift.Type.STRING, iter221.length); - for (var iter222 in iter221) { - if (iter221.hasOwnProperty(iter222)) { - iter222 = iter221[iter222]; - output.writeString(iter222); - } - } - output.writeListEnd(); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.valuesList !== null && this.valuesList !== undefined) { - output.writeFieldBegin('valuesList', Thrift.Type.LIST, 4); - output.writeListBegin(Thrift.Type.LIST, this.valuesList.length); - for (var iter223 in this.valuesList) { - if (this.valuesList.hasOwnProperty(iter223)) { - iter223 = this.valuesList[iter223]; - output.writeListBegin(Thrift.Type.STRING, iter223.length); - for (var iter224 in iter223) { - if (iter223.hasOwnProperty(iter224)) { - iter224 = iter223[iter224]; - output.writeString(iter224); - } - } - output.writeListEnd(); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.timestamps !== null && this.timestamps !== undefined) { - output.writeFieldBegin('timestamps', Thrift.Type.LIST, 5); - output.writeListBegin(Thrift.Type.I64, this.timestamps.length); - for (var iter225 in this.timestamps) { - if (this.timestamps.hasOwnProperty(iter225)) { - iter225 = this.timestamps[iter225]; - output.writeI64(iter225); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.isAligned !== null && this.isAligned !== undefined) { - output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 6); - output.writeBool(this.isAligned); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSInsertStringRecordsReq = module.exports.TSInsertStringRecordsReq = function(args) { - this.sessionId = null; - this.prefixPaths = null; - this.measurementsList = null; - this.valuesList = null; - this.timestamps = null; - this.isAligned = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.prefixPaths !== undefined && args.prefixPaths !== null) { - this.prefixPaths = Thrift.copyList(args.prefixPaths, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPaths is unset!'); - } - if (args.measurementsList !== undefined && args.measurementsList !== null) { - this.measurementsList = Thrift.copyList(args.measurementsList, [Thrift.copyList, null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurementsList is unset!'); - } - if (args.valuesList !== undefined && args.valuesList !== null) { - this.valuesList = Thrift.copyList(args.valuesList, [Thrift.copyList, null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field valuesList is unset!'); - } - if (args.timestamps !== undefined && args.timestamps !== null) { - this.timestamps = Thrift.copyList(args.timestamps, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestamps is unset!'); - } - if (args.isAligned !== undefined && args.isAligned !== null) { - this.isAligned = args.isAligned; - } - } -}; -TSInsertStringRecordsReq.prototype = {}; -TSInsertStringRecordsReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.LIST) { - this.prefixPaths = []; - var _rtmp3227 = input.readListBegin(); - var _size226 = _rtmp3227.size || 0; - for (var _i228 = 0; _i228 < _size226; ++_i228) { - var elem229 = null; - elem229 = input.readString(); - this.prefixPaths.push(elem229); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.LIST) { - this.measurementsList = []; - var _rtmp3231 = input.readListBegin(); - var _size230 = _rtmp3231.size || 0; - for (var _i232 = 0; _i232 < _size230; ++_i232) { - var elem233 = null; - elem233 = []; - var _rtmp3235 = input.readListBegin(); - var _size234 = _rtmp3235.size || 0; - for (var _i236 = 0; _i236 < _size234; ++_i236) { - var elem237 = null; - elem237 = input.readString(); - elem233.push(elem237); - } - input.readListEnd(); - this.measurementsList.push(elem233); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.LIST) { - this.valuesList = []; - var _rtmp3239 = input.readListBegin(); - var _size238 = _rtmp3239.size || 0; - for (var _i240 = 0; _i240 < _size238; ++_i240) { - var elem241 = null; - elem241 = []; - var _rtmp3243 = input.readListBegin(); - var _size242 = _rtmp3243.size || 0; - for (var _i244 = 0; _i244 < _size242; ++_i244) { - var elem245 = null; - elem245 = input.readString(); - elem241.push(elem245); - } - input.readListEnd(); - this.valuesList.push(elem241); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.LIST) { - this.timestamps = []; - var _rtmp3247 = input.readListBegin(); - var _size246 = _rtmp3247.size || 0; - for (var _i248 = 0; _i248 < _size246; ++_i248) { - var elem249 = null; - elem249 = input.readI64(); - this.timestamps.push(elem249); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.BOOL) { - this.isAligned = input.readBool(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSInsertStringRecordsReq.prototype.write = function(output) { - output.writeStructBegin('TSInsertStringRecordsReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.prefixPaths !== null && this.prefixPaths !== undefined) { - output.writeFieldBegin('prefixPaths', Thrift.Type.LIST, 2); - output.writeListBegin(Thrift.Type.STRING, this.prefixPaths.length); - for (var iter250 in this.prefixPaths) { - if (this.prefixPaths.hasOwnProperty(iter250)) { - iter250 = this.prefixPaths[iter250]; - output.writeString(iter250); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.measurementsList !== null && this.measurementsList !== undefined) { - output.writeFieldBegin('measurementsList', Thrift.Type.LIST, 3); - output.writeListBegin(Thrift.Type.LIST, this.measurementsList.length); - for (var iter251 in this.measurementsList) { - if (this.measurementsList.hasOwnProperty(iter251)) { - iter251 = this.measurementsList[iter251]; - output.writeListBegin(Thrift.Type.STRING, iter251.length); - for (var iter252 in iter251) { - if (iter251.hasOwnProperty(iter252)) { - iter252 = iter251[iter252]; - output.writeString(iter252); - } - } - output.writeListEnd(); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.valuesList !== null && this.valuesList !== undefined) { - output.writeFieldBegin('valuesList', Thrift.Type.LIST, 4); - output.writeListBegin(Thrift.Type.LIST, this.valuesList.length); - for (var iter253 in this.valuesList) { - if (this.valuesList.hasOwnProperty(iter253)) { - iter253 = this.valuesList[iter253]; - output.writeListBegin(Thrift.Type.STRING, iter253.length); - for (var iter254 in iter253) { - if (iter253.hasOwnProperty(iter254)) { - iter254 = iter253[iter254]; - output.writeString(iter254); - } - } - output.writeListEnd(); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.timestamps !== null && this.timestamps !== undefined) { - output.writeFieldBegin('timestamps', Thrift.Type.LIST, 5); - output.writeListBegin(Thrift.Type.I64, this.timestamps.length); - for (var iter255 in this.timestamps) { - if (this.timestamps.hasOwnProperty(iter255)) { - iter255 = this.timestamps[iter255]; - output.writeI64(iter255); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.isAligned !== null && this.isAligned !== undefined) { - output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 6); - output.writeBool(this.isAligned); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSDeleteDataReq = module.exports.TSDeleteDataReq = function(args) { - this.sessionId = null; - this.paths = null; - this.startTime = null; - this.endTime = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.paths !== undefined && args.paths !== null) { - this.paths = Thrift.copyList(args.paths, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field paths is unset!'); - } - if (args.startTime !== undefined && args.startTime !== null) { - this.startTime = args.startTime; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field startTime is unset!'); - } - if (args.endTime !== undefined && args.endTime !== null) { - this.endTime = args.endTime; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field endTime is unset!'); - } - } -}; -TSDeleteDataReq.prototype = {}; -TSDeleteDataReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.LIST) { - this.paths = []; - var _rtmp3257 = input.readListBegin(); - var _size256 = _rtmp3257.size || 0; - for (var _i258 = 0; _i258 < _size256; ++_i258) { - var elem259 = null; - elem259 = input.readString(); - this.paths.push(elem259); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.I64) { - this.startTime = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.I64) { - this.endTime = input.readI64(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSDeleteDataReq.prototype.write = function(output) { - output.writeStructBegin('TSDeleteDataReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.paths !== null && this.paths !== undefined) { - output.writeFieldBegin('paths', Thrift.Type.LIST, 2); - output.writeListBegin(Thrift.Type.STRING, this.paths.length); - for (var iter260 in this.paths) { - if (this.paths.hasOwnProperty(iter260)) { - iter260 = this.paths[iter260]; - output.writeString(iter260); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.startTime !== null && this.startTime !== undefined) { - output.writeFieldBegin('startTime', Thrift.Type.I64, 3); - output.writeI64(this.startTime); - output.writeFieldEnd(); - } - if (this.endTime !== null && this.endTime !== undefined) { - output.writeFieldBegin('endTime', Thrift.Type.I64, 4); - output.writeI64(this.endTime); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSCreateTimeseriesReq = module.exports.TSCreateTimeseriesReq = function(args) { - this.sessionId = null; - this.path = null; - this.dataType = null; - this.encoding = null; - this.compressor = null; - this.props = null; - this.tags = null; - this.attributes = null; - this.measurementAlias = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.path !== undefined && args.path !== null) { - this.path = args.path; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field path is unset!'); - } - if (args.dataType !== undefined && args.dataType !== null) { - this.dataType = args.dataType; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dataType is unset!'); - } - if (args.encoding !== undefined && args.encoding !== null) { - this.encoding = args.encoding; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field encoding is unset!'); - } - if (args.compressor !== undefined && args.compressor !== null) { - this.compressor = args.compressor; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field compressor is unset!'); - } - if (args.props !== undefined && args.props !== null) { - this.props = Thrift.copyMap(args.props, [null]); - } - if (args.tags !== undefined && args.tags !== null) { - this.tags = Thrift.copyMap(args.tags, [null]); - } - if (args.attributes !== undefined && args.attributes !== null) { - this.attributes = Thrift.copyMap(args.attributes, [null]); - } - if (args.measurementAlias !== undefined && args.measurementAlias !== null) { - this.measurementAlias = args.measurementAlias; - } - } -}; -TSCreateTimeseriesReq.prototype = {}; -TSCreateTimeseriesReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.path = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.I32) { - this.dataType = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.I32) { - this.encoding = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.I32) { - this.compressor = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.MAP) { - this.props = {}; - var _rtmp3262 = input.readMapBegin(); - var _size261 = _rtmp3262.size || 0; - for (var _i263 = 0; _i263 < _size261; ++_i263) { - var key264 = null; - var val265 = null; - key264 = input.readString(); - val265 = input.readString(); - this.props[key264] = val265; - } - input.readMapEnd(); - } else { - input.skip(ftype); - } - break; - case 7: - if (ftype == Thrift.Type.MAP) { - this.tags = {}; - var _rtmp3267 = input.readMapBegin(); - var _size266 = _rtmp3267.size || 0; - for (var _i268 = 0; _i268 < _size266; ++_i268) { - var key269 = null; - var val270 = null; - key269 = input.readString(); - val270 = input.readString(); - this.tags[key269] = val270; - } - input.readMapEnd(); - } else { - input.skip(ftype); - } - break; - case 8: - if (ftype == Thrift.Type.MAP) { - this.attributes = {}; - var _rtmp3272 = input.readMapBegin(); - var _size271 = _rtmp3272.size || 0; - for (var _i273 = 0; _i273 < _size271; ++_i273) { - var key274 = null; - var val275 = null; - key274 = input.readString(); - val275 = input.readString(); - this.attributes[key274] = val275; - } - input.readMapEnd(); - } else { - input.skip(ftype); - } - break; - case 9: - if (ftype == Thrift.Type.STRING) { - this.measurementAlias = input.readString(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSCreateTimeseriesReq.prototype.write = function(output) { - output.writeStructBegin('TSCreateTimeseriesReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.path !== null && this.path !== undefined) { - output.writeFieldBegin('path', Thrift.Type.STRING, 2); - output.writeString(this.path); - output.writeFieldEnd(); - } - if (this.dataType !== null && this.dataType !== undefined) { - output.writeFieldBegin('dataType', Thrift.Type.I32, 3); - output.writeI32(this.dataType); - output.writeFieldEnd(); - } - if (this.encoding !== null && this.encoding !== undefined) { - output.writeFieldBegin('encoding', Thrift.Type.I32, 4); - output.writeI32(this.encoding); - output.writeFieldEnd(); - } - if (this.compressor !== null && this.compressor !== undefined) { - output.writeFieldBegin('compressor', Thrift.Type.I32, 5); - output.writeI32(this.compressor); - output.writeFieldEnd(); - } - if (this.props !== null && this.props !== undefined) { - output.writeFieldBegin('props', Thrift.Type.MAP, 6); - output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.props)); - for (var kiter276 in this.props) { - if (this.props.hasOwnProperty(kiter276)) { - var viter277 = this.props[kiter276]; - output.writeString(kiter276); - output.writeString(viter277); - } - } - output.writeMapEnd(); - output.writeFieldEnd(); - } - if (this.tags !== null && this.tags !== undefined) { - output.writeFieldBegin('tags', Thrift.Type.MAP, 7); - output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.tags)); - for (var kiter278 in this.tags) { - if (this.tags.hasOwnProperty(kiter278)) { - var viter279 = this.tags[kiter278]; - output.writeString(kiter278); - output.writeString(viter279); - } - } - output.writeMapEnd(); - output.writeFieldEnd(); - } - if (this.attributes !== null && this.attributes !== undefined) { - output.writeFieldBegin('attributes', Thrift.Type.MAP, 8); - output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.attributes)); - for (var kiter280 in this.attributes) { - if (this.attributes.hasOwnProperty(kiter280)) { - var viter281 = this.attributes[kiter280]; - output.writeString(kiter280); - output.writeString(viter281); - } - } - output.writeMapEnd(); - output.writeFieldEnd(); - } - if (this.measurementAlias !== null && this.measurementAlias !== undefined) { - output.writeFieldBegin('measurementAlias', Thrift.Type.STRING, 9); - output.writeString(this.measurementAlias); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSCreateAlignedTimeseriesReq = module.exports.TSCreateAlignedTimeseriesReq = function(args) { - this.sessionId = null; - this.prefixPath = null; - this.measurements = null; - this.dataTypes = null; - this.encodings = null; - this.compressors = null; - this.measurementAlias = null; - this.tagsList = null; - this.attributesList = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.prefixPath !== undefined && args.prefixPath !== null) { - this.prefixPath = args.prefixPath; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPath is unset!'); - } - if (args.measurements !== undefined && args.measurements !== null) { - this.measurements = Thrift.copyList(args.measurements, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurements is unset!'); - } - if (args.dataTypes !== undefined && args.dataTypes !== null) { - this.dataTypes = Thrift.copyList(args.dataTypes, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dataTypes is unset!'); - } - if (args.encodings !== undefined && args.encodings !== null) { - this.encodings = Thrift.copyList(args.encodings, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field encodings is unset!'); - } - if (args.compressors !== undefined && args.compressors !== null) { - this.compressors = Thrift.copyList(args.compressors, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field compressors is unset!'); - } - if (args.measurementAlias !== undefined && args.measurementAlias !== null) { - this.measurementAlias = Thrift.copyList(args.measurementAlias, [null]); - } - if (args.tagsList !== undefined && args.tagsList !== null) { - this.tagsList = Thrift.copyList(args.tagsList, [Thrift.copyMap, null]); - } - if (args.attributesList !== undefined && args.attributesList !== null) { - this.attributesList = Thrift.copyList(args.attributesList, [Thrift.copyMap, null]); - } - } -}; -TSCreateAlignedTimeseriesReq.prototype = {}; -TSCreateAlignedTimeseriesReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.prefixPath = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.LIST) { - this.measurements = []; - var _rtmp3283 = input.readListBegin(); - var _size282 = _rtmp3283.size || 0; - for (var _i284 = 0; _i284 < _size282; ++_i284) { - var elem285 = null; - elem285 = input.readString(); - this.measurements.push(elem285); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.LIST) { - this.dataTypes = []; - var _rtmp3287 = input.readListBegin(); - var _size286 = _rtmp3287.size || 0; - for (var _i288 = 0; _i288 < _size286; ++_i288) { - var elem289 = null; - elem289 = input.readI32(); - this.dataTypes.push(elem289); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.LIST) { - this.encodings = []; - var _rtmp3291 = input.readListBegin(); - var _size290 = _rtmp3291.size || 0; - for (var _i292 = 0; _i292 < _size290; ++_i292) { - var elem293 = null; - elem293 = input.readI32(); - this.encodings.push(elem293); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.LIST) { - this.compressors = []; - var _rtmp3295 = input.readListBegin(); - var _size294 = _rtmp3295.size || 0; - for (var _i296 = 0; _i296 < _size294; ++_i296) { - var elem297 = null; - elem297 = input.readI32(); - this.compressors.push(elem297); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 7: - if (ftype == Thrift.Type.LIST) { - this.measurementAlias = []; - var _rtmp3299 = input.readListBegin(); - var _size298 = _rtmp3299.size || 0; - for (var _i300 = 0; _i300 < _size298; ++_i300) { - var elem301 = null; - elem301 = input.readString(); - this.measurementAlias.push(elem301); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 8: - if (ftype == Thrift.Type.LIST) { - this.tagsList = []; - var _rtmp3303 = input.readListBegin(); - var _size302 = _rtmp3303.size || 0; - for (var _i304 = 0; _i304 < _size302; ++_i304) { - var elem305 = null; - elem305 = {}; - var _rtmp3307 = input.readMapBegin(); - var _size306 = _rtmp3307.size || 0; - for (var _i308 = 0; _i308 < _size306; ++_i308) { - var key309 = null; - var val310 = null; - key309 = input.readString(); - val310 = input.readString(); - elem305[key309] = val310; - } - input.readMapEnd(); - this.tagsList.push(elem305); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 9: - if (ftype == Thrift.Type.LIST) { - this.attributesList = []; - var _rtmp3312 = input.readListBegin(); - var _size311 = _rtmp3312.size || 0; - for (var _i313 = 0; _i313 < _size311; ++_i313) { - var elem314 = null; - elem314 = {}; - var _rtmp3316 = input.readMapBegin(); - var _size315 = _rtmp3316.size || 0; - for (var _i317 = 0; _i317 < _size315; ++_i317) { - var key318 = null; - var val319 = null; - key318 = input.readString(); - val319 = input.readString(); - elem314[key318] = val319; - } - input.readMapEnd(); - this.attributesList.push(elem314); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSCreateAlignedTimeseriesReq.prototype.write = function(output) { - output.writeStructBegin('TSCreateAlignedTimeseriesReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.prefixPath !== null && this.prefixPath !== undefined) { - output.writeFieldBegin('prefixPath', Thrift.Type.STRING, 2); - output.writeString(this.prefixPath); - output.writeFieldEnd(); - } - if (this.measurements !== null && this.measurements !== undefined) { - output.writeFieldBegin('measurements', Thrift.Type.LIST, 3); - output.writeListBegin(Thrift.Type.STRING, this.measurements.length); - for (var iter320 in this.measurements) { - if (this.measurements.hasOwnProperty(iter320)) { - iter320 = this.measurements[iter320]; - output.writeString(iter320); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.dataTypes !== null && this.dataTypes !== undefined) { - output.writeFieldBegin('dataTypes', Thrift.Type.LIST, 4); - output.writeListBegin(Thrift.Type.I32, this.dataTypes.length); - for (var iter321 in this.dataTypes) { - if (this.dataTypes.hasOwnProperty(iter321)) { - iter321 = this.dataTypes[iter321]; - output.writeI32(iter321); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.encodings !== null && this.encodings !== undefined) { - output.writeFieldBegin('encodings', Thrift.Type.LIST, 5); - output.writeListBegin(Thrift.Type.I32, this.encodings.length); - for (var iter322 in this.encodings) { - if (this.encodings.hasOwnProperty(iter322)) { - iter322 = this.encodings[iter322]; - output.writeI32(iter322); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.compressors !== null && this.compressors !== undefined) { - output.writeFieldBegin('compressors', Thrift.Type.LIST, 6); - output.writeListBegin(Thrift.Type.I32, this.compressors.length); - for (var iter323 in this.compressors) { - if (this.compressors.hasOwnProperty(iter323)) { - iter323 = this.compressors[iter323]; - output.writeI32(iter323); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.measurementAlias !== null && this.measurementAlias !== undefined) { - output.writeFieldBegin('measurementAlias', Thrift.Type.LIST, 7); - output.writeListBegin(Thrift.Type.STRING, this.measurementAlias.length); - for (var iter324 in this.measurementAlias) { - if (this.measurementAlias.hasOwnProperty(iter324)) { - iter324 = this.measurementAlias[iter324]; - output.writeString(iter324); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.tagsList !== null && this.tagsList !== undefined) { - output.writeFieldBegin('tagsList', Thrift.Type.LIST, 8); - output.writeListBegin(Thrift.Type.MAP, this.tagsList.length); - for (var iter325 in this.tagsList) { - if (this.tagsList.hasOwnProperty(iter325)) { - iter325 = this.tagsList[iter325]; - output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(iter325)); - for (var kiter326 in iter325) { - if (iter325.hasOwnProperty(kiter326)) { - var viter327 = iter325[kiter326]; - output.writeString(kiter326); - output.writeString(viter327); - } - } - output.writeMapEnd(); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.attributesList !== null && this.attributesList !== undefined) { - output.writeFieldBegin('attributesList', Thrift.Type.LIST, 9); - output.writeListBegin(Thrift.Type.MAP, this.attributesList.length); - for (var iter328 in this.attributesList) { - if (this.attributesList.hasOwnProperty(iter328)) { - iter328 = this.attributesList[iter328]; - output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(iter328)); - for (var kiter329 in iter328) { - if (iter328.hasOwnProperty(kiter329)) { - var viter330 = iter328[kiter329]; - output.writeString(kiter329); - output.writeString(viter330); - } - } - output.writeMapEnd(); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSRawDataQueryReq = module.exports.TSRawDataQueryReq = function(args) { - this.sessionId = null; - this.paths = null; - this.fetchSize = null; - this.startTime = null; - this.endTime = null; - this.statementId = null; - this.enableRedirectQuery = null; - this.jdbcQuery = null; - this.timeout = null; - this.legalPathNodes = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.paths !== undefined && args.paths !== null) { - this.paths = Thrift.copyList(args.paths, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field paths is unset!'); - } - if (args.fetchSize !== undefined && args.fetchSize !== null) { - this.fetchSize = args.fetchSize; - } - if (args.startTime !== undefined && args.startTime !== null) { - this.startTime = args.startTime; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field startTime is unset!'); - } - if (args.endTime !== undefined && args.endTime !== null) { - this.endTime = args.endTime; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field endTime is unset!'); - } - if (args.statementId !== undefined && args.statementId !== null) { - this.statementId = args.statementId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statementId is unset!'); - } - if (args.enableRedirectQuery !== undefined && args.enableRedirectQuery !== null) { - this.enableRedirectQuery = args.enableRedirectQuery; - } - if (args.jdbcQuery !== undefined && args.jdbcQuery !== null) { - this.jdbcQuery = args.jdbcQuery; - } - if (args.timeout !== undefined && args.timeout !== null) { - this.timeout = args.timeout; - } - if (args.legalPathNodes !== undefined && args.legalPathNodes !== null) { - this.legalPathNodes = args.legalPathNodes; - } - } -}; -TSRawDataQueryReq.prototype = {}; -TSRawDataQueryReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.LIST) { - this.paths = []; - var _rtmp3332 = input.readListBegin(); - var _size331 = _rtmp3332.size || 0; - for (var _i333 = 0; _i333 < _size331; ++_i333) { - var elem334 = null; - elem334 = input.readString(); - this.paths.push(elem334); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.I32) { - this.fetchSize = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.I64) { - this.startTime = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.I64) { - this.endTime = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.I64) { - this.statementId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 7: - if (ftype == Thrift.Type.BOOL) { - this.enableRedirectQuery = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 8: - if (ftype == Thrift.Type.BOOL) { - this.jdbcQuery = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 9: - if (ftype == Thrift.Type.I64) { - this.timeout = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 10: - if (ftype == Thrift.Type.BOOL) { - this.legalPathNodes = input.readBool(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSRawDataQueryReq.prototype.write = function(output) { - output.writeStructBegin('TSRawDataQueryReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.paths !== null && this.paths !== undefined) { - output.writeFieldBegin('paths', Thrift.Type.LIST, 2); - output.writeListBegin(Thrift.Type.STRING, this.paths.length); - for (var iter335 in this.paths) { - if (this.paths.hasOwnProperty(iter335)) { - iter335 = this.paths[iter335]; - output.writeString(iter335); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.fetchSize !== null && this.fetchSize !== undefined) { - output.writeFieldBegin('fetchSize', Thrift.Type.I32, 3); - output.writeI32(this.fetchSize); - output.writeFieldEnd(); - } - if (this.startTime !== null && this.startTime !== undefined) { - output.writeFieldBegin('startTime', Thrift.Type.I64, 4); - output.writeI64(this.startTime); - output.writeFieldEnd(); - } - if (this.endTime !== null && this.endTime !== undefined) { - output.writeFieldBegin('endTime', Thrift.Type.I64, 5); - output.writeI64(this.endTime); - output.writeFieldEnd(); - } - if (this.statementId !== null && this.statementId !== undefined) { - output.writeFieldBegin('statementId', Thrift.Type.I64, 6); - output.writeI64(this.statementId); - output.writeFieldEnd(); - } - if (this.enableRedirectQuery !== null && this.enableRedirectQuery !== undefined) { - output.writeFieldBegin('enableRedirectQuery', Thrift.Type.BOOL, 7); - output.writeBool(this.enableRedirectQuery); - output.writeFieldEnd(); - } - if (this.jdbcQuery !== null && this.jdbcQuery !== undefined) { - output.writeFieldBegin('jdbcQuery', Thrift.Type.BOOL, 8); - output.writeBool(this.jdbcQuery); - output.writeFieldEnd(); - } - if (this.timeout !== null && this.timeout !== undefined) { - output.writeFieldBegin('timeout', Thrift.Type.I64, 9); - output.writeI64(this.timeout); - output.writeFieldEnd(); - } - if (this.legalPathNodes !== null && this.legalPathNodes !== undefined) { - output.writeFieldBegin('legalPathNodes', Thrift.Type.BOOL, 10); - output.writeBool(this.legalPathNodes); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSLastDataQueryReq = module.exports.TSLastDataQueryReq = function(args) { - this.sessionId = null; - this.paths = null; - this.fetchSize = null; - this.time = null; - this.statementId = null; - this.enableRedirectQuery = null; - this.jdbcQuery = null; - this.timeout = null; - this.legalPathNodes = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.paths !== undefined && args.paths !== null) { - this.paths = Thrift.copyList(args.paths, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field paths is unset!'); - } - if (args.fetchSize !== undefined && args.fetchSize !== null) { - this.fetchSize = args.fetchSize; - } - if (args.time !== undefined && args.time !== null) { - this.time = args.time; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field time is unset!'); - } - if (args.statementId !== undefined && args.statementId !== null) { - this.statementId = args.statementId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statementId is unset!'); - } - if (args.enableRedirectQuery !== undefined && args.enableRedirectQuery !== null) { - this.enableRedirectQuery = args.enableRedirectQuery; - } - if (args.jdbcQuery !== undefined && args.jdbcQuery !== null) { - this.jdbcQuery = args.jdbcQuery; - } - if (args.timeout !== undefined && args.timeout !== null) { - this.timeout = args.timeout; - } - if (args.legalPathNodes !== undefined && args.legalPathNodes !== null) { - this.legalPathNodes = args.legalPathNodes; - } - } -}; -TSLastDataQueryReq.prototype = {}; -TSLastDataQueryReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.LIST) { - this.paths = []; - var _rtmp3337 = input.readListBegin(); - var _size336 = _rtmp3337.size || 0; - for (var _i338 = 0; _i338 < _size336; ++_i338) { - var elem339 = null; - elem339 = input.readString(); - this.paths.push(elem339); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.I32) { - this.fetchSize = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.I64) { - this.time = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.I64) { - this.statementId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.BOOL) { - this.enableRedirectQuery = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 7: - if (ftype == Thrift.Type.BOOL) { - this.jdbcQuery = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 8: - if (ftype == Thrift.Type.I64) { - this.timeout = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 9: - if (ftype == Thrift.Type.BOOL) { - this.legalPathNodes = input.readBool(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSLastDataQueryReq.prototype.write = function(output) { - output.writeStructBegin('TSLastDataQueryReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.paths !== null && this.paths !== undefined) { - output.writeFieldBegin('paths', Thrift.Type.LIST, 2); - output.writeListBegin(Thrift.Type.STRING, this.paths.length); - for (var iter340 in this.paths) { - if (this.paths.hasOwnProperty(iter340)) { - iter340 = this.paths[iter340]; - output.writeString(iter340); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.fetchSize !== null && this.fetchSize !== undefined) { - output.writeFieldBegin('fetchSize', Thrift.Type.I32, 3); - output.writeI32(this.fetchSize); - output.writeFieldEnd(); - } - if (this.time !== null && this.time !== undefined) { - output.writeFieldBegin('time', Thrift.Type.I64, 4); - output.writeI64(this.time); - output.writeFieldEnd(); - } - if (this.statementId !== null && this.statementId !== undefined) { - output.writeFieldBegin('statementId', Thrift.Type.I64, 5); - output.writeI64(this.statementId); - output.writeFieldEnd(); - } - if (this.enableRedirectQuery !== null && this.enableRedirectQuery !== undefined) { - output.writeFieldBegin('enableRedirectQuery', Thrift.Type.BOOL, 6); - output.writeBool(this.enableRedirectQuery); - output.writeFieldEnd(); - } - if (this.jdbcQuery !== null && this.jdbcQuery !== undefined) { - output.writeFieldBegin('jdbcQuery', Thrift.Type.BOOL, 7); - output.writeBool(this.jdbcQuery); - output.writeFieldEnd(); - } - if (this.timeout !== null && this.timeout !== undefined) { - output.writeFieldBegin('timeout', Thrift.Type.I64, 8); - output.writeI64(this.timeout); - output.writeFieldEnd(); - } - if (this.legalPathNodes !== null && this.legalPathNodes !== undefined) { - output.writeFieldBegin('legalPathNodes', Thrift.Type.BOOL, 9); - output.writeBool(this.legalPathNodes); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSFastLastDataQueryForOneDeviceReq = module.exports.TSFastLastDataQueryForOneDeviceReq = function(args) { - this.sessionId = null; - this.db = null; - this.deviceId = null; - this.sensors = null; - this.fetchSize = null; - this.statementId = null; - this.enableRedirectQuery = null; - this.jdbcQuery = null; - this.timeout = null; - this.legalPathNodes = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.db !== undefined && args.db !== null) { - this.db = args.db; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field db is unset!'); - } - if (args.deviceId !== undefined && args.deviceId !== null) { - this.deviceId = args.deviceId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field deviceId is unset!'); - } - if (args.sensors !== undefined && args.sensors !== null) { - this.sensors = Thrift.copyList(args.sensors, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sensors is unset!'); - } - if (args.fetchSize !== undefined && args.fetchSize !== null) { - this.fetchSize = args.fetchSize; - } - if (args.statementId !== undefined && args.statementId !== null) { - this.statementId = args.statementId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statementId is unset!'); - } - if (args.enableRedirectQuery !== undefined && args.enableRedirectQuery !== null) { - this.enableRedirectQuery = args.enableRedirectQuery; - } - if (args.jdbcQuery !== undefined && args.jdbcQuery !== null) { - this.jdbcQuery = args.jdbcQuery; - } - if (args.timeout !== undefined && args.timeout !== null) { - this.timeout = args.timeout; - } - if (args.legalPathNodes !== undefined && args.legalPathNodes !== null) { - this.legalPathNodes = args.legalPathNodes; - } - } -}; -TSFastLastDataQueryForOneDeviceReq.prototype = {}; -TSFastLastDataQueryForOneDeviceReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.db = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.STRING) { - this.deviceId = input.readString(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.LIST) { - this.sensors = []; - var _rtmp3342 = input.readListBegin(); - var _size341 = _rtmp3342.size || 0; - for (var _i343 = 0; _i343 < _size341; ++_i343) { - var elem344 = null; - elem344 = input.readString(); - this.sensors.push(elem344); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.I32) { - this.fetchSize = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.I64) { - this.statementId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 7: - if (ftype == Thrift.Type.BOOL) { - this.enableRedirectQuery = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 8: - if (ftype == Thrift.Type.BOOL) { - this.jdbcQuery = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 9: - if (ftype == Thrift.Type.I64) { - this.timeout = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 10: - if (ftype == Thrift.Type.BOOL) { - this.legalPathNodes = input.readBool(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSFastLastDataQueryForOneDeviceReq.prototype.write = function(output) { - output.writeStructBegin('TSFastLastDataQueryForOneDeviceReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.db !== null && this.db !== undefined) { - output.writeFieldBegin('db', Thrift.Type.STRING, 2); - output.writeString(this.db); - output.writeFieldEnd(); - } - if (this.deviceId !== null && this.deviceId !== undefined) { - output.writeFieldBegin('deviceId', Thrift.Type.STRING, 3); - output.writeString(this.deviceId); - output.writeFieldEnd(); - } - if (this.sensors !== null && this.sensors !== undefined) { - output.writeFieldBegin('sensors', Thrift.Type.LIST, 4); - output.writeListBegin(Thrift.Type.STRING, this.sensors.length); - for (var iter345 in this.sensors) { - if (this.sensors.hasOwnProperty(iter345)) { - iter345 = this.sensors[iter345]; - output.writeString(iter345); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.fetchSize !== null && this.fetchSize !== undefined) { - output.writeFieldBegin('fetchSize', Thrift.Type.I32, 5); - output.writeI32(this.fetchSize); - output.writeFieldEnd(); - } - if (this.statementId !== null && this.statementId !== undefined) { - output.writeFieldBegin('statementId', Thrift.Type.I64, 6); - output.writeI64(this.statementId); - output.writeFieldEnd(); - } - if (this.enableRedirectQuery !== null && this.enableRedirectQuery !== undefined) { - output.writeFieldBegin('enableRedirectQuery', Thrift.Type.BOOL, 7); - output.writeBool(this.enableRedirectQuery); - output.writeFieldEnd(); - } - if (this.jdbcQuery !== null && this.jdbcQuery !== undefined) { - output.writeFieldBegin('jdbcQuery', Thrift.Type.BOOL, 8); - output.writeBool(this.jdbcQuery); - output.writeFieldEnd(); - } - if (this.timeout !== null && this.timeout !== undefined) { - output.writeFieldBegin('timeout', Thrift.Type.I64, 9); - output.writeI64(this.timeout); - output.writeFieldEnd(); - } - if (this.legalPathNodes !== null && this.legalPathNodes !== undefined) { - output.writeFieldBegin('legalPathNodes', Thrift.Type.BOOL, 10); - output.writeBool(this.legalPathNodes); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSAggregationQueryReq = module.exports.TSAggregationQueryReq = function(args) { - this.sessionId = null; - this.statementId = null; - this.paths = null; - this.aggregations = null; - this.startTime = null; - this.endTime = null; - this.interval = null; - this.slidingStep = null; - this.fetchSize = null; - this.timeout = null; - this.legalPathNodes = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.statementId !== undefined && args.statementId !== null) { - this.statementId = args.statementId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statementId is unset!'); - } - if (args.paths !== undefined && args.paths !== null) { - this.paths = Thrift.copyList(args.paths, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field paths is unset!'); - } - if (args.aggregations !== undefined && args.aggregations !== null) { - this.aggregations = Thrift.copyList(args.aggregations, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field aggregations is unset!'); - } - if (args.startTime !== undefined && args.startTime !== null) { - this.startTime = args.startTime; - } - if (args.endTime !== undefined && args.endTime !== null) { - this.endTime = args.endTime; - } - if (args.interval !== undefined && args.interval !== null) { - this.interval = args.interval; - } - if (args.slidingStep !== undefined && args.slidingStep !== null) { - this.slidingStep = args.slidingStep; - } - if (args.fetchSize !== undefined && args.fetchSize !== null) { - this.fetchSize = args.fetchSize; - } - if (args.timeout !== undefined && args.timeout !== null) { - this.timeout = args.timeout; - } - if (args.legalPathNodes !== undefined && args.legalPathNodes !== null) { - this.legalPathNodes = args.legalPathNodes; - } - } -}; -TSAggregationQueryReq.prototype = {}; -TSAggregationQueryReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.I64) { - this.statementId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.LIST) { - this.paths = []; - var _rtmp3347 = input.readListBegin(); - var _size346 = _rtmp3347.size || 0; - for (var _i348 = 0; _i348 < _size346; ++_i348) { - var elem349 = null; - elem349 = input.readString(); - this.paths.push(elem349); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.LIST) { - this.aggregations = []; - var _rtmp3351 = input.readListBegin(); - var _size350 = _rtmp3351.size || 0; - for (var _i352 = 0; _i352 < _size350; ++_i352) { - var elem353 = null; - elem353 = input.readI32(); - this.aggregations.push(elem353); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.I64) { - this.startTime = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.I64) { - this.endTime = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 7: - if (ftype == Thrift.Type.I64) { - this.interval = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 8: - if (ftype == Thrift.Type.I64) { - this.slidingStep = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 9: - if (ftype == Thrift.Type.I32) { - this.fetchSize = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 10: - if (ftype == Thrift.Type.I64) { - this.timeout = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 11: - if (ftype == Thrift.Type.BOOL) { - this.legalPathNodes = input.readBool(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSAggregationQueryReq.prototype.write = function(output) { - output.writeStructBegin('TSAggregationQueryReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.statementId !== null && this.statementId !== undefined) { - output.writeFieldBegin('statementId', Thrift.Type.I64, 2); - output.writeI64(this.statementId); - output.writeFieldEnd(); - } - if (this.paths !== null && this.paths !== undefined) { - output.writeFieldBegin('paths', Thrift.Type.LIST, 3); - output.writeListBegin(Thrift.Type.STRING, this.paths.length); - for (var iter354 in this.paths) { - if (this.paths.hasOwnProperty(iter354)) { - iter354 = this.paths[iter354]; - output.writeString(iter354); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.aggregations !== null && this.aggregations !== undefined) { - output.writeFieldBegin('aggregations', Thrift.Type.LIST, 4); - output.writeListBegin(Thrift.Type.I32, this.aggregations.length); - for (var iter355 in this.aggregations) { - if (this.aggregations.hasOwnProperty(iter355)) { - iter355 = this.aggregations[iter355]; - output.writeI32(iter355); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.startTime !== null && this.startTime !== undefined) { - output.writeFieldBegin('startTime', Thrift.Type.I64, 5); - output.writeI64(this.startTime); - output.writeFieldEnd(); - } - if (this.endTime !== null && this.endTime !== undefined) { - output.writeFieldBegin('endTime', Thrift.Type.I64, 6); - output.writeI64(this.endTime); - output.writeFieldEnd(); - } - if (this.interval !== null && this.interval !== undefined) { - output.writeFieldBegin('interval', Thrift.Type.I64, 7); - output.writeI64(this.interval); - output.writeFieldEnd(); - } - if (this.slidingStep !== null && this.slidingStep !== undefined) { - output.writeFieldBegin('slidingStep', Thrift.Type.I64, 8); - output.writeI64(this.slidingStep); - output.writeFieldEnd(); - } - if (this.fetchSize !== null && this.fetchSize !== undefined) { - output.writeFieldBegin('fetchSize', Thrift.Type.I32, 9); - output.writeI32(this.fetchSize); - output.writeFieldEnd(); - } - if (this.timeout !== null && this.timeout !== undefined) { - output.writeFieldBegin('timeout', Thrift.Type.I64, 10); - output.writeI64(this.timeout); - output.writeFieldEnd(); - } - if (this.legalPathNodes !== null && this.legalPathNodes !== undefined) { - output.writeFieldBegin('legalPathNodes', Thrift.Type.BOOL, 11); - output.writeBool(this.legalPathNodes); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSGroupByQueryIntervalReq = module.exports.TSGroupByQueryIntervalReq = function(args) { - this.sessionId = null; - this.statementId = null; - this.device = null; - this.measurement = null; - this.dataType = null; - this.aggregationType = null; - this.database = null; - this.startTime = null; - this.endTime = null; - this.interval = null; - this.fetchSize = null; - this.timeout = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.statementId !== undefined && args.statementId !== null) { - this.statementId = args.statementId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statementId is unset!'); - } - if (args.device !== undefined && args.device !== null) { - this.device = args.device; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field device is unset!'); - } - if (args.measurement !== undefined && args.measurement !== null) { - this.measurement = args.measurement; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurement is unset!'); - } - if (args.dataType !== undefined && args.dataType !== null) { - this.dataType = args.dataType; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dataType is unset!'); - } - if (args.aggregationType !== undefined && args.aggregationType !== null) { - this.aggregationType = args.aggregationType; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field aggregationType is unset!'); - } - if (args.database !== undefined && args.database !== null) { - this.database = args.database; - } - if (args.startTime !== undefined && args.startTime !== null) { - this.startTime = args.startTime; - } - if (args.endTime !== undefined && args.endTime !== null) { - this.endTime = args.endTime; - } - if (args.interval !== undefined && args.interval !== null) { - this.interval = args.interval; - } - if (args.fetchSize !== undefined && args.fetchSize !== null) { - this.fetchSize = args.fetchSize; - } - if (args.timeout !== undefined && args.timeout !== null) { - this.timeout = args.timeout; - } - } -}; -TSGroupByQueryIntervalReq.prototype = {}; -TSGroupByQueryIntervalReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.I64) { - this.statementId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.STRING) { - this.device = input.readString(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.STRING) { - this.measurement = input.readString(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.I32) { - this.dataType = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.I32) { - this.aggregationType = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 7: - if (ftype == Thrift.Type.STRING) { - this.database = input.readString(); - } else { - input.skip(ftype); - } - break; - case 8: - if (ftype == Thrift.Type.I64) { - this.startTime = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 9: - if (ftype == Thrift.Type.I64) { - this.endTime = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 10: - if (ftype == Thrift.Type.I64) { - this.interval = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 11: - if (ftype == Thrift.Type.I32) { - this.fetchSize = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 12: - if (ftype == Thrift.Type.I64) { - this.timeout = input.readI64(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSGroupByQueryIntervalReq.prototype.write = function(output) { - output.writeStructBegin('TSGroupByQueryIntervalReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.statementId !== null && this.statementId !== undefined) { - output.writeFieldBegin('statementId', Thrift.Type.I64, 2); - output.writeI64(this.statementId); - output.writeFieldEnd(); - } - if (this.device !== null && this.device !== undefined) { - output.writeFieldBegin('device', Thrift.Type.STRING, 3); - output.writeString(this.device); - output.writeFieldEnd(); - } - if (this.measurement !== null && this.measurement !== undefined) { - output.writeFieldBegin('measurement', Thrift.Type.STRING, 4); - output.writeString(this.measurement); - output.writeFieldEnd(); - } - if (this.dataType !== null && this.dataType !== undefined) { - output.writeFieldBegin('dataType', Thrift.Type.I32, 5); - output.writeI32(this.dataType); - output.writeFieldEnd(); - } - if (this.aggregationType !== null && this.aggregationType !== undefined) { - output.writeFieldBegin('aggregationType', Thrift.Type.I32, 6); - output.writeI32(this.aggregationType); - output.writeFieldEnd(); - } - if (this.database !== null && this.database !== undefined) { - output.writeFieldBegin('database', Thrift.Type.STRING, 7); - output.writeString(this.database); - output.writeFieldEnd(); - } - if (this.startTime !== null && this.startTime !== undefined) { - output.writeFieldBegin('startTime', Thrift.Type.I64, 8); - output.writeI64(this.startTime); - output.writeFieldEnd(); - } - if (this.endTime !== null && this.endTime !== undefined) { - output.writeFieldBegin('endTime', Thrift.Type.I64, 9); - output.writeI64(this.endTime); - output.writeFieldEnd(); - } - if (this.interval !== null && this.interval !== undefined) { - output.writeFieldBegin('interval', Thrift.Type.I64, 10); - output.writeI64(this.interval); - output.writeFieldEnd(); - } - if (this.fetchSize !== null && this.fetchSize !== undefined) { - output.writeFieldBegin('fetchSize', Thrift.Type.I32, 11); - output.writeI32(this.fetchSize); - output.writeFieldEnd(); - } - if (this.timeout !== null && this.timeout !== undefined) { - output.writeFieldBegin('timeout', Thrift.Type.I64, 12); - output.writeI64(this.timeout); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSCreateMultiTimeseriesReq = module.exports.TSCreateMultiTimeseriesReq = function(args) { - this.sessionId = null; - this.paths = null; - this.dataTypes = null; - this.encodings = null; - this.compressors = null; - this.propsList = null; - this.tagsList = null; - this.attributesList = null; - this.measurementAliasList = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.paths !== undefined && args.paths !== null) { - this.paths = Thrift.copyList(args.paths, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field paths is unset!'); - } - if (args.dataTypes !== undefined && args.dataTypes !== null) { - this.dataTypes = Thrift.copyList(args.dataTypes, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dataTypes is unset!'); - } - if (args.encodings !== undefined && args.encodings !== null) { - this.encodings = Thrift.copyList(args.encodings, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field encodings is unset!'); - } - if (args.compressors !== undefined && args.compressors !== null) { - this.compressors = Thrift.copyList(args.compressors, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field compressors is unset!'); - } - if (args.propsList !== undefined && args.propsList !== null) { - this.propsList = Thrift.copyList(args.propsList, [Thrift.copyMap, null]); - } - if (args.tagsList !== undefined && args.tagsList !== null) { - this.tagsList = Thrift.copyList(args.tagsList, [Thrift.copyMap, null]); - } - if (args.attributesList !== undefined && args.attributesList !== null) { - this.attributesList = Thrift.copyList(args.attributesList, [Thrift.copyMap, null]); - } - if (args.measurementAliasList !== undefined && args.measurementAliasList !== null) { - this.measurementAliasList = Thrift.copyList(args.measurementAliasList, [null]); - } - } -}; -TSCreateMultiTimeseriesReq.prototype = {}; -TSCreateMultiTimeseriesReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.LIST) { - this.paths = []; - var _rtmp3357 = input.readListBegin(); - var _size356 = _rtmp3357.size || 0; - for (var _i358 = 0; _i358 < _size356; ++_i358) { - var elem359 = null; - elem359 = input.readString(); - this.paths.push(elem359); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.LIST) { - this.dataTypes = []; - var _rtmp3361 = input.readListBegin(); - var _size360 = _rtmp3361.size || 0; - for (var _i362 = 0; _i362 < _size360; ++_i362) { - var elem363 = null; - elem363 = input.readI32(); - this.dataTypes.push(elem363); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.LIST) { - this.encodings = []; - var _rtmp3365 = input.readListBegin(); - var _size364 = _rtmp3365.size || 0; - for (var _i366 = 0; _i366 < _size364; ++_i366) { - var elem367 = null; - elem367 = input.readI32(); - this.encodings.push(elem367); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.LIST) { - this.compressors = []; - var _rtmp3369 = input.readListBegin(); - var _size368 = _rtmp3369.size || 0; - for (var _i370 = 0; _i370 < _size368; ++_i370) { - var elem371 = null; - elem371 = input.readI32(); - this.compressors.push(elem371); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.LIST) { - this.propsList = []; - var _rtmp3373 = input.readListBegin(); - var _size372 = _rtmp3373.size || 0; - for (var _i374 = 0; _i374 < _size372; ++_i374) { - var elem375 = null; - elem375 = {}; - var _rtmp3377 = input.readMapBegin(); - var _size376 = _rtmp3377.size || 0; - for (var _i378 = 0; _i378 < _size376; ++_i378) { - var key379 = null; - var val380 = null; - key379 = input.readString(); - val380 = input.readString(); - elem375[key379] = val380; - } - input.readMapEnd(); - this.propsList.push(elem375); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 7: - if (ftype == Thrift.Type.LIST) { - this.tagsList = []; - var _rtmp3382 = input.readListBegin(); - var _size381 = _rtmp3382.size || 0; - for (var _i383 = 0; _i383 < _size381; ++_i383) { - var elem384 = null; - elem384 = {}; - var _rtmp3386 = input.readMapBegin(); - var _size385 = _rtmp3386.size || 0; - for (var _i387 = 0; _i387 < _size385; ++_i387) { - var key388 = null; - var val389 = null; - key388 = input.readString(); - val389 = input.readString(); - elem384[key388] = val389; - } - input.readMapEnd(); - this.tagsList.push(elem384); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 8: - if (ftype == Thrift.Type.LIST) { - this.attributesList = []; - var _rtmp3391 = input.readListBegin(); - var _size390 = _rtmp3391.size || 0; - for (var _i392 = 0; _i392 < _size390; ++_i392) { - var elem393 = null; - elem393 = {}; - var _rtmp3395 = input.readMapBegin(); - var _size394 = _rtmp3395.size || 0; - for (var _i396 = 0; _i396 < _size394; ++_i396) { - var key397 = null; - var val398 = null; - key397 = input.readString(); - val398 = input.readString(); - elem393[key397] = val398; - } - input.readMapEnd(); - this.attributesList.push(elem393); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 9: - if (ftype == Thrift.Type.LIST) { - this.measurementAliasList = []; - var _rtmp3400 = input.readListBegin(); - var _size399 = _rtmp3400.size || 0; - for (var _i401 = 0; _i401 < _size399; ++_i401) { - var elem402 = null; - elem402 = input.readString(); - this.measurementAliasList.push(elem402); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSCreateMultiTimeseriesReq.prototype.write = function(output) { - output.writeStructBegin('TSCreateMultiTimeseriesReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.paths !== null && this.paths !== undefined) { - output.writeFieldBegin('paths', Thrift.Type.LIST, 2); - output.writeListBegin(Thrift.Type.STRING, this.paths.length); - for (var iter403 in this.paths) { - if (this.paths.hasOwnProperty(iter403)) { - iter403 = this.paths[iter403]; - output.writeString(iter403); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.dataTypes !== null && this.dataTypes !== undefined) { - output.writeFieldBegin('dataTypes', Thrift.Type.LIST, 3); - output.writeListBegin(Thrift.Type.I32, this.dataTypes.length); - for (var iter404 in this.dataTypes) { - if (this.dataTypes.hasOwnProperty(iter404)) { - iter404 = this.dataTypes[iter404]; - output.writeI32(iter404); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.encodings !== null && this.encodings !== undefined) { - output.writeFieldBegin('encodings', Thrift.Type.LIST, 4); - output.writeListBegin(Thrift.Type.I32, this.encodings.length); - for (var iter405 in this.encodings) { - if (this.encodings.hasOwnProperty(iter405)) { - iter405 = this.encodings[iter405]; - output.writeI32(iter405); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.compressors !== null && this.compressors !== undefined) { - output.writeFieldBegin('compressors', Thrift.Type.LIST, 5); - output.writeListBegin(Thrift.Type.I32, this.compressors.length); - for (var iter406 in this.compressors) { - if (this.compressors.hasOwnProperty(iter406)) { - iter406 = this.compressors[iter406]; - output.writeI32(iter406); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.propsList !== null && this.propsList !== undefined) { - output.writeFieldBegin('propsList', Thrift.Type.LIST, 6); - output.writeListBegin(Thrift.Type.MAP, this.propsList.length); - for (var iter407 in this.propsList) { - if (this.propsList.hasOwnProperty(iter407)) { - iter407 = this.propsList[iter407]; - output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(iter407)); - for (var kiter408 in iter407) { - if (iter407.hasOwnProperty(kiter408)) { - var viter409 = iter407[kiter408]; - output.writeString(kiter408); - output.writeString(viter409); - } - } - output.writeMapEnd(); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.tagsList !== null && this.tagsList !== undefined) { - output.writeFieldBegin('tagsList', Thrift.Type.LIST, 7); - output.writeListBegin(Thrift.Type.MAP, this.tagsList.length); - for (var iter410 in this.tagsList) { - if (this.tagsList.hasOwnProperty(iter410)) { - iter410 = this.tagsList[iter410]; - output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(iter410)); - for (var kiter411 in iter410) { - if (iter410.hasOwnProperty(kiter411)) { - var viter412 = iter410[kiter411]; - output.writeString(kiter411); - output.writeString(viter412); - } - } - output.writeMapEnd(); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.attributesList !== null && this.attributesList !== undefined) { - output.writeFieldBegin('attributesList', Thrift.Type.LIST, 8); - output.writeListBegin(Thrift.Type.MAP, this.attributesList.length); - for (var iter413 in this.attributesList) { - if (this.attributesList.hasOwnProperty(iter413)) { - iter413 = this.attributesList[iter413]; - output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(iter413)); - for (var kiter414 in iter413) { - if (iter413.hasOwnProperty(kiter414)) { - var viter415 = iter413[kiter414]; - output.writeString(kiter414); - output.writeString(viter415); - } - } - output.writeMapEnd(); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.measurementAliasList !== null && this.measurementAliasList !== undefined) { - output.writeFieldBegin('measurementAliasList', Thrift.Type.LIST, 9); - output.writeListBegin(Thrift.Type.STRING, this.measurementAliasList.length); - for (var iter416 in this.measurementAliasList) { - if (this.measurementAliasList.hasOwnProperty(iter416)) { - iter416 = this.measurementAliasList[iter416]; - output.writeString(iter416); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var ServerProperties = module.exports.ServerProperties = function(args) { - this.version = null; - this.supportedTimeAggregationOperations = null; - this.timestampPrecision = null; - this.maxConcurrentClientNum = null; - this.thriftMaxFrameSize = null; - this.isReadOnly = null; - this.buildInfo = null; - this.logo = null; - if (args) { - if (args.version !== undefined && args.version !== null) { - this.version = args.version; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field version is unset!'); - } - if (args.supportedTimeAggregationOperations !== undefined && args.supportedTimeAggregationOperations !== null) { - this.supportedTimeAggregationOperations = Thrift.copyList(args.supportedTimeAggregationOperations, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field supportedTimeAggregationOperations is unset!'); - } - if (args.timestampPrecision !== undefined && args.timestampPrecision !== null) { - this.timestampPrecision = args.timestampPrecision; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestampPrecision is unset!'); - } - if (args.maxConcurrentClientNum !== undefined && args.maxConcurrentClientNum !== null) { - this.maxConcurrentClientNum = args.maxConcurrentClientNum; - } - if (args.thriftMaxFrameSize !== undefined && args.thriftMaxFrameSize !== null) { - this.thriftMaxFrameSize = args.thriftMaxFrameSize; - } - if (args.isReadOnly !== undefined && args.isReadOnly !== null) { - this.isReadOnly = args.isReadOnly; - } - if (args.buildInfo !== undefined && args.buildInfo !== null) { - this.buildInfo = args.buildInfo; - } - if (args.logo !== undefined && args.logo !== null) { - this.logo = args.logo; - } - } -}; -ServerProperties.prototype = {}; -ServerProperties.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRING) { - this.version = input.readString(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.LIST) { - this.supportedTimeAggregationOperations = []; - var _rtmp3418 = input.readListBegin(); - var _size417 = _rtmp3418.size || 0; - for (var _i419 = 0; _i419 < _size417; ++_i419) { - var elem420 = null; - elem420 = input.readString(); - this.supportedTimeAggregationOperations.push(elem420); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.STRING) { - this.timestampPrecision = input.readString(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.I32) { - this.maxConcurrentClientNum = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.I32) { - this.thriftMaxFrameSize = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.BOOL) { - this.isReadOnly = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 7: - if (ftype == Thrift.Type.STRING) { - this.buildInfo = input.readString(); - } else { - input.skip(ftype); - } - break; - case 8: - if (ftype == Thrift.Type.STRING) { - this.logo = input.readString(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -ServerProperties.prototype.write = function(output) { - output.writeStructBegin('ServerProperties'); - if (this.version !== null && this.version !== undefined) { - output.writeFieldBegin('version', Thrift.Type.STRING, 1); - output.writeString(this.version); - output.writeFieldEnd(); - } - if (this.supportedTimeAggregationOperations !== null && this.supportedTimeAggregationOperations !== undefined) { - output.writeFieldBegin('supportedTimeAggregationOperations', Thrift.Type.LIST, 2); - output.writeListBegin(Thrift.Type.STRING, this.supportedTimeAggregationOperations.length); - for (var iter421 in this.supportedTimeAggregationOperations) { - if (this.supportedTimeAggregationOperations.hasOwnProperty(iter421)) { - iter421 = this.supportedTimeAggregationOperations[iter421]; - output.writeString(iter421); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.timestampPrecision !== null && this.timestampPrecision !== undefined) { - output.writeFieldBegin('timestampPrecision', Thrift.Type.STRING, 3); - output.writeString(this.timestampPrecision); - output.writeFieldEnd(); - } - if (this.maxConcurrentClientNum !== null && this.maxConcurrentClientNum !== undefined) { - output.writeFieldBegin('maxConcurrentClientNum', Thrift.Type.I32, 4); - output.writeI32(this.maxConcurrentClientNum); - output.writeFieldEnd(); - } - if (this.thriftMaxFrameSize !== null && this.thriftMaxFrameSize !== undefined) { - output.writeFieldBegin('thriftMaxFrameSize', Thrift.Type.I32, 5); - output.writeI32(this.thriftMaxFrameSize); - output.writeFieldEnd(); - } - if (this.isReadOnly !== null && this.isReadOnly !== undefined) { - output.writeFieldBegin('isReadOnly', Thrift.Type.BOOL, 6); - output.writeBool(this.isReadOnly); - output.writeFieldEnd(); - } - if (this.buildInfo !== null && this.buildInfo !== undefined) { - output.writeFieldBegin('buildInfo', Thrift.Type.STRING, 7); - output.writeString(this.buildInfo); - output.writeFieldEnd(); - } - if (this.logo !== null && this.logo !== undefined) { - output.writeFieldBegin('logo', Thrift.Type.STRING, 8); - output.writeString(this.logo); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSSetSchemaTemplateReq = module.exports.TSSetSchemaTemplateReq = function(args) { - this.sessionId = null; - this.templateName = null; - this.prefixPath = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.templateName !== undefined && args.templateName !== null) { - this.templateName = args.templateName; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field templateName is unset!'); - } - if (args.prefixPath !== undefined && args.prefixPath !== null) { - this.prefixPath = args.prefixPath; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPath is unset!'); - } - } -}; -TSSetSchemaTemplateReq.prototype = {}; -TSSetSchemaTemplateReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.templateName = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.STRING) { - this.prefixPath = input.readString(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSSetSchemaTemplateReq.prototype.write = function(output) { - output.writeStructBegin('TSSetSchemaTemplateReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.templateName !== null && this.templateName !== undefined) { - output.writeFieldBegin('templateName', Thrift.Type.STRING, 2); - output.writeString(this.templateName); - output.writeFieldEnd(); - } - if (this.prefixPath !== null && this.prefixPath !== undefined) { - output.writeFieldBegin('prefixPath', Thrift.Type.STRING, 3); - output.writeString(this.prefixPath); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSCreateSchemaTemplateReq = module.exports.TSCreateSchemaTemplateReq = function(args) { - this.sessionId = null; - this.name = null; - this.serializedTemplate = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.name !== undefined && args.name !== null) { - this.name = args.name; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field name is unset!'); - } - if (args.serializedTemplate !== undefined && args.serializedTemplate !== null) { - this.serializedTemplate = args.serializedTemplate; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field serializedTemplate is unset!'); - } - } -}; -TSCreateSchemaTemplateReq.prototype = {}; -TSCreateSchemaTemplateReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.name = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.STRING) { - this.serializedTemplate = input.readBinary(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSCreateSchemaTemplateReq.prototype.write = function(output) { - output.writeStructBegin('TSCreateSchemaTemplateReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.name !== null && this.name !== undefined) { - output.writeFieldBegin('name', Thrift.Type.STRING, 2); - output.writeString(this.name); - output.writeFieldEnd(); - } - if (this.serializedTemplate !== null && this.serializedTemplate !== undefined) { - output.writeFieldBegin('serializedTemplate', Thrift.Type.STRING, 3); - output.writeBinary(this.serializedTemplate); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSAppendSchemaTemplateReq = module.exports.TSAppendSchemaTemplateReq = function(args) { - this.sessionId = null; - this.name = null; - this.isAligned = null; - this.measurements = null; - this.dataTypes = null; - this.encodings = null; - this.compressors = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.name !== undefined && args.name !== null) { - this.name = args.name; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field name is unset!'); - } - if (args.isAligned !== undefined && args.isAligned !== null) { - this.isAligned = args.isAligned; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field isAligned is unset!'); - } - if (args.measurements !== undefined && args.measurements !== null) { - this.measurements = Thrift.copyList(args.measurements, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurements is unset!'); - } - if (args.dataTypes !== undefined && args.dataTypes !== null) { - this.dataTypes = Thrift.copyList(args.dataTypes, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dataTypes is unset!'); - } - if (args.encodings !== undefined && args.encodings !== null) { - this.encodings = Thrift.copyList(args.encodings, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field encodings is unset!'); - } - if (args.compressors !== undefined && args.compressors !== null) { - this.compressors = Thrift.copyList(args.compressors, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field compressors is unset!'); - } - } -}; -TSAppendSchemaTemplateReq.prototype = {}; -TSAppendSchemaTemplateReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.name = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.BOOL) { - this.isAligned = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.LIST) { - this.measurements = []; - var _rtmp3423 = input.readListBegin(); - var _size422 = _rtmp3423.size || 0; - for (var _i424 = 0; _i424 < _size422; ++_i424) { - var elem425 = null; - elem425 = input.readString(); - this.measurements.push(elem425); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.LIST) { - this.dataTypes = []; - var _rtmp3427 = input.readListBegin(); - var _size426 = _rtmp3427.size || 0; - for (var _i428 = 0; _i428 < _size426; ++_i428) { - var elem429 = null; - elem429 = input.readI32(); - this.dataTypes.push(elem429); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.LIST) { - this.encodings = []; - var _rtmp3431 = input.readListBegin(); - var _size430 = _rtmp3431.size || 0; - for (var _i432 = 0; _i432 < _size430; ++_i432) { - var elem433 = null; - elem433 = input.readI32(); - this.encodings.push(elem433); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 7: - if (ftype == Thrift.Type.LIST) { - this.compressors = []; - var _rtmp3435 = input.readListBegin(); - var _size434 = _rtmp3435.size || 0; - for (var _i436 = 0; _i436 < _size434; ++_i436) { - var elem437 = null; - elem437 = input.readI32(); - this.compressors.push(elem437); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSAppendSchemaTemplateReq.prototype.write = function(output) { - output.writeStructBegin('TSAppendSchemaTemplateReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.name !== null && this.name !== undefined) { - output.writeFieldBegin('name', Thrift.Type.STRING, 2); - output.writeString(this.name); - output.writeFieldEnd(); - } - if (this.isAligned !== null && this.isAligned !== undefined) { - output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 3); - output.writeBool(this.isAligned); - output.writeFieldEnd(); - } - if (this.measurements !== null && this.measurements !== undefined) { - output.writeFieldBegin('measurements', Thrift.Type.LIST, 4); - output.writeListBegin(Thrift.Type.STRING, this.measurements.length); - for (var iter438 in this.measurements) { - if (this.measurements.hasOwnProperty(iter438)) { - iter438 = this.measurements[iter438]; - output.writeString(iter438); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.dataTypes !== null && this.dataTypes !== undefined) { - output.writeFieldBegin('dataTypes', Thrift.Type.LIST, 5); - output.writeListBegin(Thrift.Type.I32, this.dataTypes.length); - for (var iter439 in this.dataTypes) { - if (this.dataTypes.hasOwnProperty(iter439)) { - iter439 = this.dataTypes[iter439]; - output.writeI32(iter439); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.encodings !== null && this.encodings !== undefined) { - output.writeFieldBegin('encodings', Thrift.Type.LIST, 6); - output.writeListBegin(Thrift.Type.I32, this.encodings.length); - for (var iter440 in this.encodings) { - if (this.encodings.hasOwnProperty(iter440)) { - iter440 = this.encodings[iter440]; - output.writeI32(iter440); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.compressors !== null && this.compressors !== undefined) { - output.writeFieldBegin('compressors', Thrift.Type.LIST, 7); - output.writeListBegin(Thrift.Type.I32, this.compressors.length); - for (var iter441 in this.compressors) { - if (this.compressors.hasOwnProperty(iter441)) { - iter441 = this.compressors[iter441]; - output.writeI32(iter441); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSPruneSchemaTemplateReq = module.exports.TSPruneSchemaTemplateReq = function(args) { - this.sessionId = null; - this.name = null; - this.path = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.name !== undefined && args.name !== null) { - this.name = args.name; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field name is unset!'); - } - if (args.path !== undefined && args.path !== null) { - this.path = args.path; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field path is unset!'); - } - } -}; -TSPruneSchemaTemplateReq.prototype = {}; -TSPruneSchemaTemplateReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.name = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.STRING) { - this.path = input.readString(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSPruneSchemaTemplateReq.prototype.write = function(output) { - output.writeStructBegin('TSPruneSchemaTemplateReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.name !== null && this.name !== undefined) { - output.writeFieldBegin('name', Thrift.Type.STRING, 2); - output.writeString(this.name); - output.writeFieldEnd(); - } - if (this.path !== null && this.path !== undefined) { - output.writeFieldBegin('path', Thrift.Type.STRING, 3); - output.writeString(this.path); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSQueryTemplateReq = module.exports.TSQueryTemplateReq = function(args) { - this.sessionId = null; - this.name = null; - this.queryType = null; - this.measurement = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.name !== undefined && args.name !== null) { - this.name = args.name; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field name is unset!'); - } - if (args.queryType !== undefined && args.queryType !== null) { - this.queryType = args.queryType; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field queryType is unset!'); - } - if (args.measurement !== undefined && args.measurement !== null) { - this.measurement = args.measurement; - } - } -}; -TSQueryTemplateReq.prototype = {}; -TSQueryTemplateReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.name = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.I32) { - this.queryType = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.STRING) { - this.measurement = input.readString(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSQueryTemplateReq.prototype.write = function(output) { - output.writeStructBegin('TSQueryTemplateReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.name !== null && this.name !== undefined) { - output.writeFieldBegin('name', Thrift.Type.STRING, 2); - output.writeString(this.name); - output.writeFieldEnd(); - } - if (this.queryType !== null && this.queryType !== undefined) { - output.writeFieldBegin('queryType', Thrift.Type.I32, 3); - output.writeI32(this.queryType); - output.writeFieldEnd(); - } - if (this.measurement !== null && this.measurement !== undefined) { - output.writeFieldBegin('measurement', Thrift.Type.STRING, 4); - output.writeString(this.measurement); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSQueryTemplateResp = module.exports.TSQueryTemplateResp = function(args) { - this.status = null; - this.queryType = null; - this.result = null; - this.count = null; - this.measurements = null; - if (args) { - if (args.status !== undefined && args.status !== null) { - this.status = new common_ttypes.TSStatus(args.status); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); - } - if (args.queryType !== undefined && args.queryType !== null) { - this.queryType = args.queryType; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field queryType is unset!'); - } - if (args.result !== undefined && args.result !== null) { - this.result = args.result; - } - if (args.count !== undefined && args.count !== null) { - this.count = args.count; - } - if (args.measurements !== undefined && args.measurements !== null) { - this.measurements = Thrift.copyList(args.measurements, [null]); - } - } -}; -TSQueryTemplateResp.prototype = {}; -TSQueryTemplateResp.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.status = new common_ttypes.TSStatus(); - this.status.read(input); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.I32) { - this.queryType = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.BOOL) { - this.result = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.I32) { - this.count = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.LIST) { - this.measurements = []; - var _rtmp3443 = input.readListBegin(); - var _size442 = _rtmp3443.size || 0; - for (var _i444 = 0; _i444 < _size442; ++_i444) { - var elem445 = null; - elem445 = input.readString(); - this.measurements.push(elem445); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSQueryTemplateResp.prototype.write = function(output) { - output.writeStructBegin('TSQueryTemplateResp'); - if (this.status !== null && this.status !== undefined) { - output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); - this.status.write(output); - output.writeFieldEnd(); - } - if (this.queryType !== null && this.queryType !== undefined) { - output.writeFieldBegin('queryType', Thrift.Type.I32, 2); - output.writeI32(this.queryType); - output.writeFieldEnd(); - } - if (this.result !== null && this.result !== undefined) { - output.writeFieldBegin('result', Thrift.Type.BOOL, 3); - output.writeBool(this.result); - output.writeFieldEnd(); - } - if (this.count !== null && this.count !== undefined) { - output.writeFieldBegin('count', Thrift.Type.I32, 4); - output.writeI32(this.count); - output.writeFieldEnd(); - } - if (this.measurements !== null && this.measurements !== undefined) { - output.writeFieldBegin('measurements', Thrift.Type.LIST, 5); - output.writeListBegin(Thrift.Type.STRING, this.measurements.length); - for (var iter446 in this.measurements) { - if (this.measurements.hasOwnProperty(iter446)) { - iter446 = this.measurements[iter446]; - output.writeString(iter446); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSUnsetSchemaTemplateReq = module.exports.TSUnsetSchemaTemplateReq = function(args) { - this.sessionId = null; - this.prefixPath = null; - this.templateName = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.prefixPath !== undefined && args.prefixPath !== null) { - this.prefixPath = args.prefixPath; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPath is unset!'); - } - if (args.templateName !== undefined && args.templateName !== null) { - this.templateName = args.templateName; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field templateName is unset!'); - } - } -}; -TSUnsetSchemaTemplateReq.prototype = {}; -TSUnsetSchemaTemplateReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.prefixPath = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.STRING) { - this.templateName = input.readString(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSUnsetSchemaTemplateReq.prototype.write = function(output) { - output.writeStructBegin('TSUnsetSchemaTemplateReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.prefixPath !== null && this.prefixPath !== undefined) { - output.writeFieldBegin('prefixPath', Thrift.Type.STRING, 2); - output.writeString(this.prefixPath); - output.writeFieldEnd(); - } - if (this.templateName !== null && this.templateName !== undefined) { - output.writeFieldBegin('templateName', Thrift.Type.STRING, 3); - output.writeString(this.templateName); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSDropSchemaTemplateReq = module.exports.TSDropSchemaTemplateReq = function(args) { - this.sessionId = null; - this.templateName = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.templateName !== undefined && args.templateName !== null) { - this.templateName = args.templateName; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field templateName is unset!'); - } - } -}; -TSDropSchemaTemplateReq.prototype = {}; -TSDropSchemaTemplateReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.templateName = input.readString(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSDropSchemaTemplateReq.prototype.write = function(output) { - output.writeStructBegin('TSDropSchemaTemplateReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.templateName !== null && this.templateName !== undefined) { - output.writeFieldBegin('templateName', Thrift.Type.STRING, 2); - output.writeString(this.templateName); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TCreateTimeseriesUsingSchemaTemplateReq = module.exports.TCreateTimeseriesUsingSchemaTemplateReq = function(args) { - this.sessionId = null; - this.devicePathList = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.devicePathList !== undefined && args.devicePathList !== null) { - this.devicePathList = Thrift.copyList(args.devicePathList, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field devicePathList is unset!'); - } - } -}; -TCreateTimeseriesUsingSchemaTemplateReq.prototype = {}; -TCreateTimeseriesUsingSchemaTemplateReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.LIST) { - this.devicePathList = []; - var _rtmp3448 = input.readListBegin(); - var _size447 = _rtmp3448.size || 0; - for (var _i449 = 0; _i449 < _size447; ++_i449) { - var elem450 = null; - elem450 = input.readString(); - this.devicePathList.push(elem450); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TCreateTimeseriesUsingSchemaTemplateReq.prototype.write = function(output) { - output.writeStructBegin('TCreateTimeseriesUsingSchemaTemplateReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.devicePathList !== null && this.devicePathList !== undefined) { - output.writeFieldBegin('devicePathList', Thrift.Type.LIST, 2); - output.writeListBegin(Thrift.Type.STRING, this.devicePathList.length); - for (var iter451 in this.devicePathList) { - if (this.devicePathList.hasOwnProperty(iter451)) { - iter451 = this.devicePathList[iter451]; - output.writeString(iter451); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSyncIdentityInfo = module.exports.TSyncIdentityInfo = function(args) { - this.pipeName = null; - this.createTime = null; - this.version = null; - this.database = null; - if (args) { - if (args.pipeName !== undefined && args.pipeName !== null) { - this.pipeName = args.pipeName; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field pipeName is unset!'); - } - if (args.createTime !== undefined && args.createTime !== null) { - this.createTime = args.createTime; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field createTime is unset!'); - } - if (args.version !== undefined && args.version !== null) { - this.version = args.version; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field version is unset!'); - } - if (args.database !== undefined && args.database !== null) { - this.database = args.database; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field database is unset!'); - } - } -}; -TSyncIdentityInfo.prototype = {}; -TSyncIdentityInfo.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRING) { - this.pipeName = input.readString(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.I64) { - this.createTime = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.STRING) { - this.version = input.readString(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.STRING) { - this.database = input.readString(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSyncIdentityInfo.prototype.write = function(output) { - output.writeStructBegin('TSyncIdentityInfo'); - if (this.pipeName !== null && this.pipeName !== undefined) { - output.writeFieldBegin('pipeName', Thrift.Type.STRING, 1); - output.writeString(this.pipeName); - output.writeFieldEnd(); - } - if (this.createTime !== null && this.createTime !== undefined) { - output.writeFieldBegin('createTime', Thrift.Type.I64, 2); - output.writeI64(this.createTime); - output.writeFieldEnd(); - } - if (this.version !== null && this.version !== undefined) { - output.writeFieldBegin('version', Thrift.Type.STRING, 3); - output.writeString(this.version); - output.writeFieldEnd(); - } - if (this.database !== null && this.database !== undefined) { - output.writeFieldBegin('database', Thrift.Type.STRING, 4); - output.writeString(this.database); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSyncTransportMetaInfo = module.exports.TSyncTransportMetaInfo = function(args) { - this.fileName = null; - this.startIndex = null; - if (args) { - if (args.fileName !== undefined && args.fileName !== null) { - this.fileName = args.fileName; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field fileName is unset!'); - } - if (args.startIndex !== undefined && args.startIndex !== null) { - this.startIndex = args.startIndex; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field startIndex is unset!'); - } - } -}; -TSyncTransportMetaInfo.prototype = {}; -TSyncTransportMetaInfo.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRING) { - this.fileName = input.readString(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.I64) { - this.startIndex = input.readI64(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSyncTransportMetaInfo.prototype.write = function(output) { - output.writeStructBegin('TSyncTransportMetaInfo'); - if (this.fileName !== null && this.fileName !== undefined) { - output.writeFieldBegin('fileName', Thrift.Type.STRING, 1); - output.writeString(this.fileName); - output.writeFieldEnd(); - } - if (this.startIndex !== null && this.startIndex !== undefined) { - output.writeFieldBegin('startIndex', Thrift.Type.I64, 2); - output.writeI64(this.startIndex); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TPipeTransferReq = module.exports.TPipeTransferReq = function(args) { - this.version = null; - this.type = null; - this.body = null; - if (args) { - if (args.version !== undefined && args.version !== null) { - this.version = args.version; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field version is unset!'); - } - if (args.type !== undefined && args.type !== null) { - this.type = args.type; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field type is unset!'); - } - if (args.body !== undefined && args.body !== null) { - this.body = args.body; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field body is unset!'); - } - } -}; -TPipeTransferReq.prototype = {}; -TPipeTransferReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.BYTE) { - this.version = input.readByte(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.I16) { - this.type = input.readI16(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.STRING) { - this.body = input.readBinary(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TPipeTransferReq.prototype.write = function(output) { - output.writeStructBegin('TPipeTransferReq'); - if (this.version !== null && this.version !== undefined) { - output.writeFieldBegin('version', Thrift.Type.BYTE, 1); - output.writeByte(this.version); - output.writeFieldEnd(); - } - if (this.type !== null && this.type !== undefined) { - output.writeFieldBegin('type', Thrift.Type.I16, 2); - output.writeI16(this.type); - output.writeFieldEnd(); - } - if (this.body !== null && this.body !== undefined) { - output.writeFieldBegin('body', Thrift.Type.STRING, 3); - output.writeBinary(this.body); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TPipeTransferResp = module.exports.TPipeTransferResp = function(args) { - this.status = null; - this.body = null; - if (args) { - if (args.status !== undefined && args.status !== null) { - this.status = new common_ttypes.TSStatus(args.status); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); - } - if (args.body !== undefined && args.body !== null) { - this.body = args.body; - } - } -}; -TPipeTransferResp.prototype = {}; -TPipeTransferResp.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.status = new common_ttypes.TSStatus(); - this.status.read(input); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.body = input.readBinary(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TPipeTransferResp.prototype.write = function(output) { - output.writeStructBegin('TPipeTransferResp'); - if (this.status !== null && this.status !== undefined) { - output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); - this.status.write(output); - output.writeFieldEnd(); - } - if (this.body !== null && this.body !== undefined) { - output.writeFieldBegin('body', Thrift.Type.STRING, 2); - output.writeBinary(this.body); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TPipeSubscribeReq = module.exports.TPipeSubscribeReq = function(args) { - this.version = null; - this.type = null; - this.body = null; - if (args) { - if (args.version !== undefined && args.version !== null) { - this.version = args.version; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field version is unset!'); - } - if (args.type !== undefined && args.type !== null) { - this.type = args.type; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field type is unset!'); - } - if (args.body !== undefined && args.body !== null) { - this.body = args.body; - } - } -}; -TPipeSubscribeReq.prototype = {}; -TPipeSubscribeReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.BYTE) { - this.version = input.readByte(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.I16) { - this.type = input.readI16(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.STRING) { - this.body = input.readBinary(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TPipeSubscribeReq.prototype.write = function(output) { - output.writeStructBegin('TPipeSubscribeReq'); - if (this.version !== null && this.version !== undefined) { - output.writeFieldBegin('version', Thrift.Type.BYTE, 1); - output.writeByte(this.version); - output.writeFieldEnd(); - } - if (this.type !== null && this.type !== undefined) { - output.writeFieldBegin('type', Thrift.Type.I16, 2); - output.writeI16(this.type); - output.writeFieldEnd(); - } - if (this.body !== null && this.body !== undefined) { - output.writeFieldBegin('body', Thrift.Type.STRING, 3); - output.writeBinary(this.body); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TPipeSubscribeResp = module.exports.TPipeSubscribeResp = function(args) { - this.status = null; - this.version = null; - this.type = null; - this.body = null; - if (args) { - if (args.status !== undefined && args.status !== null) { - this.status = new common_ttypes.TSStatus(args.status); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); - } - if (args.version !== undefined && args.version !== null) { - this.version = args.version; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field version is unset!'); - } - if (args.type !== undefined && args.type !== null) { - this.type = args.type; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field type is unset!'); - } - if (args.body !== undefined && args.body !== null) { - this.body = Thrift.copyList(args.body, [null]); - } - } -}; -TPipeSubscribeResp.prototype = {}; -TPipeSubscribeResp.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.status = new common_ttypes.TSStatus(); - this.status.read(input); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.BYTE) { - this.version = input.readByte(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.I16) { - this.type = input.readI16(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.LIST) { - this.body = []; - var _rtmp3453 = input.readListBegin(); - var _size452 = _rtmp3453.size || 0; - for (var _i454 = 0; _i454 < _size452; ++_i454) { - var elem455 = null; - elem455 = input.readBinary(); - this.body.push(elem455); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TPipeSubscribeResp.prototype.write = function(output) { - output.writeStructBegin('TPipeSubscribeResp'); - if (this.status !== null && this.status !== undefined) { - output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); - this.status.write(output); - output.writeFieldEnd(); - } - if (this.version !== null && this.version !== undefined) { - output.writeFieldBegin('version', Thrift.Type.BYTE, 2); - output.writeByte(this.version); - output.writeFieldEnd(); - } - if (this.type !== null && this.type !== undefined) { - output.writeFieldBegin('type', Thrift.Type.I16, 3); - output.writeI16(this.type); - output.writeFieldEnd(); - } - if (this.body !== null && this.body !== undefined) { - output.writeFieldBegin('body', Thrift.Type.LIST, 4); - output.writeListBegin(Thrift.Type.STRING, this.body.length); - for (var iter456 in this.body) { - if (this.body.hasOwnProperty(iter456)) { - iter456 = this.body[iter456]; - output.writeBinary(iter456); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSBackupConfigurationResp = module.exports.TSBackupConfigurationResp = function(args) { - this.status = null; - this.enableOperationSync = null; - this.secondaryAddress = null; - this.secondaryPort = null; - if (args) { - if (args.status !== undefined && args.status !== null) { - this.status = new common_ttypes.TSStatus(args.status); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); - } - if (args.enableOperationSync !== undefined && args.enableOperationSync !== null) { - this.enableOperationSync = args.enableOperationSync; - } - if (args.secondaryAddress !== undefined && args.secondaryAddress !== null) { - this.secondaryAddress = args.secondaryAddress; - } - if (args.secondaryPort !== undefined && args.secondaryPort !== null) { - this.secondaryPort = args.secondaryPort; - } - } -}; -TSBackupConfigurationResp.prototype = {}; -TSBackupConfigurationResp.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.status = new common_ttypes.TSStatus(); - this.status.read(input); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.BOOL) { - this.enableOperationSync = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.STRING) { - this.secondaryAddress = input.readString(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.I32) { - this.secondaryPort = input.readI32(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSBackupConfigurationResp.prototype.write = function(output) { - output.writeStructBegin('TSBackupConfigurationResp'); - if (this.status !== null && this.status !== undefined) { - output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); - this.status.write(output); - output.writeFieldEnd(); - } - if (this.enableOperationSync !== null && this.enableOperationSync !== undefined) { - output.writeFieldBegin('enableOperationSync', Thrift.Type.BOOL, 2); - output.writeBool(this.enableOperationSync); - output.writeFieldEnd(); - } - if (this.secondaryAddress !== null && this.secondaryAddress !== undefined) { - output.writeFieldBegin('secondaryAddress', Thrift.Type.STRING, 3); - output.writeString(this.secondaryAddress); - output.writeFieldEnd(); - } - if (this.secondaryPort !== null && this.secondaryPort !== undefined) { - output.writeFieldBegin('secondaryPort', Thrift.Type.I32, 4); - output.writeI32(this.secondaryPort); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSConnectionInfo = module.exports.TSConnectionInfo = function(args) { - this.userName = null; - this.logInTime = null; - this.connectionId = null; - this.type = null; - if (args) { - if (args.userName !== undefined && args.userName !== null) { - this.userName = args.userName; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field userName is unset!'); - } - if (args.logInTime !== undefined && args.logInTime !== null) { - this.logInTime = args.logInTime; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field logInTime is unset!'); - } - if (args.connectionId !== undefined && args.connectionId !== null) { - this.connectionId = args.connectionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field connectionId is unset!'); - } - if (args.type !== undefined && args.type !== null) { - this.type = args.type; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field type is unset!'); - } - } -}; -TSConnectionInfo.prototype = {}; -TSConnectionInfo.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRING) { - this.userName = input.readString(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.I64) { - this.logInTime = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.STRING) { - this.connectionId = input.readString(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.I32) { - this.type = input.readI32(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSConnectionInfo.prototype.write = function(output) { - output.writeStructBegin('TSConnectionInfo'); - if (this.userName !== null && this.userName !== undefined) { - output.writeFieldBegin('userName', Thrift.Type.STRING, 1); - output.writeString(this.userName); - output.writeFieldEnd(); - } - if (this.logInTime !== null && this.logInTime !== undefined) { - output.writeFieldBegin('logInTime', Thrift.Type.I64, 2); - output.writeI64(this.logInTime); - output.writeFieldEnd(); - } - if (this.connectionId !== null && this.connectionId !== undefined) { - output.writeFieldBegin('connectionId', Thrift.Type.STRING, 3); - output.writeString(this.connectionId); - output.writeFieldEnd(); - } - if (this.type !== null && this.type !== undefined) { - output.writeFieldBegin('type', Thrift.Type.I32, 4); - output.writeI32(this.type); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSConnectionInfoResp = module.exports.TSConnectionInfoResp = function(args) { - this.connectionInfoList = null; - if (args) { - if (args.connectionInfoList !== undefined && args.connectionInfoList !== null) { - this.connectionInfoList = Thrift.copyList(args.connectionInfoList, [ttypes.TSConnectionInfo]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field connectionInfoList is unset!'); - } - } -}; -TSConnectionInfoResp.prototype = {}; -TSConnectionInfoResp.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.LIST) { - this.connectionInfoList = []; - var _rtmp3458 = input.readListBegin(); - var _size457 = _rtmp3458.size || 0; - for (var _i459 = 0; _i459 < _size457; ++_i459) { - var elem460 = null; - elem460 = new ttypes.TSConnectionInfo(); - elem460.read(input); - this.connectionInfoList.push(elem460); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSConnectionInfoResp.prototype.write = function(output) { - output.writeStructBegin('TSConnectionInfoResp'); - if (this.connectionInfoList !== null && this.connectionInfoList !== undefined) { - output.writeFieldBegin('connectionInfoList', Thrift.Type.LIST, 1); - output.writeListBegin(Thrift.Type.STRUCT, this.connectionInfoList.length); - for (var iter461 in this.connectionInfoList) { - if (this.connectionInfoList.hasOwnProperty(iter461)) { - iter461 = this.connectionInfoList[iter461]; - iter461.write(output); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - diff --git a/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/common_types.js b/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/common_types.js deleted file mode 100644 index 26ba413..0000000 --- a/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/common_types.js +++ /dev/null @@ -1,2627 +0,0 @@ -// -// Autogenerated by Thrift Compiler (0.14.1) -// -// 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 Int64 = require('node-int64'); - - -var ttypes = module.exports = {}; -ttypes.TConsensusGroupType = { - 'ConfigRegion' : 0, - 'DataRegion' : 1, - 'SchemaRegion' : 2 -}; -ttypes.TRegionMigrateFailedType = { - 'AddPeerFailed' : 0, - 'RemovePeerFailed' : 1, - 'RemoveConsensusGroupFailed' : 2, - 'DeleteRegionFailed' : 3, - 'CreateRegionFailed' : 4, - 'Disconnect' : 5 -}; -ttypes.TRegionMaintainTaskStatus = { - 'TASK_NOT_EXIST' : 0, - 'PROCESSING' : 1, - 'SUCCESS' : 2, - 'FAIL' : 3 -}; -ttypes.ThrottleType = { - 'REQUEST_NUMBER' : 0, - 'REQUEST_SIZE' : 1, - 'WRITE_NUMBER' : 2, - 'WRITE_SIZE' : 3, - 'READ_NUMBER' : 4, - 'READ_SIZE' : 5 -}; -ttypes.TServiceType = { - 'ConfigNodeInternalService' : 0, - 'DataNodeInternalService' : 1, - 'DataNodeMPPService' : 2, - 'DataNodeExternalService' : 3 -}; -ttypes.TAggregationType = { - 'COUNT' : 0, - 'AVG' : 1, - 'SUM' : 2, - 'FIRST_VALUE' : 3, - 'LAST_VALUE' : 4, - 'MAX_TIME' : 5, - 'MIN_TIME' : 6, - 'MAX_VALUE' : 7, - 'MIN_VALUE' : 8, - 'EXTREME' : 9, - 'COUNT_IF' : 10, - 'TIME_DURATION' : 11, - 'MODE' : 12, - 'COUNT_TIME' : 13, - 'STDDEV' : 14, - 'STDDEV_POP' : 15, - 'STDDEV_SAMP' : 16, - 'VARIANCE' : 17, - 'VAR_POP' : 18, - 'VAR_SAMP' : 19, - 'MAX_BY' : 20, - 'MIN_BY' : 21, - 'UDAF' : 22 -}; -var TEndPoint = module.exports.TEndPoint = function(args) { - this.ip = null; - this.port = null; - if (args) { - if (args.ip !== undefined && args.ip !== null) { - this.ip = args.ip; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field ip is unset!'); - } - if (args.port !== undefined && args.port !== null) { - this.port = args.port; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field port is unset!'); - } - } -}; -TEndPoint.prototype = {}; -TEndPoint.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRING) { - this.ip = input.readString(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.I32) { - this.port = input.readI32(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TEndPoint.prototype.write = function(output) { - output.writeStructBegin('TEndPoint'); - if (this.ip !== null && this.ip !== undefined) { - output.writeFieldBegin('ip', Thrift.Type.STRING, 1); - output.writeString(this.ip); - output.writeFieldEnd(); - } - if (this.port !== null && this.port !== undefined) { - output.writeFieldBegin('port', Thrift.Type.I32, 2); - output.writeI32(this.port); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSStatus = module.exports.TSStatus = function(args) { - this.code = null; - this.message = null; - this.subStatus = null; - this.redirectNode = null; - this.needRetry = null; - if (args) { - if (args.code !== undefined && args.code !== null) { - this.code = args.code; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field code is unset!'); - } - if (args.message !== undefined && args.message !== null) { - this.message = args.message; - } - if (args.subStatus !== undefined && args.subStatus !== null) { - this.subStatus = Thrift.copyList(args.subStatus, [null]); - } - if (args.redirectNode !== undefined && args.redirectNode !== null) { - this.redirectNode = new ttypes.TEndPoint(args.redirectNode); - } - if (args.needRetry !== undefined && args.needRetry !== null) { - this.needRetry = args.needRetry; - } - } -}; -TSStatus.prototype = {}; -TSStatus.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I32) { - this.code = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.message = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.LIST) { - this.subStatus = []; - var _rtmp31 = input.readListBegin(); - var _size0 = _rtmp31.size || 0; - for (var _i2 = 0; _i2 < _size0; ++_i2) { - var elem3 = null; - elem3 = new ttypes.TSStatus(); - elem3.read(input); - this.subStatus.push(elem3); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.STRUCT) { - this.redirectNode = new ttypes.TEndPoint(); - this.redirectNode.read(input); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.BOOL) { - this.needRetry = input.readBool(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSStatus.prototype.write = function(output) { - output.writeStructBegin('TSStatus'); - if (this.code !== null && this.code !== undefined) { - output.writeFieldBegin('code', Thrift.Type.I32, 1); - output.writeI32(this.code); - output.writeFieldEnd(); - } - if (this.message !== null && this.message !== undefined) { - output.writeFieldBegin('message', Thrift.Type.STRING, 2); - output.writeString(this.message); - output.writeFieldEnd(); - } - if (this.subStatus !== null && this.subStatus !== undefined) { - output.writeFieldBegin('subStatus', Thrift.Type.LIST, 3); - output.writeListBegin(Thrift.Type.STRUCT, this.subStatus.length); - for (var iter4 in this.subStatus) { - if (this.subStatus.hasOwnProperty(iter4)) { - iter4 = this.subStatus[iter4]; - iter4.write(output); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.redirectNode !== null && this.redirectNode !== undefined) { - output.writeFieldBegin('redirectNode', Thrift.Type.STRUCT, 4); - this.redirectNode.write(output); - output.writeFieldEnd(); - } - if (this.needRetry !== null && this.needRetry !== undefined) { - output.writeFieldBegin('needRetry', Thrift.Type.BOOL, 5); - output.writeBool(this.needRetry); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TConsensusGroupId = module.exports.TConsensusGroupId = function(args) { - this.type = null; - this.id = null; - if (args) { - if (args.type !== undefined && args.type !== null) { - this.type = args.type; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field type is unset!'); - } - if (args.id !== undefined && args.id !== null) { - this.id = args.id; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field id is unset!'); - } - } -}; -TConsensusGroupId.prototype = {}; -TConsensusGroupId.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I32) { - this.type = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.I32) { - this.id = input.readI32(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TConsensusGroupId.prototype.write = function(output) { - output.writeStructBegin('TConsensusGroupId'); - if (this.type !== null && this.type !== undefined) { - output.writeFieldBegin('type', Thrift.Type.I32, 1); - output.writeI32(this.type); - output.writeFieldEnd(); - } - if (this.id !== null && this.id !== undefined) { - output.writeFieldBegin('id', Thrift.Type.I32, 2); - output.writeI32(this.id); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSeriesPartitionSlot = module.exports.TSeriesPartitionSlot = function(args) { - this.slotId = null; - if (args) { - if (args.slotId !== undefined && args.slotId !== null) { - this.slotId = args.slotId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field slotId is unset!'); - } - } -}; -TSeriesPartitionSlot.prototype = {}; -TSeriesPartitionSlot.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I32) { - this.slotId = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSeriesPartitionSlot.prototype.write = function(output) { - output.writeStructBegin('TSeriesPartitionSlot'); - if (this.slotId !== null && this.slotId !== undefined) { - output.writeFieldBegin('slotId', Thrift.Type.I32, 1); - output.writeI32(this.slotId); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TTimePartitionSlot = module.exports.TTimePartitionSlot = function(args) { - this.startTime = null; - if (args) { - if (args.startTime !== undefined && args.startTime !== null) { - this.startTime = args.startTime; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field startTime is unset!'); - } - } -}; -TTimePartitionSlot.prototype = {}; -TTimePartitionSlot.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.startTime = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TTimePartitionSlot.prototype.write = function(output) { - output.writeStructBegin('TTimePartitionSlot'); - if (this.startTime !== null && this.startTime !== undefined) { - output.writeFieldBegin('startTime', Thrift.Type.I64, 1); - output.writeI64(this.startTime); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TRegionReplicaSet = module.exports.TRegionReplicaSet = function(args) { - this.regionId = null; - this.dataNodeLocations = null; - if (args) { - if (args.regionId !== undefined && args.regionId !== null) { - this.regionId = new ttypes.TConsensusGroupId(args.regionId); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field regionId is unset!'); - } - if (args.dataNodeLocations !== undefined && args.dataNodeLocations !== null) { - this.dataNodeLocations = Thrift.copyList(args.dataNodeLocations, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dataNodeLocations is unset!'); - } - } -}; -TRegionReplicaSet.prototype = {}; -TRegionReplicaSet.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.regionId = new ttypes.TConsensusGroupId(); - this.regionId.read(input); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.LIST) { - this.dataNodeLocations = []; - var _rtmp36 = input.readListBegin(); - var _size5 = _rtmp36.size || 0; - for (var _i7 = 0; _i7 < _size5; ++_i7) { - var elem8 = null; - elem8 = new ttypes.TDataNodeLocation(); - elem8.read(input); - this.dataNodeLocations.push(elem8); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TRegionReplicaSet.prototype.write = function(output) { - output.writeStructBegin('TRegionReplicaSet'); - if (this.regionId !== null && this.regionId !== undefined) { - output.writeFieldBegin('regionId', Thrift.Type.STRUCT, 1); - this.regionId.write(output); - output.writeFieldEnd(); - } - if (this.dataNodeLocations !== null && this.dataNodeLocations !== undefined) { - output.writeFieldBegin('dataNodeLocations', Thrift.Type.LIST, 2); - output.writeListBegin(Thrift.Type.STRUCT, this.dataNodeLocations.length); - for (var iter9 in this.dataNodeLocations) { - if (this.dataNodeLocations.hasOwnProperty(iter9)) { - iter9 = this.dataNodeLocations[iter9]; - iter9.write(output); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TNodeResource = module.exports.TNodeResource = function(args) { - this.cpuCoreNum = null; - this.maxMemory = null; - if (args) { - if (args.cpuCoreNum !== undefined && args.cpuCoreNum !== null) { - this.cpuCoreNum = args.cpuCoreNum; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field cpuCoreNum is unset!'); - } - if (args.maxMemory !== undefined && args.maxMemory !== null) { - this.maxMemory = args.maxMemory; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field maxMemory is unset!'); - } - } -}; -TNodeResource.prototype = {}; -TNodeResource.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I32) { - this.cpuCoreNum = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.I64) { - this.maxMemory = input.readI64(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TNodeResource.prototype.write = function(output) { - output.writeStructBegin('TNodeResource'); - if (this.cpuCoreNum !== null && this.cpuCoreNum !== undefined) { - output.writeFieldBegin('cpuCoreNum', Thrift.Type.I32, 1); - output.writeI32(this.cpuCoreNum); - output.writeFieldEnd(); - } - if (this.maxMemory !== null && this.maxMemory !== undefined) { - output.writeFieldBegin('maxMemory', Thrift.Type.I64, 2); - output.writeI64(this.maxMemory); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TConfigNodeLocation = module.exports.TConfigNodeLocation = function(args) { - this.configNodeId = null; - this.internalEndPoint = null; - this.consensusEndPoint = null; - if (args) { - if (args.configNodeId !== undefined && args.configNodeId !== null) { - this.configNodeId = args.configNodeId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field configNodeId is unset!'); - } - if (args.internalEndPoint !== undefined && args.internalEndPoint !== null) { - this.internalEndPoint = new ttypes.TEndPoint(args.internalEndPoint); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field internalEndPoint is unset!'); - } - if (args.consensusEndPoint !== undefined && args.consensusEndPoint !== null) { - this.consensusEndPoint = new ttypes.TEndPoint(args.consensusEndPoint); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field consensusEndPoint is unset!'); - } - } -}; -TConfigNodeLocation.prototype = {}; -TConfigNodeLocation.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I32) { - this.configNodeId = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRUCT) { - this.internalEndPoint = new ttypes.TEndPoint(); - this.internalEndPoint.read(input); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.STRUCT) { - this.consensusEndPoint = new ttypes.TEndPoint(); - this.consensusEndPoint.read(input); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TConfigNodeLocation.prototype.write = function(output) { - output.writeStructBegin('TConfigNodeLocation'); - if (this.configNodeId !== null && this.configNodeId !== undefined) { - output.writeFieldBegin('configNodeId', Thrift.Type.I32, 1); - output.writeI32(this.configNodeId); - output.writeFieldEnd(); - } - if (this.internalEndPoint !== null && this.internalEndPoint !== undefined) { - output.writeFieldBegin('internalEndPoint', Thrift.Type.STRUCT, 2); - this.internalEndPoint.write(output); - output.writeFieldEnd(); - } - if (this.consensusEndPoint !== null && this.consensusEndPoint !== undefined) { - output.writeFieldBegin('consensusEndPoint', Thrift.Type.STRUCT, 3); - this.consensusEndPoint.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TDataNodeLocation = module.exports.TDataNodeLocation = function(args) { - this.dataNodeId = null; - this.clientRpcEndPoint = null; - this.internalEndPoint = null; - this.mPPDataExchangeEndPoint = null; - this.dataRegionConsensusEndPoint = null; - this.schemaRegionConsensusEndPoint = null; - if (args) { - if (args.dataNodeId !== undefined && args.dataNodeId !== null) { - this.dataNodeId = args.dataNodeId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dataNodeId is unset!'); - } - if (args.clientRpcEndPoint !== undefined && args.clientRpcEndPoint !== null) { - this.clientRpcEndPoint = new ttypes.TEndPoint(args.clientRpcEndPoint); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field clientRpcEndPoint is unset!'); - } - if (args.internalEndPoint !== undefined && args.internalEndPoint !== null) { - this.internalEndPoint = new ttypes.TEndPoint(args.internalEndPoint); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field internalEndPoint is unset!'); - } - if (args.mPPDataExchangeEndPoint !== undefined && args.mPPDataExchangeEndPoint !== null) { - this.mPPDataExchangeEndPoint = new ttypes.TEndPoint(args.mPPDataExchangeEndPoint); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field mPPDataExchangeEndPoint is unset!'); - } - if (args.dataRegionConsensusEndPoint !== undefined && args.dataRegionConsensusEndPoint !== null) { - this.dataRegionConsensusEndPoint = new ttypes.TEndPoint(args.dataRegionConsensusEndPoint); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dataRegionConsensusEndPoint is unset!'); - } - if (args.schemaRegionConsensusEndPoint !== undefined && args.schemaRegionConsensusEndPoint !== null) { - this.schemaRegionConsensusEndPoint = new ttypes.TEndPoint(args.schemaRegionConsensusEndPoint); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field schemaRegionConsensusEndPoint is unset!'); - } - } -}; -TDataNodeLocation.prototype = {}; -TDataNodeLocation.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I32) { - this.dataNodeId = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRUCT) { - this.clientRpcEndPoint = new ttypes.TEndPoint(); - this.clientRpcEndPoint.read(input); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.STRUCT) { - this.internalEndPoint = new ttypes.TEndPoint(); - this.internalEndPoint.read(input); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.STRUCT) { - this.mPPDataExchangeEndPoint = new ttypes.TEndPoint(); - this.mPPDataExchangeEndPoint.read(input); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.STRUCT) { - this.dataRegionConsensusEndPoint = new ttypes.TEndPoint(); - this.dataRegionConsensusEndPoint.read(input); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.STRUCT) { - this.schemaRegionConsensusEndPoint = new ttypes.TEndPoint(); - this.schemaRegionConsensusEndPoint.read(input); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TDataNodeLocation.prototype.write = function(output) { - output.writeStructBegin('TDataNodeLocation'); - if (this.dataNodeId !== null && this.dataNodeId !== undefined) { - output.writeFieldBegin('dataNodeId', Thrift.Type.I32, 1); - output.writeI32(this.dataNodeId); - output.writeFieldEnd(); - } - if (this.clientRpcEndPoint !== null && this.clientRpcEndPoint !== undefined) { - output.writeFieldBegin('clientRpcEndPoint', Thrift.Type.STRUCT, 2); - this.clientRpcEndPoint.write(output); - output.writeFieldEnd(); - } - if (this.internalEndPoint !== null && this.internalEndPoint !== undefined) { - output.writeFieldBegin('internalEndPoint', Thrift.Type.STRUCT, 3); - this.internalEndPoint.write(output); - output.writeFieldEnd(); - } - if (this.mPPDataExchangeEndPoint !== null && this.mPPDataExchangeEndPoint !== undefined) { - output.writeFieldBegin('mPPDataExchangeEndPoint', Thrift.Type.STRUCT, 4); - this.mPPDataExchangeEndPoint.write(output); - output.writeFieldEnd(); - } - if (this.dataRegionConsensusEndPoint !== null && this.dataRegionConsensusEndPoint !== undefined) { - output.writeFieldBegin('dataRegionConsensusEndPoint', Thrift.Type.STRUCT, 5); - this.dataRegionConsensusEndPoint.write(output); - output.writeFieldEnd(); - } - if (this.schemaRegionConsensusEndPoint !== null && this.schemaRegionConsensusEndPoint !== undefined) { - output.writeFieldBegin('schemaRegionConsensusEndPoint', Thrift.Type.STRUCT, 6); - this.schemaRegionConsensusEndPoint.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TDataNodeConfiguration = module.exports.TDataNodeConfiguration = function(args) { - this.location = null; - this.resource = null; - if (args) { - if (args.location !== undefined && args.location !== null) { - this.location = new ttypes.TDataNodeLocation(args.location); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field location is unset!'); - } - if (args.resource !== undefined && args.resource !== null) { - this.resource = new ttypes.TNodeResource(args.resource); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field resource is unset!'); - } - } -}; -TDataNodeConfiguration.prototype = {}; -TDataNodeConfiguration.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.location = new ttypes.TDataNodeLocation(); - this.location.read(input); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRUCT) { - this.resource = new ttypes.TNodeResource(); - this.resource.read(input); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TDataNodeConfiguration.prototype.write = function(output) { - output.writeStructBegin('TDataNodeConfiguration'); - if (this.location !== null && this.location !== undefined) { - output.writeFieldBegin('location', Thrift.Type.STRUCT, 1); - this.location.write(output); - output.writeFieldEnd(); - } - if (this.resource !== null && this.resource !== undefined) { - output.writeFieldBegin('resource', Thrift.Type.STRUCT, 2); - this.resource.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TFlushReq = module.exports.TFlushReq = function(args) { - this.isSeq = null; - this.storageGroups = null; - if (args) { - if (args.isSeq !== undefined && args.isSeq !== null) { - this.isSeq = args.isSeq; - } - if (args.storageGroups !== undefined && args.storageGroups !== null) { - this.storageGroups = Thrift.copyList(args.storageGroups, [null]); - } - } -}; -TFlushReq.prototype = {}; -TFlushReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRING) { - this.isSeq = input.readString(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.LIST) { - this.storageGroups = []; - var _rtmp311 = input.readListBegin(); - var _size10 = _rtmp311.size || 0; - for (var _i12 = 0; _i12 < _size10; ++_i12) { - var elem13 = null; - elem13 = input.readString(); - this.storageGroups.push(elem13); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TFlushReq.prototype.write = function(output) { - output.writeStructBegin('TFlushReq'); - if (this.isSeq !== null && this.isSeq !== undefined) { - output.writeFieldBegin('isSeq', Thrift.Type.STRING, 1); - output.writeString(this.isSeq); - output.writeFieldEnd(); - } - if (this.storageGroups !== null && this.storageGroups !== undefined) { - output.writeFieldBegin('storageGroups', Thrift.Type.LIST, 2); - output.writeListBegin(Thrift.Type.STRING, this.storageGroups.length); - for (var iter14 in this.storageGroups) { - if (this.storageGroups.hasOwnProperty(iter14)) { - iter14 = this.storageGroups[iter14]; - output.writeString(iter14); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSettleReq = module.exports.TSettleReq = function(args) { - this.paths = null; - if (args) { - if (args.paths !== undefined && args.paths !== null) { - this.paths = Thrift.copyList(args.paths, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field paths is unset!'); - } - } -}; -TSettleReq.prototype = {}; -TSettleReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.LIST) { - this.paths = []; - var _rtmp316 = input.readListBegin(); - var _size15 = _rtmp316.size || 0; - for (var _i17 = 0; _i17 < _size15; ++_i17) { - var elem18 = null; - elem18 = input.readString(); - this.paths.push(elem18); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSettleReq.prototype.write = function(output) { - output.writeStructBegin('TSettleReq'); - if (this.paths !== null && this.paths !== undefined) { - output.writeFieldBegin('paths', Thrift.Type.LIST, 1); - output.writeListBegin(Thrift.Type.STRING, this.paths.length); - for (var iter19 in this.paths) { - if (this.paths.hasOwnProperty(iter19)) { - iter19 = this.paths[iter19]; - output.writeString(iter19); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSchemaNode = module.exports.TSchemaNode = function(args) { - this.nodeName = null; - this.nodeType = null; - if (args) { - if (args.nodeName !== undefined && args.nodeName !== null) { - this.nodeName = args.nodeName; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field nodeName is unset!'); - } - if (args.nodeType !== undefined && args.nodeType !== null) { - this.nodeType = args.nodeType; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field nodeType is unset!'); - } - } -}; -TSchemaNode.prototype = {}; -TSchemaNode.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRING) { - this.nodeName = input.readString(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.BYTE) { - this.nodeType = input.readByte(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSchemaNode.prototype.write = function(output) { - output.writeStructBegin('TSchemaNode'); - if (this.nodeName !== null && this.nodeName !== undefined) { - output.writeFieldBegin('nodeName', Thrift.Type.STRING, 1); - output.writeString(this.nodeName); - output.writeFieldEnd(); - } - if (this.nodeType !== null && this.nodeType !== undefined) { - output.writeFieldBegin('nodeType', Thrift.Type.BYTE, 2); - output.writeByte(this.nodeType); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSetConfigurationReq = module.exports.TSetConfigurationReq = function(args) { - this.configs = null; - this.nodeId = null; - if (args) { - if (args.configs !== undefined && args.configs !== null) { - this.configs = Thrift.copyMap(args.configs, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field configs is unset!'); - } - if (args.nodeId !== undefined && args.nodeId !== null) { - this.nodeId = args.nodeId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field nodeId is unset!'); - } - } -}; -TSetConfigurationReq.prototype = {}; -TSetConfigurationReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.MAP) { - this.configs = {}; - var _rtmp321 = input.readMapBegin(); - var _size20 = _rtmp321.size || 0; - for (var _i22 = 0; _i22 < _size20; ++_i22) { - var key23 = null; - var val24 = null; - key23 = input.readString(); - val24 = input.readString(); - this.configs[key23] = val24; - } - input.readMapEnd(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.I32) { - this.nodeId = input.readI32(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSetConfigurationReq.prototype.write = function(output) { - output.writeStructBegin('TSetConfigurationReq'); - if (this.configs !== null && this.configs !== undefined) { - output.writeFieldBegin('configs', Thrift.Type.MAP, 1); - output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.configs)); - for (var kiter25 in this.configs) { - if (this.configs.hasOwnProperty(kiter25)) { - var viter26 = this.configs[kiter25]; - output.writeString(kiter25); - output.writeString(viter26); - } - } - output.writeMapEnd(); - output.writeFieldEnd(); - } - if (this.nodeId !== null && this.nodeId !== undefined) { - output.writeFieldBegin('nodeId', Thrift.Type.I32, 2); - output.writeI32(this.nodeId); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSetTTLReq = module.exports.TSetTTLReq = function(args) { - this.pathPattern = null; - this.TTL = null; - this.isDataBase = null; - if (args) { - if (args.pathPattern !== undefined && args.pathPattern !== null) { - this.pathPattern = Thrift.copyList(args.pathPattern, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field pathPattern is unset!'); - } - if (args.TTL !== undefined && args.TTL !== null) { - this.TTL = args.TTL; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field TTL is unset!'); - } - if (args.isDataBase !== undefined && args.isDataBase !== null) { - this.isDataBase = args.isDataBase; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field isDataBase is unset!'); - } - } -}; -TSetTTLReq.prototype = {}; -TSetTTLReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.LIST) { - this.pathPattern = []; - var _rtmp328 = input.readListBegin(); - var _size27 = _rtmp328.size || 0; - for (var _i29 = 0; _i29 < _size27; ++_i29) { - var elem30 = null; - elem30 = input.readString(); - this.pathPattern.push(elem30); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.I64) { - this.TTL = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.BOOL) { - this.isDataBase = input.readBool(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSetTTLReq.prototype.write = function(output) { - output.writeStructBegin('TSetTTLReq'); - if (this.pathPattern !== null && this.pathPattern !== undefined) { - output.writeFieldBegin('pathPattern', Thrift.Type.LIST, 1); - output.writeListBegin(Thrift.Type.STRING, this.pathPattern.length); - for (var iter31 in this.pathPattern) { - if (this.pathPattern.hasOwnProperty(iter31)) { - iter31 = this.pathPattern[iter31]; - output.writeString(iter31); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.TTL !== null && this.TTL !== undefined) { - output.writeFieldBegin('TTL', Thrift.Type.I64, 2); - output.writeI64(this.TTL); - output.writeFieldEnd(); - } - if (this.isDataBase !== null && this.isDataBase !== undefined) { - output.writeFieldBegin('isDataBase', Thrift.Type.BOOL, 3); - output.writeBool(this.isDataBase); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TShowTTLReq = module.exports.TShowTTLReq = function(args) { - this.pathPattern = null; - if (args) { - if (args.pathPattern !== undefined && args.pathPattern !== null) { - this.pathPattern = Thrift.copyList(args.pathPattern, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field pathPattern is unset!'); - } - } -}; -TShowTTLReq.prototype = {}; -TShowTTLReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.LIST) { - this.pathPattern = []; - var _rtmp333 = input.readListBegin(); - var _size32 = _rtmp333.size || 0; - for (var _i34 = 0; _i34 < _size32; ++_i34) { - var elem35 = null; - elem35 = input.readString(); - this.pathPattern.push(elem35); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TShowTTLReq.prototype.write = function(output) { - output.writeStructBegin('TShowTTLReq'); - if (this.pathPattern !== null && this.pathPattern !== undefined) { - output.writeFieldBegin('pathPattern', Thrift.Type.LIST, 1); - output.writeListBegin(Thrift.Type.STRING, this.pathPattern.length); - for (var iter36 in this.pathPattern) { - if (this.pathPattern.hasOwnProperty(iter36)) { - iter36 = this.pathPattern[iter36]; - output.writeString(iter36); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TFile = module.exports.TFile = function(args) { - this.fileName = null; - this.file = null; - if (args) { - if (args.fileName !== undefined && args.fileName !== null) { - this.fileName = args.fileName; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field fileName is unset!'); - } - if (args.file !== undefined && args.file !== null) { - this.file = args.file; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field file is unset!'); - } - } -}; -TFile.prototype = {}; -TFile.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRING) { - this.fileName = input.readString(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.file = input.readBinary(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TFile.prototype.write = function(output) { - output.writeStructBegin('TFile'); - if (this.fileName !== null && this.fileName !== undefined) { - output.writeFieldBegin('fileName', Thrift.Type.STRING, 1); - output.writeString(this.fileName); - output.writeFieldEnd(); - } - if (this.file !== null && this.file !== undefined) { - output.writeFieldBegin('file', Thrift.Type.STRING, 2); - output.writeBinary(this.file); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TFilesResp = module.exports.TFilesResp = function(args) { - this.status = null; - this.files = null; - if (args) { - if (args.status !== undefined && args.status !== null) { - this.status = new ttypes.TSStatus(args.status); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); - } - if (args.files !== undefined && args.files !== null) { - this.files = Thrift.copyList(args.files, [ttypes.TFile]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field files is unset!'); - } - } -}; -TFilesResp.prototype = {}; -TFilesResp.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.status = new ttypes.TSStatus(); - this.status.read(input); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.LIST) { - this.files = []; - var _rtmp338 = input.readListBegin(); - var _size37 = _rtmp338.size || 0; - for (var _i39 = 0; _i39 < _size37; ++_i39) { - var elem40 = null; - elem40 = new ttypes.TFile(); - elem40.read(input); - this.files.push(elem40); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TFilesResp.prototype.write = function(output) { - output.writeStructBegin('TFilesResp'); - if (this.status !== null && this.status !== undefined) { - output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); - this.status.write(output); - output.writeFieldEnd(); - } - if (this.files !== null && this.files !== undefined) { - output.writeFieldBegin('files', Thrift.Type.LIST, 2); - output.writeListBegin(Thrift.Type.STRUCT, this.files.length); - for (var iter41 in this.files) { - if (this.files.hasOwnProperty(iter41)) { - iter41 = this.files[iter41]; - iter41.write(output); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSpaceQuota = module.exports.TSpaceQuota = function(args) { - this.diskSize = null; - this.deviceNum = null; - this.timeserieNum = null; - if (args) { - if (args.diskSize !== undefined && args.diskSize !== null) { - this.diskSize = args.diskSize; - } - if (args.deviceNum !== undefined && args.deviceNum !== null) { - this.deviceNum = args.deviceNum; - } - if (args.timeserieNum !== undefined && args.timeserieNum !== null) { - this.timeserieNum = args.timeserieNum; - } - } -}; -TSpaceQuota.prototype = {}; -TSpaceQuota.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.diskSize = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.I64) { - this.deviceNum = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.I64) { - this.timeserieNum = input.readI64(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSpaceQuota.prototype.write = function(output) { - output.writeStructBegin('TSpaceQuota'); - if (this.diskSize !== null && this.diskSize !== undefined) { - output.writeFieldBegin('diskSize', Thrift.Type.I64, 1); - output.writeI64(this.diskSize); - output.writeFieldEnd(); - } - if (this.deviceNum !== null && this.deviceNum !== undefined) { - output.writeFieldBegin('deviceNum', Thrift.Type.I64, 2); - output.writeI64(this.deviceNum); - output.writeFieldEnd(); - } - if (this.timeserieNum !== null && this.timeserieNum !== undefined) { - output.writeFieldBegin('timeserieNum', Thrift.Type.I64, 3); - output.writeI64(this.timeserieNum); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TTimedQuota = module.exports.TTimedQuota = function(args) { - this.timeUnit = null; - this.softLimit = null; - if (args) { - if (args.timeUnit !== undefined && args.timeUnit !== null) { - this.timeUnit = args.timeUnit; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timeUnit is unset!'); - } - if (args.softLimit !== undefined && args.softLimit !== null) { - this.softLimit = args.softLimit; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field softLimit is unset!'); - } - } -}; -TTimedQuota.prototype = {}; -TTimedQuota.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.timeUnit = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.I64) { - this.softLimit = input.readI64(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TTimedQuota.prototype.write = function(output) { - output.writeStructBegin('TTimedQuota'); - if (this.timeUnit !== null && this.timeUnit !== undefined) { - output.writeFieldBegin('timeUnit', Thrift.Type.I64, 1); - output.writeI64(this.timeUnit); - output.writeFieldEnd(); - } - if (this.softLimit !== null && this.softLimit !== undefined) { - output.writeFieldBegin('softLimit', Thrift.Type.I64, 2); - output.writeI64(this.softLimit); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TThrottleQuota = module.exports.TThrottleQuota = function(args) { - this.throttleLimit = null; - this.memLimit = null; - this.cpuLimit = null; - if (args) { - if (args.throttleLimit !== undefined && args.throttleLimit !== null) { - this.throttleLimit = Thrift.copyMap(args.throttleLimit, [ttypes.TTimedQuota]); - } - if (args.memLimit !== undefined && args.memLimit !== null) { - this.memLimit = args.memLimit; - } - if (args.cpuLimit !== undefined && args.cpuLimit !== null) { - this.cpuLimit = args.cpuLimit; - } - } -}; -TThrottleQuota.prototype = {}; -TThrottleQuota.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.MAP) { - this.throttleLimit = {}; - var _rtmp343 = input.readMapBegin(); - var _size42 = _rtmp343.size || 0; - for (var _i44 = 0; _i44 < _size42; ++_i44) { - var key45 = null; - var val46 = null; - key45 = input.readI32(); - val46 = new ttypes.TTimedQuota(); - val46.read(input); - this.throttleLimit[key45] = val46; - } - input.readMapEnd(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.I64) { - this.memLimit = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.I32) { - this.cpuLimit = input.readI32(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TThrottleQuota.prototype.write = function(output) { - output.writeStructBegin('TThrottleQuota'); - if (this.throttleLimit !== null && this.throttleLimit !== undefined) { - output.writeFieldBegin('throttleLimit', Thrift.Type.MAP, 1); - output.writeMapBegin(Thrift.Type.I32, Thrift.Type.STRUCT, Thrift.objectLength(this.throttleLimit)); - for (var kiter47 in this.throttleLimit) { - if (this.throttleLimit.hasOwnProperty(kiter47)) { - var viter48 = this.throttleLimit[kiter47]; - output.writeI32(kiter47); - viter48.write(output); - } - } - output.writeMapEnd(); - output.writeFieldEnd(); - } - if (this.memLimit !== null && this.memLimit !== undefined) { - output.writeFieldBegin('memLimit', Thrift.Type.I64, 2); - output.writeI64(this.memLimit); - output.writeFieldEnd(); - } - if (this.cpuLimit !== null && this.cpuLimit !== undefined) { - output.writeFieldBegin('cpuLimit', Thrift.Type.I32, 3); - output.writeI32(this.cpuLimit); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSetSpaceQuotaReq = module.exports.TSetSpaceQuotaReq = function(args) { - this.database = null; - this.spaceLimit = null; - if (args) { - if (args.database !== undefined && args.database !== null) { - this.database = Thrift.copyList(args.database, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field database is unset!'); - } - if (args.spaceLimit !== undefined && args.spaceLimit !== null) { - this.spaceLimit = new ttypes.TSpaceQuota(args.spaceLimit); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field spaceLimit is unset!'); - } - } -}; -TSetSpaceQuotaReq.prototype = {}; -TSetSpaceQuotaReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.LIST) { - this.database = []; - var _rtmp350 = input.readListBegin(); - var _size49 = _rtmp350.size || 0; - for (var _i51 = 0; _i51 < _size49; ++_i51) { - var elem52 = null; - elem52 = input.readString(); - this.database.push(elem52); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRUCT) { - this.spaceLimit = new ttypes.TSpaceQuota(); - this.spaceLimit.read(input); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSetSpaceQuotaReq.prototype.write = function(output) { - output.writeStructBegin('TSetSpaceQuotaReq'); - if (this.database !== null && this.database !== undefined) { - output.writeFieldBegin('database', Thrift.Type.LIST, 1); - output.writeListBegin(Thrift.Type.STRING, this.database.length); - for (var iter53 in this.database) { - if (this.database.hasOwnProperty(iter53)) { - iter53 = this.database[iter53]; - output.writeString(iter53); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.spaceLimit !== null && this.spaceLimit !== undefined) { - output.writeFieldBegin('spaceLimit', Thrift.Type.STRUCT, 2); - this.spaceLimit.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSetThrottleQuotaReq = module.exports.TSetThrottleQuotaReq = function(args) { - this.userName = null; - this.throttleQuota = null; - if (args) { - if (args.userName !== undefined && args.userName !== null) { - this.userName = args.userName; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field userName is unset!'); - } - if (args.throttleQuota !== undefined && args.throttleQuota !== null) { - this.throttleQuota = new ttypes.TThrottleQuota(args.throttleQuota); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field throttleQuota is unset!'); - } - } -}; -TSetThrottleQuotaReq.prototype = {}; -TSetThrottleQuotaReq.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRING) { - this.userName = input.readString(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRUCT) { - this.throttleQuota = new ttypes.TThrottleQuota(); - this.throttleQuota.read(input); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSetThrottleQuotaReq.prototype.write = function(output) { - output.writeStructBegin('TSetThrottleQuotaReq'); - if (this.userName !== null && this.userName !== undefined) { - output.writeFieldBegin('userName', Thrift.Type.STRING, 1); - output.writeString(this.userName); - output.writeFieldEnd(); - } - if (this.throttleQuota !== null && this.throttleQuota !== undefined) { - output.writeFieldBegin('throttleQuota', Thrift.Type.STRUCT, 2); - this.throttleQuota.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TLicense = module.exports.TLicense = function(args) { - this.licenseIssueTimestamp = null; - this.expireTimestamp = null; - this.dataNodeNumLimit = null; - this.cpuCoreNumLimit = null; - this.deviceNumLimit = null; - this.sensorNumLimit = null; - this.disconnectionFromActiveNodeTimeLimit = null; - this.mlNodeNumLimit = null; - if (args) { - if (args.licenseIssueTimestamp !== undefined && args.licenseIssueTimestamp !== null) { - this.licenseIssueTimestamp = args.licenseIssueTimestamp; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field licenseIssueTimestamp is unset!'); - } - if (args.expireTimestamp !== undefined && args.expireTimestamp !== null) { - this.expireTimestamp = args.expireTimestamp; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field expireTimestamp is unset!'); - } - if (args.dataNodeNumLimit !== undefined && args.dataNodeNumLimit !== null) { - this.dataNodeNumLimit = args.dataNodeNumLimit; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dataNodeNumLimit is unset!'); - } - if (args.cpuCoreNumLimit !== undefined && args.cpuCoreNumLimit !== null) { - this.cpuCoreNumLimit = args.cpuCoreNumLimit; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field cpuCoreNumLimit is unset!'); - } - if (args.deviceNumLimit !== undefined && args.deviceNumLimit !== null) { - this.deviceNumLimit = args.deviceNumLimit; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field deviceNumLimit is unset!'); - } - if (args.sensorNumLimit !== undefined && args.sensorNumLimit !== null) { - this.sensorNumLimit = args.sensorNumLimit; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sensorNumLimit is unset!'); - } - if (args.disconnectionFromActiveNodeTimeLimit !== undefined && args.disconnectionFromActiveNodeTimeLimit !== null) { - this.disconnectionFromActiveNodeTimeLimit = args.disconnectionFromActiveNodeTimeLimit; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field disconnectionFromActiveNodeTimeLimit is unset!'); - } - if (args.mlNodeNumLimit !== undefined && args.mlNodeNumLimit !== null) { - this.mlNodeNumLimit = args.mlNodeNumLimit; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field mlNodeNumLimit is unset!'); - } - } -}; -TLicense.prototype = {}; -TLicense.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.licenseIssueTimestamp = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.I64) { - this.expireTimestamp = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.I16) { - this.dataNodeNumLimit = input.readI16(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.I32) { - this.cpuCoreNumLimit = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.I64) { - this.deviceNumLimit = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 7: - if (ftype == Thrift.Type.I64) { - this.sensorNumLimit = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 8: - if (ftype == Thrift.Type.I64) { - this.disconnectionFromActiveNodeTimeLimit = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 9: - if (ftype == Thrift.Type.I16) { - this.mlNodeNumLimit = input.readI16(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TLicense.prototype.write = function(output) { - output.writeStructBegin('TLicense'); - if (this.licenseIssueTimestamp !== null && this.licenseIssueTimestamp !== undefined) { - output.writeFieldBegin('licenseIssueTimestamp', Thrift.Type.I64, 1); - output.writeI64(this.licenseIssueTimestamp); - output.writeFieldEnd(); - } - if (this.expireTimestamp !== null && this.expireTimestamp !== undefined) { - output.writeFieldBegin('expireTimestamp', Thrift.Type.I64, 2); - output.writeI64(this.expireTimestamp); - output.writeFieldEnd(); - } - if (this.dataNodeNumLimit !== null && this.dataNodeNumLimit !== undefined) { - output.writeFieldBegin('dataNodeNumLimit', Thrift.Type.I16, 4); - output.writeI16(this.dataNodeNumLimit); - output.writeFieldEnd(); - } - if (this.cpuCoreNumLimit !== null && this.cpuCoreNumLimit !== undefined) { - output.writeFieldBegin('cpuCoreNumLimit', Thrift.Type.I32, 5); - output.writeI32(this.cpuCoreNumLimit); - output.writeFieldEnd(); - } - if (this.deviceNumLimit !== null && this.deviceNumLimit !== undefined) { - output.writeFieldBegin('deviceNumLimit', Thrift.Type.I64, 6); - output.writeI64(this.deviceNumLimit); - output.writeFieldEnd(); - } - if (this.sensorNumLimit !== null && this.sensorNumLimit !== undefined) { - output.writeFieldBegin('sensorNumLimit', Thrift.Type.I64, 7); - output.writeI64(this.sensorNumLimit); - output.writeFieldEnd(); - } - if (this.disconnectionFromActiveNodeTimeLimit !== null && this.disconnectionFromActiveNodeTimeLimit !== undefined) { - output.writeFieldBegin('disconnectionFromActiveNodeTimeLimit', Thrift.Type.I64, 8); - output.writeI64(this.disconnectionFromActiveNodeTimeLimit); - output.writeFieldEnd(); - } - if (this.mlNodeNumLimit !== null && this.mlNodeNumLimit !== undefined) { - output.writeFieldBegin('mlNodeNumLimit', Thrift.Type.I16, 9); - output.writeI16(this.mlNodeNumLimit); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TServiceProvider = module.exports.TServiceProvider = function(args) { - this.endPoint = null; - this.serviceType = null; - if (args) { - if (args.endPoint !== undefined && args.endPoint !== null) { - this.endPoint = new ttypes.TEndPoint(args.endPoint); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field endPoint is unset!'); - } - if (args.serviceType !== undefined && args.serviceType !== null) { - this.serviceType = args.serviceType; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field serviceType is unset!'); - } - } -}; -TServiceProvider.prototype = {}; -TServiceProvider.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.endPoint = new ttypes.TEndPoint(); - this.endPoint.read(input); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.I32) { - this.serviceType = input.readI32(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TServiceProvider.prototype.write = function(output) { - output.writeStructBegin('TServiceProvider'); - if (this.endPoint !== null && this.endPoint !== undefined) { - output.writeFieldBegin('endPoint', Thrift.Type.STRUCT, 1); - this.endPoint.write(output); - output.writeFieldEnd(); - } - if (this.serviceType !== null && this.serviceType !== undefined) { - output.writeFieldBegin('serviceType', Thrift.Type.I32, 2); - output.writeI32(this.serviceType); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSender = module.exports.TSender = function(args) { - this.dataNodeLocation = null; - this.configNodeLocation = null; - if (args) { - if (args.dataNodeLocation !== undefined && args.dataNodeLocation !== null) { - this.dataNodeLocation = new ttypes.TDataNodeLocation(args.dataNodeLocation); - } - if (args.configNodeLocation !== undefined && args.configNodeLocation !== null) { - this.configNodeLocation = new ttypes.TConfigNodeLocation(args.configNodeLocation); - } - } -}; -TSender.prototype = {}; -TSender.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.dataNodeLocation = new ttypes.TDataNodeLocation(); - this.dataNodeLocation.read(input); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRUCT) { - this.configNodeLocation = new ttypes.TConfigNodeLocation(); - this.configNodeLocation.read(input); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSender.prototype.write = function(output) { - output.writeStructBegin('TSender'); - if (this.dataNodeLocation !== null && this.dataNodeLocation !== undefined) { - output.writeFieldBegin('dataNodeLocation', Thrift.Type.STRUCT, 1); - this.dataNodeLocation.write(output); - output.writeFieldEnd(); - } - if (this.configNodeLocation !== null && this.configNodeLocation !== undefined) { - output.writeFieldBegin('configNodeLocation', Thrift.Type.STRUCT, 2); - this.configNodeLocation.write(output); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TTestConnectionResult = module.exports.TTestConnectionResult = function(args) { - this.serviceProvider = null; - this.sender = null; - this.success = null; - this.reason = null; - if (args) { - if (args.serviceProvider !== undefined && args.serviceProvider !== null) { - this.serviceProvider = new ttypes.TServiceProvider(args.serviceProvider); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field serviceProvider is unset!'); - } - if (args.sender !== undefined && args.sender !== null) { - this.sender = new ttypes.TSender(args.sender); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sender is unset!'); - } - if (args.success !== undefined && args.success !== null) { - this.success = args.success; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field success is unset!'); - } - if (args.reason !== undefined && args.reason !== null) { - this.reason = args.reason; - } - } -}; -TTestConnectionResult.prototype = {}; -TTestConnectionResult.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.serviceProvider = new ttypes.TServiceProvider(); - this.serviceProvider.read(input); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRUCT) { - this.sender = new ttypes.TSender(); - this.sender.read(input); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.BOOL) { - this.success = input.readBool(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.STRING) { - this.reason = input.readString(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TTestConnectionResult.prototype.write = function(output) { - output.writeStructBegin('TTestConnectionResult'); - if (this.serviceProvider !== null && this.serviceProvider !== undefined) { - output.writeFieldBegin('serviceProvider', Thrift.Type.STRUCT, 1); - this.serviceProvider.write(output); - output.writeFieldEnd(); - } - if (this.sender !== null && this.sender !== undefined) { - output.writeFieldBegin('sender', Thrift.Type.STRUCT, 2); - this.sender.write(output); - output.writeFieldEnd(); - } - if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.BOOL, 3); - output.writeBool(this.success); - output.writeFieldEnd(); - } - if (this.reason !== null && this.reason !== undefined) { - output.writeFieldBegin('reason', Thrift.Type.STRING, 4); - output.writeString(this.reason); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TTestConnectionResp = module.exports.TTestConnectionResp = function(args) { - this.status = null; - this.resultList = null; - if (args) { - if (args.status !== undefined && args.status !== null) { - this.status = new ttypes.TSStatus(args.status); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); - } - if (args.resultList !== undefined && args.resultList !== null) { - this.resultList = Thrift.copyList(args.resultList, [ttypes.TTestConnectionResult]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field resultList is unset!'); - } - } -}; -TTestConnectionResp.prototype = {}; -TTestConnectionResp.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.status = new ttypes.TSStatus(); - this.status.read(input); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.LIST) { - this.resultList = []; - var _rtmp355 = input.readListBegin(); - var _size54 = _rtmp355.size || 0; - for (var _i56 = 0; _i56 < _size54; ++_i56) { - var elem57 = null; - elem57 = new ttypes.TTestConnectionResult(); - elem57.read(input); - this.resultList.push(elem57); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TTestConnectionResp.prototype.write = function(output) { - output.writeStructBegin('TTestConnectionResp'); - if (this.status !== null && this.status !== undefined) { - output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); - this.status.write(output); - output.writeFieldEnd(); - } - if (this.resultList !== null && this.resultList !== undefined) { - output.writeFieldBegin('resultList', Thrift.Type.LIST, 2); - output.writeListBegin(Thrift.Type.STRUCT, this.resultList.length); - for (var iter58 in this.resultList) { - if (this.resultList.hasOwnProperty(iter58)) { - iter58 = this.resultList[iter58]; - iter58.write(output); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TNodeLocations = module.exports.TNodeLocations = function(args) { - this.configNodeLocations = null; - this.dataNodeLocations = null; - if (args) { - if (args.configNodeLocations !== undefined && args.configNodeLocations !== null) { - this.configNodeLocations = Thrift.copyList(args.configNodeLocations, [ttypes.TConfigNodeLocation]); - } - if (args.dataNodeLocations !== undefined && args.dataNodeLocations !== null) { - this.dataNodeLocations = Thrift.copyList(args.dataNodeLocations, [ttypes.TDataNodeLocation]); - } - } -}; -TNodeLocations.prototype = {}; -TNodeLocations.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.LIST) { - this.configNodeLocations = []; - var _rtmp360 = input.readListBegin(); - var _size59 = _rtmp360.size || 0; - for (var _i61 = 0; _i61 < _size59; ++_i61) { - var elem62 = null; - elem62 = new ttypes.TConfigNodeLocation(); - elem62.read(input); - this.configNodeLocations.push(elem62); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.LIST) { - this.dataNodeLocations = []; - var _rtmp364 = input.readListBegin(); - var _size63 = _rtmp364.size || 0; - for (var _i65 = 0; _i65 < _size63; ++_i65) { - var elem66 = null; - elem66 = new ttypes.TDataNodeLocation(); - elem66.read(input); - this.dataNodeLocations.push(elem66); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TNodeLocations.prototype.write = function(output) { - output.writeStructBegin('TNodeLocations'); - if (this.configNodeLocations !== null && this.configNodeLocations !== undefined) { - output.writeFieldBegin('configNodeLocations', Thrift.Type.LIST, 1); - output.writeListBegin(Thrift.Type.STRUCT, this.configNodeLocations.length); - for (var iter67 in this.configNodeLocations) { - if (this.configNodeLocations.hasOwnProperty(iter67)) { - iter67 = this.configNodeLocations[iter67]; - iter67.write(output); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.dataNodeLocations !== null && this.dataNodeLocations !== undefined) { - output.writeFieldBegin('dataNodeLocations', Thrift.Type.LIST, 2); - output.writeListBegin(Thrift.Type.STRUCT, this.dataNodeLocations.length); - for (var iter68 in this.dataNodeLocations) { - if (this.dataNodeLocations.hasOwnProperty(iter68)) { - iter68 = this.dataNodeLocations[iter68]; - iter68.write(output); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TShowConfigurationTemplateResp = module.exports.TShowConfigurationTemplateResp = function(args) { - this.status = null; - this.content = null; - if (args) { - if (args.status !== undefined && args.status !== null) { - this.status = new ttypes.TSStatus(args.status); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); - } - if (args.content !== undefined && args.content !== null) { - this.content = args.content; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field content is unset!'); - } - } -}; -TShowConfigurationTemplateResp.prototype = {}; -TShowConfigurationTemplateResp.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.status = new ttypes.TSStatus(); - this.status.read(input); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.content = input.readString(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TShowConfigurationTemplateResp.prototype.write = function(output) { - output.writeStructBegin('TShowConfigurationTemplateResp'); - if (this.status !== null && this.status !== undefined) { - output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); - this.status.write(output); - output.writeFieldEnd(); - } - if (this.content !== null && this.content !== undefined) { - output.writeFieldBegin('content', Thrift.Type.STRING, 2); - output.writeString(this.content); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TShowConfigurationResp = module.exports.TShowConfigurationResp = function(args) { - this.status = null; - this.content = null; - if (args) { - if (args.status !== undefined && args.status !== null) { - this.status = new ttypes.TSStatus(args.status); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); - } - if (args.content !== undefined && args.content !== null) { - this.content = args.content; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field content is unset!'); - } - } -}; -TShowConfigurationResp.prototype = {}; -TShowConfigurationResp.prototype.read = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRUCT) { - this.status = new ttypes.TSStatus(); - this.status.read(input); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.content = input.readString(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TShowConfigurationResp.prototype.write = function(output) { - output.writeStructBegin('TShowConfigurationResp'); - if (this.status !== null && this.status !== undefined) { - output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); - this.status.write(output); - output.writeFieldEnd(); - } - if (this.content !== null && this.content !== undefined) { - output.writeFieldBegin('content', Thrift.Type.STRING, 2); - output.writeString(this.content); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - diff --git a/cdsp/information-layer/handlers/src/iotdb/package.json b/cdsp/information-layer/handlers/src/iotdb/package.json deleted file mode 100644 index 0b68fe0..0000000 --- a/cdsp/information-layer/handlers/src/iotdb/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "iotdb-handler", - "version": "1.0.0", - "description": "IoT database handler", - "main": "iotdb-handler.js", - "dependencies": { - "thrift": "^0.20.0", - "uuid": "^9.0.1" - } -} diff --git a/cdsp/information-layer/handlers/src/iotdb/src/IoTDBHandler.ts b/cdsp/information-layer/handlers/src/iotdb/src/IoTDBHandler.ts new file mode 100644 index 0000000..3ede2fb --- /dev/null +++ b/cdsp/information-layer/handlers/src/iotdb/src/IoTDBHandler.ts @@ -0,0 +1,553 @@ +import { SupportedMessageDataTypes } from "./../utils/iotdb-constants"; +import { Client as ThriftClient } from "../gen-nodejs/IClientRPCService"; +import { + TSExecuteStatementReq, + TSOpenSessionReq, + TSOpenSessionResp, + TSProtocolVersion, + TSCloseSessionReq, + TSInsertRecordReq, + Int64, +} from "../gen-nodejs/IClientRPCService_types"; +import thrift from "thrift"; +import { IotDBInt64 } from "../utils/Int64"; +import { HandlerBase } from "../../HandlerBase"; +import { SessionDataSet } from "../utils/SessionDataSet"; +import { IoTDBDataInterpreter } from "../utils/IoTDBDataInterpreter"; +import { + createDataPointsSchema, + isSupportedDataPoint, + SupportedDataPoints, +} from "../config/iotdb-config"; +import { databaseParams, databaseConfig } from "../config/database-params"; +import { + logMessage, + logError, + logErrorStr, + logWithColor, + MessageType, + COLORS, +} from "../../../../utils/logger"; +import { createErrorMessage } from "../../../../utils/error-message-helper"; +import { WebSocket, Message, STATUS_ERRORS } from "../../../utils/data_types"; + +export class IoTDBHandler extends HandlerBase { + private client: ThriftClient | null; + private sendMessageToClients: + | ((ws: WebSocket, message: Message) => void) + | null; + private sessionId: Int64 | undefined; + private readonly protocolVersion: number; + private statementId: Int64 | undefined; + private readonly fetchSize: number; + private dataPointsSchema: SupportedDataPoints; + + constructor() { + super(); + if (!databaseConfig) { + throw new Error("Invalid database configuration."); + } + + this.client = null; + this.sendMessageToClients = null; + this.sessionId = undefined; + this.protocolVersion = TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V3; + this.statementId = undefined; + this.fetchSize = databaseConfig.fetchSize; + this.dataPointsSchema = {}; + } + + async authenticateAndConnect( + sendMessageToClients: (ws: WebSocket, message: Message) => void + ): Promise { + try { + this.sendMessageToClients = sendMessageToClients; + + const connection = thrift.createConnection( + databaseConfig!.iotdbHost, + databaseConfig!.iotdbPort!, + { + transport: thrift.TFramedTransport, + protocol: thrift.TBinaryProtocol, + } + ); + + logMessage( + `Connect to IoTDB, host: ${databaseConfig!.iotdbHost} port: ${databaseConfig!.iotdbPort}` + ); + + this.client = thrift.createClient(ThriftClient, connection); + + connection.on("error", (error: Error) => { + logError("thrift connection error", error); + }); + + const supportedDataPoint: SupportedDataPoints = + this.getSupportedDataPoints() as SupportedDataPoints; + this.dataPointsSchema = createDataPointsSchema(supportedDataPoint); + + logMessage("Successfully connected to IoTDB using thrift"); + } catch (error: unknown) { + logError("Failed to authenticate with IoTDB", error); + } + } + + protected async read(message: Message, ws: WebSocket): Promise { + if (this.areNodesValid(message, ws)) { + try { + await this.openSessionIfNeeded(); + const responseNodes = await this.queryLastFields(message, ws); + if (responseNodes.length > 0) { + const responseMessage = this.createUpdateMessage( + message, + responseNodes + ); + this.sendMessageToClient(ws, responseMessage); + } else { + this.sendMessageToClient( + ws, + createErrorMessage( + "read", + STATUS_ERRORS.NOT_FOUND, + `No data found with the Id: ${message.id}` + ) + ); + } + } catch (error: unknown) { + const errMsg = error instanceof Error ? error.message : "Unknown error"; + this.sendMessageToClient( + ws, + createErrorMessage("read", STATUS_ERRORS.NOT_FOUND, errMsg) + ); + } finally { + await this.closeSessionIfNeeded(); + } + } + } + + protected async write(message: Message, ws: WebSocket): Promise { + if (this.areNodesValid(message, ws)) { + try { + await this.openSessionIfNeeded(); + const data = this.createObjectToInsert(message); + let measurements: string[] = []; + let dataTypes: string[] = []; + let values: any[] = []; + + for (const [key, value] of Object.entries(data)) { + measurements.push(key); + dataTypes.push(this.dataPointsSchema[key]); + values.push(value); + } + + const tree = message.tree as keyof typeof databaseParams; + if (!tree || !databaseParams[tree]) { + throw new Error(`Invalid tree specified: ${message.tree}`); + } + + const deviceId = databaseParams[tree].databaseName; + const status = await this.insertRecord( + deviceId, + measurements, + dataTypes, + values + ); + + logWithColor( + `Record inserted to device ${deviceId}, status code: `.concat( + JSON.stringify(status) + ), + COLORS.GREY + ); + + const responseNodes = await this.queryLastFields(message, ws); + + if (responseNodes.length) { + const responseMessage = this.createUpdateMessage( + message, + responseNodes + ); + this.sendMessageToClient(ws, responseMessage); + } else { + this.sendMessageToClient( + ws, + createErrorMessage( + "write", + STATUS_ERRORS.NOT_FOUND, + `No data found with the Id: ${message.id}` + ) + ); + } + } catch (error: unknown) { + const errMsg = error instanceof Error ? error.message : "Unknown error"; + this.sendMessageToClient( + ws, + createErrorMessage( + "write", + STATUS_ERRORS.SERVICE_UNAVAILABLE, + `Failed writing data. ${errMsg}` + ) + ); + } finally { + await this.closeSessionIfNeeded(); + } + } + } + + /** + * Opens a session with the IoTDB server using the provided credentials and configuration. + */ + private async openSession(): Promise { + if (this.sessionId) { + logMessage("The session is already opened."); + return; + } + + const openSessionReq = new TSOpenSessionReq({ + username: databaseConfig!.iotdbUser, + password: databaseConfig!.iotdbPassword, + client_protocol: this.protocolVersion, + zoneId: databaseConfig!.timeZoneId, + configuration: new Map([["version", "V_0_13"]]), + }); + + try { + if (!this.client) { + throw new Error("Client is not initialized"); + } + const resp: TSOpenSessionResp = + await this.client.openSession(openSessionReq); + + if (this.protocolVersion !== resp.serverProtocolVersion) { + logMessage( + "Protocol differ, Client version is " + + this.protocolVersion + + ", but Server version is " + + resp.serverProtocolVersion + ); + // version is less than 0.10 + if (resp.serverProtocolVersion === 0) { + throw new Error("Protocol not supported."); + } + } + + this.sessionId = resp.sessionId; + if (this.sessionId) { + this.statementId = await this.client?.requestStatementId( + this.sessionId + ); + } else { + throw new Error( + "Session ID is undefined, cannot request statement ID." + ); + } + logMessage("Session started!"); + } catch (error: unknown) { + logError("Failed starting session with IoTDB", error); + } + } + + /** + * Closes the current session if it is not already closed. + */ + private async closeSession(): Promise { + if (!this.sessionId) { + logMessage("Session is already closed."); + return; + } + + const req = new TSCloseSessionReq({ sessionId: this.sessionId! }); + + try { + await this.client?.closeSession(req); + } catch (error: unknown) { + logError( + "Error occurs when closing session at server. Maybe server is down. Error message", + error + ); + } finally { + this.sessionId = undefined; + logMessage("Session closed!"); + } + } + + private async openSessionIfNeeded(): Promise { + if (!this.sessionId) { + await this.openSession(); + } + } + + private async closeSessionIfNeeded(): Promise { + if (this.sessionId) { + this.closeSession(); + } + } + + /** + * Validates the nodes in a message against the schema of a media element. + * + * @param message - The message object containing details for the request. + * @param ws - The WebSocket object for communication. + * @returns - Returns true if all nodes are valid against the schema, otherwise false. + */ + private areNodesValid(message: Message, ws: WebSocket): boolean { + const { type } = message; + + const errorData = this.validateNodesAgainstSchema( + message, + this.dataPointsSchema + ); + + if (errorData) { + logErrorStr( + `Error validating message nodes against schema: ${JSON.stringify(errorData)}` + ); + this.sendMessageToClient( + ws, + createErrorMessage( + `${type}`, + STATUS_ERRORS.NOT_FOUND, + JSON.stringify(errorData) + ) + ); + + return false; + } + return true; + } + + /** + * Queries the last fields from the database based on the provided message and sends the response to the client. + * + * @param message - The message object containing the query details. + * @param ws - The WebSocket connection to send the response to. + */ + private async queryLastFields( + message: Message, + ws: WebSocket + ): Promise> { + const { id: objectId, tree } = message; + + if (!tree || !(tree in databaseParams)) { + const errorMsg = `Invalid or undefined tree provided: ${tree}`; + logErrorStr(errorMsg); + this.sendMessageToClient( + ws, + createErrorMessage("read", STATUS_ERRORS.NOT_FOUND, errorMsg) + ); + return []; + } + const { databaseName, dataPointId } = + databaseParams[tree as keyof typeof databaseParams]; + const fieldsToSearch = this.extractDataPointsFromNodes(message).join(", "); + const sql = `SELECT ${fieldsToSearch} FROM ${databaseName} WHERE ${dataPointId} = '${objectId}' ORDER BY Time ASC`; + + try { + const sessionDataSet = await this.executeQueryStatement(sql); + + // Check if sessionDataSet is not an instance of SessionDataSet, and handle the error + if (!(sessionDataSet instanceof SessionDataSet)) { + throw new Error( + "Failed to retrieve session data. Invalid session dataset." + ); + } + + const mediaElements: any[] = []; + while (sessionDataSet.hasNext()) { + mediaElements.push(sessionDataSet.next()); + } + + const latestValues: Record = {}; + mediaElements.forEach((mediaElement) => { + const transformedMediaElement = Object.fromEntries( + Object.entries(mediaElement).map(([key, value]) => { + const newKey = this.transformDataPointsWithDots(key); + return [newKey, value]; + }) + ); + + const transformedObject = + IoTDBDataInterpreter.extractNodesFromTimeseries( + transformedMediaElement, + databaseName + ); + + Object.entries(transformedObject).forEach(([key, value]) => { + if (value !== null && !isNaN(value)) { + latestValues[key] = value; + } + }); + }); + + return Object.entries(latestValues).map(([name, value]) => ({ + name, + value, + })); + } catch (error: unknown) { + const errMsg = error instanceof Error ? error.message : "Unknown error"; + this.sendMessageToClient( + ws, + createErrorMessage("read", STATUS_ERRORS.SERVICE_UNAVAILABLE, errMsg) + ); + return []; + } + } + + /** + * Executes a SQL query statement asynchronously. + * + * @param sql - The SQL query statement to be executed. + * @returns - Returns a SessionDataSet object if the query is successful, + * otherwise returns an empty object. + * @throws - Throws an error if the session is not open. + */ + private async executeQueryStatement(sql: string): Promise { + try { + if (!this.sessionId) { + throw new Error("Session is not open. Please authenticate first."); + } + if (!this.statementId) { + throw new Error("Missing statement ID"); + } + + const request = new TSExecuteStatementReq({ + sessionId: this.sessionId, + statement: sql, + statementId: this.statementId, + fetchSize: this.fetchSize, + timeout: 0, + }); + + const resp = await this.client?.executeQueryStatement(request); + if (!resp || !resp.queryDataSet || !resp.queryDataSet.valueList) { + throw new Error("Failed to execute query or retrieve valid data."); + } + return new SessionDataSet( + resp.columns ?? [], + resp.dataTypeList ?? [], + resp.columnNameIndexMap + ? Object.fromEntries(resp.columnNameIndexMap) + : {}, + resp.queryId ?? new IotDBInt64(-1), + this.client!, + this.statementId!, + this.sessionId!, + resp.queryDataSet, + resp.ignoreTimeStamp ?? false + ); + } catch (error: unknown) { + logError("Failed executing query statement", error); + throw error; + } + } + + /** + * Inserts a record into the time series database. + * @param deviceId - The ID of the device. + * @param timestamp - The timestamp of the record. + * @param measurements - Array of measurement names. + * @param dataTypes - Array of data types for each value. + * @param values - Array of values to be inserted. + * @param isAligned - Flag indicating if the data is aligned. + * @returns - A promise that resolves with the result of the insertion. + * @throws - Throws an error if lengths of data types, values, and measurements do not match. + */ + private async insertRecord( + deviceId: string, + measurements: string[], + dataTypes: string[], + values: any[], + isAligned = false + ): Promise { + if (!this.sessionId) { + throw new Error("Session is not open. Please authenticate first."); + } + if ( + values.length !== dataTypes.length || + values.length !== measurements.length + ) { + throw "Length of data types does not equal to length of values!"; + } + + // Validate the dataTypes before using them + const validatedDataTypes: (keyof typeof SupportedMessageDataTypes)[] = []; + + dataTypes.forEach((dataType) => { + if (isSupportedDataPoint(dataType)) { + validatedDataTypes.push(dataType); // Add valid data types + } else { + throw new Error(`Unsupported data type: ${dataType}`); + } + }); + + const valuesInBytes = IoTDBDataInterpreter.serializeValues( + validatedDataTypes, + values + ); + + const request = new TSInsertRecordReq({ + sessionId: this.sessionId!, + prefixPath: deviceId, + measurements: measurements, + values: valuesInBytes, + timestamp: new IotDBInt64(Date.now()), + isAligned: isAligned, + }); + + return await this.client?.insertRecord(request); + } + + /** + * Extracts data point names from the given message. + * + * This function checks if the message has a single node or multiple nodes and + * extracts the names accordingly. + * + * @param message - The message containing node(s). + * @returns An array of data point names. + */ + private extractDataPointsFromNodes(message: Message): string[] { + let dataPoints: string[] = []; + + if (message.node) { + dataPoints.push( + this.transformDataPointsWithUnderscores(message.node.name) + ); + } else if (message.nodes) { + dataPoints = message.nodes.map((node) => + this.transformDataPointsWithUnderscores(node.name) + ); + } + return dataPoints; + } + + /** + * Creates an object to be inserted into the database based on the provided message. + * The object is constructed using the message's ID and its associated nodes. + * + * @param message - The message object containing the ID, tree, and nodes. + * @returns An object representing the data to be inserted. + * @throws Will throw an error if the tree is invalid or undefined. + */ + private createObjectToInsert(message: Message): Record { + const { id, tree } = message; + + if (!tree || !(tree in databaseParams)) { + throw new Error(`Invalid or undefined tree provided: ${tree}`); + } + const { dataPointId } = databaseParams[tree as keyof typeof databaseParams]; + const data: Record = { [dataPointId]: id }; + + if (message.node) { + data[this.transformDataPointsWithUnderscores(message.node.name)] = + message.node.value; + } else if (message.nodes) { + message.nodes.forEach((node) => { + data[this.transformDataPointsWithUnderscores(node.name)] = node.value; + }); + } + return data; + } +} + +export default IoTDBHandler; diff --git a/cdsp/information-layer/handlers/src/iotdb/src/iotdb-handler.js b/cdsp/information-layer/handlers/src/iotdb/src/iotdb-handler.js deleted file mode 100644 index b7aa035..0000000 --- a/cdsp/information-layer/handlers/src/iotdb/src/iotdb-handler.js +++ /dev/null @@ -1,473 +0,0 @@ -const Client = require("../gen-nodejs/IClientRPCService"); -const { - TSExecuteStatementReq, - TSOpenSessionReq, - TSProtocolVersion, - TSCloseSessionReq, - TSInsertRecordReq, -} = require("../gen-nodejs/client_types"); -const thrift = require("thrift"); -const Handler = require("../../handler"); -const SessionDataSet = require("../utils/session-data-set"); -const { IoTDBDataInterpreter } = require("../utils/iotdb-data-interpreter"); -const { createDataPointsSchema } = require("../config/data-points-type"); -const { databaseParams, databaseConfig } = require("../config/database-params"); -const { - logMessage, - logWithColor, - MessageType, - COLORS, -} = require("../../../../utils/logger"); -const { - createErrorMessage, -} = require("../../../../utils/error-message-helper"); - -class IoTDBHandler extends Handler { - constructor() { - super(); - this.client = null; - this._sendMessageToClients = null; - this.sessionId = null; - this.protocolVersion = TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V3; - this.statementId = null; - this.zoneId = databaseConfig.timeZoneId; - this.fetchSize = databaseConfig.fetchSize; - this.isSessionClosed = true; - this.dataPointsSchema = null; - } - - async authenticateAndConnect(sendMessageToClients) { - try { - this._sendMessageToClients = sendMessageToClients; - - const connection = thrift.createConnection( - databaseConfig.iotdbHost, - databaseConfig.iotdbPort, - { - transport: thrift.TFramedTransport, - protocol: thrift.TBinaryProtocol, - }, - ); - - this.client = thrift.createClient(Client, connection); - - connection.on("error", (error) => { - logMessage( - "thrift connection error: ".concat(error), - MessageType.ERROR, - ); - }); - - const supportedDataPoint = this._getSupportedDataPoints(); - this.dataPointsSchema = createDataPointsSchema(supportedDataPoint); - - console.info("Successfully connected to IoTDB using thrift"); - } catch (error) { - logMessage( - "Failed to authenticate with IoTDB: ".concat(error), - MessageType.ERROR, - ); - } - } - - async read(message, ws) { - if (this.#areNodesValid(message, ws)) { - try { - await this.#openSessionIfNeeded(); - const responseNodes = await this.#queryLastFields(message, ws); - if (responseNodes.length > 0) { - const responseMessage = this._createUpdateMessage( - message, - responseNodes, - ); - this._sendMessageToClient(ws, responseMessage); - } else { - this._sendMessageToClient( - ws, - createErrorMessage( - "read", - 404, - `No data found with the Id: ${message.id}`, - ), - ); - } - } catch (error) { - this._sendMessageToClient( - ws, - createErrorMessage("read", 404, error.message), - ); - } finally { - await this.#closeSessionIfNeeded(); - } - } - } - - async write(message, ws) { - if (this.#areNodesValid(message, ws)) { - try { - await this.#openSessionIfNeeded(); - const data = this.#createObjectToInsert(message); - let measurements = []; - let dataTypes = []; - let values = []; - - for (const [key, value] of Object.entries(data)) { - measurements.push(key); - dataTypes.push(this.dataPointsSchema[key]); - values.push(value); - } - - const timestamp = new Date().getTime(); - const deviceId = databaseParams[message.tree].databaseName; - const status = await this.#insertRecord( - deviceId, - timestamp, - measurements, - dataTypes, - values, - ); - - logWithColor( - `Record inserted to device ${deviceId}, status code: `.concat( - JSON.stringify(status), - ), - COLORS.GREY, - ); - - const responseNodes = await this.#queryLastFields(message, ws); - - if (responseNodes.length) { - const responseMessage = this._createUpdateMessage( - message, - responseNodes, - ); - this._sendMessageToClient(ws, responseMessage); - } else { - this._sendMessageToClient( - ws, - createErrorMessage( - "write", - 404, - `No data found with the Id: ${message.id}`, - ), - ); - } - } catch (error) { - this._sendMessageToClient( - ws, - createErrorMessage("write", 503, `Failed writing data. ${error}`), - ); - } finally { - await this.#closeSessionIfNeeded(); - } - } - } - - /** - * Opens a session with the IoTDB server using the provided credentials and configuration. - */ - async #openSession() { - if (!this.isSessionClosed) { - console.info("The session is already opened."); - return; - } - - const openSessionReq = new TSOpenSessionReq({ - username: databaseConfig.iotdbUser, - password: databaseConfig.iotdbPassword, - client_protocol: this.protocolVersion, - zoneId: databaseConfig.timeZoneId, - configuration: { version: "V_0_13" }, - }); - - try { - const resp = await this.client.openSession(openSessionReq); - - if (this.protocolVersion !== resp.serverProtocolVersion) { - console.info( - "Protocol differ, Client version is " + - this.protocolVersion + - ", but Server version is " + - resp.serverProtocolVersion, - ); - // version is less than 0.10 - if (resp.serverProtocolVersion === 0) { - throw new Error("Protocol not supported."); - } - } - - this.sessionId = resp.sessionId; - this.statementId = await this.client.requestStatementId(this.sessionId); - this.isSessionClosed = false; - console.info("Session started!"); - } catch (error) { - logMessage( - "Failed starting session with IoTDB: ".concat(error), - MessageType.ERROR, - ); - } - } - - /** - * Closes the current session if it is not already closed. - */ - #closeSession() { - if (this.isSessionClosed) { - console.info("Session is already closed."); - return; - } - - let req = new TSCloseSessionReq({ - sessionId: this.sessionId, - }); - - try { - this.client.closeSession(req); - } catch (error) { - logMessage( - "Error occurs when closing session at server. Maybe server is down. Error message: ".concat( - error, - ), - MessageType.ERROR, - ); - } finally { - this.isSessionClosed = true; - console.info("Session closed!"); - } - } - - async #openSessionIfNeeded() { - if (this.isSessionClosed) { - await this.#openSession(); - } - } - - async #closeSessionIfNeeded() { - if (!this.isSessionClosed) { - this.#closeSession(); - } - } - - /** - * Validates the nodes in a message against the schema of a media element. - * - * @param {Object} message - The message object containing details for the request. - * @param {WebSocket} ws - The WebSocket object for communication. - * @returns {boolean} - Returns true if all nodes are valid against the schema, otherwise false. - */ - #areNodesValid(message, ws) { - const { type } = message; - - const errorData = this._validateNodesAgainstSchema( - message, - this.dataPointsSchema, - ); - - if (errorData) { - logMessage( - `Error validating message nodes against schema: ${JSON.stringify(errorData)}`, - MessageType.ERROR, - ); - this._sendMessageToClient( - ws, - createErrorMessage(`${type}`, 404, errorData), - ); - - return false; - } - return true; - } - - /** - * Executes a SQL query statement asynchronously. - * - * @param {string} sql - The SQL query statement to be executed. - * @returns {Promise} - Returns a SessionDataSet object if the query is successful, - * otherwise returns an empty object. - * @throws {Error} - Throws an error if the session is not open. - */ - async #executeQueryStatement(sql) { - try { - if (!this.sessionId) { - throw new Error("Session is not open. Please authenticate first."); - } - - const request = new TSExecuteStatementReq({ - sessionId: this.sessionId, - statement: sql, - statementId: this.statementId, - fetchSize: this.fetchSize, - timeout: 0, - }); - - const resp = await this.client.executeQueryStatement(request); - if (!resp || !resp.queryDataSet || !resp.queryDataSet.valueList) { - return {}; - } else { - return new SessionDataSet( - resp.columns, - resp.dataTypeList, - resp.columnNameIndexMap, - resp.queryId, - this.client, - this.statementId, - this.sessionId, - resp.queryDataSet, - resp.ignoreTimeStamp, - ); - } - } catch (error) { - logMessage( - "Failed executing query statement: ".concat(error), - MessageType.ERROR, - ); - } - } - - /** - * Inserts a record into the time series database. - * @param {string} deviceId - The ID of the device. - * @param {number} timestamp - The timestamp of the record. - * @param {string[]} measurements - Array of measurement names. - * @param {string[]} dataTypes - Array of data types for each value. - * @param {any[]} values - Array of values to be inserted. - * @param {boolean} isAligned - Flag indicating if the data is aligned. - * @returns {Promise} - A promise that resolves with the result of the insertion. - * @throws {string} - Throws an error if lengths of data types, values, and measurements do not match. - */ - async #insertRecord( - deviceId, - timestamp, - measurements, - dataTypes, - values, - isAligned = false, - ) { - if ( - values.length !== dataTypes.length || - values.length !== measurements.length - ) { - throw "length of data types does not equal to length of values!"; - } - const valuesInBytes = IoTDBDataInterpreter.serializeValues( - dataTypes, - values, - ); - - let request = new TSInsertRecordReq({ - sessionId: this.sessionId, - prefixPath: deviceId, - measurements: measurements, - values: valuesInBytes, - timestamp: timestamp, - isAligned: isAligned, - }); - return await this.client.insertRecord(request); - } - - /** - * Queries the last fields from the database based on the provided message and sends the response to the client. - * - * @param {Object} message - The message object containing the query details. - * @param {WebSocket} ws - The WebSocket connection to send the response to. - * @private - */ - async #queryLastFields(message, ws) { - const { id: objectId, tree } = message; - const { databaseName, dataPointId } = databaseParams[tree]; - const fieldsToSearch = this.#extractDataPointsFromNodes(message).join(", "); - const sql = `SELECT ${fieldsToSearch} FROM ${databaseName} WHERE ${dataPointId} = '${objectId}' ORDER BY Time ASC`; - - try { - const sessionDataSet = await this.#executeQueryStatement(sql); - - if (!sessionDataSet || Object.keys(sessionDataSet).length === 0) { - throw new Error("Internal error constructing read object."); - } - - const mediaElements = []; - while (sessionDataSet.hasNext()) { - mediaElements.push(sessionDataSet.next()); - } - - let latestValues = {}; - mediaElements.forEach((mediaElement) => { - // extract underscores from media element key - const transformedMediaElement = Object.fromEntries( - Object.entries(mediaElement).map(([key, value]) => { - const newKey = this._transformDataPointsWithDots(key); - return [newKey, value]; - }), - ); - - const transformedObject = - IoTDBDataInterpreter.extractNodesFromTimeseries( - transformedMediaElement, - databaseName, - ); - - Object.entries(transformedObject).forEach(([key, value]) => { - if (value !== null && !isNaN(value)) { - latestValues[key] = value; - } - }); - }); - - return Object.entries(latestValues).map(([name, value]) => ({ - name, - value, - })); - } catch (error) { - this._sendMessageToClient( - ws, - createErrorMessage("read", 503, error.message), - ); - } - } - - /** - * Extracts data point names from the given message. - * - * This function checks if the message has a single node or multiple nodes and - * extracts the names accordingly. - * - * @param {Object} message - The message containing node(s). - * @returns {Array} An array of data point names. - */ - #extractDataPointsFromNodes(message) { - let dataPoints = []; - - if (message.node) { - dataPoints.push( - this._transformDataPointsWithUnderscores(message.node.name), - ); - } else if (message.nodes) { - dataPoints = message.nodes.map((node) => - this._transformDataPointsWithUnderscores(node.name), - ); - } - return dataPoints; - } - - /** - * Creates an object to insert data in IoTDB based on the provided message. - * - * @param {Object} message - The message containing data to be inserted. - * @returns {Object} The data object to be inserted. - */ - #createObjectToInsert(message) { - const { id, tree } = message; - const data = { [databaseParams[tree].dataPointId]: id }; - if (message.node) { - data[this._transformDataPointsWithUnderscores(message.node.name)] = - message.node.value; - } else if (message.nodes) { - message.nodes.forEach((node) => { - data[this._transformDataPointsWithUnderscores(node.name)] = node.value; - }); - } - return data; - } -} - -module.exports = IoTDBHandler; diff --git a/cdsp/information-layer/handlers/src/iotdb/utils/Int64.ts b/cdsp/information-layer/handlers/src/iotdb/utils/Int64.ts new file mode 100644 index 0000000..9f8b6a6 --- /dev/null +++ b/cdsp/information-layer/handlers/src/iotdb/utils/Int64.ts @@ -0,0 +1,44 @@ +// Implementing Int64 class that matches the structure expected by Thrift +import { Int64 } from "../gen-nodejs/IClientRPCService_types"; + +/** + * Represents a 64-bit integer for IoT applications. + * Implements the Int64 interface. + */ +export class IotDBInt64 implements Int64 { + private value: bigint; // Holds the 64-bit integer value + + /** + * Constructs an instance of IotDBInt64. + * @param input - An optional number or string to initialize the 64-bit integer. + * If no input is provided, it defaults to 0. + */ + constructor(input?: number | string) { + this.value = BigInt(input ?? 0); // Handle input as either number or string + } + + /** + * A placeholder constructor method that is not implemented. + * @param o - An optional number or string parameter. + * @throws {Error} Throws an error indicating that the method is not implemented. + */ + ["constructor"](o?: number | string): this { + throw new Error("Method not implemented."); + } + + /** + * Converts the 64-bit integer to its string representation. + * @returns {string} The string representation of the 64-bit integer. + */ + toString(): string { + return this.value.toString(); + } + + /** + * Converts the 64-bit integer to its JSON representation. + * @returns {string} The JSON representation of the 64-bit integer. + */ + toJson(): string { + return this.toString(); // You can customize this if needed + } +} diff --git a/cdsp/information-layer/handlers/src/iotdb/utils/iotdb-data-interpreter.js b/cdsp/information-layer/handlers/src/iotdb/utils/IoTDBDataInterpreter.ts similarity index 58% rename from cdsp/information-layer/handlers/src/iotdb/utils/iotdb-data-interpreter.js rename to cdsp/information-layer/handlers/src/iotdb/utils/IoTDBDataInterpreter.ts index 7a52b4f..d8a7e74 100644 --- a/cdsp/information-layer/handlers/src/iotdb/utils/iotdb-data-interpreter.js +++ b/cdsp/information-layer/handlers/src/iotdb/utils/IoTDBDataInterpreter.ts @@ -1,52 +1,52 @@ -const { - IoTDBDataType, - SupportedMessageDataTypes, -} = require("./iotdb-constants"); +import { IoTDBDataType, SupportedMessageDataTypes } from "./iotdb-constants"; -class IotdbDataInterpreter { +export class IoTDBDataInterpreter { /** * Serializes values based on the specified data types. - * @param {Array} dataTypes - Array of data types to serialize the values as. - * @param {Array} values - Array of values to be serialized. - * @returns {Buffer} - Serialized values as a Buffer. + * @param dataTypes - Array of data types to serialize the values as. + * @param values - Array of values to be serialized. + * @returns Serialized values as a Buffer. */ - static serializeValues(dataTypes, values) { - function serializeBoolean(value) { + static serializeValues( + dataTypes: (keyof typeof SupportedMessageDataTypes)[], + values: any[], + ): Buffer { + function serializeBoolean(value: boolean): (number | boolean)[] { return [IoTDBDataType.BOOLEAN, value]; } - function serializeInt32(value) { + function serializeInt32(value: number): (number | Uint8Array)[] { const int32 = new Int32Array([value]); const uint8 = new Uint8Array(int32.buffer).reverse(); return [IoTDBDataType.INT32, ...uint8]; } - function serializeInt64(value) { + function serializeInt64(value: bigint): (number | Uint8Array)[] { const bigint64 = new BigInt64Array([value]); const uint8 = new Uint8Array(bigint64.buffer).reverse(); return [IoTDBDataType.INT64, ...uint8]; } - function serializeFloat(value) { + function serializeFloat(value: number): (number | Uint8Array)[] { const float32 = new Float32Array([value]); const uint8 = new Uint8Array(float32.buffer).reverse(); return [IoTDBDataType.FLOAT, ...uint8]; } - function serializeDouble(value) { + function serializeDouble(value: number): (number | Uint8Array)[] { const float64 = new Float64Array([value]); const uint8 = new Uint8Array(float64.buffer).reverse(); return [IoTDBDataType.DOUBLE, ...uint8]; } - function serializeText(value) { + function serializeText(value: string): (number | Uint8Array)[] { const utf8arr = Buffer.from(value); const int32 = new Uint32Array([utf8arr.length]); const uint8 = new Uint8Array(int32.buffer).reverse(); return [IoTDBDataType.TEXT, ...uint8, ...utf8arr]; } - const serializedValues = []; + const serializedValues: (number | Uint8Array | boolean)[] = []; for (let i = 0; i < dataTypes.length; i++) { switch (dataTypes[i]) { @@ -75,33 +75,43 @@ class IotdbDataInterpreter { throw new Error(`Unsupported data type: ${dataTypes[i]}`); } } - return Buffer.from(serializedValues); + // Convert to Uint8Array and pass it to Buffer.from + const flattenedValues = new Uint8Array( + serializedValues.flat().map((val) => Number(val)), + ); + return Buffer.from(flattenedValues); } /** * Extracts and transforms timeseries nodes from the given object with the required message format. * - * @param {Object} obj - The object containing timeseries data. - * @param {string} databaseName - The database name to match and remove from the keys. - * @returns {Object} - A new object with transformed keys and their corresponding values. + * @param obj - The object containing timeseries data. + * @param databaseName - The database name to match and remove from the keys. + * @returns A new object with transformed keys and their corresponding values. */ - static extractNodesFromTimeseries(obj, databaseName) { - return Object.entries(obj).reduce((acc, [key, value]) => { - if (key.startsWith(databaseName)) { - const newKey = key.replace(`${databaseName}.`, ""); - acc[newKey] = value; - } - return acc; - }, {}); + static extractNodesFromTimeseries( + obj: Record, + databaseName: string, + ): Record { + return Object.entries(obj).reduce( + (acc: Record, [key, value]) => { + if (key.startsWith(databaseName)) { + const newKey = key.replace(`${databaseName}.`, ""); + acc[newKey] = value; + } + return acc; + }, + {}, + ); } /** * This function converts a buffer to a BigInt64Array and extracts the timestamp. * - * @param {Buffer} buffer - The buffer containing the timestamp. - * @returns {{ timestamp: BigInt }} An object containing the extracted timestamp. + * @param buffer - The buffer containing the timestamp. + * @returns An object containing the extracted timestamp. */ - static extractTimestamp(buffer) { + static extractTimestamp(buffer: Buffer): { timestamp: bigint } { const reverseBuffer = Buffer.from(buffer.subarray(0, 8).reverse()); const uinit8Buffer = new Uint8Array(reverseBuffer).buffer; const timestamp = new BigInt64Array(uinit8Buffer)[0]; @@ -109,5 +119,3 @@ class IotdbDataInterpreter { return { timestamp }; } } - -module.exports = { IoTDBDataInterpreter: IotdbDataInterpreter }; diff --git a/cdsp/information-layer/handlers/src/iotdb/utils/IoTDBRpcDataSet.ts b/cdsp/information-layer/handlers/src/iotdb/utils/IoTDBRpcDataSet.ts new file mode 100644 index 0000000..de8a98a --- /dev/null +++ b/cdsp/information-layer/handlers/src/iotdb/utils/IoTDBRpcDataSet.ts @@ -0,0 +1,223 @@ +import { IoTDBDataType } from "./iotdb-constants"; +import { Int64 } from "../gen-nodejs/IClientRPCService_types"; + +export class IoTDBRpcDataSet { + // Static properties + static TIMESTAMP_STR = "Time"; + static START_INDEX = 2; + static FLAG = 0x80; + + // Private fields + private sql: string | null = null; + private columnNameList: string[]; + private columnTypeList: IoTDBDataType[]; + private queryId: Int64; + private client: any; + private statementId: Int64; + private sessionId: Int64; + private queryDataSet: any; + private ignoreTimestamp: boolean; + private fetchSize: number; + private columnOrdinalDict: Map; + private columnTypeDeduplicatedList: (IoTDBDataType | null)[]; + private timeBytes: Buffer; + private currentBitmap: Buffer[]; + private hasCachedRecord: boolean; + private value: (Buffer | null)[]; + private emptyResultSet: boolean; + private rowsIndex: number; + private columnSize: number; + + constructor( + columnNameList: string[], + columnTypeList: IoTDBDataType[], + columnNameIndex: { [key: string]: number } | null, + queryId: Int64, + client: any, + statementId: Int64, + sessionId: Int64, + queryDataSet: any, + ignoreTimestamp: boolean, + fetchSize: number + ) { + this.columnNameList = []; + this.columnTypeList = []; + this.queryId = queryId; + this.client = client; + this.statementId = statementId; + this.sessionId = sessionId; + this.queryDataSet = queryDataSet; + this.ignoreTimestamp = ignoreTimestamp; + this.fetchSize = fetchSize; + this.columnSize = columnNameList.length; + this.columnOrdinalDict = new Map(); + this.columnTypeDeduplicatedList = []; + this.hasCachedRecord = false; + this.emptyResultSet = false; + this.rowsIndex = 0; + + if (!ignoreTimestamp) { + this.columnNameList.push(IoTDBRpcDataSet.TIMESTAMP_STR); + this.columnTypeList.push(IoTDBDataType.INT64); + this.columnOrdinalDict.set(IoTDBRpcDataSet.TIMESTAMP_STR, 1); + } + + if (columnNameIndex !== null) { + for (let j = 0; j < columnNameIndex.length; j++) { + this.columnTypeDeduplicatedList.push(null); + } + + for (let i = 0; i < columnNameList.length; i++) { + const name = columnNameList[i]; + this.columnNameList.push(name); + this.columnTypeList.push(columnTypeList[i]); + if (!this.columnOrdinalDict.has(name)) { + const index = columnNameIndex[name]; + this.columnOrdinalDict.set(name, index + IoTDBRpcDataSet.START_INDEX); + this.columnTypeDeduplicatedList[index] = columnTypeList[i]; + } + } + } + + this.timeBytes = Buffer.alloc(0); + this.currentBitmap = Array(this.columnTypeDeduplicatedList.length).fill( + Buffer.alloc(0) + ); + this.value = Array(this.columnTypeDeduplicatedList.length).fill(null); + } + + next(): boolean { + if (this.hasCachedResult()) { + this.constructOneRow(); + return true; + } + if (this.emptyResultSet) { + return true; + } + this.fetchResults(); + if (this.hasCachedResult()) { + this.constructOneRow(); + return true; + } + return false; + } + + getHasCachedRecord(): boolean { + return this.hasCachedRecord; + } + + setHasCachedRecord(value: boolean): void { + this.hasCachedRecord = value; + } + + getTimeBytes(): Buffer { + return this.timeBytes; + } + + getColumnSize(): number { + return this.columnSize; + } + + getIgnoreTimestamp(): boolean { + return this.ignoreTimestamp; + } + + getColumnNames(): string[] { + return this.columnNameList; + } + + getColumnOrdinalDict(): Map { + return this.columnOrdinalDict; + } + + isNullByIndex(columnIndex: number): boolean { + const index = + this.columnOrdinalDict.get(this.findColumnNameByIndex(columnIndex))! - + IoTDBRpcDataSet.START_INDEX; + if (index < 0) { + return true; + } + return this.isNull(index, this.rowsIndex - 1); + } + + getValues(): (Buffer | null)[] { + return this.value; + } + + getColumnTypeDeduplicatedList(): (IoTDBDataType | null)[] { + return this.columnTypeDeduplicatedList; + } + + findColumnNameByIndex(columnIndex: number): string { + if (columnIndex <= 0 || columnIndex > this.columnNameList.length) { + throw new Error("Column index out of range"); + } + return this.columnNameList[columnIndex - 1]; + } + + private hasCachedResult(): boolean { + return this.queryDataSet !== null && this.queryDataSet.time.length !== 0; + } + + private constructOneRow(): void { + this.timeBytes = this.queryDataSet.time.slice(0, 8); + this.queryDataSet.time = this.queryDataSet.time.slice(8); + + for (let i = 0; i < this.queryDataSet.bitmapList.length; i++) { + const bitmapBuffer = this.queryDataSet.bitmapList[i]; + + if (this.rowsIndex % 8 === 0) { + this.currentBitmap[i] = bitmapBuffer[0]; + this.queryDataSet.bitmapList[i] = bitmapBuffer.slice(1); + } + + if (!this.isNull(i, this.rowsIndex)) { + const valueBuffer = this.queryDataSet.valueList[i]; + const dataType = this.columnTypeDeduplicatedList[i]; + + switch (dataType) { + case IoTDBDataType.BOOLEAN: + this.value[i] = valueBuffer.slice(0, 1); + this.queryDataSet.valueList[i] = valueBuffer.slice(1); + break; + case IoTDBDataType.INT32: + this.value[i] = valueBuffer.slice(0, 4); + this.queryDataSet.valueList[i] = valueBuffer.slice(4); + break; + case IoTDBDataType.INT64: + this.value[i] = valueBuffer.slice(0, 8); + this.queryDataSet.valueList[i] = valueBuffer.slice(8); + break; + case IoTDBDataType.FLOAT: + this.value[i] = valueBuffer.slice(0, 4); + this.queryDataSet.valueList[i] = valueBuffer.slice(4); + break; + case IoTDBDataType.DOUBLE: + this.value[i] = valueBuffer.slice(0, 8); + this.queryDataSet.valueList[i] = valueBuffer.slice(8); + break; + case IoTDBDataType.TEXT: + const length = valueBuffer.readInt32BE(0); + this.value[i] = valueBuffer.slice(4, 4 + length); + this.queryDataSet.valueList[i] = valueBuffer.slice(4 + length); + break; + default: + throw new Error(`Unsupported data type: ${dataType}`); + } + } + } + this.rowsIndex += 1; + this.hasCachedRecord = true; + } + + private isNull(index: number, rowNum: number): boolean { + const bitmap = this.currentBitmap[index]; + const shift = rowNum % 8; + const bitmapValue = bitmap.readUInt8(0); // Read the first byte as an unsigned integer + return ((IoTDBRpcDataSet.FLAG >> shift) & (bitmapValue & 0xff)) === 0; + } + + private fetchResults(): void { + this.rowsIndex = 0; + } +} diff --git a/cdsp/information-layer/handlers/src/iotdb/utils/SessionDataSet.ts b/cdsp/information-layer/handlers/src/iotdb/utils/SessionDataSet.ts new file mode 100644 index 0000000..364fdc2 --- /dev/null +++ b/cdsp/information-layer/handlers/src/iotdb/utils/SessionDataSet.ts @@ -0,0 +1,111 @@ +import { IoTDBDataType } from "./iotdb-constants"; +import { IoTDBRpcDataSet } from "./IoTDBRpcDataSet"; +import { IoTDBDataInterpreter } from "./IoTDBDataInterpreter"; +import { Int64 } from "../gen-nodejs/IClientRPCService_types"; + +// Define the dataTypeProcessors map with specific function types +const dataTypeProcessors: { + [key in IoTDBDataType]: ( + bytes: Uint8Array | Buffer, + ) => number | bigint | string; +} = { + [IoTDBDataType.BOOLEAN]: (bytes) => + new Int8Array(new Uint8Array(bytes.slice(0, 1).reverse()).buffer)[0], + [IoTDBDataType.INT32]: (bytes) => + new Int32Array(new Uint8Array(bytes.slice(0, 4).reverse()).buffer)[0], + [IoTDBDataType.INT64]: (bytes) => + new BigInt64Array(new Uint8Array(bytes.slice(0, 8).reverse()).buffer)[0], + [IoTDBDataType.FLOAT]: (bytes) => + new Float32Array(new Uint8Array(bytes.slice(0, 4).reverse()).buffer)[0], + [IoTDBDataType.DOUBLE]: (bytes) => + new Float64Array(new Uint8Array(bytes.slice(0, 8).reverse()).buffer)[0], + [IoTDBDataType.TEXT]: (bytes) => bytes.toString(), +}; + +export class SessionDataSet { + private iotdbRpcDataSet: IoTDBRpcDataSet; + + constructor( + columnNameList: string[], + columnTypeList: IoTDBDataType[], + columnNameIndex: { [key: string]: number }, + queryId: Int64, + client: any, + statementId: Int64, + sessionId: Int64, + queryDataSet: any, + ignoreTimestamp: boolean, + ) { + this.iotdbRpcDataSet = new IoTDBRpcDataSet( + columnNameList, + columnTypeList, + columnNameIndex, + queryId, + client, + statementId, + sessionId, + queryDataSet, + ignoreTimestamp, + 1024, // Buffer size or default value + ); + } + + hasNext(): boolean { + return this.iotdbRpcDataSet.next(); + } + + next(): { [key: string]: any } | null { + if (!this.iotdbRpcDataSet.getHasCachedRecord()) { + if (!this.hasNext()) { + return null; + } + } + this.iotdbRpcDataSet.setHasCachedRecord(false); + return this.constructRowRecordFromValueArray(); + } + + private constructRowRecordFromValueArray(): { [key: string]: any } { + const time64 = IoTDBDataInterpreter.extractTimestamp( + this.iotdbRpcDataSet.getTimeBytes(), + ); + const obj: { [key: string]: any } = { timestamp: time64 }; + + for (let i = 0; i < this.iotdbRpcDataSet.getColumnSize(); ++i) { + let index = i + 1; + let dataSetColumnIndex = i + IoTDBRpcDataSet.START_INDEX; + + if (this.iotdbRpcDataSet.getIgnoreTimestamp()) { + index -= 1; + dataSetColumnIndex -= 1; + } + + const columnName = this.iotdbRpcDataSet.getColumnNames()[index]; + const location = + this.iotdbRpcDataSet.getColumnOrdinalDict().get(columnName)! - + IoTDBRpcDataSet.START_INDEX; + + if (!this.iotdbRpcDataSet.isNullByIndex(dataSetColumnIndex)) { + const valueBytes = this.iotdbRpcDataSet.getValues()[location]; + const dataType = + this.iotdbRpcDataSet.getColumnTypeDeduplicatedList()[location]; + const tsName = + this.iotdbRpcDataSet.findColumnNameByIndex(dataSetColumnIndex); + + if (dataType !== null && valueBytes !== null) { + if (dataTypeProcessors[dataType]) { + obj[tsName] = dataTypeProcessors[dataType](valueBytes); + } else { + throw new Error(`Unsupported data type: ${dataType}`); + } + } else { + obj[tsName] = null; + } + } else { + const tsName = + this.iotdbRpcDataSet.findColumnNameByIndex(dataSetColumnIndex); + obj[tsName] = null; + } + } + return obj; + } +} diff --git a/cdsp/information-layer/handlers/src/iotdb/utils/iotdb-constants.js b/cdsp/information-layer/handlers/src/iotdb/utils/iotdb-constants.js deleted file mode 100644 index 152f176..0000000 --- a/cdsp/information-layer/handlers/src/iotdb/utils/iotdb-constants.js +++ /dev/null @@ -1,21 +0,0 @@ -const IoTDBDataType = Object.freeze({ - BOOLEAN: 0, - INT32: 1, - INT64: 2, - FLOAT: 3, - DOUBLE: 4, - TEXT: 5, -}); - -const SupportedMessageDataTypes = Object.freeze({ - boolean: "boolean", - string: "string", - float: "float", - double: "double", - int8: "int8", - int16: "int16", - uint8: "uint8", - uint16: "uint16", -}); - -module.exports = { IoTDBDataType, SupportedMessageDataTypes }; diff --git a/cdsp/information-layer/handlers/src/iotdb/utils/iotdb-constants.ts b/cdsp/information-layer/handlers/src/iotdb/utils/iotdb-constants.ts new file mode 100644 index 0000000..f2cebd2 --- /dev/null +++ b/cdsp/information-layer/handlers/src/iotdb/utils/iotdb-constants.ts @@ -0,0 +1,21 @@ +// Define IoTDBDataType as an enum for better type safety +export enum IoTDBDataType { + BOOLEAN = 0, + INT32 = 1, + INT64 = 2, + FLOAT = 3, + DOUBLE = 4, + TEXT = 5, +} + +// Define SupportedMessageDataTypes as a frozen object with a string-to-string mapping +export const SupportedMessageDataTypes = { + boolean: "boolean", + string: "string", + float: "float", + double: "double", + int8: "int8", + int16: "int16", + uint8: "uint8", + uint16: "uint16", +} as const; diff --git a/cdsp/information-layer/handlers/src/iotdb/utils/iotdb-rpc-data-sets.js b/cdsp/information-layer/handlers/src/iotdb/utils/iotdb-rpc-data-sets.js deleted file mode 100644 index 18a3745..0000000 --- a/cdsp/information-layer/handlers/src/iotdb/utils/iotdb-rpc-data-sets.js +++ /dev/null @@ -1,271 +0,0 @@ -const { IoTDBDataType } = require("./iotdb-constants"); -class IoTDBRpcDataSet { - // Static properties - static TIMESTAMP_STR = "Time"; - static START_INDEX = 2; - static FLAG = 0x80; - - // Private fields - #sql; - #columnNameList; - #columnTypeList; - #queryId; - #client; - #statementId; - #sessionId; - #queryDataSet; - #ignoreTimestamp; - #fetchSize; - #columnOrdinalDict; - #columnTypeDeduplicatedList; - #timeBytes; - #currentBitmap; - #hasCachedRecord; - #value; - #emptyResultSet; - #rowsIndex; - #columnSize; - - constructor( - columnNameList, - columnTypeList, - columnNameIndex, - queryId, - client, - statementId, - sessionId, - queryDataSet, - ignoreTimestamp, - fetchSize, - ) { - this.#columnNameList = []; - this.#columnTypeList = []; - this.#queryId = queryId; - this.#client = client; - this.#statementId = statementId; - this.#sessionId = sessionId; - this.#queryDataSet = queryDataSet; - this.#ignoreTimestamp = ignoreTimestamp; - this.#fetchSize = fetchSize; - this.#columnSize = columnNameList.length; - this.#columnOrdinalDict = new Map(); - this.#columnTypeDeduplicatedList = []; - this.#hasCachedRecord = false; - this.#emptyResultSet = false; - this.#rowsIndex = 0; - - if (!ignoreTimestamp) { - this.#columnNameList.push(IoTDBRpcDataSet.TIMESTAMP_STR); - this.#columnTypeList.push(IoTDBDataType.INT64); - this.#columnOrdinalDict.set(IoTDBRpcDataSet.TIMESTAMP_STR, 1); - } - - if (columnNameIndex !== null) { - // Initialize deduplicated list - for (let j = 0; j < columnNameIndex.length; j++) { - this.#columnTypeDeduplicatedList.push(null); - } - - // Populate column_name_list and column_type_list - for (let i = 0; i < columnNameList.length; i++) { - const name = columnNameList[i]; - this.#columnNameList.push(name); - this.#columnTypeList.push(IoTDBDataType[columnTypeList[i]]); - if (!this.#columnOrdinalDict.has(name)) { - let index = columnNameIndex[name]; - this.#columnOrdinalDict.set( - name, - index + IoTDBRpcDataSet.START_INDEX, - ); - this.#columnTypeDeduplicatedList[index] = - IoTDBDataType[columnTypeList[i]]; - } - } - } - - this.#timeBytes = Buffer.alloc(0); - this.#currentBitmap = Array(this.#columnTypeDeduplicatedList.length).fill( - Buffer.alloc(0), - ); - this.#value = Array(this.#columnTypeDeduplicatedList.length).fill(null); - } - - /** - * Advances the cursor to the next row in the result set. - * - * @returns {boolean} - Returns true if the cursor was successfully advanced to the next row, - * or if there are no more rows in the result set. Returns false if - * there are no more rows and no cached results. - */ - next() { - if (this.#hasCachedResult()) { - this.#constructOneRow(); - return true; - } - if (this.#emptyResultSet) { - return true; - } - if (this.#fetchResults()) { - this.#constructOneRow(); - return true; - } - return false; - } - - getHasCachedRecord() { - return this.#hasCachedRecord; - } - - setHasCachedRecord(value) { - this.#hasCachedRecord = value; - } - - getTimeBytes() { - return this.#timeBytes; - } - - getColumnSize() { - return this.#columnSize; - } - - getIgnoreTimestamp() { - return this.#ignoreTimestamp; - } - - getColumnNames() { - return this.#columnNameList; - } - - getColumnOrdinalDict() { - return this.#columnOrdinalDict; - } - - /** - * Checks if the value at the specified column index is null. - * - * @param {number} columnIndex - The index of the column to check. - * @returns {boolean} - Returns true if the value at the specified column index is null, otherwise false. - */ - isNullByIndex(columnIndex) { - let index = - this.#columnOrdinalDict.get(this.findColumnNameByIndex(columnIndex)) - - IoTDBRpcDataSet.START_INDEX; - - // time column will never be null - if (index < 0) { - return true; - } - return this.#isNull(index, this.#rowsIndex - 1); - } - - getValues() { - return this.#value; - } - - getColumnTypeDeduplicatedList() { - return this.#columnTypeDeduplicatedList; - } - - /** - * Finds the column name by its index. - * @param {number} columnIndex - The index of the column (starting from 1). - * @returns {string} The name of the column corresponding to the index. - * @throws {Error} If the column index is less than or equal to 0 or greater than the number of columns. - */ - findColumnNameByIndex(columnIndex) { - if (columnIndex <= 0) { - throw new Error("Column index should start from 1"); - } - if (columnIndex > this.#columnNameList.length) { - throw new Error("Column index out of range"); - } - return this.#columnNameList[columnIndex - 1]; - } - - /** - * Checks if there is a cached result available. - * - * @returns {boolean} True if there is a cached result, otherwise false. - */ - #hasCachedResult() { - return this.#queryDataSet !== null && this.#queryDataSet.time.length !== 0; - } - - /** - * Constructs one row of data by reading from the dataset buffers. - * This method updates the internal state of the object by reading - * time, bitmap, and value buffers, and discarding the bytes that have been read. - */ - #constructOneRow() { - // Simulating buffer, read 8 bytes from data set and discard first 8 bytes which have been read. - this.#timeBytes = this.#queryDataSet.time.slice(0, 8); - this.#queryDataSet.time = this.#queryDataSet.time.slice(8); - - for (let i = 0; i < this.#queryDataSet.bitmapList.length; i++) { - let bitmapBuffer = this.#queryDataSet.bitmapList[i]; - - // Another 8 new rows, should move the bitmap buffer position to next byte. - if (this.#rowsIndex % 8 === 0) { - this.#currentBitmap[i] = bitmapBuffer[0]; - this.#queryDataSet.bitmapList[i] = bitmapBuffer.slice(1); - } - - if (!this.#isNull(i, this.#rowsIndex)) { - let valueBuffer = this.#queryDataSet.valueList[i]; - let dataType = this.#columnTypeDeduplicatedList[i]; - - // Simulating buffer based on data type. - switch (dataType) { - case IoTDBDataType.BOOLEAN: - this.#value[i] = valueBuffer.slice(0, 1); - this.#queryDataSet.valueList[i] = valueBuffer.slice(1); - break; - case IoTDBDataType.INT32: - this.#value[i] = valueBuffer.slice(0, 4); - this.#queryDataSet.valueList[i] = valueBuffer.slice(4); - break; - case IoTDBDataType.INT64: - this.#value[i] = valueBuffer.slice(0, 8); - this.#queryDataSet.valueList[i] = valueBuffer.slice(8); - break; - case IoTDBDataType.FLOAT: - this.#value[i] = valueBuffer.slice(0, 4); - this.#queryDataSet.valueList[i] = valueBuffer.slice(4); - break; - case IoTDBDataType.DOUBLE: - this.#value[i] = valueBuffer.slice(0, 8); - this.#queryDataSet.valueList[i] = valueBuffer.slice(8); - break; - case IoTDBDataType.TEXT: - let length = valueBuffer.readInt32BE(0); - this.#value[i] = valueBuffer.slice(4, 4 + length); - this.#queryDataSet.valueList[i] = valueBuffer.slice(4 + length); - break; - default: - throw new Error(`Unsupported data type: ${dataType}`); - } - } - } - this.#rowsIndex += 1; - this.#hasCachedRecord = true; - } - - /** - * Checks if the value at the specified index and row number is null. - * - * @param {number} index - The index in the bitmap array. - * @param {number} rowNum - The row number to check. - * @returns {boolean} - Returns true if the value is null, otherwise false. - */ - #isNull(index, rowNum) { - let bitmap = this.#currentBitmap[index]; - let shift = rowNum % 8; - return ((IoTDBRpcDataSet.FLAG >> shift) & (bitmap & 0xff)) === 0; - } - - #fetchResults() { - this.#rowsIndex = 0; - } -} - -module.exports = IoTDBRpcDataSet; diff --git a/cdsp/information-layer/handlers/src/iotdb/utils/session-data-set.js b/cdsp/information-layer/handlers/src/iotdb/utils/session-data-set.js deleted file mode 100644 index 6bf0cb5..0000000 --- a/cdsp/information-layer/handlers/src/iotdb/utils/session-data-set.js +++ /dev/null @@ -1,135 +0,0 @@ -const { IoTDBDataType } = require("./iotdb-constants"); -const IoTDBRpcDataSet = require("./iotdb-rpc-data-sets"); -const { IoTDBDataInterpreter } = require("./iotdb-data-interpreter"); - -const dataTypeProcessors = { - [IoTDBDataType.BOOLEAN]: (bytes) => - new Int8Array(new Uint8Array(bytes.slice(0, 1).reverse()).buffer)[0], - [IoTDBDataType.INT32]: (bytes) => - new Int32Array(new Uint8Array(bytes.slice(0, 4).reverse()).buffer)[0], - [IoTDBDataType.INT64]: (bytes) => - new BigInt64Array(new Uint8Array(bytes.slice(0, 8).reverse()).buffer)[0], - [IoTDBDataType.FLOAT]: (bytes) => - new Float32Array(new Uint8Array(bytes.slice(0, 4).reverse()).buffer)[0], - [IoTDBDataType.DOUBLE]: (bytes) => - new Float64Array(new Uint8Array(bytes.slice(0, 8).reverse()).buffer)[0], - [IoTDBDataType.TEXT]: (bytes) => bytes.toString(), -}; - -class SessionDataSet { - /** - * Constructor for initializing the class with the provided parameters. - * - * @param {Array} columnNameList - List of column names. - * @param {Array} columnTypeList - List of column types. - * @param {Object} columnNameIndex - Index mapping of column names. - * @param {string} queryId - Unique identifier for the query. - * @param {Object} client - Client instance for database connection. - * @param {string} statementId - Unique identifier for the statement. - * @param {string} sessionId - Unique identifier for the session. - * @param {Object} queryDataSet - Data set returned from the query. - * @param {boolean} ignoreTimestamp - Flag to determine if timestamps should be ignored. - */ - constructor( - columnNameList, - columnTypeList, - columnNameIndex, - queryId, - client, - statementId, - sessionId, - queryDataSet, - ignoreTimestamp, - ) { - this.iotdbRpcDataSet = new IoTDBRpcDataSet( - columnNameList, - columnTypeList, - columnNameIndex, - queryId, - client, - statementId, - sessionId, - queryDataSet, - ignoreTimestamp, - 1024, // Buffer size or default value - ); - } - - /** - * Checks if there is a next element in the IoTDB RPC DataSet. - * - * @returns {boolean} True if there is a next element, otherwise false. - */ - hasNext() { - return this.iotdbRpcDataSet.next(); - } - - /** - * Retrieves the next row record from the dataset. - * If there is no cached record, checks if there is a next record available. - * If there is no next record available, returns null. - * Resets the cached record flag after retrieving the record. - * @returns {Object|null} The next row record or null if no more records are available. - */ - next() { - if (!this.iotdbRpcDataSet.getHasCachedRecord()) { - if (!this.hasNext()) { - return null; - } - } - this.iotdbRpcDataSet.setHasCachedRecord(false); - - return this.constructRowRecordFromValueArray(); - } - - /** - * Constructs a row record from a value array. - * - * This function processes the IoTDB RPC dataset to extract and convert - * the timestamp and column values into a structured object. - * - * @returns {Object} The constructed row record with timestamp and column values. - */ - constructRowRecordFromValueArray() { - let time64 = IoTDBDataInterpreter.extractTimestamp( - this.iotdbRpcDataSet.getTimeBytes(), - ); - let obj = { timestamp: time64 }; - - for (let i = 0; i < this.iotdbRpcDataSet.getColumnSize(); ++i) { - let index = i + 1; - let dataSetColumnIndex = i + IoTDBRpcDataSet.START_INDEX; - - if (this.iotdbRpcDataSet.getIgnoreTimestamp()) { - index -= 1; - dataSetColumnIndex -= 1; - } - - let columnName = this.iotdbRpcDataSet.getColumnNames()[index]; - let location = - this.iotdbRpcDataSet.getColumnOrdinalDict().get(columnName) - - IoTDBRpcDataSet.START_INDEX; - - if (!this.iotdbRpcDataSet.isNullByIndex(dataSetColumnIndex)) { - let valueBytes = this.iotdbRpcDataSet.getValues()[location]; - let dataType = - this.iotdbRpcDataSet.getColumnTypeDeduplicatedList()[location]; - let tsName = - this.iotdbRpcDataSet.findColumnNameByIndex(dataSetColumnIndex); - - if (dataTypeProcessors[dataType]) { - obj[tsName] = dataTypeProcessors[dataType](valueBytes); - } else { - throw new Error(`Unsupported data type: ${dataType}`); - } - } else { - let tsName = - this.iotdbRpcDataSet.findColumnNameByIndex(dataSetColumnIndex); - obj[tsName] = null; - } - } - return obj; - } -} - -module.exports = SessionDataSet; diff --git a/cdsp/information-layer/handlers/src/package.json b/cdsp/information-layer/handlers/src/package.json deleted file mode 100644 index 40ea91b..0000000 --- a/cdsp/information-layer/handlers/src/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "handlers", - "version": "1.0.0", - "description": "Database handlers", - "dependencies": { - "js-yaml": "^4.1.0" - } -} diff --git a/cdsp/information-layer/handlers/src/realmdb/.gitignore b/cdsp/information-layer/handlers/src/realmdb/.gitignore deleted file mode 100644 index 645f5bd..0000000 --- a/cdsp/information-layer/handlers/src/realmdb/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Node.js -node_modules/ -package-lock.json \ No newline at end of file diff --git a/cdsp/information-layer/handlers/src/realmdb/config/database-params.js b/cdsp/information-layer/handlers/src/realmdb/config/database-params.js deleted file mode 100644 index c9d585b..0000000 --- a/cdsp/information-layer/handlers/src/realmdb/config/database-params.js +++ /dev/null @@ -1,46 +0,0 @@ -const { getEnvValue } = require("../../../config/config"); - -/* - * Contains the definition of the database name and its identifier data point for each catalog. - */ -const mediaElementsParams = Object.freeze({ - VSS: { - databaseName: "Vehicles", // name of the configured RealmDB for the VSS database - dataPointId: "Vehicle_VehicleIdentification_VIN", // data point used as element ID - }, -}); - -/** - * Retrieves the database configuration. - * - * This function fetches the Realm application ID and API key from the environment variables. - * If either of these values is not found, it throws an error. - * - * @throws {Error} If the REALMDB_APP_ID is not set in the environment variables. - * @throws {Error} If the REALMDB_API_KEY is not set in the environment variables. - * - * @returns {Object} The database configuration object containing: - * - storePath: The path to the Realm database file. - * - realmAppId: The Realm application ID. - * - realmApiKey: The Realm API key. - */ -const getDatabaseConfig = () => { - const realmAppId = getEnvValue("REALMDB_APP_ID"); - const realmApiKey = getEnvValue("REALMDB_API_KEY"); - if (!realmAppId) { - throw new Error("REALMDB_APP_ID is required, any default has been set"); - } else if (!realmApiKey) { - throw new Error("REALMDB_API_KEY is required, any default has been set"); - } - - return Object.freeze({ - storePath: "myrealm12.realm", - realmAppId: realmAppId, - realmApiKey: realmApiKey, - }); -}; - -const databaseConfig = - getEnvValue("HANDLER_TYPE") === "realmdb" ? getDatabaseConfig() : {}; - -module.exports = { mediaElementsParams, databaseConfig }; diff --git a/cdsp/information-layer/handlers/src/realmdb/config/database-params.ts b/cdsp/information-layer/handlers/src/realmdb/config/database-params.ts new file mode 100644 index 0000000..f1c5e64 --- /dev/null +++ b/cdsp/information-layer/handlers/src/realmdb/config/database-params.ts @@ -0,0 +1,51 @@ +import { getEnvValue } from "../../../config/config"; +import { DatabaseParamsRecord } from "../../../utils/data_types"; + +interface RealmDBConfig { + storePath: string; + realmAppId: string; + realmApiKey: string; +} + +/** + * Contains the definition of the database name and its identifier data point for each catalog. + */ +export const mediaElementsParams: Readonly = { + VSS: { + databaseName: "Vehicles", // name of the configured RealmDB for the VSS database + dataPointId: "Vehicle_VehicleIdentification_VIN", // data point used as element ID + }, +}; + +/** + * Retrieves the database configuration as a read-only object. + * + * This function fetches the Realm application ID and API key from the environment variables. + * It ensures that both values are present, throwing an error if either is missing. + * + * @returns The database configuration object containing the store path, Realm app ID, and API key. + * + * @throws If the REALMDB_APP_ID or REALMDB_API_KEY environment variables are not set. + */ +const getDatabaseConfig = (): Readonly => { + const realmAppId = getEnvValue("REALMDB_APP_ID"); + const realmApiKey = getEnvValue("REALMDB_API_KEY"); + + if (!realmAppId) { + throw new Error("REALMDB_APP_ID is required, but no default has been set"); + } else if (!realmApiKey) { + throw new Error("REALMDB_API_KEY is required, but no default has been set"); + } + + return { + storePath: "myrealm12.realm", + realmAppId, + realmApiKey, + }; +}; + +/** + * Exports the database configuration depending on the handler type. + */ +export const databaseConfig = + getEnvValue("HANDLER_TYPE") === "realmdb" ? getDatabaseConfig() : undefined; diff --git a/cdsp/information-layer/handlers/src/realmdb/config/realm-config.ts b/cdsp/information-layer/handlers/src/realmdb/config/realm-config.ts new file mode 100644 index 0000000..f61616b --- /dev/null +++ b/cdsp/information-layer/handlers/src/realmdb/config/realm-config.ts @@ -0,0 +1,113 @@ +import { mediaElementsParams, databaseConfig } from "./database-params"; +import { getEnvValue } from "../../../config/config"; +import { User, Configuration, SyncConfiguration } from "realm"; // Import Realm SDK types +import { logError } from "../../../../utils/logger"; + +// Define the type for supported data points +export interface SupportedDataPoints { + [key: string]: + | "boolean" + | "string" + | "float" + | "double" + | "int8" + | "int16" + | "uint8" + | "uint16"; +} + +// Define the Realm schema structure +interface RealmSchema { + primaryKey: string; + name: string; + properties: Record; +} + +/** + * Creates a Realm schema for media elements based on the supported endpoints. + * + * @param supportedEndpoints - An object representing the data points + * that are supported, where keys are the property names and values are their data types. + * @returns The constructed Realm schema object containing the primary key, + * name of the schema, and properties with their corresponding data types. + * @throws Throws an error if an unsupported data type is encountered in the + * provided supportedEndpoints. + */ +function createMediaElementSchema( + supportedEndpoints: SupportedDataPoints, +): RealmSchema { + const properties: Record = { _id: "string" }; + + Object.entries(supportedEndpoints).forEach(([key, value]) => { + switch (value) { + case "boolean": + properties[key] = "bool"; + break; + case "string": + case "float": + case "double": + properties[key] = value; + break; + case "int8": + case "int16": + case "uint8": + case "uint16": + properties[key] = "int"; + break; + default: + throw new Error( + `The initialized data points contain an unsupported data type: ${value}`, + ); + } + }); + + return { + primaryKey: "_id", + name: mediaElementsParams.VSS.databaseName, // Assuming mediaElementsParams contains 'VSS' + properties: properties, + }; +} + +// Get the schema version from environment variables +const getSchemaVersion = (): number => { + const schemaVersion = parseInt( + getEnvValue("VERSION_REALMDB_SCHEMA") ?? "", + 10, + ); + if (isNaN(schemaVersion)) { + throw new Error( + "Version must be specified as an ENV variable and it must be 0 or a positive integer", + ); + } + return schemaVersion; +}; + +/** + * Configures the Realm database settings. + * + * @param user - The user object for authentication. + * @param supportedEndpoints - List of supported endpoints for the media element schema. + * @return The configuration object for the Realm database. + */ +export function realmConfig( + user: User, + supportedDataPoints: SupportedDataPoints, +): Configuration { + const mediaElementSchema = createMediaElementSchema(supportedDataPoints); + + return { + schema: [mediaElementSchema], + path: databaseConfig!.storePath, + sync: { + user: user, + flexible: true, + error: (error: Error) => { + logError("Realm sync error:", error); + }, + } as SyncConfiguration, // Cast sync as SyncConfiguration + schemaVersion: getSchemaVersion(), + // migration: (oldRealm: any, newRealm: any) => { + // // Migration logic here + // }, + }; +} diff --git a/cdsp/information-layer/handlers/src/realmdb/config/realm-configuration.js b/cdsp/information-layer/handlers/src/realmdb/config/realm-configuration.js deleted file mode 100644 index 26912dd..0000000 --- a/cdsp/information-layer/handlers/src/realmdb/config/realm-configuration.js +++ /dev/null @@ -1,78 +0,0 @@ -const { mediaElementsParams, databaseConfig } = require("./database-params"); -const { getEnvValue } = require("../../../config/config"); - -/** - * Configures the Realm database settings. - * - * @param {Object} user - The user object for authentication. - * @param {Array} supportedEndpoints - List of supported endpoints for the media element schema. - * @returns {Object} - The configuration object for the Realm database. - */ -function realmConfig(user, supportedDataPoints) { - const mediaElementSchema = createMediaElementSchema(supportedDataPoints); - return { - schema: [mediaElementSchema], - path: databaseConfig.storePath, - sync: { - user: user, - flexible: true, - error: (error) => { - console.error("Realm sync error:", error); - }, - }, - // `schemaVersion` is by default 0, it can be incremented when the schema changes, - // but you need to write the logic to migrate existing data to the new schema. - // See: https://www.mongodb.com/docs/atlas/device-sdks/sdk/node/model-data/modify-an-object-schema/ - schemaVersion: getSchemaVersion(), - migration: (oldRealm, newRealm) => { - // Perform migration logic here - }, - }; -} - -const getSchemaVersion = () => { - const schemaVersion = parseInt(getEnvValue("VERSION_REALMDB_SCHEMA"), 10); - if (isNaN(schemaVersion)) { - throw new Error( - "Version must be specified as an ENV variable and it must be 0 or a positive integer", - ); - } - return schemaVersion; -}; - -function createMediaElementSchema(supportedEndpoints) { - const properties = { _id: "string" }; - - Object.entries(supportedEndpoints).forEach(([key, value]) => { - switch (value) { - case "boolean": - properties[key] = "bool"; - break; - case "string": - case "float": - case "double": - properties[key] = value; - break; - case "int8": - case "int16": - case "uint8": - case "uint16": - properties[key] = "int"; - break; - default: - throw new Error( - `The initialized data points contains an unsupported data type: ${value}`, - ); - } - }); - - const mediaElementSchema = { - primaryKey: "_id", - name: mediaElementsParams.VSS.databaseName, - properties: properties, - }; - - return mediaElementSchema; -} - -module.exports = realmConfig; diff --git a/cdsp/information-layer/handlers/src/realmdb/package.json b/cdsp/information-layer/handlers/src/realmdb/package.json deleted file mode 100644 index 71a4504..0000000 --- a/cdsp/information-layer/handlers/src/realmdb/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "realmdb-handler", - "version": "1.0.0", - "description": "Realm database handler", - "main": "realmdb-handler.js", - "dependencies": { - "realm": "^12.13.1", - "uuid": "^9.0.1" - } -} diff --git a/cdsp/information-layer/handlers/src/realmdb/src/RealmDbHandler.ts b/cdsp/information-layer/handlers/src/realmdb/src/RealmDbHandler.ts new file mode 100644 index 0000000..37e3c46 --- /dev/null +++ b/cdsp/information-layer/handlers/src/realmdb/src/RealmDbHandler.ts @@ -0,0 +1,463 @@ +import Realm from "realm"; +import { v4 as uuidv4 } from "uuid"; +import { HandlerBase } from "../../../../handlers/src/HandlerBase"; +import { mediaElementsParams, databaseConfig } from "../config/database-params"; +import { realmConfig, SupportedDataPoints } from "../config/realm-config"; +import { + logMessage, + logError, + logWithColor, + MessageType, + COLORS, + logErrorStr, +} from "../../../../utils/logger"; +import { createErrorMessage } from "../../../../utils/error-message-helper"; +import { WebSocket, Message, STATUS_ERRORS } from "../../../utils/data_types"; + +// Define a type for changes +interface Changes { + deleted: boolean; + changedProperties: string[]; +} + +/** + * Parses the response from a media element change event. + * + * @param changes - The object containing the changed properties. + * @param mediaElement - The media element object with updated properties. + * @returns An array of objects, each containing the name and value of a changed property. + */ +function parseOnMediaElementChangeResponse( + changes: Changes, + mediaElement: any +) { + return changes.changedProperties.map((prop) => ({ + name: prop, + value: mediaElement[prop], + })); +} + +export class RealmDBHandler extends HandlerBase { + private realm: Realm | null; + private sendMessageToClients: + | ((ws: WebSocket, message: Message) => void) + | null; + private listeners: Map>; + + constructor() { + super(); + if (!databaseConfig) { + throw new Error("Invalid database configuration."); + } + this.realm = null; + this.sendMessageToClients = null; + this.listeners = new Map(); + } + + async authenticateAndConnect( + sendMessageToClients: (ws: WebSocket, message: Message) => void + ): Promise { + try { + this.sendMessageToClients = sendMessageToClients; + + const app = new Realm.App({ id: databaseConfig!.realmAppId }); + const credentials = Realm.Credentials.apiKey(databaseConfig!.realmApiKey); + const user = await app.logIn(credentials); + logMessage("Successfully authenticated to RealmDB"); + + const supportedDataPoints = + this.getSupportedDataPoints() as SupportedDataPoints; + const realmConfigObj = realmConfig(user, supportedDataPoints); + this.realm = await Realm.open(realmConfigObj); + logMessage("Connection established successfully"); + + for (const [key, value] of Object.entries(mediaElementsParams)) { + try { + const databaseName = value.databaseName; + await this.realm.objects(databaseName).subscribe(); + logMessage(`Subscribed to the database ${key}: ${databaseName}`); + } catch (error: unknown) { + logError("Error subscribing databases", error); + } + } + } catch (error: unknown) { + logError("Failed to authenticate with Realm", error); + } + } + + protected async read(message: Message, ws: WebSocket): Promise { + if (this.areNodesValid(message, ws)) { + try { + const updateMessage = await this.getMessageData(message); + this.sendMessageToClient(ws, updateMessage); + } catch (error: unknown) { + const errMsg = error instanceof Error ? error.message : "Unknown error"; + logError("Error reading object from Realm", error); + this.sendMessageToClient( + ws, + createErrorMessage("read", STATUS_ERRORS.NOT_FOUND, errMsg) + ); + } + } + } + + protected async write(message: Message, ws: WebSocket): Promise { + if (this.areNodesValid(message, ws)) { + try { + const mediaElement = await this.getMediaElement(message); + const nodes = message.node ? [message.node] : message.nodes; + + const transformAndAssign = (element: any, nodes: any[]) => { + nodes.forEach(({ name, value }) => { + const prop = this.transformDataPointsWithUnderscores(name); + element[prop] = value; + }); + }; + + this.realm?.write(() => { + if (mediaElement) { + transformAndAssign(mediaElement, nodes ?? []); + } else { + if (!message.tree || !mediaElementsParams[message.tree]) { + const errorMessage = + "Tree is undefined or does not exist in mediaElementsParams"; + logErrorStr(errorMessage); + this.sendMessageToClient( + ws, + createErrorMessage( + "write", + STATUS_ERRORS.NOT_FOUND, + errorMessage + ) + ); + return; + } + + const dataPointId = mediaElementsParams[message.tree].dataPointId; + const document = { _id: uuidv4(), [dataPointId]: message.id }; + transformAndAssign(document, nodes ?? []); + const databaseName = mediaElementsParams[message.tree].databaseName; + this.realm?.create(databaseName, document); + } + }); + + await this.read(message, ws); + } catch (error: unknown) { + const errMsg = error instanceof Error ? error.message : "Unknown error"; + const errorMessage = `Schema is not compatible for that media element: ${errMsg}`; + logErrorStr(errorMessage); + this.sendMessageToClient( + ws, + createErrorMessage("write", STATUS_ERRORS.NOT_FOUND, errorMessage) + ); + } + } + } + + protected async subscribe(message: Message, ws: WebSocket): Promise { + try { + const mediaElement = await this.getMediaElement(message); + + if (mediaElement) { + const objectId = mediaElement._id; + const { id, tree, uuid } = message; + if (!id || !tree || !mediaElementsParams[tree]) { + const errorMessage = + "Tree or id is undefined or does not exist in mediaElementsParams"; + logErrorStr(errorMessage); + this.sendMessageToClient( + ws, + createErrorMessage("write", STATUS_ERRORS.NOT_FOUND, errorMessage) + ); + return; + } + + const { databaseName, dataPointId } = mediaElementsParams[tree]; + + if (!this.listeners.has(ws)) { + this.listeners.set(ws, new Map()); + } + + if (!this.listeners.get(ws)?.has(id)) { + logWithColor( + `Subscribing element for user '${uuid}': Object ID: ${objectId} with ${dataPointId}: '${id}' on ${databaseName}`, + COLORS.GREY + ); + + const listener = (mediaElement: any, changes: Changes) => + this.onMediaElementChange( + mediaElement, + changes, + { id, tree, uuid }, + ws + ); + + mediaElement.addListener(listener); + + this.listeners.get(ws)?.set(id, { + objectId: objectId, + mediaElement: mediaElement, + listener: listener, + }); + + this.sendMessageToClient( + ws, + this.createSubscribeMessage("subscribe", message, "succeed") + ); + + logWithColor( + `Subscription added! Amount Clients: ${this.listeners.size}`, + COLORS.GREY + ); + } else { + this.sendMessageToClient( + ws, + createErrorMessage( + "subscribe", + STATUS_ERRORS.BAD_REQUEST, + `Subscription already done to ${dataPointId}: '${id}'` + ) + ); + } + } else { + this.sendMessageToClient( + ws, + createErrorMessage( + "subscribe", + STATUS_ERRORS.BAD_REQUEST, + "Object not found" + ) + ); + } + } catch (error: unknown) { + const errMsg = error instanceof Error ? error.message : "Unknown error"; + this.sendMessageToClient( + ws, + createErrorMessage( + "subscribe", + STATUS_ERRORS.SERVICE_UNAVAILABLE, + `Subscription process could not finish, try again: ${errMsg}` + ) + ); + } + } + + protected async unsubscribe(message: Message, ws: WebSocket): Promise { + const { id, tree, uuid } = message; + if (!id || !tree || !mediaElementsParams[tree]) { + const errorMessage = + "Tree or id is undefined or does not exist in mediaElementsParams"; + logErrorStr(errorMessage); + this.sendMessageToClient( + ws, + createErrorMessage("write", STATUS_ERRORS.NOT_FOUND, errorMessage) + ); + return; + } + + const { databaseName, dataPointId } = mediaElementsParams[tree]; + + if (this.listeners.has(ws)) { + const wsListeners = this.listeners.get(ws); + if (wsListeners?.has(id)) { + const listener = wsListeners.get(id); + logWithColor( + `Unsubscribing element for user '${uuid}': Object ID: ${listener.objectId} with ${dataPointId}: '${id}' on ${databaseName}`, + COLORS.GREY + ); + listener.mediaElement.removeListener(listener.listener); + wsListeners.delete(id); + + if (wsListeners.size === 0) { + this.listeners.delete(ws); + } + + this.sendMessageToClient( + ws, + this.createSubscribeMessage("unsubscribe", message, "succeed") + ); + } else { + this.sendMessageToClient( + ws, + createErrorMessage( + "unsubscribe", + STATUS_ERRORS.BAD_REQUEST, + `No subscription found for VIN: ${id}` + ) + ); + } + } else { + this.sendMessageToClient( + ws, + createErrorMessage( + "unsubscribe", + STATUS_ERRORS.BAD_REQUEST, + `No subscription found for this client` + ) + ); + } + logWithColor( + `Subscription removed! Amount Clients: ${this.listeners.size}`, + COLORS.GREY + ); + } + + async unsubscribe_client(ws: WebSocket): Promise { + this.listeners.delete(ws); + logWithColor( + `All client subscriptions removed! Amount Clients: ${this.listeners.size}`, + COLORS.GREY + ); + } + + /** + * Validates the nodes in a message against the schema of a media element. + * + * @param message - The message object containing details for the request. + * @param ws - The WebSocket object for communication. + * @returns - Returns true if all nodes are valid against the schema, otherwise false. + */ + private areNodesValid(message: Message, ws: WebSocket): boolean { + const { type, tree } = message; + if (!tree || !mediaElementsParams[tree]) { + logErrorStr("Tree is undefined or does not exist in mediaElementsParams"); + return false; + } + + const { databaseName } = mediaElementsParams[tree]; + + const mediaElementSchema = this.realm?.schema.find( + (schema) => schema.name === databaseName + ); + + const errorData = this.validateNodesAgainstSchema( + message, + mediaElementSchema?.properties ?? {} + ); + + if (errorData) { + logErrorStr( + `Error validating message nodes against schema: ${JSON.stringify(errorData)}` + ); + this.sendMessageToClient( + ws, + createErrorMessage( + `${type}`, + STATUS_ERRORS.NOT_FOUND, + JSON.stringify(errorData) + ) + ); + return false; + } + return true; + } + + /** + * Asynchronously processes a message to fetch and handle media data. + * + * @param message - The message object containing details for the request. + * @returns Returns a promise that resolves to an updated message object. + * @throws Throws an error if no media element for the message ID is found. + * @private + */ + private async getMessageData(message: Message): Promise { + const mediaElement = await this.getMediaElement(message); + + if (!mediaElement) { + throw new Error(`No data found with the Id: ${message.id}`); + } + + logWithColor( + `Media Element: \n ${JSON.stringify(mediaElement)}`, + COLORS.GREY + ); + + const responseNodes = this.parseReadResponse(message, mediaElement); + return this.createUpdateMessage(message, responseNodes); + } + + /** + * Parses the response from a read event. + * + * @param message - The message object containing node or nodes information. + * @param queryResponseObj - The query response object containing values to be mapped. + * @returns - A data object with keys from the message nodes and values from the query response. + * @private + */ + private parseReadResponse( + message: Message, + queryResponseObj: any + ): { name: string; value: any }[] { + const data: { name: string; value: any }[] = []; + const nodes = message.node ? [message.node] : message.nodes; + nodes?.forEach((node: any) => { + const prop = this.transformDataPointsWithUnderscores(node.name); + data.push({ + name: node.name, + value: queryResponseObj[prop], + }); + }); + return data; + } + + /** + * Asynchronously retrieves a media element from the database based on the provided message. + * + * @param message - The message containing the id and tree information. + * @returns - The media element object from the database. + * @private + */ + private async getMediaElement(message: Message): Promise { + try { + const { id, tree } = message; + if (!tree || !mediaElementsParams[tree]) { + logErrorStr( + "Tree is undefined or does not exist in mediaElementsParams" + ); + return false; + } + + const { databaseName, dataPointId } = mediaElementsParams[tree]; + return await this.realm + ?.objects(databaseName) + .filtered(`${dataPointId} = '${id}'`)[0]; + } catch (error: unknown) { + logError("Error trying to get media element from Realm", error); + } + } + + /** + * Handles changes to a media element and sends update messages to clients. + * @param mediaElement - The media element that has changed. + * @param changes - An object containing information about the changes. + * @param messageHeader - The header information for the message. + * @param ws - The WebSocket object for communication. + */ + private onMediaElementChange( + mediaElement: any, + changes: Changes, + messageHeader: Pick, + ws: WebSocket + ): void { + logMessage( + "Media element changed", + MessageType.RECEIVED, + `Web-Socket Connection Event Received` + ); + if (changes.deleted) { + logWithColor("MediaElement is deleted", COLORS.YELLOW); + } else { + if (changes.changedProperties.length > 0) { + const responseNodes = parseOnMediaElementChangeResponse( + changes, + mediaElement + ); + const updateMessage = this.createUpdateMessage( + messageHeader, + responseNodes + ); + this.sendMessageToClient(ws, updateMessage); + } + } + } +} diff --git a/cdsp/information-layer/handlers/src/realmdb/src/realmdb-handler.js b/cdsp/information-layer/handlers/src/realmdb/src/realmdb-handler.js deleted file mode 100644 index 0ff5e83..0000000 --- a/cdsp/information-layer/handlers/src/realmdb/src/realmdb-handler.js +++ /dev/null @@ -1,402 +0,0 @@ -const Realm = require("realm"); -const Handler = require("../../handler"); -const { - mediaElementsParams, - databaseConfig, -} = require("../config/database-params"); -const realmConfig = require("../config/realm-configuration"); -const { v4: uuidv4 } = require("uuid"); -const { - logMessage, - logWithColor, - MessageType, - COLORS, -} = require("../../../../utils/logger"); -const { - createErrorMessage, -} = require("../../../../utils/error-message-helper"); - -/** - * Parses the response from a media element change event. - * - * @param {Object} changes - The object containing the changed properties. - * @param {Object} mediaElement - The media element object with updated properties. - * @returns {Array} An array of objects, each containing the name and value of a changed property. - */ -function parseOnMediaElementChangeResponse(changes, mediaElement) { - return changes.changedProperties.map((prop) => ({ - name: prop, - value: mediaElement[prop], - })); -} - -class RealmDBHandler extends Handler { - constructor() { - super(); - this.realm = null; - this._sendMessageToClients = null; - this.listeners = new Map(); - } - - async authenticateAndConnect(sendMessageToClients) { - try { - this._sendMessageToClients = sendMessageToClients; - - const app = new Realm.App({ id: databaseConfig.realmAppId }); - const credentials = Realm.Credentials.apiKey(databaseConfig.realmApiKey); - const user = await app.logIn(credentials); - console.info("Successfully authenticated to RealmDB"); - - const supportedDataPoints = this._getSupportedDataPoints(); - const realmConfigObj = realmConfig(user, supportedDataPoints); - this.realm = await Realm.open(realmConfigObj); - console.info("Connection established successfully"); - - for (const [key, value] of Object.entries(mediaElementsParams)) { - try { - const databaseName = value.databaseName; - await this.realm.objects(databaseName).subscribe(); - console.info(`Subscribed to the database ${key}: ${databaseName}`); - } catch (error) { - logMessage( - "Error subscribing databases: ".concat(error), - MessageType.ERROR, - ); - } - } - } catch (error) { - logMessage( - "Failed to authenticate with Realm: ".concat(error), - MessageType.ERROR, - ); - } - } - - async read(message, ws) { - if (this.#areNodesValid(message, ws)) { - try { - const updateMessage = await this.#getMessageData(message); - this._sendMessageToClient(ws, updateMessage); - } catch (error) { - logMessage( - `Error reading object from Realm: ${error.message}`, - MessageType.ERROR, - ); - this._sendMessageToClient( - ws, - createErrorMessage("read", 404, JSON.parse(error.message)), - ); - } - } - } - - async write(message, ws) { - if (this.#areNodesValid(message, ws)) { - try { - const mediaElement = await this.#getMediaElement(message); - const nodes = message.node ? [message.node] : message.nodes; - - const transformAndAssign = (element, nodes) => { - nodes.forEach(({ name, value }) => { - const prop = this._transformDataPointsWithUnderscores(name); - element[prop] = value; - }); - }; - - this.realm.write(() => { - if (mediaElement) { - // Write on existing media element - transformAndAssign(mediaElement, nodes); - } else { - // Create a new media element - const dataPointId = mediaElementsParams[message.tree].dataPointId; - const document = { _id: uuidv4(), [dataPointId]: message.id }; - transformAndAssign(document, nodes); - const databaseName = mediaElementsParams[message.tree].databaseName; - this.realm.create(databaseName, document); - } - }); - - // Read the updated media element - await this.read(message, ws); - } catch (error) { - const errorMessage = `Schema is not compatible for that media element: ${error.message}`; - logMessage(errorMessage, MessageType.ERROR); - this._sendMessageToClient( - ws, - createErrorMessage("write", 404, errorMessage), - ); - } - } - } - - async subscribe(message, ws) { - try { - const mediaElement = await this.#getMediaElement(message); - - if (mediaElement) { - const objectId = mediaElement._id; - const { id, tree, uuid } = message; - const { databaseName, dataPointId } = mediaElementsParams[tree]; - - if (!this.listeners.has(ws)) { - this.listeners.set(ws, new Map()); - } - - if (!this.listeners.get(ws).has(id)) { - logWithColor( - `Subscribing element for user '${uuid}': Object ID: ${objectId} with ${dataPointId}: '${id}' on ${databaseName}`, - COLORS.GREY, - ); - - const listener = (mediaElement, changes) => - this.#onMediaElementChange( - mediaElement, - changes, - { - id: id, - tree: tree, - uuid: uuid, - }, - ws, - ); - - mediaElement.addListener(listener); - - // Store the listener so we can remove it later - this.listeners.get(ws).set(id, { - objectId: objectId, - mediaElement: mediaElement, - listener: listener, - }); - - this._sendMessageToClient( - ws, - this._createSubscribeMessage("subscribe", message, "succeed"), - ); - - logWithColor( - `Subscription added! Amount Clients: ${this.listeners.size}`, - COLORS.GREY, - ); - } else { - this._sendMessageToClient( - ws, - createErrorMessage( - "subscribe", - 400, - `Subscription already done to ${dataPointId}: '${id}'`, - ), - ); - } - } else { - this._sendMessageToClient( - ws, - createErrorMessage("subscribe", 400, "Object not found"), - ); - } - } catch (error) { - this._sendMessageToClient( - ws, - createErrorMessage( - "subscribe", - 503, - "Subscription process could not finish, try again", - ), - ); - } - } - - async unsubscribe(message, ws) { - const { id, tree, uuid } = message; - const { databaseName, dataPointId } = mediaElementsParams[tree]; - - if (this.listeners.has(ws)) { - const wsListeners = this.listeners.get(ws); - if (wsListeners.has(id)) { - const listener = wsListeners.get(id); - logWithColor( - `Unsubscribing element for user '${uuid}': Object ID: ${listener.objectId} with ${dataPointId}: '${id}' on ${databaseName}`, - COLORS.GREY, - ); - listener.mediaElement.removeListener(listener.listener); - wsListeners.delete(id); - - if (wsListeners.size === 0) { - this.listeners.delete(ws); - } - - this._sendMessageToClient( - ws, - this._createSubscribeMessage("unsubscribe", message, "succeed"), - ); - } else { - this._sendMessageToClient( - ws, - createErrorMessage( - "unsubscribe", - 400, - `No subscription found for VIN: ${id}`, - ), - ); - } - } else { - this._sendMessageToClient( - ws, - createErrorMessage( - "unsubscribe", - 400, - `No subscription found for this client`, - ), - ); - } - logWithColor( - `Subscription removed! Amount Clients: ${this.listeners.size}`, - COLORS.GREY, - ); - } - - async unsubscribe_client(ws) { - this.listeners.delete(ws); - logWithColor( - `All client subscriptions removed! Amount Clients: ${this.listeners.size}`, - COLORS.GREY, - ); - } - - /** - * Validates the nodes in a message against the schema of a media element. - * - * @param {Object} message - The message object containing details for the request. - * @param {WebSocket} ws - The WebSocket object for communication. - * @returns {boolean} - Returns true if all nodes are valid against the schema, otherwise false. - */ - #areNodesValid(message, ws) { - const { type, tree } = message; - const { databaseName } = mediaElementsParams[tree]; - - // Get the schema for the mediaElement to check if fields are valid - const mediaElementSchema = this.realm.schema.find( - (schema) => schema.name === databaseName, - ); - - const errorData = this._validateNodesAgainstSchema( - message, - mediaElementSchema.properties, - ); - - if (errorData) { - logMessage( - `Error validating message nodes against schema: ${JSON.stringify(errorData)}`, - MessageType.ERROR, - ); - this._sendMessageToClient( - ws, - createErrorMessage(`${type}`, 404, errorData), - ); - - return false; - } - return true; - } - - /** - * Asynchronously processes a message to fetch and handle media data. - * - * @param {Object} message - The message object containing details for the request. - * @returns {Promise} - Returns a promise that resolves to an updated message object. - * @throws {Error} - Throws an error if no media element for the message ID is found. - * @private - */ - async #getMessageData(message) { - const mediaElement = await this.#getMediaElement(message); - - if (!mediaElement) { - throw new Error(`\"No data found with the Id: ${message.id}\"`); - } - - logWithColor( - `Media Element: \n ${JSON.stringify(mediaElement)}`, - COLORS.GREY, - ); - - const responseNodes = this.#parseReadResponse(message, mediaElement); - return this._createUpdateMessage(message, responseNodes); - } - - /** - * Parses the response from a read event. - * - * @param {Object} message - The message object containing node or nodes information. - * @param {Object} queryResponseObj - The query response object containing values to be mapped. - * @returns {Object} - A data object with keys from the message nodes and values from the query response. - * @private - */ - #parseReadResponse(message, queryResponseObj) { - const data = []; - const nodes = message.node ? [message.node] : message.nodes; - nodes.forEach((node) => { - const prop = this._transformDataPointsWithUnderscores(node.name); - data.push({ - name: node.name, - value: queryResponseObj[prop], - }); - }); - return data; - } - - /** - * Asynchronously retrieves a media element from the database based on the provided message. - * - * @param {Object} message - The message containing the id and tree information. - * @returns {Promise} - The media element object from the database. - * @private - */ - async #getMediaElement(message) { - try { - const { id, tree } = message; - const { databaseName, dataPointId } = mediaElementsParams[tree]; - return await this.realm - .objects(databaseName) - .filtered(`${dataPointId} = '${id}'`)[0]; - } catch (error) { - logMessage( - `Error trying to get media element from Realm: ${error.message}`, - MessageType.ERROR, - ); - } - } - - /** - * Handles changes to a media element and sends update messages to clients. - * @param {mediaElement} mediaElement - The media element that has changed. - * @param {object} changes - An object containing information about the changes. - * @param {{tree, id, uuid}} messageHeader - The header information for the message. - * @param {WebSocket} ws - The WebSocket object for communication. - * @private - */ - #onMediaElementChange(mediaElement, changes, messageHeader, ws) { - logMessage( - "Media element changed", - MessageType.RECEIVED, - `Web-Socket Connection Event Received`, - ); - if (changes.deleted) { - logMessage(changes.deleted, COLORS.YELLOW, "MediaElement is deleted"); - } else { - if (changes.changedProperties.length > 0) { - const responseNodes = parseOnMediaElementChangeResponse( - changes, - mediaElement, - ); - const updateMessage = this._createUpdateMessage( - messageHeader, - responseNodes, - ); - this._sendMessageToClient(ws, updateMessage); - } - } - } -} - -module.exports = RealmDBHandler; diff --git a/cdsp/information-layer/handlers/utils/data_types.ts b/cdsp/information-layer/handlers/utils/data_types.ts new file mode 100644 index 0000000..9e2fd84 --- /dev/null +++ b/cdsp/information-layer/handlers/utils/data_types.ts @@ -0,0 +1,52 @@ +export interface MessageBase { + type: "read" | "write" | "subscribe" | "unsubscribe" | "update"; + id: string; + tree: string; + uuid: string; + dateTime?: string; + status?: string; +} + +export interface MessageWithNode extends MessageBase { + node: { name: string; value: any }; + nodes?: never; // Ensures 'nodes' cannot be present if 'node' is used +} + +export interface MessageWithNodes extends MessageBase { + nodes: Array<{ name: string; value: any }>; + node?: never; // Ensures 'node' cannot be present if 'nodes' is used +} + +export type Message = MessageWithNode | MessageWithNodes; + +export type ErrorMessage = { + category: string; + statusCode: number; + message: string; +}; + +export const STATUS_ERRORS = { + BAD_REQUEST: 400, + NOT_FOUND: 404, + UNAUTHORIZED: 401, + FORBIDDEN: 403, + INTERNAL_SERVER_ERROR: 500, + SERVICE_UNAVAILABLE: 503, +} as const; + +interface databaseParams { + databaseName: string; + dataPointId: string; +} + +export interface DatabaseParamsRecord { + [key: string]: databaseParams; +} + +export interface WebSocket { + send: (data: string) => void; +} + +export interface DataPointSchema { + [key: string]: any; +} diff --git a/cdsp/information-layer/package-lock.json b/cdsp/information-layer/package-lock.json new file mode 100644 index 0000000..0a6cafa --- /dev/null +++ b/cdsp/information-layer/package-lock.json @@ -0,0 +1,6741 @@ +{ + "name": "information-layer", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "information-layer", + "version": "1.0.0", + "dependencies": { + "ajv": "^8.17.1", + "dotenv": "^16.4.5", + "js-yaml": "^4.1.0", + "realm": "^12.13.1", + "thrift": "^0.21.0", + "uuid": "^10.0.0", + "ws": "^8.18.0" + }, + "devDependencies": { + "@types/ajv": "^0.0.5", + "@types/js-yaml": "^4.0.9", + "@types/node": "^22.7.0", + "@types/thrift": "^0.10.17", + "@types/uuid": "^10.0.0", + "@types/ws": "^8.5.12", + "copyfiles": "^2.4.1", + "eslint": "^9.9.1", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-prettier": "^5.2.1", + "prettier": "3.3.3", + "rimraf": "^6.0.1", + "ts-jest": "^29.2.5", + "typescript": "^5.6.2", + "typescript-eslint": "^8.4.0" + } + }, + "node_modules/@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.25.7.tgz", + "integrity": "sha512-0xZJFNE5XMpENsgfHYTw8FbX4kv53mFLn2i3XPoq69LyhYSCBJtitaHx9QnsVTrsogI4Z3+HtEfZ2/GFPOtf5g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/highlight": "^7.25.7", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.25.8", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.8.tgz", + "integrity": "sha512-ZsysZyXY4Tlx+Q53XdnOFmqwfB9QDTHYxaZYajWRoBLuLEAwI2UIbtxOjWh/cFaa9IKUlcB+DDuoskLuKu56JA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.25.8", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.25.8.tgz", + "integrity": "sha512-Oixnb+DzmRT30qu9d3tJSQkxuygWm32DFykT4bRoORPa9hZ/L4KhVB/XiRm6KG+roIEM7DBQlmg27kw2HZkdZg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.25.7", + "@babel/generator": "^7.25.7", + "@babel/helper-compilation-targets": "^7.25.7", + "@babel/helper-module-transforms": "^7.25.7", + "@babel/helpers": "^7.25.7", + "@babel/parser": "^7.25.8", + "@babel/template": "^7.25.7", + "@babel/traverse": "^7.25.7", + "@babel/types": "^7.25.8", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "peer": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/generator": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.7.tgz", + "integrity": "sha512-5Dqpl5fyV9pIAD62yK9P7fcA768uVPUyrQmqpqstHWgMma4feF1x/oFysBCVZLY5wJ2GkMUCdsNDnGZrPoR6rA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/types": "^7.25.7", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.7.tgz", + "integrity": "sha512-DniTEax0sv6isaw6qSQSfV4gVRNtw2rte8HHM45t9ZR0xILaufBRNkpMifCRiAPyvL4ACD6v0gfCwCmtOQaV4A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/compat-data": "^7.25.7", + "@babel/helper-validator-option": "^7.25.7", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "peer": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.7.tgz", + "integrity": "sha512-o0xCgpNmRohmnoWKQ0Ij8IdddjyBFE4T2kagL/x6M3+4zUgc+4qTOUBoNe4XxDskt1HPKO007ZPiMgLDq2s7Kw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/traverse": "^7.25.7", + "@babel/types": "^7.25.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.7.tgz", + "integrity": "sha512-k/6f8dKG3yDz/qCwSM+RKovjMix563SLxQFo0UhRNo239SP6n9u5/eLtKD6EAjwta2JHJ49CsD8pms2HdNiMMQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-module-imports": "^7.25.7", + "@babel/helper-simple-access": "^7.25.7", + "@babel/helper-validator-identifier": "^7.25.7", + "@babel/traverse": "^7.25.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.7.tgz", + "integrity": "sha512-eaPZai0PiqCi09pPs3pAFfl/zYgGaE6IdXtYvmf0qlcDTd3WCtO7JWCcRd64e0EQrcYgiHibEZnOGsSY4QSgaw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-simple-access": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.25.7.tgz", + "integrity": "sha512-FPGAkJmyoChQeM+ruBGIDyrT2tKfZJO8NcxdC+CWNJi7N8/rZpSxK7yvBJ5O/nF1gfu5KzN7VKG3YVSLFfRSxQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/traverse": "^7.25.7", + "@babel/types": "^7.25.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.7.tgz", + "integrity": "sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.7.tgz", + "integrity": "sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.7.tgz", + "integrity": "sha512-ytbPLsm+GjArDYXJ8Ydr1c/KJuutjF2besPNbIZnZ6MKUxi/uTA22t2ymmA4WFjZFpjiAMO0xuuJPqK2nvDVfQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.25.7.tgz", + "integrity": "sha512-Sv6pASx7Esm38KQpF/U/OXLwPPrdGHNKoeblRxgZRLXnAtnkEe4ptJPDtAZM7fBLadbc1Q07kQpSiGQ0Jg6tRA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/template": "^7.25.7", + "@babel/types": "^7.25.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.25.7.tgz", + "integrity": "sha512-iYyACpW3iW8Fw+ZybQK+drQre+ns/tKpXbNESfrhNnPLIklLbXr7MYJ6gPEd0iETGLOK+SxMjVvKb/ffmk+FEw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.25.7", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/highlight/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@babel/highlight/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/highlight/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/parser": { + "version": "7.25.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.8.tgz", + "integrity": "sha512-HcttkxzdPucv3nNFmfOOMfFf64KgdJVqm1KaCm25dPGMLElo9nsLvXeJECQg8UzPuBGLyTSA0ZzqCtDSzKTEoQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/types": "^7.25.8" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-static-block": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", + "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-attributes": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.25.7.tgz", + "integrity": "sha512-AqVo+dguCgmpi/3mYBdu9lkngOBlQ2w2vnNpa6gfiCxQZLzV4ZbhsXitJ2Yblkoe1VQwtHSaNmIaGll/26YWRw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.7.tgz", + "integrity": "sha512-ruZOnKO+ajVL/MVx+PwNBPOkrnXTXoWMtte1MBpegfCArhqOe3Bj52avVj1huLLxNKYKXYaSxZ2F+woK1ekXfw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", + "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.7.tgz", + "integrity": "sha512-rR+5FDjpCHqqZN2bzZm18bVYGaejGq5ZkpVCJLXor/+zlSrSoc4KWcHI0URVWjl/68Dyr1uwZUz/1njycEAv9g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/template": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.7.tgz", + "integrity": "sha512-wRwtAgI3bAS+JGU2upWNL9lSlDcRCqD05BZ1n3X2ONLH1WilFP6O1otQjeMK/1g0pvYcXC7b/qVUB1keofjtZA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.25.7", + "@babel/parser": "^7.25.7", + "@babel/types": "^7.25.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.7.tgz", + "integrity": "sha512-jatJPT1Zjqvh/1FyJs6qAHL+Dzb7sTb+xr7Q+gM1b+1oBsMsQQ4FkVKb6dFlJvLlVssqkRzV05Jzervt9yhnzg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.25.7", + "@babel/generator": "^7.25.7", + "@babel/parser": "^7.25.7", + "@babel/template": "^7.25.7", + "@babel/types": "^7.25.7", + "debug": "^4.3.1", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/types": { + "version": "7.25.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.8.tgz", + "integrity": "sha512-JWtuCu8VQsMladxVz/P4HzHUGCAwpuqacmowgXFs5XjxIgKuNjnLokQzuVjlTvIzODaDmpjT3oxcC48vyk9EWg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-string-parser": "^7.25.7", + "@babel/helper-validator-identifier": "^7.25.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.11.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.1.tgz", + "integrity": "sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.18.0.tgz", + "integrity": "sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.4", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.6.0.tgz", + "integrity": "sha512-8I2Q8ykA4J0x0o7cg67FPVnehcqWTBehu/lmY+bolPFHGjh49YzGBMXTvpqVgEbBdvNCSxj6iFgiIyHzf03lzg==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", + "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@eslint/eslintrc/node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/js": { + "version": "9.12.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.12.0.tgz", + "integrity": "sha512-eohesHH8WFRUprDNyEREgqP6beG6htMeUYeCpkEgBCieCMme5r9zFWjzAJp//9S+Kub4rqE+jXe9Cp1a7IYIIA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz", + "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.0.tgz", + "integrity": "sha512-vH9PiIMMwvhCx31Af3HiGzsVNULDbyVkHXwlemn/B0TFj/00ho3y55efXrUZTfQipxoHC5u4xq6zblww1zm1Ig==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.0.tgz", + "integrity": "sha512-2cbWIHbZVEweE853g8jymffCA+NCMiuqeECeBBLm8dg2oFdjuGJhgN4UAbI+6v0CKbbhvtXA4qV8YR5Ji86nmw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.5", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.5.tgz", + "integrity": "sha512-KSPA4umqSG4LHYRodq31VDwKAvaTF4xmVlzM8Aeh4PlU1JQ3IG0wiA8C25d3RQ9nJyM3mBHyI53K06VVL/oFFg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.0", + "@humanwhocodes/retry": "^0.3.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/console": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", + "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/core": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", + "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/environment": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "jest-get-type": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/fake-timers": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@sinonjs/fake-timers": "^10.0.2", + "@types/node": "*", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/globals": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/reporters": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", + "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^6.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "slash": "^3.0.0", + "string-length": "^4.0.1", + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/source-map": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.18", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-result": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", + "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-sequencer": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", + "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/test-result": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/transform": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.2" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/types": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@pkgr/core": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", + "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/@realm/fetch": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@realm/fetch/-/fetch-0.1.1.tgz", + "integrity": "sha512-hkTprw79RXGv54Je0DrjpQPLaz4QID2dO3FmthAQQWAkqwyrqMzrCGzJzLlmTKWZFsgLrN8KQyNewod27P+nJg==", + "engines": { + "node": ">=18" + } + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@sinonjs/commons": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@sinonjs/commons": "^3.0.0" + } + }, + "node_modules/@types/ajv": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@types/ajv/-/ajv-0.0.5.tgz", + "integrity": "sha512-0UD98SZLwPk6cTMZoLs8W4XSAWgqT9nyoZiBw+uXEPf1u5h+Dn2ztMG4Is9pDA+9D7GKbCTfIkQK/hNgoWVQcQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.6.8", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", + "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.20.6", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.6.tgz", + "integrity": "sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/types": "^7.20.7" + } + }, + "node_modules/@types/estree": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/graceful-fs": { + "version": "4.1.9", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", + "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", + "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", + "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/js-yaml": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.9.tgz", + "integrity": "sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "22.7.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", + "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.19.2" + } + }, + "node_modules/@types/node-int64": { + "version": "0.4.32", + "resolved": "https://registry.npmjs.org/@types/node-int64/-/node-int64-0.4.32.tgz", + "integrity": "sha512-xf/JsSlnXQ+mzvc0IpXemcrO4BrCfpgNpMco+GLcXkFk01k/gW9lGJu+Vof0ZSvHK6DsHJDPSbjFPs36QkWXqw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/q": { + "version": "1.5.8", + "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.8.tgz", + "integrity": "sha512-hroOstUScF6zhIi+5+x0dzqrHA1EJi+Irri6b1fxolMTqqHIV/Cg77EtnQcZqZCu8hR3mX2BzIxN4/GzI68Kfw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/stack-utils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@types/thrift": { + "version": "0.10.17", + "resolved": "https://registry.npmjs.org/@types/thrift/-/thrift-0.10.17.tgz", + "integrity": "sha512-bDX6d5a5ZDWC81tgDv224n/3PKNYfIQJTPHzlbk4vBWJrYXF6Tg1ncaVmP/c3JbGN2AK9p7zmHorJC2D6oejGQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/node-int64": "*", + "@types/q": "*" + } + }, + "node_modules/@types/uuid": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-10.0.0.tgz", + "integrity": "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/ws": { + "version": "8.5.12", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.12.tgz", + "integrity": "sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/yargs": { + "version": "17.0.33", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz", + "integrity": "sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.8.1.tgz", + "integrity": "sha512-xfvdgA8AP/vxHgtgU310+WBnLB4uJQ9XdyP17RebG26rLtDrQJV3ZYrcopX91GrHmMoH8bdSwMRh2a//TiJ1jQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.8.1", + "@typescript-eslint/type-utils": "8.8.1", + "@typescript-eslint/utils": "8.8.1", + "@typescript-eslint/visitor-keys": "8.8.1", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "eslint": "^8.57.0 || ^9.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.8.1.tgz", + "integrity": "sha512-hQUVn2Lij2NAxVFEdvIGxT9gP1tq2yM83m+by3whWFsWC+1y8pxxxHUFE1UqDu2VsGi2i6RLcv4QvouM84U+ow==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/scope-manager": "8.8.1", + "@typescript-eslint/types": "8.8.1", + "@typescript-eslint/typescript-estree": "8.8.1", + "@typescript-eslint/visitor-keys": "8.8.1", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.8.1.tgz", + "integrity": "sha512-X4JdU+66Mazev/J0gfXlcC/dV6JI37h+93W9BRYXrSn0hrE64IoWgVkO9MSJgEzoWkxONgaQpICWg8vAN74wlA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.8.1", + "@typescript-eslint/visitor-keys": "8.8.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.8.1.tgz", + "integrity": "sha512-qSVnpcbLP8CALORf0za+vjLYj1Wp8HSoiI8zYU5tHxRVj30702Z1Yw4cLwfNKhTPWp5+P+k1pjmD5Zd1nhxiZA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/typescript-estree": "8.8.1", + "@typescript-eslint/utils": "8.8.1", + "debug": "^4.3.4", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.8.1.tgz", + "integrity": "sha512-WCcTP4SDXzMd23N27u66zTKMuEevH4uzU8C9jf0RO4E04yVHgQgW+r+TeVTNnO1KIfrL8ebgVVYYMMO3+jC55Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.8.1.tgz", + "integrity": "sha512-A5d1R9p+X+1js4JogdNilDuuq+EHZdsH9MjTVxXOdVFfTJXunKJR/v+fNNyO4TnoOn5HqobzfRlc70NC6HTcdg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/types": "8.8.1", + "@typescript-eslint/visitor-keys": "8.8.1", + "debug": "^4.3.4", + "fast-glob": "^3.3.2", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.8.1.tgz", + "integrity": "sha512-/QkNJDbV0bdL7H7d0/y0qBbV2HTtf0TIyjSDTvvmQEzeVx8jEImEbLuOA4EsvE8gIgqMitns0ifb5uQhMj8d9w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.8.1", + "@typescript-eslint/types": "8.8.1", + "@typescript-eslint/typescript-estree": "8.8.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.8.1.tgz", + "integrity": "sha512-0/TdC3aeRAsW7MDvYRwEc1Uwm0TIBfzjPFgg60UU2Haj5qsCs9cc3zNgY71edqE3LbWfF/WoZQd3lJoDXFQpag==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.8.1", + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/acorn": { + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "license": "Python-2.0" + }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "dev": true, + "license": "MIT" + }, + "node_modules/async-limiter": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", + "license": "MIT" + }, + "node_modules/babel-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", + "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/transform": "^29.7.0", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.6.3", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.8.0" + } + }, + "node_modules/babel-plugin-istanbul": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "peer": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/babel-plugin-jest-hoist": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/babel-preset-current-node-syntax": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.1.0.tgz", + "integrity": "sha512-ldYss8SbBlWva1bs28q78Ju5Zq1F+8BrqBZZ0VFhLBvhh6lCpC2o3gDJi/5DRLs9FgYZCnmPYIVFU4lRXCkyUw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-import-attributes": "^7.24.7", + "@babel/plugin-syntax-import-meta": "^7.10.4", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/babel-preset-jest": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "babel-plugin-jest-hoist": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "license": "MIT", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/bl/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/bl/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browser-or-node": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/browser-or-node/-/browser-or-node-1.3.0.tgz", + "integrity": "sha512-0F2z/VSnLbmEeBcUrSuDH5l0HxTXdQQzLjkmBR4cYfvg1zJrKSlmIZFqyFR8oX0NrwPhy3c3HQ6i3OxMbew4Tg==", + "license": "MIT" + }, + "node_modules/browserslist": { + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.0.tgz", + "integrity": "sha512-Rmb62sR1Zpjql25eSanFGEhAxcFwfA1K0GuQcLoaJBAcENegrQut3hYdhXFF1obQfiDyqIW/cLM5HSJ/9k884A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "caniuse-lite": "^1.0.30001663", + "electron-to-chromium": "^1.5.28", + "node-releases": "^2.0.18", + "update-browserslist-db": "^1.1.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/bs-logger": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", + "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-json-stable-stringify": "2.x" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "node-int64": "^0.4.0" + } + }, + "node_modules/bson": { + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/bson/-/bson-4.7.2.tgz", + "integrity": "sha512-Ry9wCtIZ5kGqkJoi6aD8KjxFZEx78guTQDnpXWiNthsxzrxAK/i8E6pCHAIZTbaEFWcOCvbecMukfK7XUvyLpQ==", + "license": "Apache-2.0", + "dependencies": { + "buffer": "^5.6.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001668", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001668.tgz", + "integrity": "sha512-nWLrdxqCdblixUO+27JtGJJE/txpJlyUy5YN1u53wLZkP0emYCo5zgS6QYft7VUYR42LGgi/S5hdLZTrnyIddw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0", + "peer": true + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "license": "ISC" + }, + "node_modules/ci-info": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cjs-module-lexer": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.1.tgz", + "integrity": "sha512-cuSVIHi9/9E/+821Qjdvngor+xpnlwnuwIyZOaLmHBVdXL+gP+I6QQB9VkO7RI77YIcTV+S1W9AreJ5eN63JBA==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/collect-v8-coverage": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/copyfiles": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/copyfiles/-/copyfiles-2.4.1.tgz", + "integrity": "sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==", + "dev": true, + "license": "MIT", + "dependencies": { + "glob": "^7.0.5", + "minimatch": "^3.0.3", + "mkdirp": "^1.0.4", + "noms": "0.0.0", + "through2": "^2.0.1", + "untildify": "^4.0.0", + "yargs": "^16.1.0" + }, + "bin": { + "copyfiles": "copyfiles", + "copyup": "copyfiles" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/create-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", + "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "prompts": "^2.0.1" + }, + "bin": { + "create-jest": "bin/create-jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "license": "MIT", + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/dedent": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.3.tgz", + "integrity": "sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ==", + "dev": true, + "license": "MIT", + "peer": true, + "peerDependencies": { + "babel-plugin-macros": "^3.1.0" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/detect-libc": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/dotenv": { + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true, + "license": "MIT" + }, + "node_modules/ejs": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "jake": "^10.8.5" + }, + "bin": { + "ejs": "bin/cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.36", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.36.tgz", + "integrity": "sha512-HYTX8tKge/VNp6FGO+f/uVDmUkq+cEfcxYhKf15Akc4M5yxt5YmorwlAitKWjWhWQnKcDRBAQKXkhqqXMqcrjw==", + "dev": true, + "license": "ISC", + "peer": true + }, + "node_modules/emittery": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sindresorhus/emittery?sponsor=1" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "9.12.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.12.0.tgz", + "integrity": "sha512-UVIOlTEWxwIopRL1wgSQYdnVDcEvs2wyaO6DGo5mXqe3r16IoCNWkR29iHhyaP4cICWjbgbmFUGAhh0GJRuGZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.11.0", + "@eslint/config-array": "^0.18.0", + "@eslint/core": "^0.6.0", + "@eslint/eslintrc": "^3.1.0", + "@eslint/js": "9.12.0", + "@eslint/plugin-kit": "^0.2.0", + "@humanfs/node": "^0.16.5", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.3.1", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.1.0", + "eslint-visitor-keys": "^4.1.0", + "espree": "^10.2.0", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-config-prettier": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", + "dev": true, + "license": "MIT", + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-plugin-prettier": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.1.tgz", + "integrity": "sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==", + "dev": true, + "license": "MIT", + "dependencies": { + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.9.1" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-plugin-prettier" + }, + "peerDependencies": { + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "eslint-config-prettier": "*", + "prettier": ">=3.0.0" + }, + "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, + "eslint-config-prettier": { + "optional": true + } + } + }, + "node_modules/eslint-scope": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.1.0.tgz", + "integrity": "sha512-14dSvlhaVhKKsa9Fx1l8A17s7ah7Ef7wCakJ10LYk6+GYmP9yDti2oq2SEwcyndt6knfcZyhyxwY3i9yL78EQw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz", + "integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/eslint/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/espree": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.2.0.tgz", + "integrity": "sha512-upbkBJbckcCNBDBDXEbuhjbP68n+scUd3k/U2EkyM9nw+I/jPiL4cLF/Al06CF96wRltFda16sxDFrxsI1v0/g==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.12.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.1.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "license": "BSD-2-Clause", + "peer": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "license": "(MIT OR WTFPL)", + "engines": { + "node": ">=6" + } + }, + "node_modules/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" + }, + "node_modules/fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-uri": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.2.tgz", + "integrity": "sha512-GR6f0hD7XXyNJa25Tb9BuIdN0tdr+0BMi6/CJPH3wJO1JjNG3n/VsSw38AwRdKZABm8lGbPfakLRkYzx2V9row==", + "license": "MIT" + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fb-watchman": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "bser": "2.1.1" + } + }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/filelist": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", + "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "minimatch": "^5.0.1" + } + }, + "node_modules/filelist/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/filelist/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true, + "license": "ISC" + }, + "node_modules/foreground-child": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", + "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/foreground-child/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "license": "MIT" + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "peer": true, + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", + "license": "MIT" + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true, + "license": "MIT" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-local": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", + "integrity": "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "license": "ISC" + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/is-core-module": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", + "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/isomorphic-ws": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", + "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", + "license": "MIT", + "peerDependencies": { + "ws": "*" + } + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jackspeak": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.2.tgz", + "integrity": "sha512-bZsjR/iRjl1Nk1UkjGpAzLNfQtzuijhn2g+pbZb98HQ1Gk8vM9hfbxeMBP+M2/UUdwj0RqGG3mlvk2MsAqwvEw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/jake": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.2.tgz", + "integrity": "sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "async": "^3.2.3", + "chalk": "^4.0.2", + "filelist": "^1.0.4", + "minimatch": "^3.1.2" + }, + "bin": { + "jake": "bin/cli.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", + "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.7.0" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-changed-files": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", + "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "execa": "^5.0.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-circus": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", + "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^1.0.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0", + "pretty-format": "^29.7.0", + "pure-rand": "^6.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-cli": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", + "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "create-jest": "^29.7.0", + "exit": "^0.1.2", + "import-local": "^3.0.2", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "yargs": "^17.3.1" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-cli/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/jest-cli/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/jest-cli/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/jest-config": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", + "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-jest": "^29.7.0", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@types/node": "*", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/jest-config/node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-diff": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "chalk": "^4.0.0", + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-docblock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", + "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "detect-newline": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-each": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", + "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-environment-node": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", + "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-haste-map": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } + }, + "node_modules/jest-leak-detector": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", + "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-matcher-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "chalk": "^4.0.0", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-message-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^29.6.3", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-mock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-pnp-resolver": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "jest-resolve": "*" + }, + "peerDependenciesMeta": { + "jest-resolve": { + "optional": true + } + } + }, + "node_modules/jest-regex-util": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", + "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve-dependencies": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", + "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runner": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", + "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "graceful-fs": "^4.2.9", + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-util": "^29.7.0", + "jest-watcher": "^29.7.0", + "jest-worker": "^29.7.0", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runtime": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", + "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-snapshot": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "natural-compare": "^1.4.0", + "pretty-format": "^29.7.0", + "semver": "^7.5.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-validate": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-validate/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-watcher": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", + "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "jest-util": "^29.7.0", + "string-length": "^4.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsesc": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", + "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true, + "license": "ISC" + }, + "node_modules/makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "tmpl": "1.0.5" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "license": "MIT", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "license": "MIT" + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/napi-build-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", + "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==", + "license": "MIT" + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-abi": { + "version": "3.68.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.68.0.tgz", + "integrity": "sha512-7vbj10trelExNjFSBm5kTvZXXa7pZyKWx9RCKIyqe6I9Ev3IzGpQoqBP3a+cOdxY+pWj6VkP28n/2wWysBHD/A==", + "license": "MIT", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "license": "MIT" + }, + "node_modules/node-machine-id": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/node-machine-id/-/node-machine-id-1.1.12.tgz", + "integrity": "sha512-QNABxbrPa3qEIfrE6GOJ7BYIuignnJw7iQ2YPbc3Nla1HzRJjXzZOiikfF8m7eAMfichLt3M4VgLOetqgDmgGQ==", + "license": "MIT" + }, + "node_modules/node-releases": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", + "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/noms": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz", + "integrity": "sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow==", + "dev": true, + "license": "ISC", + "dependencies": { + "inherits": "^2.0.1", + "readable-stream": "~1.0.31" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "license": "MIT" + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/path-scurry": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", + "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.1.tgz", + "integrity": "sha512-CgeuL5uom6j/ZVrg7G/+1IXqRY8JXX4Hghfy5YE0EhoYQWvndP1kufu58cmZLNIDKnRhZrXfdS9urVWx98AipQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/picocolors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", + "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", + "dev": true, + "license": "ISC", + "peer": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pirates": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pkg-dir/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/prebuild-install": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.2.tgz", + "integrity": "sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ==", + "license": "MIT", + "dependencies": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true, + "license": "MIT" + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/pump": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz", + "integrity": "sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/pure-rand": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", + "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT", + "peer": true + }, + "node_modules/q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==", + "deprecated": "You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other.\n\n(For a CapTP with native promises, see @endo/eventual-send and @endo/captp)", + "license": "MIT", + "engines": { + "node": ">=0.6.0", + "teleport": ">=0.2.0" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==", + "dev": true, + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "node_modules/realm": { + "version": "12.13.1", + "resolved": "https://registry.npmjs.org/realm/-/realm-12.13.1.tgz", + "integrity": "sha512-fAs70ZCBf1P7htVhOTrDMFHD6SzoGXVsALy6DpOPR6t0LXoK635cKxBMECX3bYdCgI7+riSfdoWXLA/7g5yTSQ==", + "deprecated": "This version uses Atlas Device Sync, please install `realm@community` and read https://github.com/realm/realm-js/blob/main/DEPRECATION.md for more information.", + "hasInstallScript": true, + "license": "apache-2.0", + "dependencies": { + "@realm/fetch": "^0.1.1", + "bson": "^4.7.2", + "debug": "^4.3.4", + "node-machine-id": "^1.1.12", + "path-browserify": "^1.0.1", + "prebuild-install": "^7.1.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "react-native": ">=0.71.0" + }, + "peerDependenciesMeta": { + "react-native": { + "optional": true + } + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-cwd/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/resolve.exports": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", + "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.0.1.tgz", + "integrity": "sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A==", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^11.0.0", + "package-json-from-dist": "^1.0.0" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", + "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^4.0.1", + "minimatch": "^10.0.0", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^2.0.0" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/minimatch": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", + "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC", + "peer": true + }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/stack-utils": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", + "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "escape-string-regexp": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/stack-utils/node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/string-length": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/synckit": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.2.tgz", + "integrity": "sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@pkgr/core": "^0.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/tar-fs": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", + "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "license": "MIT", + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "license": "MIT", + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tar-stream/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/tar-stream/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true, + "license": "MIT" + }, + "node_modules/thrift": { + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/thrift/-/thrift-0.21.0.tgz", + "integrity": "sha512-AW8rwHYjeqXisS8B1iwko2gkNMFwSRJ+bO/W0xTGqRspTD3lGHwZx438+pHdOJ3GwpRAnK7TKbjqPOrHAa7ZwQ==", + "license": "Apache-2.0", + "dependencies": { + "browser-or-node": "^1.2.1", + "isomorphic-ws": "^4.0.1", + "node-int64": "^0.4.0", + "q": "^1.5.0", + "ws": "^5.2.3" + }, + "engines": { + "node": ">= 10.18.0" + } + }, + "node_modules/thrift/node_modules/ws": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.4.tgz", + "integrity": "sha512-fFCejsuC8f9kOSu9FYaOw8CdO68O3h5v0lg4p74o8JqWpwTf9tniOD+nOB78aWoVSS6WptVUmDrp/KPsMVBWFQ==", + "license": "MIT", + "dependencies": { + "async-limiter": "~1.0.0" + } + }, + "node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/through2/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/through2/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/through2/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "license": "MIT" + }, + "node_modules/through2/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ts-api-utils": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, + "node_modules/ts-jest": { + "version": "29.2.5", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.2.5.tgz", + "integrity": "sha512-KD8zB2aAZrcKIdGk4OwpJggeLcH1FgrICqDSROWqlnJXGCXK4Mn6FcdK2B6670Xr73lHMG1kHw8R87A0ecZ+vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "bs-logger": "^0.2.6", + "ejs": "^3.1.10", + "fast-json-stable-stringify": "^2.1.0", + "jest-util": "^29.0.0", + "json5": "^2.2.3", + "lodash.memoize": "^4.1.2", + "make-error": "^1.3.6", + "semver": "^7.6.3", + "yargs-parser": "^21.1.1" + }, + "bin": { + "ts-jest": "cli.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "@babel/core": ">=7.0.0-beta.0 <8", + "@jest/transform": "^29.0.0", + "@jest/types": "^29.0.0", + "babel-jest": "^29.0.0", + "jest": "^29.0.0", + "typescript": ">=4.3 <6" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "@jest/transform": { + "optional": true + }, + "@jest/types": { + "optional": true + }, + "babel-jest": { + "optional": true + }, + "esbuild": { + "optional": true + } + } + }, + "node_modules/ts-jest/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", + "dev": true, + "license": "0BSD" + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", + "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/typescript-eslint": { + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.8.1.tgz", + "integrity": "sha512-R0dsXFt6t4SAFjUSKFjMh4pXDtq04SsFKCVGDP3ZOzNP7itF0jBcZYU4fMsZr4y7O7V7Nc751dDeESbe4PbQMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.8.1", + "@typescript-eslint/parser": "8.8.1", + "@typescript-eslint/utils": "8.8.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true, + "license": "MIT" + }, + "node_modules/untildify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", + "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz", + "integrity": "sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.0" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, + "node_modules/uuid": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz", + "integrity": "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/v8-to-istanbul": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", + "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "makeerror": "1.0.12" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, + "node_modules/write-file-atomic": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/ws": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC", + "peer": true + }, + "node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/cdsp/information-layer/package.json b/cdsp/information-layer/package.json index a86d372..1a7e849 100644 --- a/cdsp/information-layer/package.json +++ b/cdsp/information-layer/package.json @@ -3,20 +3,40 @@ "version": "1.0.0", "description": "WebSocket server with handlers for IoTDB and RealmDB", "private": true, - "workspaces": [ - "handlers/src", - "handlers/src/iotdb", - "handlers/src/realmdb", - "router" - ], - "main": "router/src/websocket-server.js", + "main": "dist/router/src/websocket-server.js", "scripts": { - "start": "node router/src/websocket-server.js" + "copy-files": "npx copyfiles -u 3 ./handlers/config/schema-files/**/* ./dist/handlers/config/schema-files/", + "check-format": "prettier --check './**/*.{ts,tsx}'", + "prebuild": "rimraf /dist", + "lint": "eslint", + "lint-and-fix": "eslint --fix", + "build": "tsc && npm run copy-files", + "start": "node ./dist/router/src/websocket-server.js" }, "dependencies": { - "dotenv": "^16.4.5" + "ajv": "^8.17.1", + "dotenv": "^16.4.5", + "js-yaml": "^4.1.0", + "realm": "^12.13.1", + "thrift": "^0.21.0", + "uuid": "^10.0.0", + "ws": "^8.18.0" }, "devDependencies": { - "prettier": "3.3.3" + "@types/ajv": "^0.0.5", + "@types/js-yaml": "^4.0.9", + "@types/node": "^22.7.0", + "@types/thrift": "^0.10.17", + "@types/uuid": "^10.0.0", + "@types/ws": "^8.5.12", + "copyfiles": "^2.4.1", + "eslint": "^9.9.1", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-prettier": "^5.2.1", + "prettier": "^3.3.3", + "rimraf": "^6.0.1", + "ts-jest": "^29.2.5", + "typescript": "^5.6.2", + "typescript-eslint": "^8.4.0" } } diff --git a/cdsp/information-layer/router/.gitignore b/cdsp/information-layer/router/.gitignore index eec8018..58c3437 100644 --- a/cdsp/information-layer/router/.gitignore +++ b/cdsp/information-layer/router/.gitignore @@ -1,9 +1,2 @@ -# MongoDB Realm -mongodb-realm/ - -# Node.js -node_modules/ -package-lock.json - # MAC **/.DS_Store \ No newline at end of file diff --git a/cdsp/information-layer/router/README.md b/cdsp/information-layer/router/README.md new file mode 100644 index 0000000..4f5a7f0 --- /dev/null +++ b/cdsp/information-layer/router/README.md @@ -0,0 +1,4 @@ +# Websocket-Server + +This project is a [WebSocket server](src/websocket-server.ts) that dynamically integrates different database handlers (e.g., RealmDB, IoTDB) based on the [configuration](../handlers/README.md). It listens for incoming WebSocket connections, processes messages according to the specified handler, and broadcasts messages to connected clients. + diff --git a/cdsp/information-layer/router/config/config.js b/cdsp/information-layer/router/config/config.js deleted file mode 100644 index 4233552..0000000 --- a/cdsp/information-layer/router/config/config.js +++ /dev/null @@ -1,14 +0,0 @@ -const dotenv = require("dotenv"); -dotenv.config(); - -const getHandlerType = () => { - const handlerType = process.env.HANDLER_TYPE; - if (!handlerType) { - throw new Error("HANDLER_TYPE must be specified as an ENV variable"); - } - return handlerType.toLowerCase(); -}; - -module.exports = { - getHandlerType, -}; diff --git a/cdsp/information-layer/router/config/config.ts b/cdsp/information-layer/router/config/config.ts new file mode 100644 index 0000000..33768ca --- /dev/null +++ b/cdsp/information-layer/router/config/config.ts @@ -0,0 +1,13 @@ +import dotenv from "dotenv"; +dotenv.config(); + +// Define the type of the handler, which will be a lowercase string +export const getHandlerType = (): string => { + const handlerType = process.env.HANDLER_TYPE; + + if (!handlerType) { + throw new Error("HANDLER_TYPE must be specified as an ENV variable"); + } + + return handlerType.toLowerCase(); // Ensure it's returned as lowercase +}; diff --git a/cdsp/information-layer/router/package.json b/cdsp/information-layer/router/package.json deleted file mode 100644 index 333c2ac..0000000 --- a/cdsp/information-layer/router/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "websocket-server", - "version": "1.0.0", - "description": "WebSocket server", - "main": "src/websocket-server.js", - "scripts": { - "start": "node src/websocket-server.js" - }, - "dependencies": { - "ajv": "^8.17.1", - "ws": "^7.4.6" - } -} diff --git a/cdsp/information-layer/router/src/websocket-server.js b/cdsp/information-layer/router/src/websocket-server.js deleted file mode 100644 index 64173b1..0000000 --- a/cdsp/information-layer/router/src/websocket-server.js +++ /dev/null @@ -1,74 +0,0 @@ -const WebSocket = require("ws"); -const RealmDBHandler = require("../../handlers/src/realmdb/src/realmdb-handler"); -const IoTDBHandler = require("../../handlers/src/iotdb/src/iotdb-handler"); -const { getHandlerType } = require("../config/config"); -const { validateMessage } = require("../utils/message-validator"); -const { - logMessage, - logWithColor, - MessageType, - COLORS, -} = require("../../utils/logger"); - -const handlerType = getHandlerType(); -let handler; - -logWithColor(`\n ** Handler: ${handlerType} ** \n`, COLORS.BOLD); - -switch (handlerType) { - case "realmdb": - handler = new RealmDBHandler(); - break; - case "iotdb": - handler = new IoTDBHandler(); - break; - default: - throw new Error("Unsupported handler type"); -} - -const server = new WebSocket.Server({ port: 8080 }); - -// Define clients array globally -let clients = []; - -server.on("connection", (ws) => { - logWithColor("* Client connected *", COLORS.YELLOW); - clients.push(ws); // Add client to the array - - ws.on("message", (message) => { - logMessage(JSON.stringify(message), MessageType.RECEIVED); - const validatedMessage = validateMessage(message); - - if (validatedMessage instanceof Error) { - logMessage( - `Invalid message format: ${validatedMessage.message}`, - MessageType.ERROR - ); - - JSON.parse(validatedMessage.message).forEach((error) => { - ws.send(JSON.stringify(error)); - }); - } else { - handler.handleMessage(validatedMessage, ws); - } - }); - - ws.on("close", () => { - // Remove all client listeners - handler.unsubscribe_client(ws); - // Remove disconnected client from the array - clients = clients.filter((client) => client !== ws); - console.info("* Client disconnected *"); - }); -}); - -const sendMessageToClients = (message) => { - logMessage(JSON.stringify(message), MessageType.SENT); - clients.forEach((client) => { - client.send(JSON.stringify(message)); - }); -}; - -console.info(`Starting authentication and connection ...`); -handler.authenticateAndConnect(sendMessageToClients); -logWithColor(`Web-Socket server started on ws://localhost:8080\n`, COLORS.BOLD); diff --git a/cdsp/information-layer/router/src/websocket-server.ts b/cdsp/information-layer/router/src/websocket-server.ts new file mode 100644 index 0000000..aa6f93a --- /dev/null +++ b/cdsp/information-layer/router/src/websocket-server.ts @@ -0,0 +1,96 @@ +import WebSocket, { RawData } from "ws"; +import { RealmDBHandler } from "../../handlers/src/realmdb/src/RealmDbHandler"; +import { IoTDBHandler } from "../../handlers/src/iotdb/src/IoTDBHandler"; +import { HandlerBase } from "../../handlers/src/HandlerBase"; +import { getHandlerType } from "../config/config"; +import { validateMessage } from "../utils/message-validator"; +import { + logMessage, + logError, + logWithColor, + MessageType, + COLORS, +} from "../../utils/logger"; +import { Message } from "../../handlers/utils/data_types"; + +// Define the handler as the base class type +let handler: HandlerBase; + +const handlerType: string = getHandlerType(); + +logWithColor(`\n ** Handler: ${handlerType} ** \n`, COLORS.BOLD); + +// Instantiate the correct handler based on the handler type +switch (handlerType) { + case "realmdb": + handler = new RealmDBHandler(); + break; + case "iotdb": + handler = new IoTDBHandler(); + break; + default: + throw new Error("Unsupported handler type"); +} + +// WebSocket server creation +const server = new WebSocket.Server({ port: 8080 }); + +// Define clients array globally to store connected clients +let clients: WebSocket[] = []; + +// Handle new client connections +server.on("connection", (ws: WebSocket) => { + logWithColor("* Client connected *", COLORS.YELLOW); + clients.push(ws); // Add client to the array + + // Handle messages from the client + ws.on("message", (message: WebSocket.RawData) => { + let messageString = rawDataToString(message); + logMessage(JSON.stringify(messageString), MessageType.RECEIVED); + const validatedMessage = validateMessage(messageString); + + if (validatedMessage instanceof Error) { + logError("Invalid message format", validatedMessage); + JSON.parse(validatedMessage.message).forEach((error: any) => { + ws.send(JSON.stringify(error)); + }); + } else { + // Pass the validated message to the handler + handler.handleMessage(validatedMessage, ws); + } + }); + + // Handle client disconnection + ws.on("close", () => { + handler.unsubscribe_client(ws); // Remove all client listeners + clients = clients.filter((client) => client !== ws); // Remove client from array + logMessage("* Client disconnected *"); + }); +}); + +// Function to broadcast messages to all connected clients +const sendMessageToClients = (message: Message) => { + logMessage(JSON.stringify(message), MessageType.SENT); + clients.forEach((client) => { + client.send(JSON.stringify(message)); + }); +}; + +// Initialize handler and authenticate +logMessage(`Starting authentication and connection ...`); +handler.authenticateAndConnect(sendMessageToClients); + +// Log server start +logWithColor(`Web-Socket server started on ws://localhost:8080\n`, COLORS.BOLD); + +function rawDataToString(message: RawData): string { + if (typeof message === "string") { + return message; + } else if (Buffer.isBuffer(message)) { + return message.toString(); + } else if (message instanceof ArrayBuffer) { + return new TextDecoder().decode(message); + } else { + throw new Error("Unsupported message type"); + } +} diff --git a/cdsp/information-layer/router/utils/message-validator.js b/cdsp/information-layer/router/utils/message-validator.ts similarity index 64% rename from cdsp/information-layer/router/utils/message-validator.js rename to cdsp/information-layer/router/utils/message-validator.ts index ce7ee18..4b24385 100644 --- a/cdsp/information-layer/router/utils/message-validator.js +++ b/cdsp/information-layer/router/utils/message-validator.ts @@ -1,27 +1,38 @@ -const Ajv = require("ajv"); -const { createErrorMessage } = require("../../utils/error-message-helper"); +import Ajv, { ErrorObject } from "ajv"; +import { createErrorMessage } from "../../utils/error-message-helper"; +import { + ErrorMessage, + Message, + STATUS_ERRORS, +} from "../../handlers/utils/data_types"; +// Initialize AJV with specific options const ajv = new Ajv({ allErrors: true, strict: true, allowUnionTypes: true, }); +// Define the headers for validation const itemsHeader = ["type", "tree", "id", "uuid"]; +const ERROR_CATEGORY = "messageValidation"; -const standardError = createErrorMessage( - "messageValidation", - 400, - `Received an invalid message.`, -); +// Standard error message template +const standardError: ErrorMessage = { + category: ERROR_CATEGORY, + statusCode: STATUS_ERRORS.BAD_REQUEST, + message: "Received an invalid message.", +}; -const createCommonStructure = (requestType) => ({ +// Helper to create the common structure for different message types +const createCommonStructure = (requestType: string) => ({ type: { type: "string", enum: [requestType] }, tree: { type: "string", enum: ["VSS"] }, id: { type: "string" }, uuid: { type: "string" }, }); +// Define the schemas for message validation const schemas = { read: { type: "object", @@ -113,60 +124,68 @@ const schemas = { }, }; -const customizeErrorMessage = (errors) => { +// Function to customize error messages from AJV validation +const customizeErrorMessage = ( + errors: ErrorObject[] | null | undefined, +): ErrorMessage[] => { + if (!errors) return [standardError]; + return errors.map((err) => { - switch (err.keyword) { + const { keyword, instancePath, params } = err; + + switch (keyword) { case "required": return createErrorMessage( - "messageValidation", - 400, - `Missing required field: ${err.params.missingProperty}.`, + ERROR_CATEGORY, + STATUS_ERRORS.BAD_REQUEST, + `Missing required field: ${params.missingProperty}.`, ); case "type": return createErrorMessage( - "messageValidation", - 400, - `Invalid type for field '${err.instancePath}': expected ${err.params.type}.`, + ERROR_CATEGORY, + STATUS_ERRORS.BAD_REQUEST, + `Invalid type for field '${instancePath}': expected ${params.type}.`, ); case "enum": if (err.instancePath === "/tree") { return createErrorMessage( - "messageValidation", - 404, - `Unsupported message 'tree': must be one of ${err.params.allowedValues.join(", ")}`, + ERROR_CATEGORY, + STATUS_ERRORS.NOT_FOUND, + `Unsupported message 'tree': must be one of ${params.allowedValues?.join(", ")}`, ); - } else { - return standardError; } + break; case "additionalProperties": return createErrorMessage( - "messageValidation", - 404, - `Unsupported property '${err.params.additionalProperty}' found`, + ERROR_CATEGORY, + STATUS_ERRORS.NOT_FOUND, + `Unsupported property '${params.additionalProperty}' found`, ); default: return createErrorMessage( - "messageValidation", - 400, - `Validation error on field '${err.instancePath}': ${err.message}.`, + ERROR_CATEGORY, + STATUS_ERRORS.BAD_REQUEST, + `Validation error on field '${instancePath}': ${err.message}.`, ); } + + return standardError; }); }; /** * Validates a JSON message against predefined schemas. * - * @param {string} message - The JSON message to be validated. - * @returns {Object|Error} - Returns the parsed message if valid, otherwise throws an error. + * @param message - The JSON message to be validated. + * @returns The parsed message if valid, otherwise throws an error. */ -const validateMessage = (message) => { +export const validateMessage = (message: string): Message | Error => { try { // Try to parse the JSON message - const parsedMessage = JSON.parse(message); + const parsedMessage: Message = JSON.parse(message); // Determine the schema key based on the message type - let schemaKey; + let schemaKey: keyof typeof schemas; switch (parsedMessage.type) { case "read": schemaKey = parsedMessage.nodes ? "multiNodeRead" : "read"; @@ -184,7 +203,7 @@ const validateMessage = (message) => { const error = JSON.stringify([ createErrorMessage( "messageValidation", - 404, + STATUS_ERRORS.NOT_FOUND, `Unsupported message type (${parsedMessage.type})`, ), ]); @@ -199,25 +218,21 @@ const validateMessage = (message) => { throw new Error(JSON.stringify(customError)); } return parsedMessage; - } catch (error) { + } catch (error: unknown) { if (error instanceof SyntaxError) { // Handle JSON parsing error - - const error = JSON.stringify([ + const jsonError = JSON.stringify([ createErrorMessage( "messageValidation", - 404, + STATUS_ERRORS.NOT_FOUND, "The JSON format in the message is not valid.", ), ]); - return new Error(error); + return new Error(jsonError); } else { // Handle other errors - return new Error(error.message); + const errMsg = error instanceof Error ? error.message : "Unknown error"; + return new Error(errMsg); } } }; - -module.exports = { - validateMessage, -}; diff --git a/cdsp/information-layer/tsconfig.json b/cdsp/information-layer/tsconfig.json new file mode 100644 index 0000000..6a50823 --- /dev/null +++ b/cdsp/information-layer/tsconfig.json @@ -0,0 +1,115 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + "incremental": true /* Save .tsbuildinfo files to allow for incremental compilation of projects. */, + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + + /* Language and Environment */ + "target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "jsx": "preserve", /* Specify what JSX code is generated. */ + // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ + // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ + // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "commonjs" /* Specify what module code is generated. */, + "rootDir": "." /* Specify the root folder within your source files. */, + "moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */, + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ + // "types": [], /* Specify type package names to be included without being referenced in a source file. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ + // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ + // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ + // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ + // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ + // "noUncheckedSideEffectImports": true, /* Check side effect imports. */ + // "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ + + /* JavaScript Support */ + "allowJs": true /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */, + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* Emit */ + // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + // "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + "sourceMap": true /* Create source map files for emitted JavaScript files. */, + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ + "outDir": "./dist" /* Specify an output folder for all emitted files. */, + // "removeComments": true, /* Disable emitting comments. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ + // "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */, + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, + + /* Type Checking */ + "strict": true /* Enable all strict type-checking options. */, + "noImplicitAny": true /* Enable error reporting for expressions and declarations with an implied 'any' type. */, + "strictNullChecks": true /* When type checking, take into account 'null' and 'undefined'. */, + "strictFunctionTypes": true /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ + // "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */ + // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ + // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + + /* Completeness */ + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ + // "skipLibCheck": true /* Skip type checking all .d.ts files. */ + }, + "include": [ + "./**/*.ts", + "./handlers/src/iotdb/gen-nodejs/**/*.js" // Ensure JS files in gen-nodejs are included + ], + "exclude": ["./dist", "node_modules"] +} diff --git a/cdsp/information-layer/utils/error-message-helper.js b/cdsp/information-layer/utils/error-message-helper.js deleted file mode 100644 index 9c0252b..0000000 --- a/cdsp/information-layer/utils/error-message-helper.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Creates an error message object. - * @param {string} type - The type of the error. - * @param {number} errorCode - The error code associated with the error. - * @param {string|Object} error - A descriptive error message. - * @returns {Object} An object containing the error details. - */ -function createErrorMessage(type, errorCode, error) { - return { type: `${type}:status`, errorCode, error }; -} - -module.exports = { createErrorMessage }; diff --git a/cdsp/information-layer/utils/error-message-helper.ts b/cdsp/information-layer/utils/error-message-helper.ts new file mode 100644 index 0000000..48d6218 --- /dev/null +++ b/cdsp/information-layer/utils/error-message-helper.ts @@ -0,0 +1,19 @@ +import { ErrorMessage } from "../handlers/utils/data_types"; + +/** + * Creates an error message object with the specified category, status code, and message. + * + * @param category - The category of the error. + * @param statusCode - The HTTP status code associated with the error. + * @param message - A descriptive message explaining the error. + * @returns An ErrorMessage object containing the category, status code, and message. + */ +export const createErrorMessage = ( + category: string, + statusCode: number, + message: string, +): ErrorMessage => ({ + category, + statusCode, + message, +}); diff --git a/cdsp/information-layer/utils/logger.js b/cdsp/information-layer/utils/logger.js deleted file mode 100644 index 8b0f957..0000000 --- a/cdsp/information-layer/utils/logger.js +++ /dev/null @@ -1,51 +0,0 @@ -const COLORS = { - RESET: "\x1b[0m", - GREEN: "\x1b[32m", - BLUE: "\x1b[34m", - RED: "\x1b[31m", - PALE_WHITE: "\x1b[37m", - GREY: "\x1b[90m", - YELLOW: "\x1b[33m", - BOLD: "\x1b[1m", -}; - -const MessageType = { - RECEIVED: COLORS.GREEN, - SENT: COLORS.BLUE, - ERROR: COLORS.RED, - OTHER: COLORS, -}; - -function logWithColor(message, color) { - console.log("\n", color, message, COLORS.RESET); -} - -function logMessage(featureStr, type, label = "") { - let color = type; - const datetimeNow = new Date().toLocaleString(); - let labelText; - switch (type) { - case MessageType.RECEIVED: - labelText = "\u2193 ".concat(label || "Client Received"); - break; - case MessageType.SENT: - labelText = "\u2191 ".concat(label || "Client Sent"); - break; - case MessageType.ERROR: - labelText = "\u2716".concat(label || "Internal Error"); - break; - default: - if (Object.values(MessageType.OTHER).includes(type)) { - labelText = label || "Message"; - } else { - color = COLORS.RESET; - labelText = label || "777"; - } - break; - } - const logEntry = `\n${COLORS.PALE_WHITE}${datetimeNow}${COLORS.RESET} ${color}${labelText}${COLORS.RESET}`; - console.log(logEntry); - console.log(featureStr); -} - -module.exports = { logMessage, logWithColor, MessageType, COLORS }; diff --git a/cdsp/information-layer/utils/logger.ts b/cdsp/information-layer/utils/logger.ts new file mode 100644 index 0000000..da127d0 --- /dev/null +++ b/cdsp/information-layer/utils/logger.ts @@ -0,0 +1,104 @@ +// Define COLORS as an enum +export enum COLORS { + RESET = "\x1b[0m", + GREEN = "\x1b[32m", + BLUE = "\x1b[34m", + RED = "\x1b[31m", + PALE_WHITE = "\x1b[37m", + GREY = "\x1b[90m", + YELLOW = "\x1b[33m", + BOLD = "\x1b[1m", +} + +// Define the MessageType enum to strictly enforce allowed types +export enum MessageType { + RECEIVED = "RECEIVED", + SENT = "SENT", + ERROR = "ERROR", + WARNING = "WARNING", + OTHER = "OTHER", +} + +// Mapping MessageType to their corresponding colors +const MessageTypeColors: Record = { + [MessageType.RECEIVED]: COLORS.GREEN, + [MessageType.SENT]: COLORS.BLUE, + [MessageType.ERROR]: COLORS.RED, + [MessageType.WARNING]: COLORS.YELLOW, + [MessageType.OTHER]: COLORS.PALE_WHITE, +}; + +/** + * Logs a message to the console with a specified color. + * + * @param message - The message to be logged. + * @param color - The color to apply to the message. Should be a value from the COLORS enum. + */ +export function logWithColor(message: string, color: COLORS): void { + console.log("\n", color, message, COLORS.RESET); +} + +/** + * Logs a message with a specific format including a timestamp, message type, and label. + * + * @param featureStr - The main message string to be logged. + * @param type - The type of the message, which determines the label and color. Defaults to MessageType.OTHER. + * @param label - An optional label to override the default label for the message type. + */ +export function logMessage( + featureStr: string, + type: MessageType = MessageType.OTHER, + label: string = "" +): void { + let color: COLORS = MessageTypeColors[type]; + const dateTimeNow = new Date().toLocaleString(); + let labelText: string; + + switch (type) { + case MessageType.RECEIVED: + labelText = "\u2193 ".concat(label || "Client Received"); + break; + case MessageType.SENT: + labelText = "\u2191 ".concat(label || "Client Sent"); + break; + case MessageType.ERROR: + labelText = "\u2716 ".concat(label || "Internal Error"); + break; + case MessageType.OTHER: + labelText = label || "Message"; + color = COLORS.RESET; + break; + default: + labelText = label || "Unknown"; + color = COLORS.RESET; + } + + const logEntry = `\n${COLORS.PALE_WHITE}${dateTimeNow}${COLORS.RESET} ${color}${labelText}${COLORS.RESET}`; + console.log(logEntry); + console.log(featureStr); +} + +/** + * Logs an error message with a specified feature string. + * + * @param featureStr - A string representing the feature or context where the error occurred. + * @param error - The error object or unknown error to be logged. + * If it's an instance of Error, its message will be logged. + * Otherwise, 'Unknown error' will be logged. + */ +export function logError(featureStr: string, error: Error | unknown): void { + const errMsg = featureStr + .concat(": ") + .concat(error instanceof Error ? error.message : "Unknown error"); + logMessage(errMsg, MessageType.ERROR); +} + +/** + * Logs an error message with a specified error message type. + * + * @param errMsg - The error message to be logged. + * @returns void + */ +export function logErrorStr(errMsg: string): void { + logMessage(errMsg, MessageType.ERROR); +} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..51b9d45 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "covesa.cdsp", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} From c936c4b14146e87299e4eec11168f446618d4ecb Mon Sep 17 00:00:00 2001 From: Christian Muehlbauer Date: Mon, 21 Oct 2024 15:36:35 +0200 Subject: [PATCH 39/48] add hello world kl usecase readme Signed-off-by: Christian Muehlbauer --- .../KL-example-readme-graphic.png | Bin 0 -> 674824 bytes examples/knowledgelayer-hello-world/README.md | 65 ++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 examples/knowledgelayer-hello-world/KL-example-readme-graphic.png create mode 100644 examples/knowledgelayer-hello-world/README.md diff --git a/examples/knowledgelayer-hello-world/KL-example-readme-graphic.png b/examples/knowledgelayer-hello-world/KL-example-readme-graphic.png new file mode 100644 index 0000000000000000000000000000000000000000..3222fe02700f47f0770e44726d1e8036a850c919 GIT binary patch literal 674824 zcmeFabySpV_XdmzQX&Wbh~A5L>c-Hed=>6pM!8y4Qu)MER177OKnLYfA#(Bc2iLFyeHE`cJ!L>{uU0SA zhY;R)Qe!*iu>EOxmO=70dNE=iyM{uA z^O;Z|ODLdKf(J`KdSHO#N+UKp@ogdGXPGx5H5FYomXe@TmGEWsO&op{~D1k?f2YcI7ksC--u z)aOY|w{J&v+PgcvKdTK1_{4P0U-AgL?KJ^ib(h{tii1yjLu90^#0_E!j5c!*;Z>e3 zp5425q-;s@Gly&CD?jOl&M;+BOJck^a8&Z7+S~0^kg~e8E!y3BNvfOWjy%V z3qs=lwyh`)vic=^$a+-9%TxYx%hddphWnk zrr;$Yn~DlnqU8Io@sY*t0?h}07F1E(E4S}olSJ)%wo8HEhWYM3Qz+pz zB!7`F3JeiQTeq%8T(tJXOu6?Sg%4Rp)HEfqmvf1007LNErMIk0oVys}AE{z6bDE9{ zd1V4_77CMGVh+Ins$$2LfVJrxIOA|YrH!WdbhB}?@P_vV`FBVUG1Fi4-HUyfQhHbO~cu?efjk=d2%j3}RyL$RL|=(%>jP%le@GVd8_6;d9o_LiOC+Lr9h( zux4??@IuR?@uGmjvJo09S{HQwmrXOub~HSu+7z$-J3cJTT=^*;T6@_#!B@Z4l21z4Pqg*5FJ<1s}{TLRp2udQ{#FzS? zsA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!kZ)GdGAxutX#xf`puR zZH@bi@Ci`_*o%tadF^E<*1LjCcBdTnH3SdJ@hmm2|70Beh%H)PDFQnkm!()kDwW80s<2dDS z<~;4)xakZ(niYhC-EwLTZxe@S{3iwlBK$H|K>iOb?jtL$Z@!(Dv$b8|-)xhR`cv&T zJ344XBD4~G_-~Yuhmq|Ti{xRY`nO>rCbB|%!rZy@HWB4?U?mLxw|iDeMtmK#^H!z2 zY&@%mv1%AUpzNw){0_2L5#xslxr!L8h_Q+oe@eLVl37KJRmAvh(!XjLtA?>^82_rA z|Ic%b%$J*j*Q}xLyL9ff>~DkHKk)u%hW^jVUnTiJ>E|CeuVVBnMz3P@&ye=3%dCRj zY9097xU*^)tA?>^7{3DMPiIzhjMW@tHOE-ZF@ErZpYY*V$*dyA53*X#F;;Vo)f{6L zF_yjHSHS%F%qn6m%W5^0tcH@+If Vehicle.Chassis.SteeringWheel.Angle changes by more than 90 degrees in less than 3 seconds and Vehicle.Speed is greater than 50 km/h, then flag as aggressive driving. + +Derived output data: +- `Vehicle.drivingStyle`: True, when driving style is aggressive, otherwise false + +## Installation and Running + +To be determined (TBD). + +--- + +Feel free to explore the components and rules used in this "Hello World" example to understand the basic implementation of the Knowledge Layer. You can extend this use case to more complex scenarios and even adapt it to different domains. From cd64ada5bd1dd8b00cb355ce788463ff510cd069 Mon Sep 17 00:00:00 2001 From: "Andre Wendel (Q290938)" Date: Wed, 23 Oct 2024 10:46:24 +0200 Subject: [PATCH 40/48] IMplementation of Thrift to access IoTDB without TypeScript; JavaScript backport, because of compatibility issues withiin TS; Signed-off-by: Andre Wendel --- cdsp/information-layer/Dockerfile | 10 +- .../iotdb/gen-nodejs/IClientRPCService.d.ts | 33 - .../src/iotdb/gen-nodejs/IClientRPCService.js | 12904 +++++++++++++++- .../iotdb/gen-nodejs/IClientRPCService.thrift | 65 - .../gen-nodejs/IClientRPCService_types.d.ts | 110 - .../gen-nodejs/IClientRPCService_types.js | 829 - .../src/iotdb/gen-nodejs/client_types.js | 8072 ++++++++++ .../src/iotdb/gen-nodejs/common_types.js | 2879 ++++ .../handlers/src/iotdb/src/IoTDBHandler.ts | 243 +- .../handlers/src/iotdb/utils/Int64.ts | 44 - .../src/iotdb/utils/IoTDBRpcDataSet.ts | 29 +- .../src/iotdb/utils/SessionDataSet.ts | 23 +- cdsp/information-layer/package-lock.json | 14 +- cdsp/information-layer/package.json | 4 +- 14 files changed, 23588 insertions(+), 1671 deletions(-) delete mode 100644 cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService.d.ts delete mode 100644 cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService.thrift delete mode 100644 cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService_types.d.ts delete mode 100644 cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService_types.js create mode 100644 cdsp/information-layer/handlers/src/iotdb/gen-nodejs/client_types.js create mode 100644 cdsp/information-layer/handlers/src/iotdb/gen-nodejs/common_types.js delete mode 100644 cdsp/information-layer/handlers/src/iotdb/utils/Int64.ts diff --git a/cdsp/information-layer/Dockerfile b/cdsp/information-layer/Dockerfile index 349690d..495eebc 100644 --- a/cdsp/information-layer/Dockerfile +++ b/cdsp/information-layer/Dockerfile @@ -8,10 +8,16 @@ COPY utils ./utils COPY router ./router # Install dependencies, including workspaces -RUN npm install --production +RUN npm install + +# Transpile TypeScript to JavaScript +RUN npm run build + +# Remove devDependencies to reduce the final image size +RUN npm prune --omit=dev # Expose the necessary port EXPOSE 8080 # Command to run the WebSocket server -CMD ["node", "router/src/websocket-server.js"] +CMD ["node", "./dist/router/src/websocket-server.js"] \ No newline at end of file diff --git a/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService.d.ts b/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService.d.ts deleted file mode 100644 index d8d786a..0000000 --- a/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import * as IClientRPCService from './IClientRPCService_types'; -import { - TSOpenSessionReq, - TSOpenSessionResp, - TSCloseSessionReq, - TSExecuteStatementReq, - TSExecuteStatementResp, - TSInsertRecordReq, -} from './IClientRPCService_types'; -type Callback = (err: E, resp: T) => void; - -interface Int64 { - constructor(o?: number | string): this; - toString(): string; - toJson(): string; -} - -export class Client { - openSession(req: TSOpenSessionReq, callback: Callback): void; - openSession(req: TSOpenSessionReq): Promise; - - closeSession(req: TSCloseSessionReq, callback: Callback): void; - closeSession(req: TSCloseSessionReq): Promise; - - executeQueryStatement(req: TSExecuteStatementReq, callback: Callback): void; - executeQueryStatement(req: TSExecuteStatementReq): Promise; - - requestStatementId(sessionId: Int64, callback: Callback): void; - requestStatementId(sessionId: Int64): Promise; - - insertRecord(req: TSInsertRecordReq, callback: Callback): void; - insertRecord(req: TSInsertRecordReq): Promise; -} diff --git a/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService.js b/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService.js index 86724e1..f52bef2 100644 --- a/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService.js +++ b/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService.js @@ -1,5 +1,5 @@ // -// Autogenerated by Thrift Compiler (0.22.0) +// Autogenerated by Thrift Compiler (0.14.1) // // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING // @@ -10,20 +10,22 @@ var Thrift = thrift.Thrift; var Q = thrift.Q; var Int64 = require('node-int64'); +var common_ttypes = require('./common_types'); -var ttypes = require('./IClientRPCService_types'); + +var ttypes = require('./client_types'); //HELPER FUNCTIONS AND STRUCTURES -var IClientRPCService_openSession_args = function(args) { +var IClientRPCService_executeQueryStatementV2_args = function(args) { this.req = null; if (args) { if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSOpenSessionReq(args.req); + this.req = new ttypes.TSExecuteStatementReq(args.req); } } }; -IClientRPCService_openSession_args.prototype = {}; -IClientRPCService_openSession_args.prototype[Symbol.for("read")] = function(input) { +IClientRPCService_executeQueryStatementV2_args.prototype = {}; +IClientRPCService_executeQueryStatementV2_args.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); @@ -35,8 +37,8 @@ IClientRPCService_openSession_args.prototype[Symbol.for("read")] = function(inpu switch (fid) { case 1: if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSOpenSessionReq(); - this.req[Symbol.for("read")](input); + this.req = new ttypes.TSExecuteStatementReq(); + this.req.read(input); } else { input.skip(ftype); } @@ -53,11 +55,11 @@ IClientRPCService_openSession_args.prototype[Symbol.for("read")] = function(inpu return; }; -IClientRPCService_openSession_args.prototype[Symbol.for("write")] = function(output) { - output.writeStructBegin('IClientRPCService_openSession_args'); +IClientRPCService_executeQueryStatementV2_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeQueryStatementV2_args'); if (this.req !== null && this.req !== undefined) { output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req[Symbol.for("write")](output); + this.req.write(output); output.writeFieldEnd(); } output.writeFieldStop(); @@ -65,16 +67,16 @@ IClientRPCService_openSession_args.prototype[Symbol.for("write")] = function(out return; }; -var IClientRPCService_openSession_result = function(args) { +var IClientRPCService_executeQueryStatementV2_result = function(args) { this.success = null; if (args) { if (args.success !== undefined && args.success !== null) { - this.success = new ttypes.TSOpenSessionResp(args.success); + this.success = new ttypes.TSExecuteStatementResp(args.success); } } }; -IClientRPCService_openSession_result.prototype = {}; -IClientRPCService_openSession_result.prototype[Symbol.for("read")] = function(input) { +IClientRPCService_executeQueryStatementV2_result.prototype = {}; +IClientRPCService_executeQueryStatementV2_result.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); @@ -86,8 +88,8 @@ IClientRPCService_openSession_result.prototype[Symbol.for("read")] = function(in switch (fid) { case 0: if (ftype == Thrift.Type.STRUCT) { - this.success = new ttypes.TSOpenSessionResp(); - this.success[Symbol.for("read")](input); + this.success = new ttypes.TSExecuteStatementResp(); + this.success.read(input); } else { input.skip(ftype); } @@ -104,11 +106,11 @@ IClientRPCService_openSession_result.prototype[Symbol.for("read")] = function(in return; }; -IClientRPCService_openSession_result.prototype[Symbol.for("write")] = function(output) { - output.writeStructBegin('IClientRPCService_openSession_result'); +IClientRPCService_executeQueryStatementV2_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeQueryStatementV2_result'); if (this.success !== null && this.success !== undefined) { output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success[Symbol.for("write")](output); + this.success.write(output); output.writeFieldEnd(); } output.writeFieldStop(); @@ -116,16 +118,16 @@ IClientRPCService_openSession_result.prototype[Symbol.for("write")] = function(o return; }; -var IClientRPCService_closeSession_args = function(args) { +var IClientRPCService_executeUpdateStatementV2_args = function(args) { this.req = null; if (args) { if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSCloseSessionReq(args.req); + this.req = new ttypes.TSExecuteStatementReq(args.req); } } }; -IClientRPCService_closeSession_args.prototype = {}; -IClientRPCService_closeSession_args.prototype[Symbol.for("read")] = function(input) { +IClientRPCService_executeUpdateStatementV2_args.prototype = {}; +IClientRPCService_executeUpdateStatementV2_args.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); @@ -137,8 +139,8 @@ IClientRPCService_closeSession_args.prototype[Symbol.for("read")] = function(inp switch (fid) { case 1: if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSCloseSessionReq(); - this.req[Symbol.for("read")](input); + this.req = new ttypes.TSExecuteStatementReq(); + this.req.read(input); } else { input.skip(ftype); } @@ -155,11 +157,11 @@ IClientRPCService_closeSession_args.prototype[Symbol.for("read")] = function(inp return; }; -IClientRPCService_closeSession_args.prototype[Symbol.for("write")] = function(output) { - output.writeStructBegin('IClientRPCService_closeSession_args'); +IClientRPCService_executeUpdateStatementV2_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeUpdateStatementV2_args'); if (this.req !== null && this.req !== undefined) { output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req[Symbol.for("write")](output); + this.req.write(output); output.writeFieldEnd(); } output.writeFieldStop(); @@ -167,32 +169,58 @@ IClientRPCService_closeSession_args.prototype[Symbol.for("write")] = function(ou return; }; -var IClientRPCService_closeSession_result = function(args) { +var IClientRPCService_executeUpdateStatementV2_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSExecuteStatementResp(args.success); + } + } }; -IClientRPCService_closeSession_result.prototype = {}; -IClientRPCService_closeSession_result.prototype[Symbol.for("read")] = function(input) { +IClientRPCService_executeUpdateStatementV2_result.prototype = {}; +IClientRPCService_executeUpdateStatementV2_result.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var ftype = ret.ftype; + var fid = ret.fid; if (ftype == Thrift.Type.STOP) { break; } - input.skip(ftype); + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSExecuteStatementResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } input.readFieldEnd(); } input.readStructEnd(); return; }; -IClientRPCService_closeSession_result.prototype[Symbol.for("write")] = function(output) { - output.writeStructBegin('IClientRPCService_closeSession_result'); +IClientRPCService_executeUpdateStatementV2_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeUpdateStatementV2_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } output.writeFieldStop(); output.writeStructEnd(); return; }; -var IClientRPCService_executeQueryStatement_args = function(args) { +var IClientRPCService_executeStatementV2_args = function(args) { this.req = null; if (args) { if (args.req !== undefined && args.req !== null) { @@ -200,8 +228,8 @@ var IClientRPCService_executeQueryStatement_args = function(args) { } } }; -IClientRPCService_executeQueryStatement_args.prototype = {}; -IClientRPCService_executeQueryStatement_args.prototype[Symbol.for("read")] = function(input) { +IClientRPCService_executeStatementV2_args.prototype = {}; +IClientRPCService_executeStatementV2_args.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); @@ -214,7 +242,7 @@ IClientRPCService_executeQueryStatement_args.prototype[Symbol.for("read")] = fun case 1: if (ftype == Thrift.Type.STRUCT) { this.req = new ttypes.TSExecuteStatementReq(); - this.req[Symbol.for("read")](input); + this.req.read(input); } else { input.skip(ftype); } @@ -231,11 +259,11 @@ IClientRPCService_executeQueryStatement_args.prototype[Symbol.for("read")] = fun return; }; -IClientRPCService_executeQueryStatement_args.prototype[Symbol.for("write")] = function(output) { - output.writeStructBegin('IClientRPCService_executeQueryStatement_args'); +IClientRPCService_executeStatementV2_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeStatementV2_args'); if (this.req !== null && this.req !== undefined) { output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req[Symbol.for("write")](output); + this.req.write(output); output.writeFieldEnd(); } output.writeFieldStop(); @@ -243,7 +271,7 @@ IClientRPCService_executeQueryStatement_args.prototype[Symbol.for("write")] = fu return; }; -var IClientRPCService_executeQueryStatement_result = function(args) { +var IClientRPCService_executeStatementV2_result = function(args) { this.success = null; if (args) { if (args.success !== undefined && args.success !== null) { @@ -251,8 +279,8 @@ var IClientRPCService_executeQueryStatement_result = function(args) { } } }; -IClientRPCService_executeQueryStatement_result.prototype = {}; -IClientRPCService_executeQueryStatement_result.prototype[Symbol.for("read")] = function(input) { +IClientRPCService_executeStatementV2_result.prototype = {}; +IClientRPCService_executeStatementV2_result.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); @@ -265,7 +293,7 @@ IClientRPCService_executeQueryStatement_result.prototype[Symbol.for("read")] = f case 0: if (ftype == Thrift.Type.STRUCT) { this.success = new ttypes.TSExecuteStatementResp(); - this.success[Symbol.for("read")](input); + this.success.read(input); } else { input.skip(ftype); } @@ -282,11 +310,11 @@ IClientRPCService_executeQueryStatement_result.prototype[Symbol.for("read")] = f return; }; -IClientRPCService_executeQueryStatement_result.prototype[Symbol.for("write")] = function(output) { - output.writeStructBegin('IClientRPCService_executeQueryStatement_result'); +IClientRPCService_executeStatementV2_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeStatementV2_result'); if (this.success !== null && this.success !== undefined) { output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); - this.success[Symbol.for("write")](output); + this.success.write(output); output.writeFieldEnd(); } output.writeFieldStop(); @@ -294,16 +322,16 @@ IClientRPCService_executeQueryStatement_result.prototype[Symbol.for("write")] = return; }; -var IClientRPCService_requestStatementId_args = function(args) { - this.sessionId = null; +var IClientRPCService_executeRawDataQueryV2_args = function(args) { + this.req = null; if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSRawDataQueryReq(args.req); } } }; -IClientRPCService_requestStatementId_args.prototype = {}; -IClientRPCService_requestStatementId_args.prototype[Symbol.for("read")] = function(input) { +IClientRPCService_executeRawDataQueryV2_args.prototype = {}; +IClientRPCService_executeRawDataQueryV2_args.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); @@ -314,8 +342,9 @@ IClientRPCService_requestStatementId_args.prototype[Symbol.for("read")] = functi } switch (fid) { case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSRawDataQueryReq(); + this.req.read(input); } else { input.skip(ftype); } @@ -332,11 +361,11 @@ IClientRPCService_requestStatementId_args.prototype[Symbol.for("read")] = functi return; }; -IClientRPCService_requestStatementId_args.prototype[Symbol.for("write")] = function(output) { - output.writeStructBegin('IClientRPCService_requestStatementId_args'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); +IClientRPCService_executeRawDataQueryV2_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeRawDataQueryV2_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); output.writeFieldEnd(); } output.writeFieldStop(); @@ -344,16 +373,16 @@ IClientRPCService_requestStatementId_args.prototype[Symbol.for("write")] = funct return; }; -var IClientRPCService_requestStatementId_result = function(args) { +var IClientRPCService_executeRawDataQueryV2_result = function(args) { this.success = null; if (args) { if (args.success !== undefined && args.success !== null) { - this.success = args.success; + this.success = new ttypes.TSExecuteStatementResp(args.success); } } }; -IClientRPCService_requestStatementId_result.prototype = {}; -IClientRPCService_requestStatementId_result.prototype[Symbol.for("read")] = function(input) { +IClientRPCService_executeRawDataQueryV2_result.prototype = {}; +IClientRPCService_executeRawDataQueryV2_result.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); @@ -364,8 +393,9 @@ IClientRPCService_requestStatementId_result.prototype[Symbol.for("read")] = func } switch (fid) { case 0: - if (ftype == Thrift.Type.I64) { - this.success = input.readI64(); + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSExecuteStatementResp(); + this.success.read(input); } else { input.skip(ftype); } @@ -382,11 +412,11 @@ IClientRPCService_requestStatementId_result.prototype[Symbol.for("read")] = func return; }; -IClientRPCService_requestStatementId_result.prototype[Symbol.for("write")] = function(output) { - output.writeStructBegin('IClientRPCService_requestStatementId_result'); +IClientRPCService_executeRawDataQueryV2_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeRawDataQueryV2_result'); if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.I64, 0); - output.writeI64(this.success); + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); output.writeFieldEnd(); } output.writeFieldStop(); @@ -394,16 +424,16 @@ IClientRPCService_requestStatementId_result.prototype[Symbol.for("write")] = fun return; }; -var IClientRPCService_insertRecord_args = function(args) { +var IClientRPCService_executeLastDataQueryV2_args = function(args) { this.req = null; if (args) { if (args.req !== undefined && args.req !== null) { - this.req = new ttypes.TSInsertRecordReq(args.req); + this.req = new ttypes.TSLastDataQueryReq(args.req); } } }; -IClientRPCService_insertRecord_args.prototype = {}; -IClientRPCService_insertRecord_args.prototype[Symbol.for("read")] = function(input) { +IClientRPCService_executeLastDataQueryV2_args.prototype = {}; +IClientRPCService_executeLastDataQueryV2_args.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); @@ -415,8 +445,8 @@ IClientRPCService_insertRecord_args.prototype[Symbol.for("read")] = function(inp switch (fid) { case 1: if (ftype == Thrift.Type.STRUCT) { - this.req = new ttypes.TSInsertRecordReq(); - this.req[Symbol.for("read")](input); + this.req = new ttypes.TSLastDataQueryReq(); + this.req.read(input); } else { input.skip(ftype); } @@ -433,11 +463,11 @@ IClientRPCService_insertRecord_args.prototype[Symbol.for("read")] = function(inp return; }; -IClientRPCService_insertRecord_args.prototype[Symbol.for("write")] = function(output) { - output.writeStructBegin('IClientRPCService_insertRecord_args'); +IClientRPCService_executeLastDataQueryV2_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeLastDataQueryV2_args'); if (this.req !== null && this.req !== undefined) { output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); - this.req[Symbol.for("write")](output); + this.req.write(output); output.writeFieldEnd(); } output.writeFieldStop(); @@ -445,16 +475,16 @@ IClientRPCService_insertRecord_args.prototype[Symbol.for("write")] = function(ou return; }; -var IClientRPCService_insertRecord_result = function(args) { +var IClientRPCService_executeLastDataQueryV2_result = function(args) { this.success = null; if (args) { if (args.success !== undefined && args.success !== null) { - this.success = args.success; + this.success = new ttypes.TSExecuteStatementResp(args.success); } } }; -IClientRPCService_insertRecord_result.prototype = {}; -IClientRPCService_insertRecord_result.prototype[Symbol.for("read")] = function(input) { +IClientRPCService_executeLastDataQueryV2_result.prototype = {}; +IClientRPCService_executeLastDataQueryV2_result.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); @@ -465,8 +495,9 @@ IClientRPCService_insertRecord_result.prototype[Symbol.for("read")] = function(i } switch (fid) { case 0: - if (ftype == Thrift.Type.I32) { - this.success = input.readI32(); + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSExecuteStatementResp(); + this.success.read(input); } else { input.skip(ftype); } @@ -483,11 +514,11 @@ IClientRPCService_insertRecord_result.prototype[Symbol.for("read")] = function(i return; }; -IClientRPCService_insertRecord_result.prototype[Symbol.for("write")] = function(output) { - output.writeStructBegin('IClientRPCService_insertRecord_result'); +IClientRPCService_executeLastDataQueryV2_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeLastDataQueryV2_result'); if (this.success !== null && this.success !== undefined) { - output.writeFieldBegin('success', Thrift.Type.I32, 0); - output.writeI32(this.success); + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); output.writeFieldEnd(); } output.writeFieldStop(); @@ -495,506 +526,12519 @@ IClientRPCService_insertRecord_result.prototype[Symbol.for("write")] = function( return; }; -var IClientRPCServiceClient = exports.Client = function(output, pClass) { - this.output = output; - this.pClass = pClass; - this._seqid = 0; - this._reqs = {}; +var IClientRPCService_executeFastLastDataQueryForOneDeviceV2_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSFastLastDataQueryForOneDeviceReq(args.req); + } + } }; -IClientRPCServiceClient.prototype = {}; -IClientRPCServiceClient.prototype.seqid = function() { return this._seqid; }; -IClientRPCServiceClient.prototype.new_seqid = function() { return this._seqid += 1; }; - -IClientRPCServiceClient.prototype.openSession = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); +IClientRPCService_executeFastLastDataQueryForOneDeviceV2_args.prototype = {}; +IClientRPCService_executeFastLastDataQueryForOneDeviceV2_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSFastLastDataQueryForOneDeviceReq(); + this.req.read(input); } else { - _defer.resolve(result); + input.skip(ftype); } - }; - this.send_openSession(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_openSession(req); - } -}; - -IClientRPCServiceClient.prototype.send_openSession = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_openSession_args(params); - try { - output.writeMessageBegin('openSession', Thrift.MessageType.CALL, this.seqid()); - args[Symbol.for("write")](output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); } - throw e; + input.readFieldEnd(); } + input.readStructEnd(); + return; }; -IClientRPCServiceClient.prototype.recv_openSession = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x[Symbol.for("read")](input); - input.readMessageEnd(); - return callback(x); +IClientRPCService_executeFastLastDataQueryForOneDeviceV2_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeFastLastDataQueryForOneDeviceV2_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); } - var result = new IClientRPCService_openSession_result(); - result[Symbol.for("read")](input); - input.readMessageEnd(); + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; - if (null !== result.success) { - return callback(null, result.success); +var IClientRPCService_executeFastLastDataQueryForOneDeviceV2_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSExecuteStatementResp(args.success); + } } - return callback('openSession failed: unknown result'); }; - -IClientRPCServiceClient.prototype.closeSession = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); +IClientRPCService_executeFastLastDataQueryForOneDeviceV2_result.prototype = {}; +IClientRPCService_executeFastLastDataQueryForOneDeviceV2_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSExecuteStatementResp(); + this.success.read(input); } else { - _defer.resolve(result); + input.skip(ftype); } - }; - this.send_closeSession(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_closeSession(req); + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); } + input.readStructEnd(); + return; }; -IClientRPCServiceClient.prototype.send_closeSession = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_closeSession_args(params); - try { - output.writeMessageBegin('closeSession', Thrift.MessageType.CALL, this.seqid()); - args[Symbol.for("write")](output); - output.writeMessageEnd(); - return this.output.flush(); +IClientRPCService_executeFastLastDataQueryForOneDeviceV2_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeFastLastDataQueryForOneDeviceV2_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeAggregationQueryV2_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSAggregationQueryReq(args.req); } - throw e; } }; - -IClientRPCServiceClient.prototype.recv_closeSession = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x[Symbol.for("read")](input); - input.readMessageEnd(); - return callback(x); +IClientRPCService_executeAggregationQueryV2_args.prototype = {}; +IClientRPCService_executeAggregationQueryV2_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSAggregationQueryReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); } - var result = new IClientRPCService_closeSession_result(); - result[Symbol.for("read")](input); - input.readMessageEnd(); + input.readStructEnd(); + return; +}; - callback(null); +IClientRPCService_executeAggregationQueryV2_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeAggregationQueryV2_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; }; -IClientRPCServiceClient.prototype.executeQueryStatement = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); +var IClientRPCService_executeAggregationQueryV2_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSExecuteStatementResp(args.success); + } + } +}; +IClientRPCService_executeAggregationQueryV2_result.prototype = {}; +IClientRPCService_executeAggregationQueryV2_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSExecuteStatementResp(); + this.success.read(input); } else { - _defer.resolve(result); + input.skip(ftype); } - }; - this.send_executeQueryStatement(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_executeQueryStatement(req); + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); } + input.readStructEnd(); + return; }; -IClientRPCServiceClient.prototype.send_executeQueryStatement = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_executeQueryStatement_args(params); - try { - output.writeMessageBegin('executeQueryStatement', Thrift.MessageType.CALL, this.seqid()); - args[Symbol.for("write")](output); - output.writeMessageEnd(); - return this.output.flush(); +IClientRPCService_executeAggregationQueryV2_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeAggregationQueryV2_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeGroupByQueryIntervalQuery_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSGroupByQueryIntervalReq(args.req); } - throw e; } }; +IClientRPCService_executeGroupByQueryIntervalQuery_args.prototype = {}; +IClientRPCService_executeGroupByQueryIntervalQuery_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSGroupByQueryIntervalReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; -IClientRPCServiceClient.prototype.recv_executeQueryStatement = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x[Symbol.for("read")](input); - input.readMessageEnd(); - return callback(x); +IClientRPCService_executeGroupByQueryIntervalQuery_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeGroupByQueryIntervalQuery_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); } - var result = new IClientRPCService_executeQueryStatement_result(); - result[Symbol.for("read")](input); - input.readMessageEnd(); + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; - if (null !== result.success) { - return callback(null, result.success); +var IClientRPCService_executeGroupByQueryIntervalQuery_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSExecuteStatementResp(args.success); + } } - return callback('executeQueryStatement failed: unknown result'); +}; +IClientRPCService_executeGroupByQueryIntervalQuery_result.prototype = {}; +IClientRPCService_executeGroupByQueryIntervalQuery_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSExecuteStatementResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; }; -IClientRPCServiceClient.prototype.requestStatementId = function(sessionId, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); +IClientRPCService_executeGroupByQueryIntervalQuery_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeGroupByQueryIntervalQuery_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_fetchResultsV2_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSFetchResultsReq(args.req); + } + } +}; +IClientRPCService_fetchResultsV2_args.prototype = {}; +IClientRPCService_fetchResultsV2_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSFetchResultsReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_fetchResultsV2_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_fetchResultsV2_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_fetchResultsV2_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSFetchResultsResp(args.success); + } + } +}; +IClientRPCService_fetchResultsV2_result.prototype = {}; +IClientRPCService_fetchResultsV2_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSFetchResultsResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_fetchResultsV2_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_fetchResultsV2_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_openSession_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSOpenSessionReq(args.req); + } + } +}; +IClientRPCService_openSession_args.prototype = {}; +IClientRPCService_openSession_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSOpenSessionReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_openSession_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_openSession_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_openSession_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSOpenSessionResp(args.success); + } + } +}; +IClientRPCService_openSession_result.prototype = {}; +IClientRPCService_openSession_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSOpenSessionResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_openSession_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_openSession_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_closeSession_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSCloseSessionReq(args.req); + } + } +}; +IClientRPCService_closeSession_args.prototype = {}; +IClientRPCService_closeSession_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSCloseSessionReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_closeSession_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_closeSession_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_closeSession_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_closeSession_result.prototype = {}; +IClientRPCService_closeSession_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_closeSession_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_closeSession_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeStatement_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSExecuteStatementReq(args.req); + } + } +}; +IClientRPCService_executeStatement_args.prototype = {}; +IClientRPCService_executeStatement_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSExecuteStatementReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeStatement_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeStatement_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeStatement_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSExecuteStatementResp(args.success); + } + } +}; +IClientRPCService_executeStatement_result.prototype = {}; +IClientRPCService_executeStatement_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSExecuteStatementResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeStatement_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeStatement_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeBatchStatement_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSExecuteBatchStatementReq(args.req); + } + } +}; +IClientRPCService_executeBatchStatement_args.prototype = {}; +IClientRPCService_executeBatchStatement_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSExecuteBatchStatementReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeBatchStatement_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeBatchStatement_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeBatchStatement_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_executeBatchStatement_result.prototype = {}; +IClientRPCService_executeBatchStatement_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeBatchStatement_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeBatchStatement_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeQueryStatement_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSExecuteStatementReq(args.req); + } + } +}; +IClientRPCService_executeQueryStatement_args.prototype = {}; +IClientRPCService_executeQueryStatement_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSExecuteStatementReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeQueryStatement_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeQueryStatement_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeQueryStatement_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSExecuteStatementResp(args.success); + } + } +}; +IClientRPCService_executeQueryStatement_result.prototype = {}; +IClientRPCService_executeQueryStatement_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSExecuteStatementResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeQueryStatement_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeQueryStatement_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeUpdateStatement_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSExecuteStatementReq(args.req); + } + } +}; +IClientRPCService_executeUpdateStatement_args.prototype = {}; +IClientRPCService_executeUpdateStatement_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSExecuteStatementReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeUpdateStatement_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeUpdateStatement_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeUpdateStatement_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSExecuteStatementResp(args.success); + } + } +}; +IClientRPCService_executeUpdateStatement_result.prototype = {}; +IClientRPCService_executeUpdateStatement_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSExecuteStatementResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeUpdateStatement_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeUpdateStatement_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_fetchResults_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSFetchResultsReq(args.req); + } + } +}; +IClientRPCService_fetchResults_args.prototype = {}; +IClientRPCService_fetchResults_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSFetchResultsReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_fetchResults_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_fetchResults_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_fetchResults_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSFetchResultsResp(args.success); + } + } +}; +IClientRPCService_fetchResults_result.prototype = {}; +IClientRPCService_fetchResults_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSFetchResultsResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_fetchResults_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_fetchResults_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_fetchMetadata_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSFetchMetadataReq(args.req); + } + } +}; +IClientRPCService_fetchMetadata_args.prototype = {}; +IClientRPCService_fetchMetadata_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSFetchMetadataReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_fetchMetadata_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_fetchMetadata_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_fetchMetadata_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSFetchMetadataResp(args.success); + } + } +}; +IClientRPCService_fetchMetadata_result.prototype = {}; +IClientRPCService_fetchMetadata_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSFetchMetadataResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_fetchMetadata_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_fetchMetadata_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_cancelOperation_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSCancelOperationReq(args.req); + } + } +}; +IClientRPCService_cancelOperation_args.prototype = {}; +IClientRPCService_cancelOperation_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSCancelOperationReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_cancelOperation_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_cancelOperation_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_cancelOperation_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_cancelOperation_result.prototype = {}; +IClientRPCService_cancelOperation_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_cancelOperation_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_cancelOperation_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_closeOperation_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSCloseOperationReq(args.req); + } + } +}; +IClientRPCService_closeOperation_args.prototype = {}; +IClientRPCService_closeOperation_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSCloseOperationReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_closeOperation_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_closeOperation_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_closeOperation_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_closeOperation_result.prototype = {}; +IClientRPCService_closeOperation_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_closeOperation_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_closeOperation_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_getTimeZone_args = function(args) { + this.sessionId = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } + } +}; +IClientRPCService_getTimeZone_args.prototype = {}; +IClientRPCService_getTimeZone_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_getTimeZone_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_getTimeZone_args'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_getTimeZone_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSGetTimeZoneResp(args.success); + } + } +}; +IClientRPCService_getTimeZone_result.prototype = {}; +IClientRPCService_getTimeZone_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSGetTimeZoneResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_getTimeZone_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_getTimeZone_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_setTimeZone_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSSetTimeZoneReq(args.req); + } + } +}; +IClientRPCService_setTimeZone_args.prototype = {}; +IClientRPCService_setTimeZone_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSSetTimeZoneReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_setTimeZone_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_setTimeZone_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_setTimeZone_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_setTimeZone_result.prototype = {}; +IClientRPCService_setTimeZone_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_setTimeZone_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_setTimeZone_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_getProperties_args = function(args) { +}; +IClientRPCService_getProperties_args.prototype = {}; +IClientRPCService_getProperties_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + if (ftype == Thrift.Type.STOP) { + break; + } + input.skip(ftype); + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_getProperties_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_getProperties_args'); + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_getProperties_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.ServerProperties(args.success); + } + } +}; +IClientRPCService_getProperties_result.prototype = {}; +IClientRPCService_getProperties_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.ServerProperties(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_getProperties_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_getProperties_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_setStorageGroup_args = function(args) { + this.sessionId = null; + this.storageGroup = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } + if (args.storageGroup !== undefined && args.storageGroup !== null) { + this.storageGroup = args.storageGroup; + } + } +}; +IClientRPCService_setStorageGroup_args.prototype = {}; +IClientRPCService_setStorageGroup_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.storageGroup = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_setStorageGroup_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_setStorageGroup_args'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.storageGroup !== null && this.storageGroup !== undefined) { + output.writeFieldBegin('storageGroup', Thrift.Type.STRING, 2); + output.writeString(this.storageGroup); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_setStorageGroup_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_setStorageGroup_result.prototype = {}; +IClientRPCService_setStorageGroup_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_setStorageGroup_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_setStorageGroup_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_createTimeseries_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSCreateTimeseriesReq(args.req); + } + } +}; +IClientRPCService_createTimeseries_args.prototype = {}; +IClientRPCService_createTimeseries_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSCreateTimeseriesReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_createTimeseries_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_createTimeseries_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_createTimeseries_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_createTimeseries_result.prototype = {}; +IClientRPCService_createTimeseries_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_createTimeseries_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_createTimeseries_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_createAlignedTimeseries_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSCreateAlignedTimeseriesReq(args.req); + } + } +}; +IClientRPCService_createAlignedTimeseries_args.prototype = {}; +IClientRPCService_createAlignedTimeseries_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSCreateAlignedTimeseriesReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_createAlignedTimeseries_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_createAlignedTimeseries_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_createAlignedTimeseries_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_createAlignedTimeseries_result.prototype = {}; +IClientRPCService_createAlignedTimeseries_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_createAlignedTimeseries_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_createAlignedTimeseries_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_createMultiTimeseries_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSCreateMultiTimeseriesReq(args.req); + } + } +}; +IClientRPCService_createMultiTimeseries_args.prototype = {}; +IClientRPCService_createMultiTimeseries_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSCreateMultiTimeseriesReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_createMultiTimeseries_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_createMultiTimeseries_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_createMultiTimeseries_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_createMultiTimeseries_result.prototype = {}; +IClientRPCService_createMultiTimeseries_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_createMultiTimeseries_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_createMultiTimeseries_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_deleteTimeseries_args = function(args) { + this.sessionId = null; + this.path = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } + if (args.path !== undefined && args.path !== null) { + this.path = Thrift.copyList(args.path, [null]); + } + } +}; +IClientRPCService_deleteTimeseries_args.prototype = {}; +IClientRPCService_deleteTimeseries_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.path = []; + var _rtmp3463 = input.readListBegin(); + var _size462 = _rtmp3463.size || 0; + for (var _i464 = 0; _i464 < _size462; ++_i464) { + var elem465 = null; + elem465 = input.readString(); + this.path.push(elem465); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_deleteTimeseries_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_deleteTimeseries_args'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.path !== null && this.path !== undefined) { + output.writeFieldBegin('path', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.path.length); + for (var iter466 in this.path) { + if (this.path.hasOwnProperty(iter466)) { + iter466 = this.path[iter466]; + output.writeString(iter466); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_deleteTimeseries_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_deleteTimeseries_result.prototype = {}; +IClientRPCService_deleteTimeseries_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_deleteTimeseries_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_deleteTimeseries_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_deleteStorageGroups_args = function(args) { + this.sessionId = null; + this.storageGroup = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } + if (args.storageGroup !== undefined && args.storageGroup !== null) { + this.storageGroup = Thrift.copyList(args.storageGroup, [null]); + } + } +}; +IClientRPCService_deleteStorageGroups_args.prototype = {}; +IClientRPCService_deleteStorageGroups_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.storageGroup = []; + var _rtmp3468 = input.readListBegin(); + var _size467 = _rtmp3468.size || 0; + for (var _i469 = 0; _i469 < _size467; ++_i469) { + var elem470 = null; + elem470 = input.readString(); + this.storageGroup.push(elem470); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_deleteStorageGroups_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_deleteStorageGroups_args'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.storageGroup !== null && this.storageGroup !== undefined) { + output.writeFieldBegin('storageGroup', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.storageGroup.length); + for (var iter471 in this.storageGroup) { + if (this.storageGroup.hasOwnProperty(iter471)) { + iter471 = this.storageGroup[iter471]; + output.writeString(iter471); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_deleteStorageGroups_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_deleteStorageGroups_result.prototype = {}; +IClientRPCService_deleteStorageGroups_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_deleteStorageGroups_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_deleteStorageGroups_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertRecord_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertRecordReq(args.req); + } + } +}; +IClientRPCService_insertRecord_args.prototype = {}; +IClientRPCService_insertRecord_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertRecordReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertRecord_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertRecord_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertRecord_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_insertRecord_result.prototype = {}; +IClientRPCService_insertRecord_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertRecord_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertRecord_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertStringRecord_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertStringRecordReq(args.req); + } + } +}; +IClientRPCService_insertStringRecord_args.prototype = {}; +IClientRPCService_insertStringRecord_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertStringRecordReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertStringRecord_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertStringRecord_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertStringRecord_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_insertStringRecord_result.prototype = {}; +IClientRPCService_insertStringRecord_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertStringRecord_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertStringRecord_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertTablet_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertTabletReq(args.req); + } + } +}; +IClientRPCService_insertTablet_args.prototype = {}; +IClientRPCService_insertTablet_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertTabletReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertTablet_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertTablet_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertTablet_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_insertTablet_result.prototype = {}; +IClientRPCService_insertTablet_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertTablet_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertTablet_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertTablets_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertTabletsReq(args.req); + } + } +}; +IClientRPCService_insertTablets_args.prototype = {}; +IClientRPCService_insertTablets_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertTabletsReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertTablets_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertTablets_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertTablets_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_insertTablets_result.prototype = {}; +IClientRPCService_insertTablets_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertTablets_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertTablets_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertRecords_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertRecordsReq(args.req); + } + } +}; +IClientRPCService_insertRecords_args.prototype = {}; +IClientRPCService_insertRecords_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertRecordsReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertRecords_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertRecords_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertRecords_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_insertRecords_result.prototype = {}; +IClientRPCService_insertRecords_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertRecords_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertRecords_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertRecordsOfOneDevice_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertRecordsOfOneDeviceReq(args.req); + } + } +}; +IClientRPCService_insertRecordsOfOneDevice_args.prototype = {}; +IClientRPCService_insertRecordsOfOneDevice_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertRecordsOfOneDeviceReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertRecordsOfOneDevice_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertRecordsOfOneDevice_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertRecordsOfOneDevice_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_insertRecordsOfOneDevice_result.prototype = {}; +IClientRPCService_insertRecordsOfOneDevice_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertRecordsOfOneDevice_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertRecordsOfOneDevice_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertStringRecordsOfOneDevice_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertStringRecordsOfOneDeviceReq(args.req); + } + } +}; +IClientRPCService_insertStringRecordsOfOneDevice_args.prototype = {}; +IClientRPCService_insertStringRecordsOfOneDevice_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertStringRecordsOfOneDeviceReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertStringRecordsOfOneDevice_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertStringRecordsOfOneDevice_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertStringRecordsOfOneDevice_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_insertStringRecordsOfOneDevice_result.prototype = {}; +IClientRPCService_insertStringRecordsOfOneDevice_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertStringRecordsOfOneDevice_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertStringRecordsOfOneDevice_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertStringRecords_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertStringRecordsReq(args.req); + } + } +}; +IClientRPCService_insertStringRecords_args.prototype = {}; +IClientRPCService_insertStringRecords_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertStringRecordsReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertStringRecords_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertStringRecords_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_insertStringRecords_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_insertStringRecords_result.prototype = {}; +IClientRPCService_insertStringRecords_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_insertStringRecords_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_insertStringRecords_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testInsertTablet_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertTabletReq(args.req); + } + } +}; +IClientRPCService_testInsertTablet_args.prototype = {}; +IClientRPCService_testInsertTablet_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertTabletReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testInsertTablet_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testInsertTablet_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testInsertTablet_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_testInsertTablet_result.prototype = {}; +IClientRPCService_testInsertTablet_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testInsertTablet_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testInsertTablet_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testInsertTablets_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertTabletsReq(args.req); + } + } +}; +IClientRPCService_testInsertTablets_args.prototype = {}; +IClientRPCService_testInsertTablets_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertTabletsReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testInsertTablets_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testInsertTablets_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testInsertTablets_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_testInsertTablets_result.prototype = {}; +IClientRPCService_testInsertTablets_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testInsertTablets_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testInsertTablets_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testInsertRecord_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertRecordReq(args.req); + } + } +}; +IClientRPCService_testInsertRecord_args.prototype = {}; +IClientRPCService_testInsertRecord_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertRecordReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testInsertRecord_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testInsertRecord_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testInsertRecord_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_testInsertRecord_result.prototype = {}; +IClientRPCService_testInsertRecord_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testInsertRecord_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testInsertRecord_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testInsertStringRecord_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertStringRecordReq(args.req); + } + } +}; +IClientRPCService_testInsertStringRecord_args.prototype = {}; +IClientRPCService_testInsertStringRecord_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertStringRecordReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testInsertStringRecord_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testInsertStringRecord_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testInsertStringRecord_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_testInsertStringRecord_result.prototype = {}; +IClientRPCService_testInsertStringRecord_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testInsertStringRecord_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testInsertStringRecord_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testInsertRecords_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertRecordsReq(args.req); + } + } +}; +IClientRPCService_testInsertRecords_args.prototype = {}; +IClientRPCService_testInsertRecords_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertRecordsReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testInsertRecords_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testInsertRecords_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testInsertRecords_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_testInsertRecords_result.prototype = {}; +IClientRPCService_testInsertRecords_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testInsertRecords_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testInsertRecords_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testInsertRecordsOfOneDevice_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertRecordsOfOneDeviceReq(args.req); + } + } +}; +IClientRPCService_testInsertRecordsOfOneDevice_args.prototype = {}; +IClientRPCService_testInsertRecordsOfOneDevice_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertRecordsOfOneDeviceReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testInsertRecordsOfOneDevice_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testInsertRecordsOfOneDevice_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testInsertRecordsOfOneDevice_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_testInsertRecordsOfOneDevice_result.prototype = {}; +IClientRPCService_testInsertRecordsOfOneDevice_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testInsertRecordsOfOneDevice_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testInsertRecordsOfOneDevice_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testInsertStringRecords_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSInsertStringRecordsReq(args.req); + } + } +}; +IClientRPCService_testInsertStringRecords_args.prototype = {}; +IClientRPCService_testInsertStringRecords_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSInsertStringRecordsReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testInsertStringRecords_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testInsertStringRecords_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testInsertStringRecords_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_testInsertStringRecords_result.prototype = {}; +IClientRPCService_testInsertStringRecords_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testInsertStringRecords_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testInsertStringRecords_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_deleteData_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSDeleteDataReq(args.req); + } + } +}; +IClientRPCService_deleteData_args.prototype = {}; +IClientRPCService_deleteData_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSDeleteDataReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_deleteData_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_deleteData_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_deleteData_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_deleteData_result.prototype = {}; +IClientRPCService_deleteData_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_deleteData_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_deleteData_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeRawDataQuery_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSRawDataQueryReq(args.req); + } + } +}; +IClientRPCService_executeRawDataQuery_args.prototype = {}; +IClientRPCService_executeRawDataQuery_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSRawDataQueryReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeRawDataQuery_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeRawDataQuery_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeRawDataQuery_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSExecuteStatementResp(args.success); + } + } +}; +IClientRPCService_executeRawDataQuery_result.prototype = {}; +IClientRPCService_executeRawDataQuery_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSExecuteStatementResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeRawDataQuery_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeRawDataQuery_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeLastDataQuery_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSLastDataQueryReq(args.req); + } + } +}; +IClientRPCService_executeLastDataQuery_args.prototype = {}; +IClientRPCService_executeLastDataQuery_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSLastDataQueryReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeLastDataQuery_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeLastDataQuery_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeLastDataQuery_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSExecuteStatementResp(args.success); + } + } +}; +IClientRPCService_executeLastDataQuery_result.prototype = {}; +IClientRPCService_executeLastDataQuery_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSExecuteStatementResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeLastDataQuery_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeLastDataQuery_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeAggregationQuery_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSAggregationQueryReq(args.req); + } + } +}; +IClientRPCService_executeAggregationQuery_args.prototype = {}; +IClientRPCService_executeAggregationQuery_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSAggregationQueryReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeAggregationQuery_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeAggregationQuery_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_executeAggregationQuery_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSExecuteStatementResp(args.success); + } + } +}; +IClientRPCService_executeAggregationQuery_result.prototype = {}; +IClientRPCService_executeAggregationQuery_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSExecuteStatementResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_executeAggregationQuery_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_executeAggregationQuery_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_requestStatementId_args = function(args) { + this.sessionId = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } + } +}; +IClientRPCService_requestStatementId_args.prototype = {}; +IClientRPCService_requestStatementId_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_requestStatementId_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_requestStatementId_args'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_requestStatementId_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = args.success; + } + } +}; +IClientRPCService_requestStatementId_result.prototype = {}; +IClientRPCService_requestStatementId_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.I64) { + this.success = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_requestStatementId_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_requestStatementId_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.I64, 0); + output.writeI64(this.success); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_createSchemaTemplate_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSCreateSchemaTemplateReq(args.req); + } + } +}; +IClientRPCService_createSchemaTemplate_args.prototype = {}; +IClientRPCService_createSchemaTemplate_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSCreateSchemaTemplateReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_createSchemaTemplate_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_createSchemaTemplate_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_createSchemaTemplate_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_createSchemaTemplate_result.prototype = {}; +IClientRPCService_createSchemaTemplate_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_createSchemaTemplate_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_createSchemaTemplate_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_appendSchemaTemplate_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSAppendSchemaTemplateReq(args.req); + } + } +}; +IClientRPCService_appendSchemaTemplate_args.prototype = {}; +IClientRPCService_appendSchemaTemplate_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSAppendSchemaTemplateReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_appendSchemaTemplate_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_appendSchemaTemplate_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_appendSchemaTemplate_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_appendSchemaTemplate_result.prototype = {}; +IClientRPCService_appendSchemaTemplate_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_appendSchemaTemplate_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_appendSchemaTemplate_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_pruneSchemaTemplate_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSPruneSchemaTemplateReq(args.req); + } + } +}; +IClientRPCService_pruneSchemaTemplate_args.prototype = {}; +IClientRPCService_pruneSchemaTemplate_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSPruneSchemaTemplateReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_pruneSchemaTemplate_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_pruneSchemaTemplate_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_pruneSchemaTemplate_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_pruneSchemaTemplate_result.prototype = {}; +IClientRPCService_pruneSchemaTemplate_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_pruneSchemaTemplate_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_pruneSchemaTemplate_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_querySchemaTemplate_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSQueryTemplateReq(args.req); + } + } +}; +IClientRPCService_querySchemaTemplate_args.prototype = {}; +IClientRPCService_querySchemaTemplate_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSQueryTemplateReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_querySchemaTemplate_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_querySchemaTemplate_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_querySchemaTemplate_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSQueryTemplateResp(args.success); + } + } +}; +IClientRPCService_querySchemaTemplate_result.prototype = {}; +IClientRPCService_querySchemaTemplate_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSQueryTemplateResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_querySchemaTemplate_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_querySchemaTemplate_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_showConfigurationTemplate_args = function(args) { +}; +IClientRPCService_showConfigurationTemplate_args.prototype = {}; +IClientRPCService_showConfigurationTemplate_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + if (ftype == Thrift.Type.STOP) { + break; + } + input.skip(ftype); + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_showConfigurationTemplate_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_showConfigurationTemplate_args'); + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_showConfigurationTemplate_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TShowConfigurationTemplateResp(args.success); + } + } +}; +IClientRPCService_showConfigurationTemplate_result.prototype = {}; +IClientRPCService_showConfigurationTemplate_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TShowConfigurationTemplateResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_showConfigurationTemplate_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_showConfigurationTemplate_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_showConfiguration_args = function(args) { + this.nodeId = null; + if (args) { + if (args.nodeId !== undefined && args.nodeId !== null) { + this.nodeId = args.nodeId; + } + } +}; +IClientRPCService_showConfiguration_args.prototype = {}; +IClientRPCService_showConfiguration_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I32) { + this.nodeId = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_showConfiguration_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_showConfiguration_args'); + if (this.nodeId !== null && this.nodeId !== undefined) { + output.writeFieldBegin('nodeId', Thrift.Type.I32, 1); + output.writeI32(this.nodeId); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_showConfiguration_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TShowConfigurationResp(args.success); + } + } +}; +IClientRPCService_showConfiguration_result.prototype = {}; +IClientRPCService_showConfiguration_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TShowConfigurationResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_showConfiguration_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_showConfiguration_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_setSchemaTemplate_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSSetSchemaTemplateReq(args.req); + } + } +}; +IClientRPCService_setSchemaTemplate_args.prototype = {}; +IClientRPCService_setSchemaTemplate_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSSetSchemaTemplateReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_setSchemaTemplate_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_setSchemaTemplate_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_setSchemaTemplate_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_setSchemaTemplate_result.prototype = {}; +IClientRPCService_setSchemaTemplate_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_setSchemaTemplate_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_setSchemaTemplate_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_unsetSchemaTemplate_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSUnsetSchemaTemplateReq(args.req); + } + } +}; +IClientRPCService_unsetSchemaTemplate_args.prototype = {}; +IClientRPCService_unsetSchemaTemplate_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSUnsetSchemaTemplateReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_unsetSchemaTemplate_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_unsetSchemaTemplate_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_unsetSchemaTemplate_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_unsetSchemaTemplate_result.prototype = {}; +IClientRPCService_unsetSchemaTemplate_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_unsetSchemaTemplate_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_unsetSchemaTemplate_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_dropSchemaTemplate_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TSDropSchemaTemplateReq(args.req); + } + } +}; +IClientRPCService_dropSchemaTemplate_args.prototype = {}; +IClientRPCService_dropSchemaTemplate_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TSDropSchemaTemplateReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_dropSchemaTemplate_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_dropSchemaTemplate_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_dropSchemaTemplate_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_dropSchemaTemplate_result.prototype = {}; +IClientRPCService_dropSchemaTemplate_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_dropSchemaTemplate_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_dropSchemaTemplate_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_createTimeseriesUsingSchemaTemplate_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TCreateTimeseriesUsingSchemaTemplateReq(args.req); + } + } +}; +IClientRPCService_createTimeseriesUsingSchemaTemplate_args.prototype = {}; +IClientRPCService_createTimeseriesUsingSchemaTemplate_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TCreateTimeseriesUsingSchemaTemplateReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_createTimeseriesUsingSchemaTemplate_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_createTimeseriesUsingSchemaTemplate_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_createTimeseriesUsingSchemaTemplate_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_createTimeseriesUsingSchemaTemplate_result.prototype = {}; +IClientRPCService_createTimeseriesUsingSchemaTemplate_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_createTimeseriesUsingSchemaTemplate_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_createTimeseriesUsingSchemaTemplate_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_handshake_args = function(args) { + this.info = null; + if (args) { + if (args.info !== undefined && args.info !== null) { + this.info = new ttypes.TSyncIdentityInfo(args.info); + } + } +}; +IClientRPCService_handshake_args.prototype = {}; +IClientRPCService_handshake_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.info = new ttypes.TSyncIdentityInfo(); + this.info.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_handshake_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_handshake_args'); + if (this.info !== null && this.info !== undefined) { + output.writeFieldBegin('info', Thrift.Type.STRUCT, 1); + this.info.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_handshake_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_handshake_result.prototype = {}; +IClientRPCService_handshake_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_handshake_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_handshake_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_sendPipeData_args = function(args) { + this.buff = null; + if (args) { + if (args.buff !== undefined && args.buff !== null) { + this.buff = args.buff; + } + } +}; +IClientRPCService_sendPipeData_args.prototype = {}; +IClientRPCService_sendPipeData_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.buff = input.readBinary(); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_sendPipeData_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_sendPipeData_args'); + if (this.buff !== null && this.buff !== undefined) { + output.writeFieldBegin('buff', Thrift.Type.STRING, 1); + output.writeBinary(this.buff); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_sendPipeData_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_sendPipeData_result.prototype = {}; +IClientRPCService_sendPipeData_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_sendPipeData_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_sendPipeData_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_sendFile_args = function(args) { + this.metaInfo = null; + this.buff = null; + if (args) { + if (args.metaInfo !== undefined && args.metaInfo !== null) { + this.metaInfo = new ttypes.TSyncTransportMetaInfo(args.metaInfo); + } + if (args.buff !== undefined && args.buff !== null) { + this.buff = args.buff; + } + } +}; +IClientRPCService_sendFile_args.prototype = {}; +IClientRPCService_sendFile_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.metaInfo = new ttypes.TSyncTransportMetaInfo(); + this.metaInfo.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.buff = input.readBinary(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_sendFile_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_sendFile_args'); + if (this.metaInfo !== null && this.metaInfo !== undefined) { + output.writeFieldBegin('metaInfo', Thrift.Type.STRUCT, 1); + this.metaInfo.write(output); + output.writeFieldEnd(); + } + if (this.buff !== null && this.buff !== undefined) { + output.writeFieldBegin('buff', Thrift.Type.STRING, 2); + output.writeBinary(this.buff); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_sendFile_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_sendFile_result.prototype = {}; +IClientRPCService_sendFile_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_sendFile_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_sendFile_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_pipeTransfer_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TPipeTransferReq(args.req); + } + } +}; +IClientRPCService_pipeTransfer_args.prototype = {}; +IClientRPCService_pipeTransfer_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TPipeTransferReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_pipeTransfer_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_pipeTransfer_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_pipeTransfer_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TPipeTransferResp(args.success); + } + } +}; +IClientRPCService_pipeTransfer_result.prototype = {}; +IClientRPCService_pipeTransfer_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TPipeTransferResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_pipeTransfer_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_pipeTransfer_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_pipeSubscribe_args = function(args) { + this.req = null; + if (args) { + if (args.req !== undefined && args.req !== null) { + this.req = new ttypes.TPipeSubscribeReq(args.req); + } + } +}; +IClientRPCService_pipeSubscribe_args.prototype = {}; +IClientRPCService_pipeSubscribe_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.req = new ttypes.TPipeSubscribeReq(); + this.req.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_pipeSubscribe_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_pipeSubscribe_args'); + if (this.req !== null && this.req !== undefined) { + output.writeFieldBegin('req', Thrift.Type.STRUCT, 1); + this.req.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_pipeSubscribe_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TPipeSubscribeResp(args.success); + } + } +}; +IClientRPCService_pipeSubscribe_result.prototype = {}; +IClientRPCService_pipeSubscribe_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TPipeSubscribeResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_pipeSubscribe_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_pipeSubscribe_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_getBackupConfiguration_args = function(args) { +}; +IClientRPCService_getBackupConfiguration_args.prototype = {}; +IClientRPCService_getBackupConfiguration_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + if (ftype == Thrift.Type.STOP) { + break; + } + input.skip(ftype); + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_getBackupConfiguration_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_getBackupConfiguration_args'); + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_getBackupConfiguration_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSBackupConfigurationResp(args.success); + } + } +}; +IClientRPCService_getBackupConfiguration_result.prototype = {}; +IClientRPCService_getBackupConfiguration_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSBackupConfigurationResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_getBackupConfiguration_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_getBackupConfiguration_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_fetchAllConnectionsInfo_args = function(args) { +}; +IClientRPCService_fetchAllConnectionsInfo_args.prototype = {}; +IClientRPCService_fetchAllConnectionsInfo_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + if (ftype == Thrift.Type.STOP) { + break; + } + input.skip(ftype); + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_fetchAllConnectionsInfo_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_fetchAllConnectionsInfo_args'); + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_fetchAllConnectionsInfo_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new ttypes.TSConnectionInfoResp(args.success); + } + } +}; +IClientRPCService_fetchAllConnectionsInfo_result.prototype = {}; +IClientRPCService_fetchAllConnectionsInfo_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new ttypes.TSConnectionInfoResp(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_fetchAllConnectionsInfo_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_fetchAllConnectionsInfo_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testConnectionEmptyRPC_args = function(args) { +}; +IClientRPCService_testConnectionEmptyRPC_args.prototype = {}; +IClientRPCService_testConnectionEmptyRPC_args.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + if (ftype == Thrift.Type.STOP) { + break; + } + input.skip(ftype); + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testConnectionEmptyRPC_args.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testConnectionEmptyRPC_args'); + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCService_testConnectionEmptyRPC_result = function(args) { + this.success = null; + if (args) { + if (args.success !== undefined && args.success !== null) { + this.success = new common_ttypes.TSStatus(args.success); + } + } +}; +IClientRPCService_testConnectionEmptyRPC_result.prototype = {}; +IClientRPCService_testConnectionEmptyRPC_result.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 0: + if (ftype == Thrift.Type.STRUCT) { + this.success = new common_ttypes.TSStatus(); + this.success.read(input); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +IClientRPCService_testConnectionEmptyRPC_result.prototype.write = function(output) { + output.writeStructBegin('IClientRPCService_testConnectionEmptyRPC_result'); + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.STRUCT, 0); + this.success.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var IClientRPCServiceClient = exports.Client = function(output, pClass) { + this.output = output; + this.pClass = pClass; + this._seqid = 0; + this._reqs = {}; +}; +IClientRPCServiceClient.prototype = {}; +IClientRPCServiceClient.prototype.seqid = function() { return this._seqid; }; +IClientRPCServiceClient.prototype.new_seqid = function() { return this._seqid += 1; }; + +IClientRPCServiceClient.prototype.executeQueryStatementV2 = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeQueryStatementV2(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeQueryStatementV2(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeQueryStatementV2 = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeQueryStatementV2_args(params); + try { + output.writeMessageBegin('executeQueryStatementV2', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeQueryStatementV2 = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeQueryStatementV2_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeQueryStatementV2 failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.executeUpdateStatementV2 = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeUpdateStatementV2(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeUpdateStatementV2(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeUpdateStatementV2 = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeUpdateStatementV2_args(params); + try { + output.writeMessageBegin('executeUpdateStatementV2', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeUpdateStatementV2 = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeUpdateStatementV2_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeUpdateStatementV2 failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.executeStatementV2 = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeStatementV2(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeStatementV2(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeStatementV2 = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeStatementV2_args(params); + try { + output.writeMessageBegin('executeStatementV2', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeStatementV2 = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeStatementV2_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeStatementV2 failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.executeRawDataQueryV2 = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeRawDataQueryV2(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeRawDataQueryV2(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeRawDataQueryV2 = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeRawDataQueryV2_args(params); + try { + output.writeMessageBegin('executeRawDataQueryV2', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeRawDataQueryV2 = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeRawDataQueryV2_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeRawDataQueryV2 failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.executeLastDataQueryV2 = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeLastDataQueryV2(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeLastDataQueryV2(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeLastDataQueryV2 = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeLastDataQueryV2_args(params); + try { + output.writeMessageBegin('executeLastDataQueryV2', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeLastDataQueryV2 = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeLastDataQueryV2_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeLastDataQueryV2 failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.executeFastLastDataQueryForOneDeviceV2 = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeFastLastDataQueryForOneDeviceV2(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeFastLastDataQueryForOneDeviceV2(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeFastLastDataQueryForOneDeviceV2 = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeFastLastDataQueryForOneDeviceV2_args(params); + try { + output.writeMessageBegin('executeFastLastDataQueryForOneDeviceV2', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeFastLastDataQueryForOneDeviceV2 = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeFastLastDataQueryForOneDeviceV2_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeFastLastDataQueryForOneDeviceV2 failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.executeAggregationQueryV2 = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeAggregationQueryV2(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeAggregationQueryV2(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeAggregationQueryV2 = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeAggregationQueryV2_args(params); + try { + output.writeMessageBegin('executeAggregationQueryV2', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeAggregationQueryV2 = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeAggregationQueryV2_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeAggregationQueryV2 failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.executeGroupByQueryIntervalQuery = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeGroupByQueryIntervalQuery(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeGroupByQueryIntervalQuery(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeGroupByQueryIntervalQuery = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeGroupByQueryIntervalQuery_args(params); + try { + output.writeMessageBegin('executeGroupByQueryIntervalQuery', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeGroupByQueryIntervalQuery = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeGroupByQueryIntervalQuery_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeGroupByQueryIntervalQuery failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.fetchResultsV2 = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_fetchResultsV2(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_fetchResultsV2(req); + } +}; + +IClientRPCServiceClient.prototype.send_fetchResultsV2 = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_fetchResultsV2_args(params); + try { + output.writeMessageBegin('fetchResultsV2', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_fetchResultsV2 = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_fetchResultsV2_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('fetchResultsV2 failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.openSession = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_openSession(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_openSession(req); + } +}; + +IClientRPCServiceClient.prototype.send_openSession = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_openSession_args(params); + try { + output.writeMessageBegin('openSession', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_openSession = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_openSession_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('openSession failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.closeSession = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_closeSession(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_closeSession(req); + } +}; + +IClientRPCServiceClient.prototype.send_closeSession = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_closeSession_args(params); + try { + output.writeMessageBegin('closeSession', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_closeSession = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_closeSession_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('closeSession failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.executeStatement = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeStatement(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeStatement(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeStatement = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeStatement_args(params); + try { + output.writeMessageBegin('executeStatement', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeStatement = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeStatement_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeStatement failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.executeBatchStatement = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeBatchStatement(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeBatchStatement(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeBatchStatement = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeBatchStatement_args(params); + try { + output.writeMessageBegin('executeBatchStatement', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeBatchStatement = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeBatchStatement_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeBatchStatement failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.executeQueryStatement = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeQueryStatement(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeQueryStatement(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeQueryStatement = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeQueryStatement_args(params); + try { + output.writeMessageBegin('executeQueryStatement', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeQueryStatement = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeQueryStatement_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeQueryStatement failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.executeUpdateStatement = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeUpdateStatement(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeUpdateStatement(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeUpdateStatement = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeUpdateStatement_args(params); + try { + output.writeMessageBegin('executeUpdateStatement', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeUpdateStatement = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeUpdateStatement_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeUpdateStatement failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.fetchResults = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_fetchResults(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_fetchResults(req); + } +}; + +IClientRPCServiceClient.prototype.send_fetchResults = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_fetchResults_args(params); + try { + output.writeMessageBegin('fetchResults', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_fetchResults = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_fetchResults_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('fetchResults failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.fetchMetadata = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_fetchMetadata(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_fetchMetadata(req); + } +}; + +IClientRPCServiceClient.prototype.send_fetchMetadata = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_fetchMetadata_args(params); + try { + output.writeMessageBegin('fetchMetadata', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_fetchMetadata = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_fetchMetadata_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('fetchMetadata failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.cancelOperation = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_cancelOperation(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_cancelOperation(req); + } +}; + +IClientRPCServiceClient.prototype.send_cancelOperation = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_cancelOperation_args(params); + try { + output.writeMessageBegin('cancelOperation', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_cancelOperation = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_cancelOperation_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('cancelOperation failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.closeOperation = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_closeOperation(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_closeOperation(req); + } +}; + +IClientRPCServiceClient.prototype.send_closeOperation = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_closeOperation_args(params); + try { + output.writeMessageBegin('closeOperation', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_closeOperation = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_closeOperation_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('closeOperation failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.getTimeZone = function(sessionId, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_getTimeZone(sessionId); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_getTimeZone(sessionId); + } +}; + +IClientRPCServiceClient.prototype.send_getTimeZone = function(sessionId) { + var output = new this.pClass(this.output); + var params = { + sessionId: sessionId + }; + var args = new IClientRPCService_getTimeZone_args(params); + try { + output.writeMessageBegin('getTimeZone', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_getTimeZone = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_getTimeZone_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('getTimeZone failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.setTimeZone = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_setTimeZone(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_setTimeZone(req); + } +}; + +IClientRPCServiceClient.prototype.send_setTimeZone = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_setTimeZone_args(params); + try { + output.writeMessageBegin('setTimeZone', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_setTimeZone = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_setTimeZone_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('setTimeZone failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.getProperties = function(callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_getProperties(); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_getProperties(); + } +}; + +IClientRPCServiceClient.prototype.send_getProperties = function() { + var output = new this.pClass(this.output); + var args = new IClientRPCService_getProperties_args(); + try { + output.writeMessageBegin('getProperties', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_getProperties = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_getProperties_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('getProperties failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.setStorageGroup = function(sessionId, storageGroup, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_setStorageGroup(sessionId, storageGroup); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_setStorageGroup(sessionId, storageGroup); + } +}; + +IClientRPCServiceClient.prototype.send_setStorageGroup = function(sessionId, storageGroup) { + var output = new this.pClass(this.output); + var params = { + sessionId: sessionId, + storageGroup: storageGroup + }; + var args = new IClientRPCService_setStorageGroup_args(params); + try { + output.writeMessageBegin('setStorageGroup', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_setStorageGroup = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_setStorageGroup_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('setStorageGroup failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.createTimeseries = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_createTimeseries(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_createTimeseries(req); + } +}; + +IClientRPCServiceClient.prototype.send_createTimeseries = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_createTimeseries_args(params); + try { + output.writeMessageBegin('createTimeseries', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_createTimeseries = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_createTimeseries_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('createTimeseries failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.createAlignedTimeseries = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_createAlignedTimeseries(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_createAlignedTimeseries(req); + } +}; + +IClientRPCServiceClient.prototype.send_createAlignedTimeseries = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_createAlignedTimeseries_args(params); + try { + output.writeMessageBegin('createAlignedTimeseries', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_createAlignedTimeseries = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_createAlignedTimeseries_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('createAlignedTimeseries failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.createMultiTimeseries = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_createMultiTimeseries(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_createMultiTimeseries(req); + } +}; + +IClientRPCServiceClient.prototype.send_createMultiTimeseries = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_createMultiTimeseries_args(params); + try { + output.writeMessageBegin('createMultiTimeseries', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_createMultiTimeseries = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_createMultiTimeseries_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('createMultiTimeseries failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.deleteTimeseries = function(sessionId, path, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_deleteTimeseries(sessionId, path); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_deleteTimeseries(sessionId, path); + } +}; + +IClientRPCServiceClient.prototype.send_deleteTimeseries = function(sessionId, path) { + var output = new this.pClass(this.output); + var params = { + sessionId: sessionId, + path: path + }; + var args = new IClientRPCService_deleteTimeseries_args(params); + try { + output.writeMessageBegin('deleteTimeseries', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_deleteTimeseries = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_deleteTimeseries_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('deleteTimeseries failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.deleteStorageGroups = function(sessionId, storageGroup, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_deleteStorageGroups(sessionId, storageGroup); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_deleteStorageGroups(sessionId, storageGroup); + } +}; + +IClientRPCServiceClient.prototype.send_deleteStorageGroups = function(sessionId, storageGroup) { + var output = new this.pClass(this.output); + var params = { + sessionId: sessionId, + storageGroup: storageGroup + }; + var args = new IClientRPCService_deleteStorageGroups_args(params); + try { + output.writeMessageBegin('deleteStorageGroups', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_deleteStorageGroups = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_deleteStorageGroups_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('deleteStorageGroups failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.insertRecord = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_insertRecord(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_insertRecord(req); + } +}; + +IClientRPCServiceClient.prototype.send_insertRecord = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_insertRecord_args(params); + try { + output.writeMessageBegin('insertRecord', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_insertRecord = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_insertRecord_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('insertRecord failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.insertStringRecord = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_insertStringRecord(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_insertStringRecord(req); + } +}; + +IClientRPCServiceClient.prototype.send_insertStringRecord = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_insertStringRecord_args(params); + try { + output.writeMessageBegin('insertStringRecord', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_insertStringRecord = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_insertStringRecord_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('insertStringRecord failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.insertTablet = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_insertTablet(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_insertTablet(req); + } +}; + +IClientRPCServiceClient.prototype.send_insertTablet = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_insertTablet_args(params); + try { + output.writeMessageBegin('insertTablet', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_insertTablet = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_insertTablet_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('insertTablet failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.insertTablets = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_insertTablets(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_insertTablets(req); + } +}; + +IClientRPCServiceClient.prototype.send_insertTablets = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_insertTablets_args(params); + try { + output.writeMessageBegin('insertTablets', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_insertTablets = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_insertTablets_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('insertTablets failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.insertRecords = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_insertRecords(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_insertRecords(req); + } +}; + +IClientRPCServiceClient.prototype.send_insertRecords = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_insertRecords_args(params); + try { + output.writeMessageBegin('insertRecords', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_insertRecords = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_insertRecords_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('insertRecords failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.insertRecordsOfOneDevice = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_insertRecordsOfOneDevice(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_insertRecordsOfOneDevice(req); + } +}; + +IClientRPCServiceClient.prototype.send_insertRecordsOfOneDevice = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_insertRecordsOfOneDevice_args(params); + try { + output.writeMessageBegin('insertRecordsOfOneDevice', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_insertRecordsOfOneDevice = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_insertRecordsOfOneDevice_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('insertRecordsOfOneDevice failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.insertStringRecordsOfOneDevice = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_insertStringRecordsOfOneDevice(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_insertStringRecordsOfOneDevice(req); + } +}; + +IClientRPCServiceClient.prototype.send_insertStringRecordsOfOneDevice = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_insertStringRecordsOfOneDevice_args(params); + try { + output.writeMessageBegin('insertStringRecordsOfOneDevice', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_insertStringRecordsOfOneDevice = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_insertStringRecordsOfOneDevice_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('insertStringRecordsOfOneDevice failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.insertStringRecords = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_insertStringRecords(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_insertStringRecords(req); + } +}; + +IClientRPCServiceClient.prototype.send_insertStringRecords = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_insertStringRecords_args(params); + try { + output.writeMessageBegin('insertStringRecords', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_insertStringRecords = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_insertStringRecords_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('insertStringRecords failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.testInsertTablet = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_testInsertTablet(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_testInsertTablet(req); + } +}; + +IClientRPCServiceClient.prototype.send_testInsertTablet = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_testInsertTablet_args(params); + try { + output.writeMessageBegin('testInsertTablet', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_testInsertTablet = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_testInsertTablet_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('testInsertTablet failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.testInsertTablets = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_testInsertTablets(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_testInsertTablets(req); + } +}; + +IClientRPCServiceClient.prototype.send_testInsertTablets = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_testInsertTablets_args(params); + try { + output.writeMessageBegin('testInsertTablets', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_testInsertTablets = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_testInsertTablets_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('testInsertTablets failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.testInsertRecord = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_testInsertRecord(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_testInsertRecord(req); + } +}; + +IClientRPCServiceClient.prototype.send_testInsertRecord = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_testInsertRecord_args(params); + try { + output.writeMessageBegin('testInsertRecord', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_testInsertRecord = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_testInsertRecord_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('testInsertRecord failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.testInsertStringRecord = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_testInsertStringRecord(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_testInsertStringRecord(req); + } +}; + +IClientRPCServiceClient.prototype.send_testInsertStringRecord = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_testInsertStringRecord_args(params); + try { + output.writeMessageBegin('testInsertStringRecord', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_testInsertStringRecord = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_testInsertStringRecord_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('testInsertStringRecord failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.testInsertRecords = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_testInsertRecords(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_testInsertRecords(req); + } +}; + +IClientRPCServiceClient.prototype.send_testInsertRecords = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_testInsertRecords_args(params); + try { + output.writeMessageBegin('testInsertRecords', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_testInsertRecords = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_testInsertRecords_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('testInsertRecords failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.testInsertRecordsOfOneDevice = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_testInsertRecordsOfOneDevice(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_testInsertRecordsOfOneDevice(req); + } +}; + +IClientRPCServiceClient.prototype.send_testInsertRecordsOfOneDevice = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_testInsertRecordsOfOneDevice_args(params); + try { + output.writeMessageBegin('testInsertRecordsOfOneDevice', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_testInsertRecordsOfOneDevice = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_testInsertRecordsOfOneDevice_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('testInsertRecordsOfOneDevice failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.testInsertStringRecords = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_testInsertStringRecords(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_testInsertStringRecords(req); + } +}; + +IClientRPCServiceClient.prototype.send_testInsertStringRecords = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_testInsertStringRecords_args(params); + try { + output.writeMessageBegin('testInsertStringRecords', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_testInsertStringRecords = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_testInsertStringRecords_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('testInsertStringRecords failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.deleteData = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_deleteData(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_deleteData(req); + } +}; + +IClientRPCServiceClient.prototype.send_deleteData = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_deleteData_args(params); + try { + output.writeMessageBegin('deleteData', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_deleteData = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_deleteData_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('deleteData failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.executeRawDataQuery = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeRawDataQuery(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeRawDataQuery(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeRawDataQuery = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeRawDataQuery_args(params); + try { + output.writeMessageBegin('executeRawDataQuery', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeRawDataQuery = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeRawDataQuery_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeRawDataQuery failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.executeLastDataQuery = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeLastDataQuery(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeLastDataQuery(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeLastDataQuery = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeLastDataQuery_args(params); + try { + output.writeMessageBegin('executeLastDataQuery', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeLastDataQuery = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeLastDataQuery_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeLastDataQuery failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.executeAggregationQuery = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_executeAggregationQuery(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_executeAggregationQuery(req); + } +}; + +IClientRPCServiceClient.prototype.send_executeAggregationQuery = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_executeAggregationQuery_args(params); + try { + output.writeMessageBegin('executeAggregationQuery', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_executeAggregationQuery = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_executeAggregationQuery_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('executeAggregationQuery failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.requestStatementId = function(sessionId, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_requestStatementId(sessionId); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_requestStatementId(sessionId); + } +}; + +IClientRPCServiceClient.prototype.send_requestStatementId = function(sessionId) { + var output = new this.pClass(this.output); + var params = { + sessionId: sessionId + }; + var args = new IClientRPCService_requestStatementId_args(params); + try { + output.writeMessageBegin('requestStatementId', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_requestStatementId = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_requestStatementId_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('requestStatementId failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.createSchemaTemplate = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_createSchemaTemplate(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_createSchemaTemplate(req); + } +}; + +IClientRPCServiceClient.prototype.send_createSchemaTemplate = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_createSchemaTemplate_args(params); + try { + output.writeMessageBegin('createSchemaTemplate', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_createSchemaTemplate = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_createSchemaTemplate_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('createSchemaTemplate failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.appendSchemaTemplate = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_appendSchemaTemplate(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_appendSchemaTemplate(req); + } +}; + +IClientRPCServiceClient.prototype.send_appendSchemaTemplate = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_appendSchemaTemplate_args(params); + try { + output.writeMessageBegin('appendSchemaTemplate', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_appendSchemaTemplate = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_appendSchemaTemplate_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('appendSchemaTemplate failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.pruneSchemaTemplate = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_pruneSchemaTemplate(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_pruneSchemaTemplate(req); + } +}; + +IClientRPCServiceClient.prototype.send_pruneSchemaTemplate = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_pruneSchemaTemplate_args(params); + try { + output.writeMessageBegin('pruneSchemaTemplate', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_pruneSchemaTemplate = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_pruneSchemaTemplate_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('pruneSchemaTemplate failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.querySchemaTemplate = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_querySchemaTemplate(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_querySchemaTemplate(req); + } +}; + +IClientRPCServiceClient.prototype.send_querySchemaTemplate = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_querySchemaTemplate_args(params); + try { + output.writeMessageBegin('querySchemaTemplate', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_querySchemaTemplate = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_querySchemaTemplate_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('querySchemaTemplate failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.showConfigurationTemplate = function(callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_showConfigurationTemplate(); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_showConfigurationTemplate(); + } +}; + +IClientRPCServiceClient.prototype.send_showConfigurationTemplate = function() { + var output = new this.pClass(this.output); + var args = new IClientRPCService_showConfigurationTemplate_args(); + try { + output.writeMessageBegin('showConfigurationTemplate', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_showConfigurationTemplate = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_showConfigurationTemplate_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('showConfigurationTemplate failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.showConfiguration = function(nodeId, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_showConfiguration(nodeId); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_showConfiguration(nodeId); + } +}; + +IClientRPCServiceClient.prototype.send_showConfiguration = function(nodeId) { + var output = new this.pClass(this.output); + var params = { + nodeId: nodeId + }; + var args = new IClientRPCService_showConfiguration_args(params); + try { + output.writeMessageBegin('showConfiguration', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_showConfiguration = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_showConfiguration_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('showConfiguration failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.setSchemaTemplate = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_setSchemaTemplate(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_setSchemaTemplate(req); + } +}; + +IClientRPCServiceClient.prototype.send_setSchemaTemplate = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_setSchemaTemplate_args(params); + try { + output.writeMessageBegin('setSchemaTemplate', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_setSchemaTemplate = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_setSchemaTemplate_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('setSchemaTemplate failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.unsetSchemaTemplate = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_unsetSchemaTemplate(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_unsetSchemaTemplate(req); + } +}; + +IClientRPCServiceClient.prototype.send_unsetSchemaTemplate = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_unsetSchemaTemplate_args(params); + try { + output.writeMessageBegin('unsetSchemaTemplate', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_unsetSchemaTemplate = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_unsetSchemaTemplate_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('unsetSchemaTemplate failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.dropSchemaTemplate = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_dropSchemaTemplate(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_dropSchemaTemplate(req); + } +}; + +IClientRPCServiceClient.prototype.send_dropSchemaTemplate = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_dropSchemaTemplate_args(params); + try { + output.writeMessageBegin('dropSchemaTemplate', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_dropSchemaTemplate = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_dropSchemaTemplate_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('dropSchemaTemplate failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.createTimeseriesUsingSchemaTemplate = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_createTimeseriesUsingSchemaTemplate(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_createTimeseriesUsingSchemaTemplate(req); + } +}; + +IClientRPCServiceClient.prototype.send_createTimeseriesUsingSchemaTemplate = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_createTimeseriesUsingSchemaTemplate_args(params); + try { + output.writeMessageBegin('createTimeseriesUsingSchemaTemplate', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_createTimeseriesUsingSchemaTemplate = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_createTimeseriesUsingSchemaTemplate_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('createTimeseriesUsingSchemaTemplate failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.handshake = function(info, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_handshake(info); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_handshake(info); + } +}; + +IClientRPCServiceClient.prototype.send_handshake = function(info) { + var output = new this.pClass(this.output); + var params = { + info: info + }; + var args = new IClientRPCService_handshake_args(params); + try { + output.writeMessageBegin('handshake', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_handshake = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_handshake_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('handshake failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.sendPipeData = function(buff, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_sendPipeData(buff); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_sendPipeData(buff); + } +}; + +IClientRPCServiceClient.prototype.send_sendPipeData = function(buff) { + var output = new this.pClass(this.output); + var params = { + buff: buff + }; + var args = new IClientRPCService_sendPipeData_args(params); + try { + output.writeMessageBegin('sendPipeData', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_sendPipeData = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_sendPipeData_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('sendPipeData failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.sendFile = function(metaInfo, buff, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_sendFile(metaInfo, buff); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_sendFile(metaInfo, buff); + } +}; + +IClientRPCServiceClient.prototype.send_sendFile = function(metaInfo, buff) { + var output = new this.pClass(this.output); + var params = { + metaInfo: metaInfo, + buff: buff + }; + var args = new IClientRPCService_sendFile_args(params); + try { + output.writeMessageBegin('sendFile', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_sendFile = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_sendFile_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('sendFile failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.pipeTransfer = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_pipeTransfer(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_pipeTransfer(req); + } +}; + +IClientRPCServiceClient.prototype.send_pipeTransfer = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_pipeTransfer_args(params); + try { + output.writeMessageBegin('pipeTransfer', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_pipeTransfer = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_pipeTransfer_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('pipeTransfer failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.pipeSubscribe = function(req, callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_pipeSubscribe(req); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_pipeSubscribe(req); + } +}; + +IClientRPCServiceClient.prototype.send_pipeSubscribe = function(req) { + var output = new this.pClass(this.output); + var params = { + req: req + }; + var args = new IClientRPCService_pipeSubscribe_args(params); + try { + output.writeMessageBegin('pipeSubscribe', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_pipeSubscribe = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_pipeSubscribe_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('pipeSubscribe failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.getBackupConfiguration = function(callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_getBackupConfiguration(); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_getBackupConfiguration(); + } +}; + +IClientRPCServiceClient.prototype.send_getBackupConfiguration = function() { + var output = new this.pClass(this.output); + var args = new IClientRPCService_getBackupConfiguration_args(); + try { + output.writeMessageBegin('getBackupConfiguration', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_getBackupConfiguration = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_getBackupConfiguration_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('getBackupConfiguration failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.fetchAllConnectionsInfo = function(callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_fetchAllConnectionsInfo(); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_fetchAllConnectionsInfo(); + } +}; + +IClientRPCServiceClient.prototype.send_fetchAllConnectionsInfo = function() { + var output = new this.pClass(this.output); + var args = new IClientRPCService_fetchAllConnectionsInfo_args(); + try { + output.writeMessageBegin('fetchAllConnectionsInfo', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_fetchAllConnectionsInfo = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_fetchAllConnectionsInfo_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('fetchAllConnectionsInfo failed: unknown result'); +}; + +IClientRPCServiceClient.prototype.testConnectionEmptyRPC = function(callback) { + this._seqid = this.new_seqid(); + if (callback === undefined) { + var _defer = Q.defer(); + this._reqs[this.seqid()] = function(error, result) { + if (error) { + _defer.reject(error); + } else { + _defer.resolve(result); + } + }; + this.send_testConnectionEmptyRPC(); + return _defer.promise; + } else { + this._reqs[this.seqid()] = callback; + this.send_testConnectionEmptyRPC(); + } +}; + +IClientRPCServiceClient.prototype.send_testConnectionEmptyRPC = function() { + var output = new this.pClass(this.output); + var args = new IClientRPCService_testConnectionEmptyRPC_args(); + try { + output.writeMessageBegin('testConnectionEmptyRPC', Thrift.MessageType.CALL, this.seqid()); + args.write(output); + output.writeMessageEnd(); + return this.output.flush(); + } + catch (e) { + delete this._reqs[this.seqid()]; + if (typeof output.reset === 'function') { + output.reset(); + } + throw e; + } +}; + +IClientRPCServiceClient.prototype.recv_testConnectionEmptyRPC = function(input,mtype,rseqid) { + var callback = this._reqs[rseqid] || function() {}; + delete this._reqs[rseqid]; + if (mtype == Thrift.MessageType.EXCEPTION) { + var x = new Thrift.TApplicationException(); + x.read(input); + input.readMessageEnd(); + return callback(x); + } + var result = new IClientRPCService_testConnectionEmptyRPC_result(); + result.read(input); + input.readMessageEnd(); + + if (null !== result.success) { + return callback(null, result.success); + } + return callback('testConnectionEmptyRPC failed: unknown result'); +}; +var IClientRPCServiceProcessor = exports.Processor = function(handler) { + this._handler = handler; +}; +IClientRPCServiceProcessor.prototype.process = function(input, output) { + var r = input.readMessageBegin(); + if (this['process_' + r.fname]) { + return this['process_' + r.fname].call(this, r.rseqid, input, output); + } else { + input.skip(Thrift.Type.STRUCT); + input.readMessageEnd(); + var x = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN_METHOD, 'Unknown function ' + r.fname); + output.writeMessageBegin(r.fname, Thrift.MessageType.EXCEPTION, r.rseqid); + x.write(output); + output.writeMessageEnd(); + output.flush(); + } +}; +IClientRPCServiceProcessor.prototype.process_executeQueryStatementV2 = function(seqid, input, output) { + var args = new IClientRPCService_executeQueryStatementV2_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeQueryStatementV2.length === 1) { + Q.fcall(this._handler.executeQueryStatementV2.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeQueryStatementV2_result({success: result}); + output.writeMessageBegin("executeQueryStatementV2", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeQueryStatementV2", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeQueryStatementV2(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeQueryStatementV2_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeQueryStatementV2", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeQueryStatementV2", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_executeUpdateStatementV2 = function(seqid, input, output) { + var args = new IClientRPCService_executeUpdateStatementV2_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeUpdateStatementV2.length === 1) { + Q.fcall(this._handler.executeUpdateStatementV2.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeUpdateStatementV2_result({success: result}); + output.writeMessageBegin("executeUpdateStatementV2", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeUpdateStatementV2", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeUpdateStatementV2(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeUpdateStatementV2_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeUpdateStatementV2", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeUpdateStatementV2", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_executeStatementV2 = function(seqid, input, output) { + var args = new IClientRPCService_executeStatementV2_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeStatementV2.length === 1) { + Q.fcall(this._handler.executeStatementV2.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeStatementV2_result({success: result}); + output.writeMessageBegin("executeStatementV2", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeStatementV2", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeStatementV2(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeStatementV2_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeStatementV2", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeStatementV2", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_executeRawDataQueryV2 = function(seqid, input, output) { + var args = new IClientRPCService_executeRawDataQueryV2_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeRawDataQueryV2.length === 1) { + Q.fcall(this._handler.executeRawDataQueryV2.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeRawDataQueryV2_result({success: result}); + output.writeMessageBegin("executeRawDataQueryV2", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeRawDataQueryV2", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeRawDataQueryV2(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeRawDataQueryV2_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeRawDataQueryV2", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeRawDataQueryV2", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_executeLastDataQueryV2 = function(seqid, input, output) { + var args = new IClientRPCService_executeLastDataQueryV2_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeLastDataQueryV2.length === 1) { + Q.fcall(this._handler.executeLastDataQueryV2.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeLastDataQueryV2_result({success: result}); + output.writeMessageBegin("executeLastDataQueryV2", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeLastDataQueryV2", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeLastDataQueryV2(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeLastDataQueryV2_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeLastDataQueryV2", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeLastDataQueryV2", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_executeFastLastDataQueryForOneDeviceV2 = function(seqid, input, output) { + var args = new IClientRPCService_executeFastLastDataQueryForOneDeviceV2_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeFastLastDataQueryForOneDeviceV2.length === 1) { + Q.fcall(this._handler.executeFastLastDataQueryForOneDeviceV2.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeFastLastDataQueryForOneDeviceV2_result({success: result}); + output.writeMessageBegin("executeFastLastDataQueryForOneDeviceV2", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeFastLastDataQueryForOneDeviceV2", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeFastLastDataQueryForOneDeviceV2(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeFastLastDataQueryForOneDeviceV2_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeFastLastDataQueryForOneDeviceV2", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeFastLastDataQueryForOneDeviceV2", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_executeAggregationQueryV2 = function(seqid, input, output) { + var args = new IClientRPCService_executeAggregationQueryV2_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeAggregationQueryV2.length === 1) { + Q.fcall(this._handler.executeAggregationQueryV2.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeAggregationQueryV2_result({success: result}); + output.writeMessageBegin("executeAggregationQueryV2", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeAggregationQueryV2", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeAggregationQueryV2(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeAggregationQueryV2_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeAggregationQueryV2", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeAggregationQueryV2", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_executeGroupByQueryIntervalQuery = function(seqid, input, output) { + var args = new IClientRPCService_executeGroupByQueryIntervalQuery_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeGroupByQueryIntervalQuery.length === 1) { + Q.fcall(this._handler.executeGroupByQueryIntervalQuery.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeGroupByQueryIntervalQuery_result({success: result}); + output.writeMessageBegin("executeGroupByQueryIntervalQuery", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeGroupByQueryIntervalQuery", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeGroupByQueryIntervalQuery(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeGroupByQueryIntervalQuery_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeGroupByQueryIntervalQuery", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeGroupByQueryIntervalQuery", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_fetchResultsV2 = function(seqid, input, output) { + var args = new IClientRPCService_fetchResultsV2_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.fetchResultsV2.length === 1) { + Q.fcall(this._handler.fetchResultsV2.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_fetchResultsV2_result({success: result}); + output.writeMessageBegin("fetchResultsV2", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("fetchResultsV2", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.fetchResultsV2(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_fetchResultsV2_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("fetchResultsV2", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("fetchResultsV2", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_openSession = function(seqid, input, output) { + var args = new IClientRPCService_openSession_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.openSession.length === 1) { + Q.fcall(this._handler.openSession.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_openSession_result({success: result}); + output.writeMessageBegin("openSession", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("openSession", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.openSession(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_openSession_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("openSession", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("openSession", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_closeSession = function(seqid, input, output) { + var args = new IClientRPCService_closeSession_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.closeSession.length === 1) { + Q.fcall(this._handler.closeSession.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_closeSession_result({success: result}); + output.writeMessageBegin("closeSession", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("closeSession", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.closeSession(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_closeSession_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("closeSession", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("closeSession", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_executeStatement = function(seqid, input, output) { + var args = new IClientRPCService_executeStatement_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeStatement.length === 1) { + Q.fcall(this._handler.executeStatement.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeStatement_result({success: result}); + output.writeMessageBegin("executeStatement", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeStatement", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeStatement(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeStatement_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeStatement", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeStatement", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_executeBatchStatement = function(seqid, input, output) { + var args = new IClientRPCService_executeBatchStatement_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeBatchStatement.length === 1) { + Q.fcall(this._handler.executeBatchStatement.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeBatchStatement_result({success: result}); + output.writeMessageBegin("executeBatchStatement", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeBatchStatement", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeBatchStatement(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeBatchStatement_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeBatchStatement", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeBatchStatement", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_executeQueryStatement = function(seqid, input, output) { + var args = new IClientRPCService_executeQueryStatement_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeQueryStatement.length === 1) { + Q.fcall(this._handler.executeQueryStatement.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeQueryStatement_result({success: result}); + output.writeMessageBegin("executeQueryStatement", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeQueryStatement", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeQueryStatement(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeQueryStatement_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeQueryStatement", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeQueryStatement", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_executeUpdateStatement = function(seqid, input, output) { + var args = new IClientRPCService_executeUpdateStatement_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeUpdateStatement.length === 1) { + Q.fcall(this._handler.executeUpdateStatement.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeUpdateStatement_result({success: result}); + output.writeMessageBegin("executeUpdateStatement", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeUpdateStatement", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeUpdateStatement(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeUpdateStatement_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeUpdateStatement", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeUpdateStatement", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_fetchResults = function(seqid, input, output) { + var args = new IClientRPCService_fetchResults_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.fetchResults.length === 1) { + Q.fcall(this._handler.fetchResults.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_fetchResults_result({success: result}); + output.writeMessageBegin("fetchResults", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("fetchResults", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.fetchResults(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_fetchResults_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("fetchResults", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("fetchResults", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_fetchMetadata = function(seqid, input, output) { + var args = new IClientRPCService_fetchMetadata_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.fetchMetadata.length === 1) { + Q.fcall(this._handler.fetchMetadata.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_fetchMetadata_result({success: result}); + output.writeMessageBegin("fetchMetadata", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("fetchMetadata", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.fetchMetadata(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_fetchMetadata_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("fetchMetadata", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("fetchMetadata", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_cancelOperation = function(seqid, input, output) { + var args = new IClientRPCService_cancelOperation_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.cancelOperation.length === 1) { + Q.fcall(this._handler.cancelOperation.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_cancelOperation_result({success: result}); + output.writeMessageBegin("cancelOperation", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("cancelOperation", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.cancelOperation(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_cancelOperation_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("cancelOperation", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("cancelOperation", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_closeOperation = function(seqid, input, output) { + var args = new IClientRPCService_closeOperation_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.closeOperation.length === 1) { + Q.fcall(this._handler.closeOperation.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_closeOperation_result({success: result}); + output.writeMessageBegin("closeOperation", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("closeOperation", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.closeOperation(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_closeOperation_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("closeOperation", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("closeOperation", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_getTimeZone = function(seqid, input, output) { + var args = new IClientRPCService_getTimeZone_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.getTimeZone.length === 1) { + Q.fcall(this._handler.getTimeZone.bind(this._handler), + args.sessionId + ).then(function(result) { + var result_obj = new IClientRPCService_getTimeZone_result({success: result}); + output.writeMessageBegin("getTimeZone", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("getTimeZone", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.getTimeZone(args.sessionId, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_getTimeZone_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("getTimeZone", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("getTimeZone", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_setTimeZone = function(seqid, input, output) { + var args = new IClientRPCService_setTimeZone_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.setTimeZone.length === 1) { + Q.fcall(this._handler.setTimeZone.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_setTimeZone_result({success: result}); + output.writeMessageBegin("setTimeZone", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("setTimeZone", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.setTimeZone(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_setTimeZone_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("setTimeZone", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("setTimeZone", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_getProperties = function(seqid, input, output) { + var args = new IClientRPCService_getProperties_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.getProperties.length === 0) { + Q.fcall(this._handler.getProperties.bind(this._handler) + ).then(function(result) { + var result_obj = new IClientRPCService_getProperties_result({success: result}); + output.writeMessageBegin("getProperties", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("getProperties", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.getProperties(function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_getProperties_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("getProperties", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("getProperties", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_setStorageGroup = function(seqid, input, output) { + var args = new IClientRPCService_setStorageGroup_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.setStorageGroup.length === 2) { + Q.fcall(this._handler.setStorageGroup.bind(this._handler), + args.sessionId, + args.storageGroup + ).then(function(result) { + var result_obj = new IClientRPCService_setStorageGroup_result({success: result}); + output.writeMessageBegin("setStorageGroup", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("setStorageGroup", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.setStorageGroup(args.sessionId, args.storageGroup, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_setStorageGroup_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("setStorageGroup", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("setStorageGroup", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_createTimeseries = function(seqid, input, output) { + var args = new IClientRPCService_createTimeseries_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.createTimeseries.length === 1) { + Q.fcall(this._handler.createTimeseries.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_createTimeseries_result({success: result}); + output.writeMessageBegin("createTimeseries", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("createTimeseries", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.createTimeseries(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_createTimeseries_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("createTimeseries", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("createTimeseries", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_createAlignedTimeseries = function(seqid, input, output) { + var args = new IClientRPCService_createAlignedTimeseries_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.createAlignedTimeseries.length === 1) { + Q.fcall(this._handler.createAlignedTimeseries.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_createAlignedTimeseries_result({success: result}); + output.writeMessageBegin("createAlignedTimeseries", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("createAlignedTimeseries", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.createAlignedTimeseries(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_createAlignedTimeseries_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("createAlignedTimeseries", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("createAlignedTimeseries", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_createMultiTimeseries = function(seqid, input, output) { + var args = new IClientRPCService_createMultiTimeseries_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.createMultiTimeseries.length === 1) { + Q.fcall(this._handler.createMultiTimeseries.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_createMultiTimeseries_result({success: result}); + output.writeMessageBegin("createMultiTimeseries", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("createMultiTimeseries", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.createMultiTimeseries(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_createMultiTimeseries_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("createMultiTimeseries", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("createMultiTimeseries", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_deleteTimeseries = function(seqid, input, output) { + var args = new IClientRPCService_deleteTimeseries_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.deleteTimeseries.length === 2) { + Q.fcall(this._handler.deleteTimeseries.bind(this._handler), + args.sessionId, + args.path + ).then(function(result) { + var result_obj = new IClientRPCService_deleteTimeseries_result({success: result}); + output.writeMessageBegin("deleteTimeseries", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("deleteTimeseries", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.deleteTimeseries(args.sessionId, args.path, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_deleteTimeseries_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("deleteTimeseries", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("deleteTimeseries", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_deleteStorageGroups = function(seqid, input, output) { + var args = new IClientRPCService_deleteStorageGroups_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.deleteStorageGroups.length === 2) { + Q.fcall(this._handler.deleteStorageGroups.bind(this._handler), + args.sessionId, + args.storageGroup + ).then(function(result) { + var result_obj = new IClientRPCService_deleteStorageGroups_result({success: result}); + output.writeMessageBegin("deleteStorageGroups", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("deleteStorageGroups", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.deleteStorageGroups(args.sessionId, args.storageGroup, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_deleteStorageGroups_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("deleteStorageGroups", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("deleteStorageGroups", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_insertRecord = function(seqid, input, output) { + var args = new IClientRPCService_insertRecord_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.insertRecord.length === 1) { + Q.fcall(this._handler.insertRecord.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_insertRecord_result({success: result}); + output.writeMessageBegin("insertRecord", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertRecord", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.insertRecord(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_insertRecord_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("insertRecord", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertRecord", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_insertStringRecord = function(seqid, input, output) { + var args = new IClientRPCService_insertStringRecord_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.insertStringRecord.length === 1) { + Q.fcall(this._handler.insertStringRecord.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_insertStringRecord_result({success: result}); + output.writeMessageBegin("insertStringRecord", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertStringRecord", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.insertStringRecord(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_insertStringRecord_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("insertStringRecord", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertStringRecord", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_insertTablet = function(seqid, input, output) { + var args = new IClientRPCService_insertTablet_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.insertTablet.length === 1) { + Q.fcall(this._handler.insertTablet.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_insertTablet_result({success: result}); + output.writeMessageBegin("insertTablet", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertTablet", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.insertTablet(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_insertTablet_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("insertTablet", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertTablet", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_insertTablets = function(seqid, input, output) { + var args = new IClientRPCService_insertTablets_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.insertTablets.length === 1) { + Q.fcall(this._handler.insertTablets.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_insertTablets_result({success: result}); + output.writeMessageBegin("insertTablets", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertTablets", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.insertTablets(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_insertTablets_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("insertTablets", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertTablets", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_insertRecords = function(seqid, input, output) { + var args = new IClientRPCService_insertRecords_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.insertRecords.length === 1) { + Q.fcall(this._handler.insertRecords.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_insertRecords_result({success: result}); + output.writeMessageBegin("insertRecords", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertRecords", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.insertRecords(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_insertRecords_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("insertRecords", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertRecords", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_insertRecordsOfOneDevice = function(seqid, input, output) { + var args = new IClientRPCService_insertRecordsOfOneDevice_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.insertRecordsOfOneDevice.length === 1) { + Q.fcall(this._handler.insertRecordsOfOneDevice.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_insertRecordsOfOneDevice_result({success: result}); + output.writeMessageBegin("insertRecordsOfOneDevice", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertRecordsOfOneDevice", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.insertRecordsOfOneDevice(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_insertRecordsOfOneDevice_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("insertRecordsOfOneDevice", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertRecordsOfOneDevice", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_insertStringRecordsOfOneDevice = function(seqid, input, output) { + var args = new IClientRPCService_insertStringRecordsOfOneDevice_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.insertStringRecordsOfOneDevice.length === 1) { + Q.fcall(this._handler.insertStringRecordsOfOneDevice.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_insertStringRecordsOfOneDevice_result({success: result}); + output.writeMessageBegin("insertStringRecordsOfOneDevice", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertStringRecordsOfOneDevice", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.insertStringRecordsOfOneDevice(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_insertStringRecordsOfOneDevice_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("insertStringRecordsOfOneDevice", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertStringRecordsOfOneDevice", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_insertStringRecords = function(seqid, input, output) { + var args = new IClientRPCService_insertStringRecords_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.insertStringRecords.length === 1) { + Q.fcall(this._handler.insertStringRecords.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_insertStringRecords_result({success: result}); + output.writeMessageBegin("insertStringRecords", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertStringRecords", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.insertStringRecords(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_insertStringRecords_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("insertStringRecords", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("insertStringRecords", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_testInsertTablet = function(seqid, input, output) { + var args = new IClientRPCService_testInsertTablet_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.testInsertTablet.length === 1) { + Q.fcall(this._handler.testInsertTablet.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_testInsertTablet_result({success: result}); + output.writeMessageBegin("testInsertTablet", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testInsertTablet", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.testInsertTablet(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_testInsertTablet_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("testInsertTablet", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testInsertTablet", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_testInsertTablets = function(seqid, input, output) { + var args = new IClientRPCService_testInsertTablets_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.testInsertTablets.length === 1) { + Q.fcall(this._handler.testInsertTablets.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_testInsertTablets_result({success: result}); + output.writeMessageBegin("testInsertTablets", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testInsertTablets", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.testInsertTablets(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_testInsertTablets_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("testInsertTablets", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testInsertTablets", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_testInsertRecord = function(seqid, input, output) { + var args = new IClientRPCService_testInsertRecord_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.testInsertRecord.length === 1) { + Q.fcall(this._handler.testInsertRecord.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_testInsertRecord_result({success: result}); + output.writeMessageBegin("testInsertRecord", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testInsertRecord", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.testInsertRecord(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_testInsertRecord_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("testInsertRecord", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testInsertRecord", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_testInsertStringRecord = function(seqid, input, output) { + var args = new IClientRPCService_testInsertStringRecord_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.testInsertStringRecord.length === 1) { + Q.fcall(this._handler.testInsertStringRecord.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_testInsertStringRecord_result({success: result}); + output.writeMessageBegin("testInsertStringRecord", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testInsertStringRecord", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.testInsertStringRecord(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_testInsertStringRecord_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("testInsertStringRecord", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testInsertStringRecord", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_testInsertRecords = function(seqid, input, output) { + var args = new IClientRPCService_testInsertRecords_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.testInsertRecords.length === 1) { + Q.fcall(this._handler.testInsertRecords.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_testInsertRecords_result({success: result}); + output.writeMessageBegin("testInsertRecords", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testInsertRecords", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.testInsertRecords(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_testInsertRecords_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("testInsertRecords", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testInsertRecords", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_testInsertRecordsOfOneDevice = function(seqid, input, output) { + var args = new IClientRPCService_testInsertRecordsOfOneDevice_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.testInsertRecordsOfOneDevice.length === 1) { + Q.fcall(this._handler.testInsertRecordsOfOneDevice.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_testInsertRecordsOfOneDevice_result({success: result}); + output.writeMessageBegin("testInsertRecordsOfOneDevice", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testInsertRecordsOfOneDevice", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.testInsertRecordsOfOneDevice(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_testInsertRecordsOfOneDevice_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("testInsertRecordsOfOneDevice", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testInsertRecordsOfOneDevice", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_testInsertStringRecords = function(seqid, input, output) { + var args = new IClientRPCService_testInsertStringRecords_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.testInsertStringRecords.length === 1) { + Q.fcall(this._handler.testInsertStringRecords.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_testInsertStringRecords_result({success: result}); + output.writeMessageBegin("testInsertStringRecords", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testInsertStringRecords", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.testInsertStringRecords(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_testInsertStringRecords_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("testInsertStringRecords", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("testInsertStringRecords", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_deleteData = function(seqid, input, output) { + var args = new IClientRPCService_deleteData_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.deleteData.length === 1) { + Q.fcall(this._handler.deleteData.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_deleteData_result({success: result}); + output.writeMessageBegin("deleteData", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("deleteData", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.deleteData(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_deleteData_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("deleteData", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("deleteData", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_executeRawDataQuery = function(seqid, input, output) { + var args = new IClientRPCService_executeRawDataQuery_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeRawDataQuery.length === 1) { + Q.fcall(this._handler.executeRawDataQuery.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeRawDataQuery_result({success: result}); + output.writeMessageBegin("executeRawDataQuery", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeRawDataQuery", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeRawDataQuery(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeRawDataQuery_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeRawDataQuery", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeRawDataQuery", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_executeLastDataQuery = function(seqid, input, output) { + var args = new IClientRPCService_executeLastDataQuery_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeLastDataQuery.length === 1) { + Q.fcall(this._handler.executeLastDataQuery.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeLastDataQuery_result({success: result}); + output.writeMessageBegin("executeLastDataQuery", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeLastDataQuery", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeLastDataQuery(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeLastDataQuery_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeLastDataQuery", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeLastDataQuery", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_executeAggregationQuery = function(seqid, input, output) { + var args = new IClientRPCService_executeAggregationQuery_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.executeAggregationQuery.length === 1) { + Q.fcall(this._handler.executeAggregationQuery.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_executeAggregationQuery_result({success: result}); + output.writeMessageBegin("executeAggregationQuery", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeAggregationQuery", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.executeAggregationQuery(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_executeAggregationQuery_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("executeAggregationQuery", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("executeAggregationQuery", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_requestStatementId = function(seqid, input, output) { + var args = new IClientRPCService_requestStatementId_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.requestStatementId.length === 1) { + Q.fcall(this._handler.requestStatementId.bind(this._handler), + args.sessionId + ).then(function(result) { + var result_obj = new IClientRPCService_requestStatementId_result({success: result}); + output.writeMessageBegin("requestStatementId", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("requestStatementId", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.requestStatementId(args.sessionId, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_requestStatementId_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("requestStatementId", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("requestStatementId", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_createSchemaTemplate = function(seqid, input, output) { + var args = new IClientRPCService_createSchemaTemplate_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.createSchemaTemplate.length === 1) { + Q.fcall(this._handler.createSchemaTemplate.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_createSchemaTemplate_result({success: result}); + output.writeMessageBegin("createSchemaTemplate", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("createSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.createSchemaTemplate(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_createSchemaTemplate_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("createSchemaTemplate", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("createSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_appendSchemaTemplate = function(seqid, input, output) { + var args = new IClientRPCService_appendSchemaTemplate_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.appendSchemaTemplate.length === 1) { + Q.fcall(this._handler.appendSchemaTemplate.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_appendSchemaTemplate_result({success: result}); + output.writeMessageBegin("appendSchemaTemplate", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("appendSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.appendSchemaTemplate(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_appendSchemaTemplate_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("appendSchemaTemplate", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("appendSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_pruneSchemaTemplate = function(seqid, input, output) { + var args = new IClientRPCService_pruneSchemaTemplate_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.pruneSchemaTemplate.length === 1) { + Q.fcall(this._handler.pruneSchemaTemplate.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_pruneSchemaTemplate_result({success: result}); + output.writeMessageBegin("pruneSchemaTemplate", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("pruneSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.pruneSchemaTemplate(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_pruneSchemaTemplate_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("pruneSchemaTemplate", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("pruneSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_querySchemaTemplate = function(seqid, input, output) { + var args = new IClientRPCService_querySchemaTemplate_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.querySchemaTemplate.length === 1) { + Q.fcall(this._handler.querySchemaTemplate.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_querySchemaTemplate_result({success: result}); + output.writeMessageBegin("querySchemaTemplate", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("querySchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.querySchemaTemplate(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_querySchemaTemplate_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("querySchemaTemplate", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("querySchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_showConfigurationTemplate = function(seqid, input, output) { + var args = new IClientRPCService_showConfigurationTemplate_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.showConfigurationTemplate.length === 0) { + Q.fcall(this._handler.showConfigurationTemplate.bind(this._handler) + ).then(function(result) { + var result_obj = new IClientRPCService_showConfigurationTemplate_result({success: result}); + output.writeMessageBegin("showConfigurationTemplate", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("showConfigurationTemplate", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.showConfigurationTemplate(function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_showConfigurationTemplate_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("showConfigurationTemplate", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("showConfigurationTemplate", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_showConfiguration = function(seqid, input, output) { + var args = new IClientRPCService_showConfiguration_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.showConfiguration.length === 1) { + Q.fcall(this._handler.showConfiguration.bind(this._handler), + args.nodeId + ).then(function(result) { + var result_obj = new IClientRPCService_showConfiguration_result({success: result}); + output.writeMessageBegin("showConfiguration", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("showConfiguration", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.showConfiguration(args.nodeId, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_showConfiguration_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("showConfiguration", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("showConfiguration", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_setSchemaTemplate = function(seqid, input, output) { + var args = new IClientRPCService_setSchemaTemplate_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.setSchemaTemplate.length === 1) { + Q.fcall(this._handler.setSchemaTemplate.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_setSchemaTemplate_result({success: result}); + output.writeMessageBegin("setSchemaTemplate", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("setSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.setSchemaTemplate(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_setSchemaTemplate_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("setSchemaTemplate", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("setSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } +}; +IClientRPCServiceProcessor.prototype.process_unsetSchemaTemplate = function(seqid, input, output) { + var args = new IClientRPCService_unsetSchemaTemplate_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.unsetSchemaTemplate.length === 1) { + Q.fcall(this._handler.unsetSchemaTemplate.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_unsetSchemaTemplate_result({success: result}); + output.writeMessageBegin("unsetSchemaTemplate", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("unsetSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.unsetSchemaTemplate(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_unsetSchemaTemplate_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("unsetSchemaTemplate", Thrift.MessageType.REPLY, seqid); } else { - _defer.resolve(result); + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("unsetSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); } - }; - this.send_requestStatementId(sessionId); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_requestStatementId(sessionId); - } -}; - -IClientRPCServiceClient.prototype.send_requestStatementId = function(sessionId) { - var output = new this.pClass(this.output); - var params = { - sessionId: sessionId - }; - var args = new IClientRPCService_requestStatementId_args(params); - try { - output.writeMessageBegin('requestStatementId', Thrift.MessageType.CALL, this.seqid()); - args[Symbol.for("write")](output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); } }; - -IClientRPCServiceClient.prototype.recv_requestStatementId = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x[Symbol.for("read")](input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_requestStatementId_result(); - result[Symbol.for("read")](input); +IClientRPCServiceProcessor.prototype.process_dropSchemaTemplate = function(seqid, input, output) { + var args = new IClientRPCService_dropSchemaTemplate_args(); + args.read(input); input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); + if (this._handler.dropSchemaTemplate.length === 1) { + Q.fcall(this._handler.dropSchemaTemplate.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_dropSchemaTemplate_result({success: result}); + output.writeMessageBegin("dropSchemaTemplate", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("dropSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.dropSchemaTemplate(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_dropSchemaTemplate_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("dropSchemaTemplate", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("dropSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); } - return callback('requestStatementId failed: unknown result'); }; - -IClientRPCServiceClient.prototype.insertRecord = function(req, callback) { - this._seqid = this.new_seqid(); - if (callback === undefined) { - var _defer = Q.defer(); - this._reqs[this.seqid()] = function(error, result) { - if (error) { - _defer.reject(error); +IClientRPCServiceProcessor.prototype.process_createTimeseriesUsingSchemaTemplate = function(seqid, input, output) { + var args = new IClientRPCService_createTimeseriesUsingSchemaTemplate_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.createTimeseriesUsingSchemaTemplate.length === 1) { + Q.fcall(this._handler.createTimeseriesUsingSchemaTemplate.bind(this._handler), + args.req + ).then(function(result) { + var result_obj = new IClientRPCService_createTimeseriesUsingSchemaTemplate_result({success: result}); + output.writeMessageBegin("createTimeseriesUsingSchemaTemplate", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("createTimeseriesUsingSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.createTimeseriesUsingSchemaTemplate(args.req, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_createTimeseriesUsingSchemaTemplate_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("createTimeseriesUsingSchemaTemplate", Thrift.MessageType.REPLY, seqid); } else { - _defer.resolve(result); + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("createTimeseriesUsingSchemaTemplate", Thrift.MessageType.EXCEPTION, seqid); } - }; - this.send_insertRecord(req); - return _defer.promise; - } else { - this._reqs[this.seqid()] = callback; - this.send_insertRecord(req); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); } }; - -IClientRPCServiceClient.prototype.send_insertRecord = function(req) { - var output = new this.pClass(this.output); - var params = { - req: req - }; - var args = new IClientRPCService_insertRecord_args(params); - try { - output.writeMessageBegin('insertRecord', Thrift.MessageType.CALL, this.seqid()); - args[Symbol.for("write")](output); - output.writeMessageEnd(); - return this.output.flush(); - } - catch (e) { - delete this._reqs[this.seqid()]; - if (typeof output.reset === 'function') { - output.reset(); - } - throw e; +IClientRPCServiceProcessor.prototype.process_handshake = function(seqid, input, output) { + var args = new IClientRPCService_handshake_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.handshake.length === 1) { + Q.fcall(this._handler.handshake.bind(this._handler), + args.info + ).then(function(result) { + var result_obj = new IClientRPCService_handshake_result({success: result}); + output.writeMessageBegin("handshake", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("handshake", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.handshake(args.info, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_handshake_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("handshake", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("handshake", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); } }; - -IClientRPCServiceClient.prototype.recv_insertRecord = function(input,mtype,rseqid) { - var callback = this._reqs[rseqid] || function() {}; - delete this._reqs[rseqid]; - if (mtype == Thrift.MessageType.EXCEPTION) { - var x = new Thrift.TApplicationException(); - x[Symbol.for("read")](input); - input.readMessageEnd(); - return callback(x); - } - var result = new IClientRPCService_insertRecord_result(); - result[Symbol.for("read")](input); +IClientRPCServiceProcessor.prototype.process_sendPipeData = function(seqid, input, output) { + var args = new IClientRPCService_sendPipeData_args(); + args.read(input); input.readMessageEnd(); - - if (null !== result.success) { - return callback(null, result.success); + if (this._handler.sendPipeData.length === 1) { + Q.fcall(this._handler.sendPipeData.bind(this._handler), + args.buff + ).then(function(result) { + var result_obj = new IClientRPCService_sendPipeData_result({success: result}); + output.writeMessageBegin("sendPipeData", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("sendPipeData", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); + } else { + this._handler.sendPipeData(args.buff, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_sendPipeData_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("sendPipeData", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("sendPipeData", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); } - return callback('insertRecord failed: unknown result'); -}; -var IClientRPCServiceProcessor = exports.Processor = function(handler) { - this._handler = handler; }; -IClientRPCServiceProcessor.prototype.process = function(input, output) { - var r = input.readMessageBegin(); - if (this['process_' + r.fname]) { - return this['process_' + r.fname].call(this, r.rseqid, input, output); +IClientRPCServiceProcessor.prototype.process_sendFile = function(seqid, input, output) { + var args = new IClientRPCService_sendFile_args(); + args.read(input); + input.readMessageEnd(); + if (this._handler.sendFile.length === 2) { + Q.fcall(this._handler.sendFile.bind(this._handler), + args.metaInfo, + args.buff + ).then(function(result) { + var result_obj = new IClientRPCService_sendFile_result({success: result}); + output.writeMessageBegin("sendFile", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }).catch(function (err) { + var result; + result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("sendFile", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); + output.writeMessageEnd(); + output.flush(); + }); } else { - input.skip(Thrift.Type.STRUCT); - input.readMessageEnd(); - var x = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN_METHOD, 'Unknown function ' + r.fname); - output.writeMessageBegin(r.fname, Thrift.MessageType.EXCEPTION, r.rseqid); - x[Symbol.for("write")](output); - output.writeMessageEnd(); - output.flush(); + this._handler.sendFile(args.metaInfo, args.buff, function (err, result) { + var result_obj; + if ((err === null || typeof err === 'undefined')) { + result_obj = new IClientRPCService_sendFile_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("sendFile", Thrift.MessageType.REPLY, seqid); + } else { + result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); + output.writeMessageBegin("sendFile", Thrift.MessageType.EXCEPTION, seqid); + } + result_obj.write(output); + output.writeMessageEnd(); + output.flush(); + }); } }; -IClientRPCServiceProcessor.prototype.process_openSession = function(seqid, input, output) { - var args = new IClientRPCService_openSession_args(); - args[Symbol.for("read")](input); +IClientRPCServiceProcessor.prototype.process_pipeTransfer = function(seqid, input, output) { + var args = new IClientRPCService_pipeTransfer_args(); + args.read(input); input.readMessageEnd(); - if (this._handler.openSession.length === 1) { - Q.fcall(this._handler.openSession.bind(this._handler), + if (this._handler.pipeTransfer.length === 1) { + Q.fcall(this._handler.pipeTransfer.bind(this._handler), args.req ).then(function(result) { - var result_obj = new IClientRPCService_openSession_result({success: result}); - output.writeMessageBegin("openSession", Thrift.MessageType.REPLY, seqid); - result_obj[Symbol.for("write")](output); + var result_obj = new IClientRPCService_pipeTransfer_result({success: result}); + output.writeMessageBegin("pipeTransfer", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); output.writeMessageEnd(); output.flush(); }).catch(function (err) { var result; result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("openSession", Thrift.MessageType.EXCEPTION, seqid); - result[Symbol.for("write")](output); + output.writeMessageBegin("pipeTransfer", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); output.writeMessageEnd(); output.flush(); }); } else { - this._handler.openSession(args.req, function (err, result) { + this._handler.pipeTransfer(args.req, function (err, result) { var result_obj; if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_openSession_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("openSession", Thrift.MessageType.REPLY, seqid); + result_obj = new IClientRPCService_pipeTransfer_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("pipeTransfer", Thrift.MessageType.REPLY, seqid); } else { result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("openSession", Thrift.MessageType.EXCEPTION, seqid); + output.writeMessageBegin("pipeTransfer", Thrift.MessageType.EXCEPTION, seqid); } - result_obj[Symbol.for("write")](output); + result_obj.write(output); output.writeMessageEnd(); output.flush(); }); } }; -IClientRPCServiceProcessor.prototype.process_closeSession = function(seqid, input, output) { - var args = new IClientRPCService_closeSession_args(); - args[Symbol.for("read")](input); +IClientRPCServiceProcessor.prototype.process_pipeSubscribe = function(seqid, input, output) { + var args = new IClientRPCService_pipeSubscribe_args(); + args.read(input); input.readMessageEnd(); - if (this._handler.closeSession.length === 1) { - Q.fcall(this._handler.closeSession.bind(this._handler), + if (this._handler.pipeSubscribe.length === 1) { + Q.fcall(this._handler.pipeSubscribe.bind(this._handler), args.req ).then(function(result) { - var result_obj = new IClientRPCService_closeSession_result({success: result}); - output.writeMessageBegin("closeSession", Thrift.MessageType.REPLY, seqid); - result_obj[Symbol.for("write")](output); + var result_obj = new IClientRPCService_pipeSubscribe_result({success: result}); + output.writeMessageBegin("pipeSubscribe", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); output.writeMessageEnd(); output.flush(); }).catch(function (err) { var result; result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("closeSession", Thrift.MessageType.EXCEPTION, seqid); - result[Symbol.for("write")](output); + output.writeMessageBegin("pipeSubscribe", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); output.writeMessageEnd(); output.flush(); }); } else { - this._handler.closeSession(args.req, function (err, result) { + this._handler.pipeSubscribe(args.req, function (err, result) { var result_obj; if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_closeSession_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("closeSession", Thrift.MessageType.REPLY, seqid); + result_obj = new IClientRPCService_pipeSubscribe_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("pipeSubscribe", Thrift.MessageType.REPLY, seqid); } else { result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("closeSession", Thrift.MessageType.EXCEPTION, seqid); + output.writeMessageBegin("pipeSubscribe", Thrift.MessageType.EXCEPTION, seqid); } - result_obj[Symbol.for("write")](output); + result_obj.write(output); output.writeMessageEnd(); output.flush(); }); } }; -IClientRPCServiceProcessor.prototype.process_executeQueryStatement = function(seqid, input, output) { - var args = new IClientRPCService_executeQueryStatement_args(); - args[Symbol.for("read")](input); +IClientRPCServiceProcessor.prototype.process_getBackupConfiguration = function(seqid, input, output) { + var args = new IClientRPCService_getBackupConfiguration_args(); + args.read(input); input.readMessageEnd(); - if (this._handler.executeQueryStatement.length === 1) { - Q.fcall(this._handler.executeQueryStatement.bind(this._handler), - args.req + if (this._handler.getBackupConfiguration.length === 0) { + Q.fcall(this._handler.getBackupConfiguration.bind(this._handler) ).then(function(result) { - var result_obj = new IClientRPCService_executeQueryStatement_result({success: result}); - output.writeMessageBegin("executeQueryStatement", Thrift.MessageType.REPLY, seqid); - result_obj[Symbol.for("write")](output); + var result_obj = new IClientRPCService_getBackupConfiguration_result({success: result}); + output.writeMessageBegin("getBackupConfiguration", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); output.writeMessageEnd(); output.flush(); }).catch(function (err) { var result; result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeQueryStatement", Thrift.MessageType.EXCEPTION, seqid); - result[Symbol.for("write")](output); + output.writeMessageBegin("getBackupConfiguration", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); output.writeMessageEnd(); output.flush(); }); } else { - this._handler.executeQueryStatement(args.req, function (err, result) { + this._handler.getBackupConfiguration(function (err, result) { var result_obj; if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_executeQueryStatement_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("executeQueryStatement", Thrift.MessageType.REPLY, seqid); + result_obj = new IClientRPCService_getBackupConfiguration_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("getBackupConfiguration", Thrift.MessageType.REPLY, seqid); } else { result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("executeQueryStatement", Thrift.MessageType.EXCEPTION, seqid); + output.writeMessageBegin("getBackupConfiguration", Thrift.MessageType.EXCEPTION, seqid); } - result_obj[Symbol.for("write")](output); + result_obj.write(output); output.writeMessageEnd(); output.flush(); }); } }; -IClientRPCServiceProcessor.prototype.process_requestStatementId = function(seqid, input, output) { - var args = new IClientRPCService_requestStatementId_args(); - args[Symbol.for("read")](input); +IClientRPCServiceProcessor.prototype.process_fetchAllConnectionsInfo = function(seqid, input, output) { + var args = new IClientRPCService_fetchAllConnectionsInfo_args(); + args.read(input); input.readMessageEnd(); - if (this._handler.requestStatementId.length === 1) { - Q.fcall(this._handler.requestStatementId.bind(this._handler), - args.sessionId + if (this._handler.fetchAllConnectionsInfo.length === 0) { + Q.fcall(this._handler.fetchAllConnectionsInfo.bind(this._handler) ).then(function(result) { - var result_obj = new IClientRPCService_requestStatementId_result({success: result}); - output.writeMessageBegin("requestStatementId", Thrift.MessageType.REPLY, seqid); - result_obj[Symbol.for("write")](output); + var result_obj = new IClientRPCService_fetchAllConnectionsInfo_result({success: result}); + output.writeMessageBegin("fetchAllConnectionsInfo", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); output.writeMessageEnd(); output.flush(); }).catch(function (err) { var result; result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("requestStatementId", Thrift.MessageType.EXCEPTION, seqid); - result[Symbol.for("write")](output); + output.writeMessageBegin("fetchAllConnectionsInfo", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); output.writeMessageEnd(); output.flush(); }); } else { - this._handler.requestStatementId(args.sessionId, function (err, result) { + this._handler.fetchAllConnectionsInfo(function (err, result) { var result_obj; if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_requestStatementId_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("requestStatementId", Thrift.MessageType.REPLY, seqid); + result_obj = new IClientRPCService_fetchAllConnectionsInfo_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("fetchAllConnectionsInfo", Thrift.MessageType.REPLY, seqid); } else { result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("requestStatementId", Thrift.MessageType.EXCEPTION, seqid); + output.writeMessageBegin("fetchAllConnectionsInfo", Thrift.MessageType.EXCEPTION, seqid); } - result_obj[Symbol.for("write")](output); + result_obj.write(output); output.writeMessageEnd(); output.flush(); }); } }; -IClientRPCServiceProcessor.prototype.process_insertRecord = function(seqid, input, output) { - var args = new IClientRPCService_insertRecord_args(); - args[Symbol.for("read")](input); +IClientRPCServiceProcessor.prototype.process_testConnectionEmptyRPC = function(seqid, input, output) { + var args = new IClientRPCService_testConnectionEmptyRPC_args(); + args.read(input); input.readMessageEnd(); - if (this._handler.insertRecord.length === 1) { - Q.fcall(this._handler.insertRecord.bind(this._handler), - args.req + if (this._handler.testConnectionEmptyRPC.length === 0) { + Q.fcall(this._handler.testConnectionEmptyRPC.bind(this._handler) ).then(function(result) { - var result_obj = new IClientRPCService_insertRecord_result({success: result}); - output.writeMessageBegin("insertRecord", Thrift.MessageType.REPLY, seqid); - result_obj[Symbol.for("write")](output); + var result_obj = new IClientRPCService_testConnectionEmptyRPC_result({success: result}); + output.writeMessageBegin("testConnectionEmptyRPC", Thrift.MessageType.REPLY, seqid); + result_obj.write(output); output.writeMessageEnd(); output.flush(); }).catch(function (err) { var result; result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("insertRecord", Thrift.MessageType.EXCEPTION, seqid); - result[Symbol.for("write")](output); + output.writeMessageBegin("testConnectionEmptyRPC", Thrift.MessageType.EXCEPTION, seqid); + result.write(output); output.writeMessageEnd(); output.flush(); }); } else { - this._handler.insertRecord(args.req, function (err, result) { + this._handler.testConnectionEmptyRPC(function (err, result) { var result_obj; if ((err === null || typeof err === 'undefined')) { - result_obj = new IClientRPCService_insertRecord_result((err !== null || typeof err === 'undefined') ? err : {success: result}); - output.writeMessageBegin("insertRecord", Thrift.MessageType.REPLY, seqid); + result_obj = new IClientRPCService_testConnectionEmptyRPC_result((err !== null || typeof err === 'undefined') ? err : {success: result}); + output.writeMessageBegin("testConnectionEmptyRPC", Thrift.MessageType.REPLY, seqid); } else { result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message); - output.writeMessageBegin("insertRecord", Thrift.MessageType.EXCEPTION, seqid); + output.writeMessageBegin("testConnectionEmptyRPC", Thrift.MessageType.EXCEPTION, seqid); } - result_obj[Symbol.for("write")](output); + result_obj.write(output); output.writeMessageEnd(); output.flush(); }); } -}; +}; \ No newline at end of file diff --git a/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService.thrift b/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService.thrift deleted file mode 100644 index aa087f5..0000000 --- a/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService.thrift +++ /dev/null @@ -1,65 +0,0 @@ -namespace js IClientRPCService -namespace java IClientRPCService - -enum TSProtocolVersion { - IOTDB_SERVICE_PROTOCOL_V1 = 1, - IOTDB_SERVICE_PROTOCOL_V2 = 2, - IOTDB_SERVICE_PROTOCOL_V3 = 3 -} - -struct TSOpenSessionReq { - 1: optional string username - 2: optional string password - 3: optional i32 client_protocol - 4: optional string zoneId - 5: optional map configuration -} - -struct TSCloseSessionReq { - 1: required i64 sessionId -} - -struct TSExecuteStatementReq { - 1: required i64 sessionId - 2: required string statement - 3: required i64 statementId - 4: required i32 fetchSize - 5: optional i32 timeout -} - -struct TSInsertRecordReq { - 1: required i64 sessionId - 2: required string prefixPath - 3: required list measurements - 4: required binary values - 5: required i64 timestamp - 6: optional bool isAligned -} - -struct TSOpenSessionResp { - 1: required i64 sessionId - 2: required i32 serverProtocolVersion -} - -struct TSExecuteStatementResp { - 1: optional list columns - 2: optional list dataTypeList - 3: optional map columnNameIndexMap - 4: optional i64 queryId - 5: optional QueryDataSet queryDataSet - 6: optional bool ignoreTimeStamp -} - -struct QueryDataSet { - 1: required list valueList - 2: required list bitmapList - 3: required binary time -} - -service IClientRPCService { - TSOpenSessionResp openSession(1: TSOpenSessionReq req) - void closeSession(1: TSCloseSessionReq req) - TSExecuteStatementResp executeQueryStatement(1: TSExecuteStatementReq req) - i64 requestStatementId(1: i64 sessionId) - i32 insertRecord(1: TSInsertRecordReq req) -} diff --git a/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService_types.d.ts b/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService_types.d.ts deleted file mode 100644 index 4cb465b..0000000 --- a/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService_types.d.ts +++ /dev/null @@ -1,110 +0,0 @@ -interface Int64 { - constructor(o?: number | string): this; - toString(): string; - toJson(): string; -} - -export enum TSProtocolVersion { - IOTDB_SERVICE_PROTOCOL_V1 = 1, - IOTDB_SERVICE_PROTOCOL_V2 = 2, - IOTDB_SERVICE_PROTOCOL_V3 = 3, -} - -export class TSOpenSessionReq { - username?: string; - password?: string; - client_protocol?: number; - zoneId?: string; - configuration?: Map; - - constructor(arg?: { - username?: string; - password?: string; - client_protocol?: number; - zoneId?: string; - configuration?: Map; - }) -} - -export class TSCloseSessionReq { - sessionId: Int64; - - constructor(arg?: { - sessionId: Int64; - }) -} - -export class TSExecuteStatementReq { - sessionId: Int64; - statement: string; - statementId: Int64; - fetchSize: number; - timeout?: number; - - constructor(arg?: { - sessionId: Int64; - statement: string; - statementId: Int64; - fetchSize: number; - timeout?: number; - }) -} - -export class TSInsertRecordReq { - sessionId: Int64; - prefixPath: string; - measurements: string[]; - values: Buffer; - timestamp: Int64; - isAligned?: boolean; - - constructor(arg?: { - sessionId: Int64; - prefixPath: string; - measurements: string[]; - values: Buffer; - timestamp: Int64; - isAligned?: boolean; - }) -} - -export class TSOpenSessionResp { - sessionId: Int64; - serverProtocolVersion: number; - - constructor(arg?: { - sessionId: Int64; - serverProtocolVersion: number; - }) -} - -export class TSExecuteStatementResp { - columns?: string[]; - dataTypeList?: number[]; - columnNameIndexMap?: Map; - queryId?: Int64; - queryDataSet?: QueryDataSet; - ignoreTimeStamp?: boolean; - - constructor(arg?: { - columns?: string[]; - dataTypeList?: number[]; - columnNameIndexMap?: Map; - queryId?: Int64; - queryDataSet?: QueryDataSet; - ignoreTimeStamp?: boolean; - }) -} - -export class QueryDataSet { - valueList: Buffer[]; - bitmapList: Buffer[]; - time: Buffer; - - constructor(arg?: { - valueList: Buffer[]; - bitmapList: Buffer[]; - time: Buffer; - }) -} - diff --git a/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService_types.js b/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService_types.js deleted file mode 100644 index 1e491d3..0000000 --- a/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/IClientRPCService_types.js +++ /dev/null @@ -1,829 +0,0 @@ -// -// Autogenerated by Thrift Compiler (0.22.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 Int64 = require('node-int64'); - - -var ttypes = module.exports = {}; -ttypes.TSProtocolVersion = { - 'IOTDB_SERVICE_PROTOCOL_V1' : 1, - 'IOTDB_SERVICE_PROTOCOL_V2' : 2, - 'IOTDB_SERVICE_PROTOCOL_V3' : 3 -}; -var TSOpenSessionReq = module.exports.TSOpenSessionReq = function(args) { - this.username = null; - this.password = null; - this.client_protocol = null; - this.zoneId = null; - this.configuration = null; - if (args) { - if (args.username !== undefined && args.username !== null) { - this.username = args.username; - } - if (args.password !== undefined && args.password !== null) { - this.password = args.password; - } - if (args.client_protocol !== undefined && args.client_protocol !== null) { - this.client_protocol = args.client_protocol; - } - if (args.zoneId !== undefined && args.zoneId !== null) { - this.zoneId = args.zoneId; - } - if (args.configuration !== undefined && args.configuration !== null) { - this.configuration = Thrift.copyMap(args.configuration, [null]); - } - } -}; -TSOpenSessionReq.prototype = {}; -TSOpenSessionReq.prototype[Symbol.for("read")] = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.STRING) { - this.username = input.readString(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.password = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.I32) { - this.client_protocol = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.STRING) { - this.zoneId = input.readString(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.MAP) { - this.configuration = {}; - var _rtmp31 = input.readMapBegin(); - var _size0 = _rtmp31.size || 0; - for (var _i2 = 0; _i2 < _size0; ++_i2) { - var key3 = null; - var val4 = null; - key3 = input.readString(); - val4 = input.readString(); - this.configuration[key3] = val4; - } - input.readMapEnd(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSOpenSessionReq.prototype[Symbol.for("write")] = function(output) { - output.writeStructBegin('TSOpenSessionReq'); - if (this.username !== null && this.username !== undefined) { - output.writeFieldBegin('username', Thrift.Type.STRING, 1); - output.writeString(this.username); - output.writeFieldEnd(); - } - if (this.password !== null && this.password !== undefined) { - output.writeFieldBegin('password', Thrift.Type.STRING, 2); - output.writeString(this.password); - output.writeFieldEnd(); - } - if (this.client_protocol !== null && this.client_protocol !== undefined) { - output.writeFieldBegin('client_protocol', Thrift.Type.I32, 3); - output.writeI32(this.client_protocol); - output.writeFieldEnd(); - } - if (this.zoneId !== null && this.zoneId !== undefined) { - output.writeFieldBegin('zoneId', Thrift.Type.STRING, 4); - output.writeString(this.zoneId); - output.writeFieldEnd(); - } - if (this.configuration !== null && this.configuration !== undefined) { - output.writeFieldBegin('configuration', Thrift.Type.MAP, 5); - output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.configuration)); - for (var kiter5 in this.configuration) { - if (this.configuration.hasOwnProperty(kiter5)) { - var viter6 = this.configuration[kiter5]; - output.writeString(kiter5); - output.writeString(viter6); - } - } - output.writeMapEnd(); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSCloseSessionReq = module.exports.TSCloseSessionReq = function(args) { - this.sessionId = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - } -}; -TSCloseSessionReq.prototype = {}; -TSCloseSessionReq.prototype[Symbol.for("read")] = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 0: - input.skip(ftype); - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSCloseSessionReq.prototype[Symbol.for("write")] = function(output) { - output.writeStructBegin('TSCloseSessionReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSExecuteStatementReq = module.exports.TSExecuteStatementReq = function(args) { - this.sessionId = null; - this.statement = null; - this.statementId = null; - this.fetchSize = null; - this.timeout = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.statement !== undefined && args.statement !== null) { - this.statement = args.statement; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statement is unset!'); - } - if (args.statementId !== undefined && args.statementId !== null) { - this.statementId = args.statementId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statementId is unset!'); - } - if (args.fetchSize !== undefined && args.fetchSize !== null) { - this.fetchSize = args.fetchSize; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field fetchSize is unset!'); - } - if (args.timeout !== undefined && args.timeout !== null) { - this.timeout = args.timeout; - } - } -}; -TSExecuteStatementReq.prototype = {}; -TSExecuteStatementReq.prototype[Symbol.for("read")] = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.statement = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.I64) { - this.statementId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.I32) { - this.fetchSize = input.readI32(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.I32) { - this.timeout = input.readI32(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSExecuteStatementReq.prototype[Symbol.for("write")] = function(output) { - output.writeStructBegin('TSExecuteStatementReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.statement !== null && this.statement !== undefined) { - output.writeFieldBegin('statement', Thrift.Type.STRING, 2); - output.writeString(this.statement); - output.writeFieldEnd(); - } - if (this.statementId !== null && this.statementId !== undefined) { - output.writeFieldBegin('statementId', Thrift.Type.I64, 3); - output.writeI64(this.statementId); - output.writeFieldEnd(); - } - if (this.fetchSize !== null && this.fetchSize !== undefined) { - output.writeFieldBegin('fetchSize', Thrift.Type.I32, 4); - output.writeI32(this.fetchSize); - output.writeFieldEnd(); - } - if (this.timeout !== null && this.timeout !== undefined) { - output.writeFieldBegin('timeout', Thrift.Type.I32, 5); - output.writeI32(this.timeout); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSInsertRecordReq = module.exports.TSInsertRecordReq = function(args) { - this.sessionId = null; - this.prefixPath = null; - this.measurements = null; - this.values = null; - this.timestamp = null; - this.isAligned = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.prefixPath !== undefined && args.prefixPath !== null) { - this.prefixPath = args.prefixPath; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPath is unset!'); - } - if (args.measurements !== undefined && args.measurements !== null) { - this.measurements = Thrift.copyList(args.measurements, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurements is unset!'); - } - if (args.values !== undefined && args.values !== null) { - this.values = args.values; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field values is unset!'); - } - if (args.timestamp !== undefined && args.timestamp !== null) { - this.timestamp = args.timestamp; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestamp is unset!'); - } - if (args.isAligned !== undefined && args.isAligned !== null) { - this.isAligned = args.isAligned; - } - } -}; -TSInsertRecordReq.prototype = {}; -TSInsertRecordReq.prototype[Symbol.for("read")] = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.STRING) { - this.prefixPath = input.readString(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.LIST) { - this.measurements = []; - var _rtmp38 = input.readListBegin(); - var _size7 = _rtmp38.size || 0; - for (var _i9 = 0; _i9 < _size7; ++_i9) { - var elem10 = null; - elem10 = input.readString(); - this.measurements.push(elem10); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.STRING) { - this.values = input.readBinary(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.I64) { - this.timestamp = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.BOOL) { - this.isAligned = input.readBool(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSInsertRecordReq.prototype[Symbol.for("write")] = function(output) { - output.writeStructBegin('TSInsertRecordReq'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.prefixPath !== null && this.prefixPath !== undefined) { - output.writeFieldBegin('prefixPath', Thrift.Type.STRING, 2); - output.writeString(this.prefixPath); - output.writeFieldEnd(); - } - if (this.measurements !== null && this.measurements !== undefined) { - output.writeFieldBegin('measurements', Thrift.Type.LIST, 3); - output.writeListBegin(Thrift.Type.STRING, this.measurements.length); - for (var iter11 in this.measurements) { - if (this.measurements.hasOwnProperty(iter11)) { - iter11 = this.measurements[iter11]; - output.writeString(iter11); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.values !== null && this.values !== undefined) { - output.writeFieldBegin('values', Thrift.Type.STRING, 4); - output.writeBinary(this.values); - output.writeFieldEnd(); - } - if (this.timestamp !== null && this.timestamp !== undefined) { - output.writeFieldBegin('timestamp', Thrift.Type.I64, 5); - output.writeI64(this.timestamp); - output.writeFieldEnd(); - } - if (this.isAligned !== null && this.isAligned !== undefined) { - output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 6); - output.writeBool(this.isAligned); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSOpenSessionResp = module.exports.TSOpenSessionResp = function(args) { - this.sessionId = null; - this.serverProtocolVersion = null; - if (args) { - if (args.sessionId !== undefined && args.sessionId !== null) { - this.sessionId = args.sessionId; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); - } - if (args.serverProtocolVersion !== undefined && args.serverProtocolVersion !== null) { - this.serverProtocolVersion = args.serverProtocolVersion; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field serverProtocolVersion is unset!'); - } - } -}; -TSOpenSessionResp.prototype = {}; -TSOpenSessionResp.prototype[Symbol.for("read")] = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.I64) { - this.sessionId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.I32) { - this.serverProtocolVersion = input.readI32(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSOpenSessionResp.prototype[Symbol.for("write")] = function(output) { - output.writeStructBegin('TSOpenSessionResp'); - if (this.sessionId !== null && this.sessionId !== undefined) { - output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); - output.writeI64(this.sessionId); - output.writeFieldEnd(); - } - if (this.serverProtocolVersion !== null && this.serverProtocolVersion !== undefined) { - output.writeFieldBegin('serverProtocolVersion', Thrift.Type.I32, 2); - output.writeI32(this.serverProtocolVersion); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var TSExecuteStatementResp = module.exports.TSExecuteStatementResp = function(args) { - this.columns = null; - this.dataTypeList = null; - this.columnNameIndexMap = null; - this.queryId = null; - this.queryDataSet = null; - this.ignoreTimeStamp = null; - if (args) { - if (args.columns !== undefined && args.columns !== null) { - this.columns = Thrift.copyList(args.columns, [null]); - } - if (args.dataTypeList !== undefined && args.dataTypeList !== null) { - this.dataTypeList = Thrift.copyList(args.dataTypeList, [null]); - } - if (args.columnNameIndexMap !== undefined && args.columnNameIndexMap !== null) { - this.columnNameIndexMap = Thrift.copyMap(args.columnNameIndexMap, [null]); - } - if (args.queryId !== undefined && args.queryId !== null) { - this.queryId = args.queryId; - } - if (args.queryDataSet !== undefined && args.queryDataSet !== null) { - this.queryDataSet = new ttypes.QueryDataSet(args.queryDataSet); - } - if (args.ignoreTimeStamp !== undefined && args.ignoreTimeStamp !== null) { - this.ignoreTimeStamp = args.ignoreTimeStamp; - } - } -}; -TSExecuteStatementResp.prototype = {}; -TSExecuteStatementResp.prototype[Symbol.for("read")] = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.LIST) { - this.columns = []; - var _rtmp313 = input.readListBegin(); - var _size12 = _rtmp313.size || 0; - for (var _i14 = 0; _i14 < _size12; ++_i14) { - var elem15 = null; - elem15 = input.readString(); - this.columns.push(elem15); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.LIST) { - this.dataTypeList = []; - var _rtmp317 = input.readListBegin(); - var _size16 = _rtmp317.size || 0; - for (var _i18 = 0; _i18 < _size16; ++_i18) { - var elem19 = null; - elem19 = input.readI32(); - this.dataTypeList.push(elem19); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.MAP) { - this.columnNameIndexMap = {}; - var _rtmp321 = input.readMapBegin(); - var _size20 = _rtmp321.size || 0; - for (var _i22 = 0; _i22 < _size20; ++_i22) { - var key23 = null; - var val24 = null; - key23 = input.readString(); - val24 = input.readI32(); - this.columnNameIndexMap[key23] = val24; - } - input.readMapEnd(); - } else { - input.skip(ftype); - } - break; - case 4: - if (ftype == Thrift.Type.I64) { - this.queryId = input.readI64(); - } else { - input.skip(ftype); - } - break; - case 5: - if (ftype == Thrift.Type.STRUCT) { - this.queryDataSet = new ttypes.QueryDataSet(); - this.queryDataSet[Symbol.for("read")](input); - } else { - input.skip(ftype); - } - break; - case 6: - if (ftype == Thrift.Type.BOOL) { - this.ignoreTimeStamp = input.readBool(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -TSExecuteStatementResp.prototype[Symbol.for("write")] = function(output) { - output.writeStructBegin('TSExecuteStatementResp'); - if (this.columns !== null && this.columns !== undefined) { - output.writeFieldBegin('columns', Thrift.Type.LIST, 1); - output.writeListBegin(Thrift.Type.STRING, this.columns.length); - for (var iter25 in this.columns) { - if (this.columns.hasOwnProperty(iter25)) { - iter25 = this.columns[iter25]; - output.writeString(iter25); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.dataTypeList !== null && this.dataTypeList !== undefined) { - output.writeFieldBegin('dataTypeList', Thrift.Type.LIST, 2); - output.writeListBegin(Thrift.Type.I32, this.dataTypeList.length); - for (var iter26 in this.dataTypeList) { - if (this.dataTypeList.hasOwnProperty(iter26)) { - iter26 = this.dataTypeList[iter26]; - output.writeI32(iter26); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.columnNameIndexMap !== null && this.columnNameIndexMap !== undefined) { - output.writeFieldBegin('columnNameIndexMap', Thrift.Type.MAP, 3); - output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.I32, Thrift.objectLength(this.columnNameIndexMap)); - for (var kiter27 in this.columnNameIndexMap) { - if (this.columnNameIndexMap.hasOwnProperty(kiter27)) { - var viter28 = this.columnNameIndexMap[kiter27]; - output.writeString(kiter27); - output.writeI32(viter28); - } - } - output.writeMapEnd(); - output.writeFieldEnd(); - } - if (this.queryId !== null && this.queryId !== undefined) { - output.writeFieldBegin('queryId', Thrift.Type.I64, 4); - output.writeI64(this.queryId); - output.writeFieldEnd(); - } - if (this.queryDataSet !== null && this.queryDataSet !== undefined) { - output.writeFieldBegin('queryDataSet', Thrift.Type.STRUCT, 5); - this.queryDataSet[Symbol.for("write")](output); - output.writeFieldEnd(); - } - if (this.ignoreTimeStamp !== null && this.ignoreTimeStamp !== undefined) { - output.writeFieldBegin('ignoreTimeStamp', Thrift.Type.BOOL, 6); - output.writeBool(this.ignoreTimeStamp); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - -var QueryDataSet = module.exports.QueryDataSet = function(args) { - this.valueList = null; - this.bitmapList = null; - this.time = null; - if (args) { - if (args.valueList !== undefined && args.valueList !== null) { - this.valueList = Thrift.copyList(args.valueList, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field valueList is unset!'); - } - if (args.bitmapList !== undefined && args.bitmapList !== null) { - this.bitmapList = Thrift.copyList(args.bitmapList, [null]); - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field bitmapList is unset!'); - } - if (args.time !== undefined && args.time !== null) { - this.time = args.time; - } else { - throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field time is unset!'); - } - } -}; -QueryDataSet.prototype = {}; -QueryDataSet.prototype[Symbol.for("read")] = function(input) { - input.readStructBegin(); - while (true) { - var ret = input.readFieldBegin(); - var ftype = ret.ftype; - var fid = ret.fid; - if (ftype == Thrift.Type.STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == Thrift.Type.LIST) { - this.valueList = []; - var _rtmp330 = input.readListBegin(); - var _size29 = _rtmp330.size || 0; - for (var _i31 = 0; _i31 < _size29; ++_i31) { - var elem32 = null; - elem32 = input.readBinary(); - this.valueList.push(elem32); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 2: - if (ftype == Thrift.Type.LIST) { - this.bitmapList = []; - var _rtmp334 = input.readListBegin(); - var _size33 = _rtmp334.size || 0; - for (var _i35 = 0; _i35 < _size33; ++_i35) { - var elem36 = null; - elem36 = input.readBinary(); - this.bitmapList.push(elem36); - } - input.readListEnd(); - } else { - input.skip(ftype); - } - break; - case 3: - if (ftype == Thrift.Type.STRING) { - this.time = input.readBinary(); - } else { - input.skip(ftype); - } - break; - default: - input.skip(ftype); - } - input.readFieldEnd(); - } - input.readStructEnd(); - return; -}; - -QueryDataSet.prototype[Symbol.for("write")] = function(output) { - output.writeStructBegin('QueryDataSet'); - if (this.valueList !== null && this.valueList !== undefined) { - output.writeFieldBegin('valueList', Thrift.Type.LIST, 1); - output.writeListBegin(Thrift.Type.STRING, this.valueList.length); - for (var iter37 in this.valueList) { - if (this.valueList.hasOwnProperty(iter37)) { - iter37 = this.valueList[iter37]; - output.writeBinary(iter37); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.bitmapList !== null && this.bitmapList !== undefined) { - output.writeFieldBegin('bitmapList', Thrift.Type.LIST, 2); - output.writeListBegin(Thrift.Type.STRING, this.bitmapList.length); - for (var iter38 in this.bitmapList) { - if (this.bitmapList.hasOwnProperty(iter38)) { - iter38 = this.bitmapList[iter38]; - output.writeBinary(iter38); - } - } - output.writeListEnd(); - output.writeFieldEnd(); - } - if (this.time !== null && this.time !== undefined) { - output.writeFieldBegin('time', Thrift.Type.STRING, 3); - output.writeBinary(this.time); - output.writeFieldEnd(); - } - output.writeFieldStop(); - output.writeStructEnd(); - return; -}; - diff --git a/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/client_types.js b/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/client_types.js new file mode 100644 index 0000000..5a5e912 --- /dev/null +++ b/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/client_types.js @@ -0,0 +1,8072 @@ +// +// Autogenerated by Thrift Compiler (0.14.1) +// +// 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 Int64 = require('node-int64'); + +var common_ttypes = require('./common_types'); + + +var ttypes = module.exports = {}; +ttypes.TSProtocolVersion = { + 'IOTDB_SERVICE_PROTOCOL_V1' : 0, + 'IOTDB_SERVICE_PROTOCOL_V2' : 1, + 'IOTDB_SERVICE_PROTOCOL_V3' : 2 +}; +ttypes.TSConnectionType = { + 'THRIFT_BASED' : 0, + 'MQTT_BASED' : 1, + 'INTERNAL' : 2, + 'REST_BASED' : 3 +}; +var TSQueryDataSet = module.exports.TSQueryDataSet = function(args) { + this.time = null; + this.valueList = null; + this.bitmapList = null; + if (args) { + if (args.time !== undefined && args.time !== null) { + this.time = args.time; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field time is unset!'); + } + if (args.valueList !== undefined && args.valueList !== null) { + this.valueList = Thrift.copyList(args.valueList, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field valueList is unset!'); + } + if (args.bitmapList !== undefined && args.bitmapList !== null) { + this.bitmapList = Thrift.copyList(args.bitmapList, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field bitmapList is unset!'); + } + } +}; +TSQueryDataSet.prototype = {}; +TSQueryDataSet.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.time = input.readBinary(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.valueList = []; + var _rtmp31 = input.readListBegin(); + var _size0 = _rtmp31.size || 0; + for (var _i2 = 0; _i2 < _size0; ++_i2) { + var elem3 = null; + elem3 = input.readBinary(); + this.valueList.push(elem3); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.bitmapList = []; + var _rtmp35 = input.readListBegin(); + var _size4 = _rtmp35.size || 0; + for (var _i6 = 0; _i6 < _size4; ++_i6) { + var elem7 = null; + elem7 = input.readBinary(); + this.bitmapList.push(elem7); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSQueryDataSet.prototype.write = function(output) { + output.writeStructBegin('TSQueryDataSet'); + if (this.time !== null && this.time !== undefined) { + output.writeFieldBegin('time', Thrift.Type.STRING, 1); + output.writeBinary(this.time); + output.writeFieldEnd(); + } + if (this.valueList !== null && this.valueList !== undefined) { + output.writeFieldBegin('valueList', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.valueList.length); + for (var iter8 in this.valueList) { + if (this.valueList.hasOwnProperty(iter8)) { + iter8 = this.valueList[iter8]; + output.writeBinary(iter8); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.bitmapList !== null && this.bitmapList !== undefined) { + output.writeFieldBegin('bitmapList', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.STRING, this.bitmapList.length); + for (var iter9 in this.bitmapList) { + if (this.bitmapList.hasOwnProperty(iter9)) { + iter9 = this.bitmapList[iter9]; + output.writeBinary(iter9); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSQueryNonAlignDataSet = module.exports.TSQueryNonAlignDataSet = function(args) { + this.timeList = null; + this.valueList = null; + if (args) { + if (args.timeList !== undefined && args.timeList !== null) { + this.timeList = Thrift.copyList(args.timeList, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timeList is unset!'); + } + if (args.valueList !== undefined && args.valueList !== null) { + this.valueList = Thrift.copyList(args.valueList, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field valueList is unset!'); + } + } +}; +TSQueryNonAlignDataSet.prototype = {}; +TSQueryNonAlignDataSet.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.LIST) { + this.timeList = []; + var _rtmp311 = input.readListBegin(); + var _size10 = _rtmp311.size || 0; + for (var _i12 = 0; _i12 < _size10; ++_i12) { + var elem13 = null; + elem13 = input.readBinary(); + this.timeList.push(elem13); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.valueList = []; + var _rtmp315 = input.readListBegin(); + var _size14 = _rtmp315.size || 0; + for (var _i16 = 0; _i16 < _size14; ++_i16) { + var elem17 = null; + elem17 = input.readBinary(); + this.valueList.push(elem17); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSQueryNonAlignDataSet.prototype.write = function(output) { + output.writeStructBegin('TSQueryNonAlignDataSet'); + if (this.timeList !== null && this.timeList !== undefined) { + output.writeFieldBegin('timeList', Thrift.Type.LIST, 1); + output.writeListBegin(Thrift.Type.STRING, this.timeList.length); + for (var iter18 in this.timeList) { + if (this.timeList.hasOwnProperty(iter18)) { + iter18 = this.timeList[iter18]; + output.writeBinary(iter18); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.valueList !== null && this.valueList !== undefined) { + output.writeFieldBegin('valueList', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.valueList.length); + for (var iter19 in this.valueList) { + if (this.valueList.hasOwnProperty(iter19)) { + iter19 = this.valueList[iter19]; + output.writeBinary(iter19); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSTracingInfo = module.exports.TSTracingInfo = function(args) { + this.activityList = null; + this.elapsedTimeList = null; + this.seriesPathNum = null; + this.seqFileNum = null; + this.unSeqFileNum = null; + this.sequenceChunkNum = null; + this.sequenceChunkPointNum = null; + this.unsequenceChunkNum = null; + this.unsequenceChunkPointNum = null; + this.totalPageNum = null; + this.overlappedPageNum = null; + if (args) { + if (args.activityList !== undefined && args.activityList !== null) { + this.activityList = Thrift.copyList(args.activityList, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field activityList is unset!'); + } + if (args.elapsedTimeList !== undefined && args.elapsedTimeList !== null) { + this.elapsedTimeList = Thrift.copyList(args.elapsedTimeList, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field elapsedTimeList is unset!'); + } + if (args.seriesPathNum !== undefined && args.seriesPathNum !== null) { + this.seriesPathNum = args.seriesPathNum; + } + if (args.seqFileNum !== undefined && args.seqFileNum !== null) { + this.seqFileNum = args.seqFileNum; + } + if (args.unSeqFileNum !== undefined && args.unSeqFileNum !== null) { + this.unSeqFileNum = args.unSeqFileNum; + } + if (args.sequenceChunkNum !== undefined && args.sequenceChunkNum !== null) { + this.sequenceChunkNum = args.sequenceChunkNum; + } + if (args.sequenceChunkPointNum !== undefined && args.sequenceChunkPointNum !== null) { + this.sequenceChunkPointNum = args.sequenceChunkPointNum; + } + if (args.unsequenceChunkNum !== undefined && args.unsequenceChunkNum !== null) { + this.unsequenceChunkNum = args.unsequenceChunkNum; + } + if (args.unsequenceChunkPointNum !== undefined && args.unsequenceChunkPointNum !== null) { + this.unsequenceChunkPointNum = args.unsequenceChunkPointNum; + } + if (args.totalPageNum !== undefined && args.totalPageNum !== null) { + this.totalPageNum = args.totalPageNum; + } + if (args.overlappedPageNum !== undefined && args.overlappedPageNum !== null) { + this.overlappedPageNum = args.overlappedPageNum; + } + } +}; +TSTracingInfo.prototype = {}; +TSTracingInfo.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.LIST) { + this.activityList = []; + var _rtmp321 = input.readListBegin(); + var _size20 = _rtmp321.size || 0; + for (var _i22 = 0; _i22 < _size20; ++_i22) { + var elem23 = null; + elem23 = input.readString(); + this.activityList.push(elem23); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.elapsedTimeList = []; + var _rtmp325 = input.readListBegin(); + var _size24 = _rtmp325.size || 0; + for (var _i26 = 0; _i26 < _size24; ++_i26) { + var elem27 = null; + elem27 = input.readI64(); + this.elapsedTimeList.push(elem27); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I32) { + this.seriesPathNum = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.I32) { + this.seqFileNum = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I32) { + this.unSeqFileNum = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.I32) { + this.sequenceChunkNum = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.I64) { + this.sequenceChunkPointNum = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.I32) { + this.unsequenceChunkNum = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 9: + if (ftype == Thrift.Type.I64) { + this.unsequenceChunkPointNum = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 10: + if (ftype == Thrift.Type.I32) { + this.totalPageNum = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 11: + if (ftype == Thrift.Type.I32) { + this.overlappedPageNum = input.readI32(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSTracingInfo.prototype.write = function(output) { + output.writeStructBegin('TSTracingInfo'); + if (this.activityList !== null && this.activityList !== undefined) { + output.writeFieldBegin('activityList', Thrift.Type.LIST, 1); + output.writeListBegin(Thrift.Type.STRING, this.activityList.length); + for (var iter28 in this.activityList) { + if (this.activityList.hasOwnProperty(iter28)) { + iter28 = this.activityList[iter28]; + output.writeString(iter28); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.elapsedTimeList !== null && this.elapsedTimeList !== undefined) { + output.writeFieldBegin('elapsedTimeList', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.I64, this.elapsedTimeList.length); + for (var iter29 in this.elapsedTimeList) { + if (this.elapsedTimeList.hasOwnProperty(iter29)) { + iter29 = this.elapsedTimeList[iter29]; + output.writeI64(iter29); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.seriesPathNum !== null && this.seriesPathNum !== undefined) { + output.writeFieldBegin('seriesPathNum', Thrift.Type.I32, 3); + output.writeI32(this.seriesPathNum); + output.writeFieldEnd(); + } + if (this.seqFileNum !== null && this.seqFileNum !== undefined) { + output.writeFieldBegin('seqFileNum', Thrift.Type.I32, 4); + output.writeI32(this.seqFileNum); + output.writeFieldEnd(); + } + if (this.unSeqFileNum !== null && this.unSeqFileNum !== undefined) { + output.writeFieldBegin('unSeqFileNum', Thrift.Type.I32, 5); + output.writeI32(this.unSeqFileNum); + output.writeFieldEnd(); + } + if (this.sequenceChunkNum !== null && this.sequenceChunkNum !== undefined) { + output.writeFieldBegin('sequenceChunkNum', Thrift.Type.I32, 6); + output.writeI32(this.sequenceChunkNum); + output.writeFieldEnd(); + } + if (this.sequenceChunkPointNum !== null && this.sequenceChunkPointNum !== undefined) { + output.writeFieldBegin('sequenceChunkPointNum', Thrift.Type.I64, 7); + output.writeI64(this.sequenceChunkPointNum); + output.writeFieldEnd(); + } + if (this.unsequenceChunkNum !== null && this.unsequenceChunkNum !== undefined) { + output.writeFieldBegin('unsequenceChunkNum', Thrift.Type.I32, 8); + output.writeI32(this.unsequenceChunkNum); + output.writeFieldEnd(); + } + if (this.unsequenceChunkPointNum !== null && this.unsequenceChunkPointNum !== undefined) { + output.writeFieldBegin('unsequenceChunkPointNum', Thrift.Type.I64, 9); + output.writeI64(this.unsequenceChunkPointNum); + output.writeFieldEnd(); + } + if (this.totalPageNum !== null && this.totalPageNum !== undefined) { + output.writeFieldBegin('totalPageNum', Thrift.Type.I32, 10); + output.writeI32(this.totalPageNum); + output.writeFieldEnd(); + } + if (this.overlappedPageNum !== null && this.overlappedPageNum !== undefined) { + output.writeFieldBegin('overlappedPageNum', Thrift.Type.I32, 11); + output.writeI32(this.overlappedPageNum); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSExecuteStatementResp = module.exports.TSExecuteStatementResp = function(args) { + this.status = null; + this.queryId = null; + this.columns = null; + this.operationType = null; + this.ignoreTimeStamp = null; + this.dataTypeList = null; + this.queryDataSet = null; + this.nonAlignQueryDataSet = null; + this.columnNameIndexMap = null; + this.sgColumns = null; + this.aliasColumns = null; + this.tracingInfo = null; + this.queryResult = null; + this.moreData = null; + this.database = null; + this.tableModel = null; + this.columnIndex2TsBlockColumnIndexList = null; + if (args) { + if (args.status !== undefined && args.status !== null) { + this.status = new common_ttypes.TSStatus(args.status); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); + } + if (args.queryId !== undefined && args.queryId !== null) { + this.queryId = args.queryId; + } + if (args.columns !== undefined && args.columns !== null) { + this.columns = Thrift.copyList(args.columns, [null]); + } + if (args.operationType !== undefined && args.operationType !== null) { + this.operationType = args.operationType; + } + if (args.ignoreTimeStamp !== undefined && args.ignoreTimeStamp !== null) { + this.ignoreTimeStamp = args.ignoreTimeStamp; + } + if (args.dataTypeList !== undefined && args.dataTypeList !== null) { + this.dataTypeList = Thrift.copyList(args.dataTypeList, [null]); + } + if (args.queryDataSet !== undefined && args.queryDataSet !== null) { + this.queryDataSet = new ttypes.TSQueryDataSet(args.queryDataSet); + } + if (args.nonAlignQueryDataSet !== undefined && args.nonAlignQueryDataSet !== null) { + this.nonAlignQueryDataSet = new ttypes.TSQueryNonAlignDataSet(args.nonAlignQueryDataSet); + } + if (args.columnNameIndexMap !== undefined && args.columnNameIndexMap !== null) { + this.columnNameIndexMap = Thrift.copyMap(args.columnNameIndexMap, [null]); + } + if (args.sgColumns !== undefined && args.sgColumns !== null) { + this.sgColumns = Thrift.copyList(args.sgColumns, [null]); + } + if (args.aliasColumns !== undefined && args.aliasColumns !== null) { + this.aliasColumns = args.aliasColumns; + } + if (args.tracingInfo !== undefined && args.tracingInfo !== null) { + this.tracingInfo = new ttypes.TSTracingInfo(args.tracingInfo); + } + if (args.queryResult !== undefined && args.queryResult !== null) { + this.queryResult = Thrift.copyList(args.queryResult, [null]); + } + if (args.moreData !== undefined && args.moreData !== null) { + this.moreData = args.moreData; + } + if (args.database !== undefined && args.database !== null) { + this.database = args.database; + } + if (args.tableModel !== undefined && args.tableModel !== null) { + this.tableModel = args.tableModel; + } + if (args.columnIndex2TsBlockColumnIndexList !== undefined && args.columnIndex2TsBlockColumnIndexList !== null) { + this.columnIndex2TsBlockColumnIndexList = Thrift.copyList(args.columnIndex2TsBlockColumnIndexList, [null]); + } + } +}; +TSExecuteStatementResp.prototype = {}; +TSExecuteStatementResp.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.status = new common_ttypes.TSStatus(); + this.status.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.queryId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.columns = []; + var _rtmp331 = input.readListBegin(); + var _size30 = _rtmp331.size || 0; + for (var _i32 = 0; _i32 < _size30; ++_i32) { + var elem33 = null; + elem33 = input.readString(); + this.columns.push(elem33); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRING) { + this.operationType = input.readString(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.BOOL) { + this.ignoreTimeStamp = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.LIST) { + this.dataTypeList = []; + var _rtmp335 = input.readListBegin(); + var _size34 = _rtmp335.size || 0; + for (var _i36 = 0; _i36 < _size34; ++_i36) { + var elem37 = null; + elem37 = input.readString(); + this.dataTypeList.push(elem37); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.STRUCT) { + this.queryDataSet = new ttypes.TSQueryDataSet(); + this.queryDataSet.read(input); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.STRUCT) { + this.nonAlignQueryDataSet = new ttypes.TSQueryNonAlignDataSet(); + this.nonAlignQueryDataSet.read(input); + } else { + input.skip(ftype); + } + break; + case 9: + if (ftype == Thrift.Type.MAP) { + this.columnNameIndexMap = {}; + var _rtmp339 = input.readMapBegin(); + var _size38 = _rtmp339.size || 0; + for (var _i40 = 0; _i40 < _size38; ++_i40) { + var key41 = null; + var val42 = null; + key41 = input.readString(); + val42 = input.readI32(); + this.columnNameIndexMap[key41] = val42; + } + input.readMapEnd(); + } else { + input.skip(ftype); + } + break; + case 10: + if (ftype == Thrift.Type.LIST) { + this.sgColumns = []; + var _rtmp344 = input.readListBegin(); + var _size43 = _rtmp344.size || 0; + for (var _i45 = 0; _i45 < _size43; ++_i45) { + var elem46 = null; + elem46 = input.readString(); + this.sgColumns.push(elem46); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 11: + if (ftype == Thrift.Type.STRING) { + this.aliasColumns = input.readBinary(); + } else { + input.skip(ftype); + } + break; + case 12: + if (ftype == Thrift.Type.STRUCT) { + this.tracingInfo = new ttypes.TSTracingInfo(); + this.tracingInfo.read(input); + } else { + input.skip(ftype); + } + break; + case 13: + if (ftype == Thrift.Type.LIST) { + this.queryResult = []; + var _rtmp348 = input.readListBegin(); + var _size47 = _rtmp348.size || 0; + for (var _i49 = 0; _i49 < _size47; ++_i49) { + var elem50 = null; + elem50 = input.readBinary(); + this.queryResult.push(elem50); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 14: + if (ftype == Thrift.Type.BOOL) { + this.moreData = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 15: + if (ftype == Thrift.Type.STRING) { + this.database = input.readString(); + } else { + input.skip(ftype); + } + break; + case 16: + if (ftype == Thrift.Type.BOOL) { + this.tableModel = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 17: + if (ftype == Thrift.Type.LIST) { + this.columnIndex2TsBlockColumnIndexList = []; + var _rtmp352 = input.readListBegin(); + var _size51 = _rtmp352.size || 0; + for (var _i53 = 0; _i53 < _size51; ++_i53) { + var elem54 = null; + elem54 = input.readI32(); + this.columnIndex2TsBlockColumnIndexList.push(elem54); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSExecuteStatementResp.prototype.write = function(output) { + output.writeStructBegin('TSExecuteStatementResp'); + if (this.status !== null && this.status !== undefined) { + output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); + this.status.write(output); + output.writeFieldEnd(); + } + if (this.queryId !== null && this.queryId !== undefined) { + output.writeFieldBegin('queryId', Thrift.Type.I64, 2); + output.writeI64(this.queryId); + output.writeFieldEnd(); + } + if (this.columns !== null && this.columns !== undefined) { + output.writeFieldBegin('columns', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.STRING, this.columns.length); + for (var iter55 in this.columns) { + if (this.columns.hasOwnProperty(iter55)) { + iter55 = this.columns[iter55]; + output.writeString(iter55); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.operationType !== null && this.operationType !== undefined) { + output.writeFieldBegin('operationType', Thrift.Type.STRING, 4); + output.writeString(this.operationType); + output.writeFieldEnd(); + } + if (this.ignoreTimeStamp !== null && this.ignoreTimeStamp !== undefined) { + output.writeFieldBegin('ignoreTimeStamp', Thrift.Type.BOOL, 5); + output.writeBool(this.ignoreTimeStamp); + output.writeFieldEnd(); + } + if (this.dataTypeList !== null && this.dataTypeList !== undefined) { + output.writeFieldBegin('dataTypeList', Thrift.Type.LIST, 6); + output.writeListBegin(Thrift.Type.STRING, this.dataTypeList.length); + for (var iter56 in this.dataTypeList) { + if (this.dataTypeList.hasOwnProperty(iter56)) { + iter56 = this.dataTypeList[iter56]; + output.writeString(iter56); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.queryDataSet !== null && this.queryDataSet !== undefined) { + output.writeFieldBegin('queryDataSet', Thrift.Type.STRUCT, 7); + this.queryDataSet.write(output); + output.writeFieldEnd(); + } + if (this.nonAlignQueryDataSet !== null && this.nonAlignQueryDataSet !== undefined) { + output.writeFieldBegin('nonAlignQueryDataSet', Thrift.Type.STRUCT, 8); + this.nonAlignQueryDataSet.write(output); + output.writeFieldEnd(); + } + if (this.columnNameIndexMap !== null && this.columnNameIndexMap !== undefined) { + output.writeFieldBegin('columnNameIndexMap', Thrift.Type.MAP, 9); + output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.I32, Thrift.objectLength(this.columnNameIndexMap)); + for (var kiter57 in this.columnNameIndexMap) { + if (this.columnNameIndexMap.hasOwnProperty(kiter57)) { + var viter58 = this.columnNameIndexMap[kiter57]; + output.writeString(kiter57); + output.writeI32(viter58); + } + } + output.writeMapEnd(); + output.writeFieldEnd(); + } + if (this.sgColumns !== null && this.sgColumns !== undefined) { + output.writeFieldBegin('sgColumns', Thrift.Type.LIST, 10); + output.writeListBegin(Thrift.Type.STRING, this.sgColumns.length); + for (var iter59 in this.sgColumns) { + if (this.sgColumns.hasOwnProperty(iter59)) { + iter59 = this.sgColumns[iter59]; + output.writeString(iter59); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.aliasColumns !== null && this.aliasColumns !== undefined) { + output.writeFieldBegin('aliasColumns', Thrift.Type.STRING, 11); + output.writeBinary(this.aliasColumns); + output.writeFieldEnd(); + } + if (this.tracingInfo !== null && this.tracingInfo !== undefined) { + output.writeFieldBegin('tracingInfo', Thrift.Type.STRUCT, 12); + this.tracingInfo.write(output); + output.writeFieldEnd(); + } + if (this.queryResult !== null && this.queryResult !== undefined) { + output.writeFieldBegin('queryResult', Thrift.Type.LIST, 13); + output.writeListBegin(Thrift.Type.STRING, this.queryResult.length); + for (var iter60 in this.queryResult) { + if (this.queryResult.hasOwnProperty(iter60)) { + iter60 = this.queryResult[iter60]; + output.writeBinary(iter60); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.moreData !== null && this.moreData !== undefined) { + output.writeFieldBegin('moreData', Thrift.Type.BOOL, 14); + output.writeBool(this.moreData); + output.writeFieldEnd(); + } + if (this.database !== null && this.database !== undefined) { + output.writeFieldBegin('database', Thrift.Type.STRING, 15); + output.writeString(this.database); + output.writeFieldEnd(); + } + if (this.tableModel !== null && this.tableModel !== undefined) { + output.writeFieldBegin('tableModel', Thrift.Type.BOOL, 16); + output.writeBool(this.tableModel); + output.writeFieldEnd(); + } + if (this.columnIndex2TsBlockColumnIndexList !== null && this.columnIndex2TsBlockColumnIndexList !== undefined) { + output.writeFieldBegin('columnIndex2TsBlockColumnIndexList', Thrift.Type.LIST, 17); + output.writeListBegin(Thrift.Type.I32, this.columnIndex2TsBlockColumnIndexList.length); + for (var iter61 in this.columnIndex2TsBlockColumnIndexList) { + if (this.columnIndex2TsBlockColumnIndexList.hasOwnProperty(iter61)) { + iter61 = this.columnIndex2TsBlockColumnIndexList[iter61]; + output.writeI32(iter61); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSOpenSessionResp = module.exports.TSOpenSessionResp = function(args) { + this.status = null; + this.serverProtocolVersion = 0; + this.sessionId = null; + this.configuration = null; + if (args) { + if (args.status !== undefined && args.status !== null) { + this.status = new common_ttypes.TSStatus(args.status); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); + } + if (args.serverProtocolVersion !== undefined && args.serverProtocolVersion !== null) { + this.serverProtocolVersion = args.serverProtocolVersion; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field serverProtocolVersion is unset!'); + } + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } + if (args.configuration !== undefined && args.configuration !== null) { + this.configuration = Thrift.copyMap(args.configuration, [null]); + } + } +}; +TSOpenSessionResp.prototype = {}; +TSOpenSessionResp.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.status = new common_ttypes.TSStatus(); + this.status.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I32) { + this.serverProtocolVersion = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.MAP) { + this.configuration = {}; + var _rtmp363 = input.readMapBegin(); + var _size62 = _rtmp363.size || 0; + for (var _i64 = 0; _i64 < _size62; ++_i64) { + var key65 = null; + var val66 = null; + key65 = input.readString(); + val66 = input.readString(); + this.configuration[key65] = val66; + } + input.readMapEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSOpenSessionResp.prototype.write = function(output) { + output.writeStructBegin('TSOpenSessionResp'); + if (this.status !== null && this.status !== undefined) { + output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); + this.status.write(output); + output.writeFieldEnd(); + } + if (this.serverProtocolVersion !== null && this.serverProtocolVersion !== undefined) { + output.writeFieldBegin('serverProtocolVersion', Thrift.Type.I32, 2); + output.writeI32(this.serverProtocolVersion); + output.writeFieldEnd(); + } + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 3); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.configuration !== null && this.configuration !== undefined) { + output.writeFieldBegin('configuration', Thrift.Type.MAP, 4); + output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.configuration)); + for (var kiter67 in this.configuration) { + if (this.configuration.hasOwnProperty(kiter67)) { + var viter68 = this.configuration[kiter67]; + output.writeString(kiter67); + output.writeString(viter68); + } + } + output.writeMapEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSOpenSessionReq = module.exports.TSOpenSessionReq = function(args) { + this.client_protocol = 2; + this.zoneId = null; + this.username = null; + this.password = null; + this.configuration = null; + if (args) { + if (args.client_protocol !== undefined && args.client_protocol !== null) { + this.client_protocol = args.client_protocol; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field client_protocol is unset!'); + } + if (args.zoneId !== undefined && args.zoneId !== null) { + this.zoneId = args.zoneId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field zoneId is unset!'); + } + if (args.username !== undefined && args.username !== null) { + this.username = args.username; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field username is unset!'); + } + if (args.password !== undefined && args.password !== null) { + this.password = args.password; + } + if (args.configuration !== undefined && args.configuration !== null) { + this.configuration = Thrift.copyMap(args.configuration, [null]); + } + } +}; +TSOpenSessionReq.prototype = {}; +TSOpenSessionReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I32) { + this.client_protocol = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.zoneId = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.username = input.readString(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRING) { + this.password = input.readString(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.MAP) { + this.configuration = {}; + var _rtmp370 = input.readMapBegin(); + var _size69 = _rtmp370.size || 0; + for (var _i71 = 0; _i71 < _size69; ++_i71) { + var key72 = null; + var val73 = null; + key72 = input.readString(); + val73 = input.readString(); + this.configuration[key72] = val73; + } + input.readMapEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSOpenSessionReq.prototype.write = function(output) { + output.writeStructBegin('TSOpenSessionReq'); + if (this.client_protocol !== null && this.client_protocol !== undefined) { + output.writeFieldBegin('client_protocol', Thrift.Type.I32, 1); + output.writeI32(this.client_protocol); + output.writeFieldEnd(); + } + if (this.zoneId !== null && this.zoneId !== undefined) { + output.writeFieldBegin('zoneId', Thrift.Type.STRING, 2); + output.writeString(this.zoneId); + output.writeFieldEnd(); + } + if (this.username !== null && this.username !== undefined) { + output.writeFieldBegin('username', Thrift.Type.STRING, 3); + output.writeString(this.username); + output.writeFieldEnd(); + } + if (this.password !== null && this.password !== undefined) { + output.writeFieldBegin('password', Thrift.Type.STRING, 4); + output.writeString(this.password); + output.writeFieldEnd(); + } + if (this.configuration !== null && this.configuration !== undefined) { + output.writeFieldBegin('configuration', Thrift.Type.MAP, 5); + output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.configuration)); + for (var kiter74 in this.configuration) { + if (this.configuration.hasOwnProperty(kiter74)) { + var viter75 = this.configuration[kiter74]; + output.writeString(kiter74); + output.writeString(viter75); + } + } + output.writeMapEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSCloseSessionReq = module.exports.TSCloseSessionReq = function(args) { + this.sessionId = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + } +}; +TSCloseSessionReq.prototype = {}; +TSCloseSessionReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSCloseSessionReq.prototype.write = function(output) { + output.writeStructBegin('TSCloseSessionReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSExecuteStatementReq = module.exports.TSExecuteStatementReq = function(args) { + this.sessionId = null; + this.statement = null; + this.statementId = null; + this.fetchSize = null; + this.timeout = null; + this.enableRedirectQuery = null; + this.jdbcQuery = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.statement !== undefined && args.statement !== null) { + this.statement = args.statement; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statement is unset!'); + } + if (args.statementId !== undefined && args.statementId !== null) { + this.statementId = args.statementId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statementId is unset!'); + } + if (args.fetchSize !== undefined && args.fetchSize !== null) { + this.fetchSize = args.fetchSize; + } + if (args.timeout !== undefined && args.timeout !== null) { + this.timeout = args.timeout; + } + if (args.enableRedirectQuery !== undefined && args.enableRedirectQuery !== null) { + this.enableRedirectQuery = args.enableRedirectQuery; + } + if (args.jdbcQuery !== undefined && args.jdbcQuery !== null) { + this.jdbcQuery = args.jdbcQuery; + } + } +}; +TSExecuteStatementReq.prototype = {}; +TSExecuteStatementReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.statement = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I64) { + this.statementId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.I32) { + this.fetchSize = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I64) { + this.timeout = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.BOOL) { + this.enableRedirectQuery = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.BOOL) { + this.jdbcQuery = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSExecuteStatementReq.prototype.write = function(output) { + output.writeStructBegin('TSExecuteStatementReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.statement !== null && this.statement !== undefined) { + output.writeFieldBegin('statement', Thrift.Type.STRING, 2); + output.writeString(this.statement); + output.writeFieldEnd(); + } + if (this.statementId !== null && this.statementId !== undefined) { + output.writeFieldBegin('statementId', Thrift.Type.I64, 3); + output.writeI64(this.statementId); + output.writeFieldEnd(); + } + if (this.fetchSize !== null && this.fetchSize !== undefined) { + output.writeFieldBegin('fetchSize', Thrift.Type.I32, 4); + output.writeI32(this.fetchSize); + output.writeFieldEnd(); + } + if (this.timeout !== null && this.timeout !== undefined) { + output.writeFieldBegin('timeout', Thrift.Type.I64, 5); + output.writeI64(this.timeout); + output.writeFieldEnd(); + } + if (this.enableRedirectQuery !== null && this.enableRedirectQuery !== undefined) { + output.writeFieldBegin('enableRedirectQuery', Thrift.Type.BOOL, 6); + output.writeBool(this.enableRedirectQuery); + output.writeFieldEnd(); + } + if (this.jdbcQuery !== null && this.jdbcQuery !== undefined) { + output.writeFieldBegin('jdbcQuery', Thrift.Type.BOOL, 7); + output.writeBool(this.jdbcQuery); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSExecuteBatchStatementReq = module.exports.TSExecuteBatchStatementReq = function(args) { + this.sessionId = null; + this.statements = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.statements !== undefined && args.statements !== null) { + this.statements = Thrift.copyList(args.statements, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statements is unset!'); + } + } +}; +TSExecuteBatchStatementReq.prototype = {}; +TSExecuteBatchStatementReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.statements = []; + var _rtmp377 = input.readListBegin(); + var _size76 = _rtmp377.size || 0; + for (var _i78 = 0; _i78 < _size76; ++_i78) { + var elem79 = null; + elem79 = input.readString(); + this.statements.push(elem79); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSExecuteBatchStatementReq.prototype.write = function(output) { + output.writeStructBegin('TSExecuteBatchStatementReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.statements !== null && this.statements !== undefined) { + output.writeFieldBegin('statements', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.statements.length); + for (var iter80 in this.statements) { + if (this.statements.hasOwnProperty(iter80)) { + iter80 = this.statements[iter80]; + output.writeString(iter80); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSGetOperationStatusReq = module.exports.TSGetOperationStatusReq = function(args) { + this.sessionId = null; + this.queryId = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.queryId !== undefined && args.queryId !== null) { + this.queryId = args.queryId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field queryId is unset!'); + } + } +}; +TSGetOperationStatusReq.prototype = {}; +TSGetOperationStatusReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.queryId = input.readI64(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSGetOperationStatusReq.prototype.write = function(output) { + output.writeStructBegin('TSGetOperationStatusReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.queryId !== null && this.queryId !== undefined) { + output.writeFieldBegin('queryId', Thrift.Type.I64, 2); + output.writeI64(this.queryId); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSCancelOperationReq = module.exports.TSCancelOperationReq = function(args) { + this.sessionId = null; + this.queryId = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.queryId !== undefined && args.queryId !== null) { + this.queryId = args.queryId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field queryId is unset!'); + } + } +}; +TSCancelOperationReq.prototype = {}; +TSCancelOperationReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.queryId = input.readI64(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSCancelOperationReq.prototype.write = function(output) { + output.writeStructBegin('TSCancelOperationReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.queryId !== null && this.queryId !== undefined) { + output.writeFieldBegin('queryId', Thrift.Type.I64, 2); + output.writeI64(this.queryId); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSCloseOperationReq = module.exports.TSCloseOperationReq = function(args) { + this.sessionId = null; + this.queryId = null; + this.statementId = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.queryId !== undefined && args.queryId !== null) { + this.queryId = args.queryId; + } + if (args.statementId !== undefined && args.statementId !== null) { + this.statementId = args.statementId; + } + } +}; +TSCloseOperationReq.prototype = {}; +TSCloseOperationReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.queryId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I64) { + this.statementId = input.readI64(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSCloseOperationReq.prototype.write = function(output) { + output.writeStructBegin('TSCloseOperationReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.queryId !== null && this.queryId !== undefined) { + output.writeFieldBegin('queryId', Thrift.Type.I64, 2); + output.writeI64(this.queryId); + output.writeFieldEnd(); + } + if (this.statementId !== null && this.statementId !== undefined) { + output.writeFieldBegin('statementId', Thrift.Type.I64, 3); + output.writeI64(this.statementId); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSFetchResultsReq = module.exports.TSFetchResultsReq = function(args) { + this.sessionId = null; + this.statement = null; + this.fetchSize = null; + this.queryId = null; + this.isAlign = null; + this.timeout = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.statement !== undefined && args.statement !== null) { + this.statement = args.statement; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statement is unset!'); + } + if (args.fetchSize !== undefined && args.fetchSize !== null) { + this.fetchSize = args.fetchSize; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field fetchSize is unset!'); + } + if (args.queryId !== undefined && args.queryId !== null) { + this.queryId = args.queryId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field queryId is unset!'); + } + if (args.isAlign !== undefined && args.isAlign !== null) { + this.isAlign = args.isAlign; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field isAlign is unset!'); + } + if (args.timeout !== undefined && args.timeout !== null) { + this.timeout = args.timeout; + } + } +}; +TSFetchResultsReq.prototype = {}; +TSFetchResultsReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.statement = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I32) { + this.fetchSize = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.I64) { + this.queryId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.BOOL) { + this.isAlign = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.I64) { + this.timeout = input.readI64(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSFetchResultsReq.prototype.write = function(output) { + output.writeStructBegin('TSFetchResultsReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.statement !== null && this.statement !== undefined) { + output.writeFieldBegin('statement', Thrift.Type.STRING, 2); + output.writeString(this.statement); + output.writeFieldEnd(); + } + if (this.fetchSize !== null && this.fetchSize !== undefined) { + output.writeFieldBegin('fetchSize', Thrift.Type.I32, 3); + output.writeI32(this.fetchSize); + output.writeFieldEnd(); + } + if (this.queryId !== null && this.queryId !== undefined) { + output.writeFieldBegin('queryId', Thrift.Type.I64, 4); + output.writeI64(this.queryId); + output.writeFieldEnd(); + } + if (this.isAlign !== null && this.isAlign !== undefined) { + output.writeFieldBegin('isAlign', Thrift.Type.BOOL, 5); + output.writeBool(this.isAlign); + output.writeFieldEnd(); + } + if (this.timeout !== null && this.timeout !== undefined) { + output.writeFieldBegin('timeout', Thrift.Type.I64, 6); + output.writeI64(this.timeout); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSFetchResultsResp = module.exports.TSFetchResultsResp = function(args) { + this.status = null; + this.hasResultSet = null; + this.isAlign = null; + this.queryDataSet = null; + this.nonAlignQueryDataSet = null; + this.queryResult = null; + this.moreData = null; + if (args) { + if (args.status !== undefined && args.status !== null) { + this.status = new common_ttypes.TSStatus(args.status); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); + } + if (args.hasResultSet !== undefined && args.hasResultSet !== null) { + this.hasResultSet = args.hasResultSet; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field hasResultSet is unset!'); + } + if (args.isAlign !== undefined && args.isAlign !== null) { + this.isAlign = args.isAlign; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field isAlign is unset!'); + } + if (args.queryDataSet !== undefined && args.queryDataSet !== null) { + this.queryDataSet = new ttypes.TSQueryDataSet(args.queryDataSet); + } + if (args.nonAlignQueryDataSet !== undefined && args.nonAlignQueryDataSet !== null) { + this.nonAlignQueryDataSet = new ttypes.TSQueryNonAlignDataSet(args.nonAlignQueryDataSet); + } + if (args.queryResult !== undefined && args.queryResult !== null) { + this.queryResult = Thrift.copyList(args.queryResult, [null]); + } + if (args.moreData !== undefined && args.moreData !== null) { + this.moreData = args.moreData; + } + } +}; +TSFetchResultsResp.prototype = {}; +TSFetchResultsResp.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.status = new common_ttypes.TSStatus(); + this.status.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.BOOL) { + this.hasResultSet = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.BOOL) { + this.isAlign = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRUCT) { + this.queryDataSet = new ttypes.TSQueryDataSet(); + this.queryDataSet.read(input); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.STRUCT) { + this.nonAlignQueryDataSet = new ttypes.TSQueryNonAlignDataSet(); + this.nonAlignQueryDataSet.read(input); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.LIST) { + this.queryResult = []; + var _rtmp382 = input.readListBegin(); + var _size81 = _rtmp382.size || 0; + for (var _i83 = 0; _i83 < _size81; ++_i83) { + var elem84 = null; + elem84 = input.readBinary(); + this.queryResult.push(elem84); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.BOOL) { + this.moreData = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSFetchResultsResp.prototype.write = function(output) { + output.writeStructBegin('TSFetchResultsResp'); + if (this.status !== null && this.status !== undefined) { + output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); + this.status.write(output); + output.writeFieldEnd(); + } + if (this.hasResultSet !== null && this.hasResultSet !== undefined) { + output.writeFieldBegin('hasResultSet', Thrift.Type.BOOL, 2); + output.writeBool(this.hasResultSet); + output.writeFieldEnd(); + } + if (this.isAlign !== null && this.isAlign !== undefined) { + output.writeFieldBegin('isAlign', Thrift.Type.BOOL, 3); + output.writeBool(this.isAlign); + output.writeFieldEnd(); + } + if (this.queryDataSet !== null && this.queryDataSet !== undefined) { + output.writeFieldBegin('queryDataSet', Thrift.Type.STRUCT, 4); + this.queryDataSet.write(output); + output.writeFieldEnd(); + } + if (this.nonAlignQueryDataSet !== null && this.nonAlignQueryDataSet !== undefined) { + output.writeFieldBegin('nonAlignQueryDataSet', Thrift.Type.STRUCT, 5); + this.nonAlignQueryDataSet.write(output); + output.writeFieldEnd(); + } + if (this.queryResult !== null && this.queryResult !== undefined) { + output.writeFieldBegin('queryResult', Thrift.Type.LIST, 6); + output.writeListBegin(Thrift.Type.STRING, this.queryResult.length); + for (var iter85 in this.queryResult) { + if (this.queryResult.hasOwnProperty(iter85)) { + iter85 = this.queryResult[iter85]; + output.writeBinary(iter85); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.moreData !== null && this.moreData !== undefined) { + output.writeFieldBegin('moreData', Thrift.Type.BOOL, 7); + output.writeBool(this.moreData); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSFetchMetadataResp = module.exports.TSFetchMetadataResp = function(args) { + this.status = null; + this.metadataInJson = null; + this.columnsList = null; + this.dataType = null; + if (args) { + if (args.status !== undefined && args.status !== null) { + this.status = new common_ttypes.TSStatus(args.status); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); + } + if (args.metadataInJson !== undefined && args.metadataInJson !== null) { + this.metadataInJson = args.metadataInJson; + } + if (args.columnsList !== undefined && args.columnsList !== null) { + this.columnsList = Thrift.copyList(args.columnsList, [null]); + } + if (args.dataType !== undefined && args.dataType !== null) { + this.dataType = args.dataType; + } + } +}; +TSFetchMetadataResp.prototype = {}; +TSFetchMetadataResp.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.status = new common_ttypes.TSStatus(); + this.status.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.metadataInJson = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.columnsList = []; + var _rtmp387 = input.readListBegin(); + var _size86 = _rtmp387.size || 0; + for (var _i88 = 0; _i88 < _size86; ++_i88) { + var elem89 = null; + elem89 = input.readString(); + this.columnsList.push(elem89); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRING) { + this.dataType = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSFetchMetadataResp.prototype.write = function(output) { + output.writeStructBegin('TSFetchMetadataResp'); + if (this.status !== null && this.status !== undefined) { + output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); + this.status.write(output); + output.writeFieldEnd(); + } + if (this.metadataInJson !== null && this.metadataInJson !== undefined) { + output.writeFieldBegin('metadataInJson', Thrift.Type.STRING, 2); + output.writeString(this.metadataInJson); + output.writeFieldEnd(); + } + if (this.columnsList !== null && this.columnsList !== undefined) { + output.writeFieldBegin('columnsList', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.STRING, this.columnsList.length); + for (var iter90 in this.columnsList) { + if (this.columnsList.hasOwnProperty(iter90)) { + iter90 = this.columnsList[iter90]; + output.writeString(iter90); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.dataType !== null && this.dataType !== undefined) { + output.writeFieldBegin('dataType', Thrift.Type.STRING, 4); + output.writeString(this.dataType); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSFetchMetadataReq = module.exports.TSFetchMetadataReq = function(args) { + this.sessionId = null; + this.type = null; + this.columnPath = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.type !== undefined && args.type !== null) { + this.type = args.type; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field type is unset!'); + } + if (args.columnPath !== undefined && args.columnPath !== null) { + this.columnPath = args.columnPath; + } + } +}; +TSFetchMetadataReq.prototype = {}; +TSFetchMetadataReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.type = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.columnPath = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSFetchMetadataReq.prototype.write = function(output) { + output.writeStructBegin('TSFetchMetadataReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.type !== null && this.type !== undefined) { + output.writeFieldBegin('type', Thrift.Type.STRING, 2); + output.writeString(this.type); + output.writeFieldEnd(); + } + if (this.columnPath !== null && this.columnPath !== undefined) { + output.writeFieldBegin('columnPath', Thrift.Type.STRING, 3); + output.writeString(this.columnPath); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSGetTimeZoneResp = module.exports.TSGetTimeZoneResp = function(args) { + this.status = null; + this.timeZone = null; + if (args) { + if (args.status !== undefined && args.status !== null) { + this.status = new common_ttypes.TSStatus(args.status); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); + } + if (args.timeZone !== undefined && args.timeZone !== null) { + this.timeZone = args.timeZone; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timeZone is unset!'); + } + } +}; +TSGetTimeZoneResp.prototype = {}; +TSGetTimeZoneResp.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.status = new common_ttypes.TSStatus(); + this.status.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.timeZone = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSGetTimeZoneResp.prototype.write = function(output) { + output.writeStructBegin('TSGetTimeZoneResp'); + if (this.status !== null && this.status !== undefined) { + output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); + this.status.write(output); + output.writeFieldEnd(); + } + if (this.timeZone !== null && this.timeZone !== undefined) { + output.writeFieldBegin('timeZone', Thrift.Type.STRING, 2); + output.writeString(this.timeZone); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSSetTimeZoneReq = module.exports.TSSetTimeZoneReq = function(args) { + this.sessionId = null; + this.timeZone = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.timeZone !== undefined && args.timeZone !== null) { + this.timeZone = args.timeZone; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timeZone is unset!'); + } + } +}; +TSSetTimeZoneReq.prototype = {}; +TSSetTimeZoneReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.timeZone = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSSetTimeZoneReq.prototype.write = function(output) { + output.writeStructBegin('TSSetTimeZoneReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.timeZone !== null && this.timeZone !== undefined) { + output.writeFieldBegin('timeZone', Thrift.Type.STRING, 2); + output.writeString(this.timeZone); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSInsertRecordReq = module.exports.TSInsertRecordReq = function(args) { + this.sessionId = null; + this.prefixPath = null; + this.measurements = null; + this.values = null; + this.timestamp = null; + this.isAligned = null; + this.isWriteToTable = null; + this.columnCategoryies = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.prefixPath !== undefined && args.prefixPath !== null) { + this.prefixPath = args.prefixPath; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPath is unset!'); + } + if (args.measurements !== undefined && args.measurements !== null) { + this.measurements = Thrift.copyList(args.measurements, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurements is unset!'); + } + if (args.values !== undefined && args.values !== null) { + this.values = args.values; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field values is unset!'); + } + if (args.timestamp !== undefined && args.timestamp !== null) { + this.timestamp = args.timestamp; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestamp is unset!'); + } + if (args.isAligned !== undefined && args.isAligned !== null) { + this.isAligned = args.isAligned; + } + if (args.isWriteToTable !== undefined && args.isWriteToTable !== null) { + this.isWriteToTable = args.isWriteToTable; + } + if (args.columnCategoryies !== undefined && args.columnCategoryies !== null) { + this.columnCategoryies = args.columnCategoryies; + } + } +}; +TSInsertRecordReq.prototype = {}; +TSInsertRecordReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.prefixPath = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.measurements = []; + var _rtmp392 = input.readListBegin(); + var _size91 = _rtmp392.size || 0; + for (var _i93 = 0; _i93 < _size91; ++_i93) { + var elem94 = null; + elem94 = input.readString(); + this.measurements.push(elem94); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRING) { + this.values = input.readBinary(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I64) { + this.timestamp = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.BOOL) { + this.isAligned = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.BOOL) { + this.isWriteToTable = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.STRING) { + this.columnCategoryies = input.readBinary(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSInsertRecordReq.prototype.write = function(output) { + output.writeStructBegin('TSInsertRecordReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.prefixPath !== null && this.prefixPath !== undefined) { + output.writeFieldBegin('prefixPath', Thrift.Type.STRING, 2); + output.writeString(this.prefixPath); + output.writeFieldEnd(); + } + if (this.measurements !== null && this.measurements !== undefined) { + output.writeFieldBegin('measurements', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.STRING, this.measurements.length); + for (var iter95 in this.measurements) { + if (this.measurements.hasOwnProperty(iter95)) { + iter95 = this.measurements[iter95]; + output.writeString(iter95); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.values !== null && this.values !== undefined) { + output.writeFieldBegin('values', Thrift.Type.STRING, 4); + output.writeBinary(this.values); + output.writeFieldEnd(); + } + if (this.timestamp !== null && this.timestamp !== undefined) { + output.writeFieldBegin('timestamp', Thrift.Type.I64, 5); + output.writeI64(this.timestamp); + output.writeFieldEnd(); + } + if (this.isAligned !== null && this.isAligned !== undefined) { + output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 6); + output.writeBool(this.isAligned); + output.writeFieldEnd(); + } + if (this.isWriteToTable !== null && this.isWriteToTable !== undefined) { + output.writeFieldBegin('isWriteToTable', Thrift.Type.BOOL, 7); + output.writeBool(this.isWriteToTable); + output.writeFieldEnd(); + } + if (this.columnCategoryies !== null && this.columnCategoryies !== undefined) { + output.writeFieldBegin('columnCategoryies', Thrift.Type.STRING, 8); + output.writeBinary(this.columnCategoryies); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSInsertStringRecordReq = module.exports.TSInsertStringRecordReq = function(args) { + this.sessionId = null; + this.prefixPath = null; + this.measurements = null; + this.values = null; + this.timestamp = null; + this.isAligned = null; + this.timeout = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.prefixPath !== undefined && args.prefixPath !== null) { + this.prefixPath = args.prefixPath; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPath is unset!'); + } + if (args.measurements !== undefined && args.measurements !== null) { + this.measurements = Thrift.copyList(args.measurements, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurements is unset!'); + } + if (args.values !== undefined && args.values !== null) { + this.values = Thrift.copyList(args.values, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field values is unset!'); + } + if (args.timestamp !== undefined && args.timestamp !== null) { + this.timestamp = args.timestamp; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestamp is unset!'); + } + if (args.isAligned !== undefined && args.isAligned !== null) { + this.isAligned = args.isAligned; + } + if (args.timeout !== undefined && args.timeout !== null) { + this.timeout = args.timeout; + } + } +}; +TSInsertStringRecordReq.prototype = {}; +TSInsertStringRecordReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.prefixPath = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.measurements = []; + var _rtmp397 = input.readListBegin(); + var _size96 = _rtmp397.size || 0; + for (var _i98 = 0; _i98 < _size96; ++_i98) { + var elem99 = null; + elem99 = input.readString(); + this.measurements.push(elem99); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.LIST) { + this.values = []; + var _rtmp3101 = input.readListBegin(); + var _size100 = _rtmp3101.size || 0; + for (var _i102 = 0; _i102 < _size100; ++_i102) { + var elem103 = null; + elem103 = input.readString(); + this.values.push(elem103); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I64) { + this.timestamp = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.BOOL) { + this.isAligned = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.I64) { + this.timeout = input.readI64(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSInsertStringRecordReq.prototype.write = function(output) { + output.writeStructBegin('TSInsertStringRecordReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.prefixPath !== null && this.prefixPath !== undefined) { + output.writeFieldBegin('prefixPath', Thrift.Type.STRING, 2); + output.writeString(this.prefixPath); + output.writeFieldEnd(); + } + if (this.measurements !== null && this.measurements !== undefined) { + output.writeFieldBegin('measurements', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.STRING, this.measurements.length); + for (var iter104 in this.measurements) { + if (this.measurements.hasOwnProperty(iter104)) { + iter104 = this.measurements[iter104]; + output.writeString(iter104); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.values !== null && this.values !== undefined) { + output.writeFieldBegin('values', Thrift.Type.LIST, 4); + output.writeListBegin(Thrift.Type.STRING, this.values.length); + for (var iter105 in this.values) { + if (this.values.hasOwnProperty(iter105)) { + iter105 = this.values[iter105]; + output.writeString(iter105); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.timestamp !== null && this.timestamp !== undefined) { + output.writeFieldBegin('timestamp', Thrift.Type.I64, 5); + output.writeI64(this.timestamp); + output.writeFieldEnd(); + } + if (this.isAligned !== null && this.isAligned !== undefined) { + output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 6); + output.writeBool(this.isAligned); + output.writeFieldEnd(); + } + if (this.timeout !== null && this.timeout !== undefined) { + output.writeFieldBegin('timeout', Thrift.Type.I64, 7); + output.writeI64(this.timeout); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSInsertTabletReq = module.exports.TSInsertTabletReq = function(args) { + this.sessionId = null; + this.prefixPath = null; + this.measurements = null; + this.values = null; + this.timestamps = null; + this.types = null; + this.size = null; + this.isAligned = null; + this.writeToTable = null; + this.columnCategories = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.prefixPath !== undefined && args.prefixPath !== null) { + this.prefixPath = args.prefixPath; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPath is unset!'); + } + if (args.measurements !== undefined && args.measurements !== null) { + this.measurements = Thrift.copyList(args.measurements, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurements is unset!'); + } + if (args.values !== undefined && args.values !== null) { + this.values = args.values; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field values is unset!'); + } + if (args.timestamps !== undefined && args.timestamps !== null) { + this.timestamps = args.timestamps; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestamps is unset!'); + } + if (args.types !== undefined && args.types !== null) { + this.types = Thrift.copyList(args.types, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field types is unset!'); + } + if (args.size !== undefined && args.size !== null) { + this.size = args.size; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field size is unset!'); + } + if (args.isAligned !== undefined && args.isAligned !== null) { + this.isAligned = args.isAligned; + } + if (args.writeToTable !== undefined && args.writeToTable !== null) { + this.writeToTable = args.writeToTable; + } + if (args.columnCategories !== undefined && args.columnCategories !== null) { + this.columnCategories = args.columnCategories; + } + } +}; +TSInsertTabletReq.prototype = {}; +TSInsertTabletReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.prefixPath = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.measurements = []; + var _rtmp3107 = input.readListBegin(); + var _size106 = _rtmp3107.size || 0; + for (var _i108 = 0; _i108 < _size106; ++_i108) { + var elem109 = null; + elem109 = input.readString(); + this.measurements.push(elem109); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRING) { + this.values = input.readBinary(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.STRING) { + this.timestamps = input.readBinary(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.LIST) { + this.types = []; + var _rtmp3111 = input.readListBegin(); + var _size110 = _rtmp3111.size || 0; + for (var _i112 = 0; _i112 < _size110; ++_i112) { + var elem113 = null; + elem113 = input.readI32(); + this.types.push(elem113); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.I32) { + this.size = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.BOOL) { + this.isAligned = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 9: + if (ftype == Thrift.Type.BOOL) { + this.writeToTable = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 10: + if (ftype == Thrift.Type.STRING) { + this.columnCategories = input.readBinary(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSInsertTabletReq.prototype.write = function(output) { + output.writeStructBegin('TSInsertTabletReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.prefixPath !== null && this.prefixPath !== undefined) { + output.writeFieldBegin('prefixPath', Thrift.Type.STRING, 2); + output.writeString(this.prefixPath); + output.writeFieldEnd(); + } + if (this.measurements !== null && this.measurements !== undefined) { + output.writeFieldBegin('measurements', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.STRING, this.measurements.length); + for (var iter114 in this.measurements) { + if (this.measurements.hasOwnProperty(iter114)) { + iter114 = this.measurements[iter114]; + output.writeString(iter114); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.values !== null && this.values !== undefined) { + output.writeFieldBegin('values', Thrift.Type.STRING, 4); + output.writeBinary(this.values); + output.writeFieldEnd(); + } + if (this.timestamps !== null && this.timestamps !== undefined) { + output.writeFieldBegin('timestamps', Thrift.Type.STRING, 5); + output.writeBinary(this.timestamps); + output.writeFieldEnd(); + } + if (this.types !== null && this.types !== undefined) { + output.writeFieldBegin('types', Thrift.Type.LIST, 6); + output.writeListBegin(Thrift.Type.I32, this.types.length); + for (var iter115 in this.types) { + if (this.types.hasOwnProperty(iter115)) { + iter115 = this.types[iter115]; + output.writeI32(iter115); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.size !== null && this.size !== undefined) { + output.writeFieldBegin('size', Thrift.Type.I32, 7); + output.writeI32(this.size); + output.writeFieldEnd(); + } + if (this.isAligned !== null && this.isAligned !== undefined) { + output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 8); + output.writeBool(this.isAligned); + output.writeFieldEnd(); + } + if (this.writeToTable !== null && this.writeToTable !== undefined) { + output.writeFieldBegin('writeToTable', Thrift.Type.BOOL, 9); + output.writeBool(this.writeToTable); + output.writeFieldEnd(); + } + if (this.columnCategories !== null && this.columnCategories !== undefined) { + output.writeFieldBegin('columnCategories', Thrift.Type.STRING, 10); + output.writeBinary(this.columnCategories); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSInsertTabletsReq = module.exports.TSInsertTabletsReq = function(args) { + this.sessionId = null; + this.prefixPaths = null; + this.measurementsList = null; + this.valuesList = null; + this.timestampsList = null; + this.typesList = null; + this.sizeList = null; + this.isAligned = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.prefixPaths !== undefined && args.prefixPaths !== null) { + this.prefixPaths = Thrift.copyList(args.prefixPaths, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPaths is unset!'); + } + if (args.measurementsList !== undefined && args.measurementsList !== null) { + this.measurementsList = Thrift.copyList(args.measurementsList, [Thrift.copyList, null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurementsList is unset!'); + } + if (args.valuesList !== undefined && args.valuesList !== null) { + this.valuesList = Thrift.copyList(args.valuesList, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field valuesList is unset!'); + } + if (args.timestampsList !== undefined && args.timestampsList !== null) { + this.timestampsList = Thrift.copyList(args.timestampsList, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestampsList is unset!'); + } + if (args.typesList !== undefined && args.typesList !== null) { + this.typesList = Thrift.copyList(args.typesList, [Thrift.copyList, null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field typesList is unset!'); + } + if (args.sizeList !== undefined && args.sizeList !== null) { + this.sizeList = Thrift.copyList(args.sizeList, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sizeList is unset!'); + } + if (args.isAligned !== undefined && args.isAligned !== null) { + this.isAligned = args.isAligned; + } + } +}; +TSInsertTabletsReq.prototype = {}; +TSInsertTabletsReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.prefixPaths = []; + var _rtmp3117 = input.readListBegin(); + var _size116 = _rtmp3117.size || 0; + for (var _i118 = 0; _i118 < _size116; ++_i118) { + var elem119 = null; + elem119 = input.readString(); + this.prefixPaths.push(elem119); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.measurementsList = []; + var _rtmp3121 = input.readListBegin(); + var _size120 = _rtmp3121.size || 0; + for (var _i122 = 0; _i122 < _size120; ++_i122) { + var elem123 = null; + elem123 = []; + var _rtmp3125 = input.readListBegin(); + var _size124 = _rtmp3125.size || 0; + for (var _i126 = 0; _i126 < _size124; ++_i126) { + var elem127 = null; + elem127 = input.readString(); + elem123.push(elem127); + } + input.readListEnd(); + this.measurementsList.push(elem123); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.LIST) { + this.valuesList = []; + var _rtmp3129 = input.readListBegin(); + var _size128 = _rtmp3129.size || 0; + for (var _i130 = 0; _i130 < _size128; ++_i130) { + var elem131 = null; + elem131 = input.readBinary(); + this.valuesList.push(elem131); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.LIST) { + this.timestampsList = []; + var _rtmp3133 = input.readListBegin(); + var _size132 = _rtmp3133.size || 0; + for (var _i134 = 0; _i134 < _size132; ++_i134) { + var elem135 = null; + elem135 = input.readBinary(); + this.timestampsList.push(elem135); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.LIST) { + this.typesList = []; + var _rtmp3137 = input.readListBegin(); + var _size136 = _rtmp3137.size || 0; + for (var _i138 = 0; _i138 < _size136; ++_i138) { + var elem139 = null; + elem139 = []; + var _rtmp3141 = input.readListBegin(); + var _size140 = _rtmp3141.size || 0; + for (var _i142 = 0; _i142 < _size140; ++_i142) { + var elem143 = null; + elem143 = input.readI32(); + elem139.push(elem143); + } + input.readListEnd(); + this.typesList.push(elem139); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.LIST) { + this.sizeList = []; + var _rtmp3145 = input.readListBegin(); + var _size144 = _rtmp3145.size || 0; + for (var _i146 = 0; _i146 < _size144; ++_i146) { + var elem147 = null; + elem147 = input.readI32(); + this.sizeList.push(elem147); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.BOOL) { + this.isAligned = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSInsertTabletsReq.prototype.write = function(output) { + output.writeStructBegin('TSInsertTabletsReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.prefixPaths !== null && this.prefixPaths !== undefined) { + output.writeFieldBegin('prefixPaths', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.prefixPaths.length); + for (var iter148 in this.prefixPaths) { + if (this.prefixPaths.hasOwnProperty(iter148)) { + iter148 = this.prefixPaths[iter148]; + output.writeString(iter148); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.measurementsList !== null && this.measurementsList !== undefined) { + output.writeFieldBegin('measurementsList', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.LIST, this.measurementsList.length); + for (var iter149 in this.measurementsList) { + if (this.measurementsList.hasOwnProperty(iter149)) { + iter149 = this.measurementsList[iter149]; + output.writeListBegin(Thrift.Type.STRING, iter149.length); + for (var iter150 in iter149) { + if (iter149.hasOwnProperty(iter150)) { + iter150 = iter149[iter150]; + output.writeString(iter150); + } + } + output.writeListEnd(); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.valuesList !== null && this.valuesList !== undefined) { + output.writeFieldBegin('valuesList', Thrift.Type.LIST, 4); + output.writeListBegin(Thrift.Type.STRING, this.valuesList.length); + for (var iter151 in this.valuesList) { + if (this.valuesList.hasOwnProperty(iter151)) { + iter151 = this.valuesList[iter151]; + output.writeBinary(iter151); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.timestampsList !== null && this.timestampsList !== undefined) { + output.writeFieldBegin('timestampsList', Thrift.Type.LIST, 5); + output.writeListBegin(Thrift.Type.STRING, this.timestampsList.length); + for (var iter152 in this.timestampsList) { + if (this.timestampsList.hasOwnProperty(iter152)) { + iter152 = this.timestampsList[iter152]; + output.writeBinary(iter152); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.typesList !== null && this.typesList !== undefined) { + output.writeFieldBegin('typesList', Thrift.Type.LIST, 6); + output.writeListBegin(Thrift.Type.LIST, this.typesList.length); + for (var iter153 in this.typesList) { + if (this.typesList.hasOwnProperty(iter153)) { + iter153 = this.typesList[iter153]; + output.writeListBegin(Thrift.Type.I32, iter153.length); + for (var iter154 in iter153) { + if (iter153.hasOwnProperty(iter154)) { + iter154 = iter153[iter154]; + output.writeI32(iter154); + } + } + output.writeListEnd(); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.sizeList !== null && this.sizeList !== undefined) { + output.writeFieldBegin('sizeList', Thrift.Type.LIST, 7); + output.writeListBegin(Thrift.Type.I32, this.sizeList.length); + for (var iter155 in this.sizeList) { + if (this.sizeList.hasOwnProperty(iter155)) { + iter155 = this.sizeList[iter155]; + output.writeI32(iter155); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.isAligned !== null && this.isAligned !== undefined) { + output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 8); + output.writeBool(this.isAligned); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSInsertRecordsReq = module.exports.TSInsertRecordsReq = function(args) { + this.sessionId = null; + this.prefixPaths = null; + this.measurementsList = null; + this.valuesList = null; + this.timestamps = null; + this.isAligned = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.prefixPaths !== undefined && args.prefixPaths !== null) { + this.prefixPaths = Thrift.copyList(args.prefixPaths, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPaths is unset!'); + } + if (args.measurementsList !== undefined && args.measurementsList !== null) { + this.measurementsList = Thrift.copyList(args.measurementsList, [Thrift.copyList, null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurementsList is unset!'); + } + if (args.valuesList !== undefined && args.valuesList !== null) { + this.valuesList = Thrift.copyList(args.valuesList, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field valuesList is unset!'); + } + if (args.timestamps !== undefined && args.timestamps !== null) { + this.timestamps = Thrift.copyList(args.timestamps, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestamps is unset!'); + } + if (args.isAligned !== undefined && args.isAligned !== null) { + this.isAligned = args.isAligned; + } + } +}; +TSInsertRecordsReq.prototype = {}; +TSInsertRecordsReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.prefixPaths = []; + var _rtmp3157 = input.readListBegin(); + var _size156 = _rtmp3157.size || 0; + for (var _i158 = 0; _i158 < _size156; ++_i158) { + var elem159 = null; + elem159 = input.readString(); + this.prefixPaths.push(elem159); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.measurementsList = []; + var _rtmp3161 = input.readListBegin(); + var _size160 = _rtmp3161.size || 0; + for (var _i162 = 0; _i162 < _size160; ++_i162) { + var elem163 = null; + elem163 = []; + var _rtmp3165 = input.readListBegin(); + var _size164 = _rtmp3165.size || 0; + for (var _i166 = 0; _i166 < _size164; ++_i166) { + var elem167 = null; + elem167 = input.readString(); + elem163.push(elem167); + } + input.readListEnd(); + this.measurementsList.push(elem163); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.LIST) { + this.valuesList = []; + var _rtmp3169 = input.readListBegin(); + var _size168 = _rtmp3169.size || 0; + for (var _i170 = 0; _i170 < _size168; ++_i170) { + var elem171 = null; + elem171 = input.readBinary(); + this.valuesList.push(elem171); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.LIST) { + this.timestamps = []; + var _rtmp3173 = input.readListBegin(); + var _size172 = _rtmp3173.size || 0; + for (var _i174 = 0; _i174 < _size172; ++_i174) { + var elem175 = null; + elem175 = input.readI64(); + this.timestamps.push(elem175); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.BOOL) { + this.isAligned = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSInsertRecordsReq.prototype.write = function(output) { + output.writeStructBegin('TSInsertRecordsReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.prefixPaths !== null && this.prefixPaths !== undefined) { + output.writeFieldBegin('prefixPaths', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.prefixPaths.length); + for (var iter176 in this.prefixPaths) { + if (this.prefixPaths.hasOwnProperty(iter176)) { + iter176 = this.prefixPaths[iter176]; + output.writeString(iter176); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.measurementsList !== null && this.measurementsList !== undefined) { + output.writeFieldBegin('measurementsList', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.LIST, this.measurementsList.length); + for (var iter177 in this.measurementsList) { + if (this.measurementsList.hasOwnProperty(iter177)) { + iter177 = this.measurementsList[iter177]; + output.writeListBegin(Thrift.Type.STRING, iter177.length); + for (var iter178 in iter177) { + if (iter177.hasOwnProperty(iter178)) { + iter178 = iter177[iter178]; + output.writeString(iter178); + } + } + output.writeListEnd(); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.valuesList !== null && this.valuesList !== undefined) { + output.writeFieldBegin('valuesList', Thrift.Type.LIST, 4); + output.writeListBegin(Thrift.Type.STRING, this.valuesList.length); + for (var iter179 in this.valuesList) { + if (this.valuesList.hasOwnProperty(iter179)) { + iter179 = this.valuesList[iter179]; + output.writeBinary(iter179); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.timestamps !== null && this.timestamps !== undefined) { + output.writeFieldBegin('timestamps', Thrift.Type.LIST, 5); + output.writeListBegin(Thrift.Type.I64, this.timestamps.length); + for (var iter180 in this.timestamps) { + if (this.timestamps.hasOwnProperty(iter180)) { + iter180 = this.timestamps[iter180]; + output.writeI64(iter180); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.isAligned !== null && this.isAligned !== undefined) { + output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 6); + output.writeBool(this.isAligned); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSInsertRecordsOfOneDeviceReq = module.exports.TSInsertRecordsOfOneDeviceReq = function(args) { + this.sessionId = null; + this.prefixPath = null; + this.measurementsList = null; + this.valuesList = null; + this.timestamps = null; + this.isAligned = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.prefixPath !== undefined && args.prefixPath !== null) { + this.prefixPath = args.prefixPath; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPath is unset!'); + } + if (args.measurementsList !== undefined && args.measurementsList !== null) { + this.measurementsList = Thrift.copyList(args.measurementsList, [Thrift.copyList, null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurementsList is unset!'); + } + if (args.valuesList !== undefined && args.valuesList !== null) { + this.valuesList = Thrift.copyList(args.valuesList, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field valuesList is unset!'); + } + if (args.timestamps !== undefined && args.timestamps !== null) { + this.timestamps = Thrift.copyList(args.timestamps, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestamps is unset!'); + } + if (args.isAligned !== undefined && args.isAligned !== null) { + this.isAligned = args.isAligned; + } + } +}; +TSInsertRecordsOfOneDeviceReq.prototype = {}; +TSInsertRecordsOfOneDeviceReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.prefixPath = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.measurementsList = []; + var _rtmp3182 = input.readListBegin(); + var _size181 = _rtmp3182.size || 0; + for (var _i183 = 0; _i183 < _size181; ++_i183) { + var elem184 = null; + elem184 = []; + var _rtmp3186 = input.readListBegin(); + var _size185 = _rtmp3186.size || 0; + for (var _i187 = 0; _i187 < _size185; ++_i187) { + var elem188 = null; + elem188 = input.readString(); + elem184.push(elem188); + } + input.readListEnd(); + this.measurementsList.push(elem184); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.LIST) { + this.valuesList = []; + var _rtmp3190 = input.readListBegin(); + var _size189 = _rtmp3190.size || 0; + for (var _i191 = 0; _i191 < _size189; ++_i191) { + var elem192 = null; + elem192 = input.readBinary(); + this.valuesList.push(elem192); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.LIST) { + this.timestamps = []; + var _rtmp3194 = input.readListBegin(); + var _size193 = _rtmp3194.size || 0; + for (var _i195 = 0; _i195 < _size193; ++_i195) { + var elem196 = null; + elem196 = input.readI64(); + this.timestamps.push(elem196); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.BOOL) { + this.isAligned = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSInsertRecordsOfOneDeviceReq.prototype.write = function(output) { + output.writeStructBegin('TSInsertRecordsOfOneDeviceReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.prefixPath !== null && this.prefixPath !== undefined) { + output.writeFieldBegin('prefixPath', Thrift.Type.STRING, 2); + output.writeString(this.prefixPath); + output.writeFieldEnd(); + } + if (this.measurementsList !== null && this.measurementsList !== undefined) { + output.writeFieldBegin('measurementsList', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.LIST, this.measurementsList.length); + for (var iter197 in this.measurementsList) { + if (this.measurementsList.hasOwnProperty(iter197)) { + iter197 = this.measurementsList[iter197]; + output.writeListBegin(Thrift.Type.STRING, iter197.length); + for (var iter198 in iter197) { + if (iter197.hasOwnProperty(iter198)) { + iter198 = iter197[iter198]; + output.writeString(iter198); + } + } + output.writeListEnd(); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.valuesList !== null && this.valuesList !== undefined) { + output.writeFieldBegin('valuesList', Thrift.Type.LIST, 4); + output.writeListBegin(Thrift.Type.STRING, this.valuesList.length); + for (var iter199 in this.valuesList) { + if (this.valuesList.hasOwnProperty(iter199)) { + iter199 = this.valuesList[iter199]; + output.writeBinary(iter199); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.timestamps !== null && this.timestamps !== undefined) { + output.writeFieldBegin('timestamps', Thrift.Type.LIST, 5); + output.writeListBegin(Thrift.Type.I64, this.timestamps.length); + for (var iter200 in this.timestamps) { + if (this.timestamps.hasOwnProperty(iter200)) { + iter200 = this.timestamps[iter200]; + output.writeI64(iter200); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.isAligned !== null && this.isAligned !== undefined) { + output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 6); + output.writeBool(this.isAligned); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSInsertStringRecordsOfOneDeviceReq = module.exports.TSInsertStringRecordsOfOneDeviceReq = function(args) { + this.sessionId = null; + this.prefixPath = null; + this.measurementsList = null; + this.valuesList = null; + this.timestamps = null; + this.isAligned = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.prefixPath !== undefined && args.prefixPath !== null) { + this.prefixPath = args.prefixPath; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPath is unset!'); + } + if (args.measurementsList !== undefined && args.measurementsList !== null) { + this.measurementsList = Thrift.copyList(args.measurementsList, [Thrift.copyList, null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurementsList is unset!'); + } + if (args.valuesList !== undefined && args.valuesList !== null) { + this.valuesList = Thrift.copyList(args.valuesList, [Thrift.copyList, null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field valuesList is unset!'); + } + if (args.timestamps !== undefined && args.timestamps !== null) { + this.timestamps = Thrift.copyList(args.timestamps, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestamps is unset!'); + } + if (args.isAligned !== undefined && args.isAligned !== null) { + this.isAligned = args.isAligned; + } + } +}; +TSInsertStringRecordsOfOneDeviceReq.prototype = {}; +TSInsertStringRecordsOfOneDeviceReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.prefixPath = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.measurementsList = []; + var _rtmp3202 = input.readListBegin(); + var _size201 = _rtmp3202.size || 0; + for (var _i203 = 0; _i203 < _size201; ++_i203) { + var elem204 = null; + elem204 = []; + var _rtmp3206 = input.readListBegin(); + var _size205 = _rtmp3206.size || 0; + for (var _i207 = 0; _i207 < _size205; ++_i207) { + var elem208 = null; + elem208 = input.readString(); + elem204.push(elem208); + } + input.readListEnd(); + this.measurementsList.push(elem204); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.LIST) { + this.valuesList = []; + var _rtmp3210 = input.readListBegin(); + var _size209 = _rtmp3210.size || 0; + for (var _i211 = 0; _i211 < _size209; ++_i211) { + var elem212 = null; + elem212 = []; + var _rtmp3214 = input.readListBegin(); + var _size213 = _rtmp3214.size || 0; + for (var _i215 = 0; _i215 < _size213; ++_i215) { + var elem216 = null; + elem216 = input.readString(); + elem212.push(elem216); + } + input.readListEnd(); + this.valuesList.push(elem212); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.LIST) { + this.timestamps = []; + var _rtmp3218 = input.readListBegin(); + var _size217 = _rtmp3218.size || 0; + for (var _i219 = 0; _i219 < _size217; ++_i219) { + var elem220 = null; + elem220 = input.readI64(); + this.timestamps.push(elem220); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.BOOL) { + this.isAligned = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSInsertStringRecordsOfOneDeviceReq.prototype.write = function(output) { + output.writeStructBegin('TSInsertStringRecordsOfOneDeviceReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.prefixPath !== null && this.prefixPath !== undefined) { + output.writeFieldBegin('prefixPath', Thrift.Type.STRING, 2); + output.writeString(this.prefixPath); + output.writeFieldEnd(); + } + if (this.measurementsList !== null && this.measurementsList !== undefined) { + output.writeFieldBegin('measurementsList', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.LIST, this.measurementsList.length); + for (var iter221 in this.measurementsList) { + if (this.measurementsList.hasOwnProperty(iter221)) { + iter221 = this.measurementsList[iter221]; + output.writeListBegin(Thrift.Type.STRING, iter221.length); + for (var iter222 in iter221) { + if (iter221.hasOwnProperty(iter222)) { + iter222 = iter221[iter222]; + output.writeString(iter222); + } + } + output.writeListEnd(); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.valuesList !== null && this.valuesList !== undefined) { + output.writeFieldBegin('valuesList', Thrift.Type.LIST, 4); + output.writeListBegin(Thrift.Type.LIST, this.valuesList.length); + for (var iter223 in this.valuesList) { + if (this.valuesList.hasOwnProperty(iter223)) { + iter223 = this.valuesList[iter223]; + output.writeListBegin(Thrift.Type.STRING, iter223.length); + for (var iter224 in iter223) { + if (iter223.hasOwnProperty(iter224)) { + iter224 = iter223[iter224]; + output.writeString(iter224); + } + } + output.writeListEnd(); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.timestamps !== null && this.timestamps !== undefined) { + output.writeFieldBegin('timestamps', Thrift.Type.LIST, 5); + output.writeListBegin(Thrift.Type.I64, this.timestamps.length); + for (var iter225 in this.timestamps) { + if (this.timestamps.hasOwnProperty(iter225)) { + iter225 = this.timestamps[iter225]; + output.writeI64(iter225); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.isAligned !== null && this.isAligned !== undefined) { + output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 6); + output.writeBool(this.isAligned); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSInsertStringRecordsReq = module.exports.TSInsertStringRecordsReq = function(args) { + this.sessionId = null; + this.prefixPaths = null; + this.measurementsList = null; + this.valuesList = null; + this.timestamps = null; + this.isAligned = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.prefixPaths !== undefined && args.prefixPaths !== null) { + this.prefixPaths = Thrift.copyList(args.prefixPaths, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPaths is unset!'); + } + if (args.measurementsList !== undefined && args.measurementsList !== null) { + this.measurementsList = Thrift.copyList(args.measurementsList, [Thrift.copyList, null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurementsList is unset!'); + } + if (args.valuesList !== undefined && args.valuesList !== null) { + this.valuesList = Thrift.copyList(args.valuesList, [Thrift.copyList, null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field valuesList is unset!'); + } + if (args.timestamps !== undefined && args.timestamps !== null) { + this.timestamps = Thrift.copyList(args.timestamps, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestamps is unset!'); + } + if (args.isAligned !== undefined && args.isAligned !== null) { + this.isAligned = args.isAligned; + } + } +}; +TSInsertStringRecordsReq.prototype = {}; +TSInsertStringRecordsReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.prefixPaths = []; + var _rtmp3227 = input.readListBegin(); + var _size226 = _rtmp3227.size || 0; + for (var _i228 = 0; _i228 < _size226; ++_i228) { + var elem229 = null; + elem229 = input.readString(); + this.prefixPaths.push(elem229); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.measurementsList = []; + var _rtmp3231 = input.readListBegin(); + var _size230 = _rtmp3231.size || 0; + for (var _i232 = 0; _i232 < _size230; ++_i232) { + var elem233 = null; + elem233 = []; + var _rtmp3235 = input.readListBegin(); + var _size234 = _rtmp3235.size || 0; + for (var _i236 = 0; _i236 < _size234; ++_i236) { + var elem237 = null; + elem237 = input.readString(); + elem233.push(elem237); + } + input.readListEnd(); + this.measurementsList.push(elem233); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.LIST) { + this.valuesList = []; + var _rtmp3239 = input.readListBegin(); + var _size238 = _rtmp3239.size || 0; + for (var _i240 = 0; _i240 < _size238; ++_i240) { + var elem241 = null; + elem241 = []; + var _rtmp3243 = input.readListBegin(); + var _size242 = _rtmp3243.size || 0; + for (var _i244 = 0; _i244 < _size242; ++_i244) { + var elem245 = null; + elem245 = input.readString(); + elem241.push(elem245); + } + input.readListEnd(); + this.valuesList.push(elem241); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.LIST) { + this.timestamps = []; + var _rtmp3247 = input.readListBegin(); + var _size246 = _rtmp3247.size || 0; + for (var _i248 = 0; _i248 < _size246; ++_i248) { + var elem249 = null; + elem249 = input.readI64(); + this.timestamps.push(elem249); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.BOOL) { + this.isAligned = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSInsertStringRecordsReq.prototype.write = function(output) { + output.writeStructBegin('TSInsertStringRecordsReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.prefixPaths !== null && this.prefixPaths !== undefined) { + output.writeFieldBegin('prefixPaths', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.prefixPaths.length); + for (var iter250 in this.prefixPaths) { + if (this.prefixPaths.hasOwnProperty(iter250)) { + iter250 = this.prefixPaths[iter250]; + output.writeString(iter250); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.measurementsList !== null && this.measurementsList !== undefined) { + output.writeFieldBegin('measurementsList', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.LIST, this.measurementsList.length); + for (var iter251 in this.measurementsList) { + if (this.measurementsList.hasOwnProperty(iter251)) { + iter251 = this.measurementsList[iter251]; + output.writeListBegin(Thrift.Type.STRING, iter251.length); + for (var iter252 in iter251) { + if (iter251.hasOwnProperty(iter252)) { + iter252 = iter251[iter252]; + output.writeString(iter252); + } + } + output.writeListEnd(); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.valuesList !== null && this.valuesList !== undefined) { + output.writeFieldBegin('valuesList', Thrift.Type.LIST, 4); + output.writeListBegin(Thrift.Type.LIST, this.valuesList.length); + for (var iter253 in this.valuesList) { + if (this.valuesList.hasOwnProperty(iter253)) { + iter253 = this.valuesList[iter253]; + output.writeListBegin(Thrift.Type.STRING, iter253.length); + for (var iter254 in iter253) { + if (iter253.hasOwnProperty(iter254)) { + iter254 = iter253[iter254]; + output.writeString(iter254); + } + } + output.writeListEnd(); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.timestamps !== null && this.timestamps !== undefined) { + output.writeFieldBegin('timestamps', Thrift.Type.LIST, 5); + output.writeListBegin(Thrift.Type.I64, this.timestamps.length); + for (var iter255 in this.timestamps) { + if (this.timestamps.hasOwnProperty(iter255)) { + iter255 = this.timestamps[iter255]; + output.writeI64(iter255); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.isAligned !== null && this.isAligned !== undefined) { + output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 6); + output.writeBool(this.isAligned); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSDeleteDataReq = module.exports.TSDeleteDataReq = function(args) { + this.sessionId = null; + this.paths = null; + this.startTime = null; + this.endTime = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.paths !== undefined && args.paths !== null) { + this.paths = Thrift.copyList(args.paths, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field paths is unset!'); + } + if (args.startTime !== undefined && args.startTime !== null) { + this.startTime = args.startTime; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field startTime is unset!'); + } + if (args.endTime !== undefined && args.endTime !== null) { + this.endTime = args.endTime; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field endTime is unset!'); + } + } +}; +TSDeleteDataReq.prototype = {}; +TSDeleteDataReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.paths = []; + var _rtmp3257 = input.readListBegin(); + var _size256 = _rtmp3257.size || 0; + for (var _i258 = 0; _i258 < _size256; ++_i258) { + var elem259 = null; + elem259 = input.readString(); + this.paths.push(elem259); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I64) { + this.startTime = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.I64) { + this.endTime = input.readI64(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSDeleteDataReq.prototype.write = function(output) { + output.writeStructBegin('TSDeleteDataReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.paths !== null && this.paths !== undefined) { + output.writeFieldBegin('paths', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.paths.length); + for (var iter260 in this.paths) { + if (this.paths.hasOwnProperty(iter260)) { + iter260 = this.paths[iter260]; + output.writeString(iter260); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.startTime !== null && this.startTime !== undefined) { + output.writeFieldBegin('startTime', Thrift.Type.I64, 3); + output.writeI64(this.startTime); + output.writeFieldEnd(); + } + if (this.endTime !== null && this.endTime !== undefined) { + output.writeFieldBegin('endTime', Thrift.Type.I64, 4); + output.writeI64(this.endTime); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSCreateTimeseriesReq = module.exports.TSCreateTimeseriesReq = function(args) { + this.sessionId = null; + this.path = null; + this.dataType = null; + this.encoding = null; + this.compressor = null; + this.props = null; + this.tags = null; + this.attributes = null; + this.measurementAlias = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.path !== undefined && args.path !== null) { + this.path = args.path; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field path is unset!'); + } + if (args.dataType !== undefined && args.dataType !== null) { + this.dataType = args.dataType; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dataType is unset!'); + } + if (args.encoding !== undefined && args.encoding !== null) { + this.encoding = args.encoding; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field encoding is unset!'); + } + if (args.compressor !== undefined && args.compressor !== null) { + this.compressor = args.compressor; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field compressor is unset!'); + } + if (args.props !== undefined && args.props !== null) { + this.props = Thrift.copyMap(args.props, [null]); + } + if (args.tags !== undefined && args.tags !== null) { + this.tags = Thrift.copyMap(args.tags, [null]); + } + if (args.attributes !== undefined && args.attributes !== null) { + this.attributes = Thrift.copyMap(args.attributes, [null]); + } + if (args.measurementAlias !== undefined && args.measurementAlias !== null) { + this.measurementAlias = args.measurementAlias; + } + } +}; +TSCreateTimeseriesReq.prototype = {}; +TSCreateTimeseriesReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.path = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I32) { + this.dataType = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.I32) { + this.encoding = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I32) { + this.compressor = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.MAP) { + this.props = {}; + var _rtmp3262 = input.readMapBegin(); + var _size261 = _rtmp3262.size || 0; + for (var _i263 = 0; _i263 < _size261; ++_i263) { + var key264 = null; + var val265 = null; + key264 = input.readString(); + val265 = input.readString(); + this.props[key264] = val265; + } + input.readMapEnd(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.MAP) { + this.tags = {}; + var _rtmp3267 = input.readMapBegin(); + var _size266 = _rtmp3267.size || 0; + for (var _i268 = 0; _i268 < _size266; ++_i268) { + var key269 = null; + var val270 = null; + key269 = input.readString(); + val270 = input.readString(); + this.tags[key269] = val270; + } + input.readMapEnd(); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.MAP) { + this.attributes = {}; + var _rtmp3272 = input.readMapBegin(); + var _size271 = _rtmp3272.size || 0; + for (var _i273 = 0; _i273 < _size271; ++_i273) { + var key274 = null; + var val275 = null; + key274 = input.readString(); + val275 = input.readString(); + this.attributes[key274] = val275; + } + input.readMapEnd(); + } else { + input.skip(ftype); + } + break; + case 9: + if (ftype == Thrift.Type.STRING) { + this.measurementAlias = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSCreateTimeseriesReq.prototype.write = function(output) { + output.writeStructBegin('TSCreateTimeseriesReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.path !== null && this.path !== undefined) { + output.writeFieldBegin('path', Thrift.Type.STRING, 2); + output.writeString(this.path); + output.writeFieldEnd(); + } + if (this.dataType !== null && this.dataType !== undefined) { + output.writeFieldBegin('dataType', Thrift.Type.I32, 3); + output.writeI32(this.dataType); + output.writeFieldEnd(); + } + if (this.encoding !== null && this.encoding !== undefined) { + output.writeFieldBegin('encoding', Thrift.Type.I32, 4); + output.writeI32(this.encoding); + output.writeFieldEnd(); + } + if (this.compressor !== null && this.compressor !== undefined) { + output.writeFieldBegin('compressor', Thrift.Type.I32, 5); + output.writeI32(this.compressor); + output.writeFieldEnd(); + } + if (this.props !== null && this.props !== undefined) { + output.writeFieldBegin('props', Thrift.Type.MAP, 6); + output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.props)); + for (var kiter276 in this.props) { + if (this.props.hasOwnProperty(kiter276)) { + var viter277 = this.props[kiter276]; + output.writeString(kiter276); + output.writeString(viter277); + } + } + output.writeMapEnd(); + output.writeFieldEnd(); + } + if (this.tags !== null && this.tags !== undefined) { + output.writeFieldBegin('tags', Thrift.Type.MAP, 7); + output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.tags)); + for (var kiter278 in this.tags) { + if (this.tags.hasOwnProperty(kiter278)) { + var viter279 = this.tags[kiter278]; + output.writeString(kiter278); + output.writeString(viter279); + } + } + output.writeMapEnd(); + output.writeFieldEnd(); + } + if (this.attributes !== null && this.attributes !== undefined) { + output.writeFieldBegin('attributes', Thrift.Type.MAP, 8); + output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.attributes)); + for (var kiter280 in this.attributes) { + if (this.attributes.hasOwnProperty(kiter280)) { + var viter281 = this.attributes[kiter280]; + output.writeString(kiter280); + output.writeString(viter281); + } + } + output.writeMapEnd(); + output.writeFieldEnd(); + } + if (this.measurementAlias !== null && this.measurementAlias !== undefined) { + output.writeFieldBegin('measurementAlias', Thrift.Type.STRING, 9); + output.writeString(this.measurementAlias); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSCreateAlignedTimeseriesReq = module.exports.TSCreateAlignedTimeseriesReq = function(args) { + this.sessionId = null; + this.prefixPath = null; + this.measurements = null; + this.dataTypes = null; + this.encodings = null; + this.compressors = null; + this.measurementAlias = null; + this.tagsList = null; + this.attributesList = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.prefixPath !== undefined && args.prefixPath !== null) { + this.prefixPath = args.prefixPath; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPath is unset!'); + } + if (args.measurements !== undefined && args.measurements !== null) { + this.measurements = Thrift.copyList(args.measurements, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurements is unset!'); + } + if (args.dataTypes !== undefined && args.dataTypes !== null) { + this.dataTypes = Thrift.copyList(args.dataTypes, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dataTypes is unset!'); + } + if (args.encodings !== undefined && args.encodings !== null) { + this.encodings = Thrift.copyList(args.encodings, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field encodings is unset!'); + } + if (args.compressors !== undefined && args.compressors !== null) { + this.compressors = Thrift.copyList(args.compressors, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field compressors is unset!'); + } + if (args.measurementAlias !== undefined && args.measurementAlias !== null) { + this.measurementAlias = Thrift.copyList(args.measurementAlias, [null]); + } + if (args.tagsList !== undefined && args.tagsList !== null) { + this.tagsList = Thrift.copyList(args.tagsList, [Thrift.copyMap, null]); + } + if (args.attributesList !== undefined && args.attributesList !== null) { + this.attributesList = Thrift.copyList(args.attributesList, [Thrift.copyMap, null]); + } + } +}; +TSCreateAlignedTimeseriesReq.prototype = {}; +TSCreateAlignedTimeseriesReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.prefixPath = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.measurements = []; + var _rtmp3283 = input.readListBegin(); + var _size282 = _rtmp3283.size || 0; + for (var _i284 = 0; _i284 < _size282; ++_i284) { + var elem285 = null; + elem285 = input.readString(); + this.measurements.push(elem285); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.LIST) { + this.dataTypes = []; + var _rtmp3287 = input.readListBegin(); + var _size286 = _rtmp3287.size || 0; + for (var _i288 = 0; _i288 < _size286; ++_i288) { + var elem289 = null; + elem289 = input.readI32(); + this.dataTypes.push(elem289); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.LIST) { + this.encodings = []; + var _rtmp3291 = input.readListBegin(); + var _size290 = _rtmp3291.size || 0; + for (var _i292 = 0; _i292 < _size290; ++_i292) { + var elem293 = null; + elem293 = input.readI32(); + this.encodings.push(elem293); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.LIST) { + this.compressors = []; + var _rtmp3295 = input.readListBegin(); + var _size294 = _rtmp3295.size || 0; + for (var _i296 = 0; _i296 < _size294; ++_i296) { + var elem297 = null; + elem297 = input.readI32(); + this.compressors.push(elem297); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.LIST) { + this.measurementAlias = []; + var _rtmp3299 = input.readListBegin(); + var _size298 = _rtmp3299.size || 0; + for (var _i300 = 0; _i300 < _size298; ++_i300) { + var elem301 = null; + elem301 = input.readString(); + this.measurementAlias.push(elem301); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.LIST) { + this.tagsList = []; + var _rtmp3303 = input.readListBegin(); + var _size302 = _rtmp3303.size || 0; + for (var _i304 = 0; _i304 < _size302; ++_i304) { + var elem305 = null; + elem305 = {}; + var _rtmp3307 = input.readMapBegin(); + var _size306 = _rtmp3307.size || 0; + for (var _i308 = 0; _i308 < _size306; ++_i308) { + var key309 = null; + var val310 = null; + key309 = input.readString(); + val310 = input.readString(); + elem305[key309] = val310; + } + input.readMapEnd(); + this.tagsList.push(elem305); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 9: + if (ftype == Thrift.Type.LIST) { + this.attributesList = []; + var _rtmp3312 = input.readListBegin(); + var _size311 = _rtmp3312.size || 0; + for (var _i313 = 0; _i313 < _size311; ++_i313) { + var elem314 = null; + elem314 = {}; + var _rtmp3316 = input.readMapBegin(); + var _size315 = _rtmp3316.size || 0; + for (var _i317 = 0; _i317 < _size315; ++_i317) { + var key318 = null; + var val319 = null; + key318 = input.readString(); + val319 = input.readString(); + elem314[key318] = val319; + } + input.readMapEnd(); + this.attributesList.push(elem314); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSCreateAlignedTimeseriesReq.prototype.write = function(output) { + output.writeStructBegin('TSCreateAlignedTimeseriesReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.prefixPath !== null && this.prefixPath !== undefined) { + output.writeFieldBegin('prefixPath', Thrift.Type.STRING, 2); + output.writeString(this.prefixPath); + output.writeFieldEnd(); + } + if (this.measurements !== null && this.measurements !== undefined) { + output.writeFieldBegin('measurements', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.STRING, this.measurements.length); + for (var iter320 in this.measurements) { + if (this.measurements.hasOwnProperty(iter320)) { + iter320 = this.measurements[iter320]; + output.writeString(iter320); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.dataTypes !== null && this.dataTypes !== undefined) { + output.writeFieldBegin('dataTypes', Thrift.Type.LIST, 4); + output.writeListBegin(Thrift.Type.I32, this.dataTypes.length); + for (var iter321 in this.dataTypes) { + if (this.dataTypes.hasOwnProperty(iter321)) { + iter321 = this.dataTypes[iter321]; + output.writeI32(iter321); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.encodings !== null && this.encodings !== undefined) { + output.writeFieldBegin('encodings', Thrift.Type.LIST, 5); + output.writeListBegin(Thrift.Type.I32, this.encodings.length); + for (var iter322 in this.encodings) { + if (this.encodings.hasOwnProperty(iter322)) { + iter322 = this.encodings[iter322]; + output.writeI32(iter322); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.compressors !== null && this.compressors !== undefined) { + output.writeFieldBegin('compressors', Thrift.Type.LIST, 6); + output.writeListBegin(Thrift.Type.I32, this.compressors.length); + for (var iter323 in this.compressors) { + if (this.compressors.hasOwnProperty(iter323)) { + iter323 = this.compressors[iter323]; + output.writeI32(iter323); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.measurementAlias !== null && this.measurementAlias !== undefined) { + output.writeFieldBegin('measurementAlias', Thrift.Type.LIST, 7); + output.writeListBegin(Thrift.Type.STRING, this.measurementAlias.length); + for (var iter324 in this.measurementAlias) { + if (this.measurementAlias.hasOwnProperty(iter324)) { + iter324 = this.measurementAlias[iter324]; + output.writeString(iter324); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.tagsList !== null && this.tagsList !== undefined) { + output.writeFieldBegin('tagsList', Thrift.Type.LIST, 8); + output.writeListBegin(Thrift.Type.MAP, this.tagsList.length); + for (var iter325 in this.tagsList) { + if (this.tagsList.hasOwnProperty(iter325)) { + iter325 = this.tagsList[iter325]; + output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(iter325)); + for (var kiter326 in iter325) { + if (iter325.hasOwnProperty(kiter326)) { + var viter327 = iter325[kiter326]; + output.writeString(kiter326); + output.writeString(viter327); + } + } + output.writeMapEnd(); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.attributesList !== null && this.attributesList !== undefined) { + output.writeFieldBegin('attributesList', Thrift.Type.LIST, 9); + output.writeListBegin(Thrift.Type.MAP, this.attributesList.length); + for (var iter328 in this.attributesList) { + if (this.attributesList.hasOwnProperty(iter328)) { + iter328 = this.attributesList[iter328]; + output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(iter328)); + for (var kiter329 in iter328) { + if (iter328.hasOwnProperty(kiter329)) { + var viter330 = iter328[kiter329]; + output.writeString(kiter329); + output.writeString(viter330); + } + } + output.writeMapEnd(); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSRawDataQueryReq = module.exports.TSRawDataQueryReq = function(args) { + this.sessionId = null; + this.paths = null; + this.fetchSize = null; + this.startTime = null; + this.endTime = null; + this.statementId = null; + this.enableRedirectQuery = null; + this.jdbcQuery = null; + this.timeout = null; + this.legalPathNodes = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.paths !== undefined && args.paths !== null) { + this.paths = Thrift.copyList(args.paths, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field paths is unset!'); + } + if (args.fetchSize !== undefined && args.fetchSize !== null) { + this.fetchSize = args.fetchSize; + } + if (args.startTime !== undefined && args.startTime !== null) { + this.startTime = args.startTime; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field startTime is unset!'); + } + if (args.endTime !== undefined && args.endTime !== null) { + this.endTime = args.endTime; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field endTime is unset!'); + } + if (args.statementId !== undefined && args.statementId !== null) { + this.statementId = args.statementId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statementId is unset!'); + } + if (args.enableRedirectQuery !== undefined && args.enableRedirectQuery !== null) { + this.enableRedirectQuery = args.enableRedirectQuery; + } + if (args.jdbcQuery !== undefined && args.jdbcQuery !== null) { + this.jdbcQuery = args.jdbcQuery; + } + if (args.timeout !== undefined && args.timeout !== null) { + this.timeout = args.timeout; + } + if (args.legalPathNodes !== undefined && args.legalPathNodes !== null) { + this.legalPathNodes = args.legalPathNodes; + } + } +}; +TSRawDataQueryReq.prototype = {}; +TSRawDataQueryReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.paths = []; + var _rtmp3332 = input.readListBegin(); + var _size331 = _rtmp3332.size || 0; + for (var _i333 = 0; _i333 < _size331; ++_i333) { + var elem334 = null; + elem334 = input.readString(); + this.paths.push(elem334); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I32) { + this.fetchSize = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.I64) { + this.startTime = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I64) { + this.endTime = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.I64) { + this.statementId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.BOOL) { + this.enableRedirectQuery = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.BOOL) { + this.jdbcQuery = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 9: + if (ftype == Thrift.Type.I64) { + this.timeout = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 10: + if (ftype == Thrift.Type.BOOL) { + this.legalPathNodes = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSRawDataQueryReq.prototype.write = function(output) { + output.writeStructBegin('TSRawDataQueryReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.paths !== null && this.paths !== undefined) { + output.writeFieldBegin('paths', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.paths.length); + for (var iter335 in this.paths) { + if (this.paths.hasOwnProperty(iter335)) { + iter335 = this.paths[iter335]; + output.writeString(iter335); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.fetchSize !== null && this.fetchSize !== undefined) { + output.writeFieldBegin('fetchSize', Thrift.Type.I32, 3); + output.writeI32(this.fetchSize); + output.writeFieldEnd(); + } + if (this.startTime !== null && this.startTime !== undefined) { + output.writeFieldBegin('startTime', Thrift.Type.I64, 4); + output.writeI64(this.startTime); + output.writeFieldEnd(); + } + if (this.endTime !== null && this.endTime !== undefined) { + output.writeFieldBegin('endTime', Thrift.Type.I64, 5); + output.writeI64(this.endTime); + output.writeFieldEnd(); + } + if (this.statementId !== null && this.statementId !== undefined) { + output.writeFieldBegin('statementId', Thrift.Type.I64, 6); + output.writeI64(this.statementId); + output.writeFieldEnd(); + } + if (this.enableRedirectQuery !== null && this.enableRedirectQuery !== undefined) { + output.writeFieldBegin('enableRedirectQuery', Thrift.Type.BOOL, 7); + output.writeBool(this.enableRedirectQuery); + output.writeFieldEnd(); + } + if (this.jdbcQuery !== null && this.jdbcQuery !== undefined) { + output.writeFieldBegin('jdbcQuery', Thrift.Type.BOOL, 8); + output.writeBool(this.jdbcQuery); + output.writeFieldEnd(); + } + if (this.timeout !== null && this.timeout !== undefined) { + output.writeFieldBegin('timeout', Thrift.Type.I64, 9); + output.writeI64(this.timeout); + output.writeFieldEnd(); + } + if (this.legalPathNodes !== null && this.legalPathNodes !== undefined) { + output.writeFieldBegin('legalPathNodes', Thrift.Type.BOOL, 10); + output.writeBool(this.legalPathNodes); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSLastDataQueryReq = module.exports.TSLastDataQueryReq = function(args) { + this.sessionId = null; + this.paths = null; + this.fetchSize = null; + this.time = null; + this.statementId = null; + this.enableRedirectQuery = null; + this.jdbcQuery = null; + this.timeout = null; + this.legalPathNodes = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.paths !== undefined && args.paths !== null) { + this.paths = Thrift.copyList(args.paths, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field paths is unset!'); + } + if (args.fetchSize !== undefined && args.fetchSize !== null) { + this.fetchSize = args.fetchSize; + } + if (args.time !== undefined && args.time !== null) { + this.time = args.time; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field time is unset!'); + } + if (args.statementId !== undefined && args.statementId !== null) { + this.statementId = args.statementId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statementId is unset!'); + } + if (args.enableRedirectQuery !== undefined && args.enableRedirectQuery !== null) { + this.enableRedirectQuery = args.enableRedirectQuery; + } + if (args.jdbcQuery !== undefined && args.jdbcQuery !== null) { + this.jdbcQuery = args.jdbcQuery; + } + if (args.timeout !== undefined && args.timeout !== null) { + this.timeout = args.timeout; + } + if (args.legalPathNodes !== undefined && args.legalPathNodes !== null) { + this.legalPathNodes = args.legalPathNodes; + } + } +}; +TSLastDataQueryReq.prototype = {}; +TSLastDataQueryReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.paths = []; + var _rtmp3337 = input.readListBegin(); + var _size336 = _rtmp3337.size || 0; + for (var _i338 = 0; _i338 < _size336; ++_i338) { + var elem339 = null; + elem339 = input.readString(); + this.paths.push(elem339); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I32) { + this.fetchSize = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.I64) { + this.time = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I64) { + this.statementId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.BOOL) { + this.enableRedirectQuery = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.BOOL) { + this.jdbcQuery = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.I64) { + this.timeout = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 9: + if (ftype == Thrift.Type.BOOL) { + this.legalPathNodes = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSLastDataQueryReq.prototype.write = function(output) { + output.writeStructBegin('TSLastDataQueryReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.paths !== null && this.paths !== undefined) { + output.writeFieldBegin('paths', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.paths.length); + for (var iter340 in this.paths) { + if (this.paths.hasOwnProperty(iter340)) { + iter340 = this.paths[iter340]; + output.writeString(iter340); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.fetchSize !== null && this.fetchSize !== undefined) { + output.writeFieldBegin('fetchSize', Thrift.Type.I32, 3); + output.writeI32(this.fetchSize); + output.writeFieldEnd(); + } + if (this.time !== null && this.time !== undefined) { + output.writeFieldBegin('time', Thrift.Type.I64, 4); + output.writeI64(this.time); + output.writeFieldEnd(); + } + if (this.statementId !== null && this.statementId !== undefined) { + output.writeFieldBegin('statementId', Thrift.Type.I64, 5); + output.writeI64(this.statementId); + output.writeFieldEnd(); + } + if (this.enableRedirectQuery !== null && this.enableRedirectQuery !== undefined) { + output.writeFieldBegin('enableRedirectQuery', Thrift.Type.BOOL, 6); + output.writeBool(this.enableRedirectQuery); + output.writeFieldEnd(); + } + if (this.jdbcQuery !== null && this.jdbcQuery !== undefined) { + output.writeFieldBegin('jdbcQuery', Thrift.Type.BOOL, 7); + output.writeBool(this.jdbcQuery); + output.writeFieldEnd(); + } + if (this.timeout !== null && this.timeout !== undefined) { + output.writeFieldBegin('timeout', Thrift.Type.I64, 8); + output.writeI64(this.timeout); + output.writeFieldEnd(); + } + if (this.legalPathNodes !== null && this.legalPathNodes !== undefined) { + output.writeFieldBegin('legalPathNodes', Thrift.Type.BOOL, 9); + output.writeBool(this.legalPathNodes); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSFastLastDataQueryForOneDeviceReq = module.exports.TSFastLastDataQueryForOneDeviceReq = function(args) { + this.sessionId = null; + this.db = null; + this.deviceId = null; + this.sensors = null; + this.fetchSize = null; + this.statementId = null; + this.enableRedirectQuery = null; + this.jdbcQuery = null; + this.timeout = null; + this.legalPathNodes = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.db !== undefined && args.db !== null) { + this.db = args.db; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field db is unset!'); + } + if (args.deviceId !== undefined && args.deviceId !== null) { + this.deviceId = args.deviceId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field deviceId is unset!'); + } + if (args.sensors !== undefined && args.sensors !== null) { + this.sensors = Thrift.copyList(args.sensors, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sensors is unset!'); + } + if (args.fetchSize !== undefined && args.fetchSize !== null) { + this.fetchSize = args.fetchSize; + } + if (args.statementId !== undefined && args.statementId !== null) { + this.statementId = args.statementId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statementId is unset!'); + } + if (args.enableRedirectQuery !== undefined && args.enableRedirectQuery !== null) { + this.enableRedirectQuery = args.enableRedirectQuery; + } + if (args.jdbcQuery !== undefined && args.jdbcQuery !== null) { + this.jdbcQuery = args.jdbcQuery; + } + if (args.timeout !== undefined && args.timeout !== null) { + this.timeout = args.timeout; + } + if (args.legalPathNodes !== undefined && args.legalPathNodes !== null) { + this.legalPathNodes = args.legalPathNodes; + } + } +}; +TSFastLastDataQueryForOneDeviceReq.prototype = {}; +TSFastLastDataQueryForOneDeviceReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.db = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.deviceId = input.readString(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.LIST) { + this.sensors = []; + var _rtmp3342 = input.readListBegin(); + var _size341 = _rtmp3342.size || 0; + for (var _i343 = 0; _i343 < _size341; ++_i343) { + var elem344 = null; + elem344 = input.readString(); + this.sensors.push(elem344); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I32) { + this.fetchSize = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.I64) { + this.statementId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.BOOL) { + this.enableRedirectQuery = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.BOOL) { + this.jdbcQuery = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 9: + if (ftype == Thrift.Type.I64) { + this.timeout = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 10: + if (ftype == Thrift.Type.BOOL) { + this.legalPathNodes = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSFastLastDataQueryForOneDeviceReq.prototype.write = function(output) { + output.writeStructBegin('TSFastLastDataQueryForOneDeviceReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.db !== null && this.db !== undefined) { + output.writeFieldBegin('db', Thrift.Type.STRING, 2); + output.writeString(this.db); + output.writeFieldEnd(); + } + if (this.deviceId !== null && this.deviceId !== undefined) { + output.writeFieldBegin('deviceId', Thrift.Type.STRING, 3); + output.writeString(this.deviceId); + output.writeFieldEnd(); + } + if (this.sensors !== null && this.sensors !== undefined) { + output.writeFieldBegin('sensors', Thrift.Type.LIST, 4); + output.writeListBegin(Thrift.Type.STRING, this.sensors.length); + for (var iter345 in this.sensors) { + if (this.sensors.hasOwnProperty(iter345)) { + iter345 = this.sensors[iter345]; + output.writeString(iter345); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.fetchSize !== null && this.fetchSize !== undefined) { + output.writeFieldBegin('fetchSize', Thrift.Type.I32, 5); + output.writeI32(this.fetchSize); + output.writeFieldEnd(); + } + if (this.statementId !== null && this.statementId !== undefined) { + output.writeFieldBegin('statementId', Thrift.Type.I64, 6); + output.writeI64(this.statementId); + output.writeFieldEnd(); + } + if (this.enableRedirectQuery !== null && this.enableRedirectQuery !== undefined) { + output.writeFieldBegin('enableRedirectQuery', Thrift.Type.BOOL, 7); + output.writeBool(this.enableRedirectQuery); + output.writeFieldEnd(); + } + if (this.jdbcQuery !== null && this.jdbcQuery !== undefined) { + output.writeFieldBegin('jdbcQuery', Thrift.Type.BOOL, 8); + output.writeBool(this.jdbcQuery); + output.writeFieldEnd(); + } + if (this.timeout !== null && this.timeout !== undefined) { + output.writeFieldBegin('timeout', Thrift.Type.I64, 9); + output.writeI64(this.timeout); + output.writeFieldEnd(); + } + if (this.legalPathNodes !== null && this.legalPathNodes !== undefined) { + output.writeFieldBegin('legalPathNodes', Thrift.Type.BOOL, 10); + output.writeBool(this.legalPathNodes); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSAggregationQueryReq = module.exports.TSAggregationQueryReq = function(args) { + this.sessionId = null; + this.statementId = null; + this.paths = null; + this.aggregations = null; + this.startTime = null; + this.endTime = null; + this.interval = null; + this.slidingStep = null; + this.fetchSize = null; + this.timeout = null; + this.legalPathNodes = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.statementId !== undefined && args.statementId !== null) { + this.statementId = args.statementId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statementId is unset!'); + } + if (args.paths !== undefined && args.paths !== null) { + this.paths = Thrift.copyList(args.paths, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field paths is unset!'); + } + if (args.aggregations !== undefined && args.aggregations !== null) { + this.aggregations = Thrift.copyList(args.aggregations, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field aggregations is unset!'); + } + if (args.startTime !== undefined && args.startTime !== null) { + this.startTime = args.startTime; + } + if (args.endTime !== undefined && args.endTime !== null) { + this.endTime = args.endTime; + } + if (args.interval !== undefined && args.interval !== null) { + this.interval = args.interval; + } + if (args.slidingStep !== undefined && args.slidingStep !== null) { + this.slidingStep = args.slidingStep; + } + if (args.fetchSize !== undefined && args.fetchSize !== null) { + this.fetchSize = args.fetchSize; + } + if (args.timeout !== undefined && args.timeout !== null) { + this.timeout = args.timeout; + } + if (args.legalPathNodes !== undefined && args.legalPathNodes !== null) { + this.legalPathNodes = args.legalPathNodes; + } + } +}; +TSAggregationQueryReq.prototype = {}; +TSAggregationQueryReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.statementId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.paths = []; + var _rtmp3347 = input.readListBegin(); + var _size346 = _rtmp3347.size || 0; + for (var _i348 = 0; _i348 < _size346; ++_i348) { + var elem349 = null; + elem349 = input.readString(); + this.paths.push(elem349); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.LIST) { + this.aggregations = []; + var _rtmp3351 = input.readListBegin(); + var _size350 = _rtmp3351.size || 0; + for (var _i352 = 0; _i352 < _size350; ++_i352) { + var elem353 = null; + elem353 = input.readI32(); + this.aggregations.push(elem353); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I64) { + this.startTime = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.I64) { + this.endTime = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.I64) { + this.interval = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.I64) { + this.slidingStep = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 9: + if (ftype == Thrift.Type.I32) { + this.fetchSize = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 10: + if (ftype == Thrift.Type.I64) { + this.timeout = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 11: + if (ftype == Thrift.Type.BOOL) { + this.legalPathNodes = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSAggregationQueryReq.prototype.write = function(output) { + output.writeStructBegin('TSAggregationQueryReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.statementId !== null && this.statementId !== undefined) { + output.writeFieldBegin('statementId', Thrift.Type.I64, 2); + output.writeI64(this.statementId); + output.writeFieldEnd(); + } + if (this.paths !== null && this.paths !== undefined) { + output.writeFieldBegin('paths', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.STRING, this.paths.length); + for (var iter354 in this.paths) { + if (this.paths.hasOwnProperty(iter354)) { + iter354 = this.paths[iter354]; + output.writeString(iter354); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.aggregations !== null && this.aggregations !== undefined) { + output.writeFieldBegin('aggregations', Thrift.Type.LIST, 4); + output.writeListBegin(Thrift.Type.I32, this.aggregations.length); + for (var iter355 in this.aggregations) { + if (this.aggregations.hasOwnProperty(iter355)) { + iter355 = this.aggregations[iter355]; + output.writeI32(iter355); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.startTime !== null && this.startTime !== undefined) { + output.writeFieldBegin('startTime', Thrift.Type.I64, 5); + output.writeI64(this.startTime); + output.writeFieldEnd(); + } + if (this.endTime !== null && this.endTime !== undefined) { + output.writeFieldBegin('endTime', Thrift.Type.I64, 6); + output.writeI64(this.endTime); + output.writeFieldEnd(); + } + if (this.interval !== null && this.interval !== undefined) { + output.writeFieldBegin('interval', Thrift.Type.I64, 7); + output.writeI64(this.interval); + output.writeFieldEnd(); + } + if (this.slidingStep !== null && this.slidingStep !== undefined) { + output.writeFieldBegin('slidingStep', Thrift.Type.I64, 8); + output.writeI64(this.slidingStep); + output.writeFieldEnd(); + } + if (this.fetchSize !== null && this.fetchSize !== undefined) { + output.writeFieldBegin('fetchSize', Thrift.Type.I32, 9); + output.writeI32(this.fetchSize); + output.writeFieldEnd(); + } + if (this.timeout !== null && this.timeout !== undefined) { + output.writeFieldBegin('timeout', Thrift.Type.I64, 10); + output.writeI64(this.timeout); + output.writeFieldEnd(); + } + if (this.legalPathNodes !== null && this.legalPathNodes !== undefined) { + output.writeFieldBegin('legalPathNodes', Thrift.Type.BOOL, 11); + output.writeBool(this.legalPathNodes); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSGroupByQueryIntervalReq = module.exports.TSGroupByQueryIntervalReq = function(args) { + this.sessionId = null; + this.statementId = null; + this.device = null; + this.measurement = null; + this.dataType = null; + this.aggregationType = null; + this.database = null; + this.startTime = null; + this.endTime = null; + this.interval = null; + this.fetchSize = null; + this.timeout = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.statementId !== undefined && args.statementId !== null) { + this.statementId = args.statementId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statementId is unset!'); + } + if (args.device !== undefined && args.device !== null) { + this.device = args.device; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field device is unset!'); + } + if (args.measurement !== undefined && args.measurement !== null) { + this.measurement = args.measurement; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurement is unset!'); + } + if (args.dataType !== undefined && args.dataType !== null) { + this.dataType = args.dataType; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dataType is unset!'); + } + if (args.aggregationType !== undefined && args.aggregationType !== null) { + this.aggregationType = args.aggregationType; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field aggregationType is unset!'); + } + if (args.database !== undefined && args.database !== null) { + this.database = args.database; + } + if (args.startTime !== undefined && args.startTime !== null) { + this.startTime = args.startTime; + } + if (args.endTime !== undefined && args.endTime !== null) { + this.endTime = args.endTime; + } + if (args.interval !== undefined && args.interval !== null) { + this.interval = args.interval; + } + if (args.fetchSize !== undefined && args.fetchSize !== null) { + this.fetchSize = args.fetchSize; + } + if (args.timeout !== undefined && args.timeout !== null) { + this.timeout = args.timeout; + } + } +}; +TSGroupByQueryIntervalReq.prototype = {}; +TSGroupByQueryIntervalReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.statementId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.device = input.readString(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRING) { + this.measurement = input.readString(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I32) { + this.dataType = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.I32) { + this.aggregationType = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.STRING) { + this.database = input.readString(); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.I64) { + this.startTime = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 9: + if (ftype == Thrift.Type.I64) { + this.endTime = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 10: + if (ftype == Thrift.Type.I64) { + this.interval = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 11: + if (ftype == Thrift.Type.I32) { + this.fetchSize = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 12: + if (ftype == Thrift.Type.I64) { + this.timeout = input.readI64(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSGroupByQueryIntervalReq.prototype.write = function(output) { + output.writeStructBegin('TSGroupByQueryIntervalReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.statementId !== null && this.statementId !== undefined) { + output.writeFieldBegin('statementId', Thrift.Type.I64, 2); + output.writeI64(this.statementId); + output.writeFieldEnd(); + } + if (this.device !== null && this.device !== undefined) { + output.writeFieldBegin('device', Thrift.Type.STRING, 3); + output.writeString(this.device); + output.writeFieldEnd(); + } + if (this.measurement !== null && this.measurement !== undefined) { + output.writeFieldBegin('measurement', Thrift.Type.STRING, 4); + output.writeString(this.measurement); + output.writeFieldEnd(); + } + if (this.dataType !== null && this.dataType !== undefined) { + output.writeFieldBegin('dataType', Thrift.Type.I32, 5); + output.writeI32(this.dataType); + output.writeFieldEnd(); + } + if (this.aggregationType !== null && this.aggregationType !== undefined) { + output.writeFieldBegin('aggregationType', Thrift.Type.I32, 6); + output.writeI32(this.aggregationType); + output.writeFieldEnd(); + } + if (this.database !== null && this.database !== undefined) { + output.writeFieldBegin('database', Thrift.Type.STRING, 7); + output.writeString(this.database); + output.writeFieldEnd(); + } + if (this.startTime !== null && this.startTime !== undefined) { + output.writeFieldBegin('startTime', Thrift.Type.I64, 8); + output.writeI64(this.startTime); + output.writeFieldEnd(); + } + if (this.endTime !== null && this.endTime !== undefined) { + output.writeFieldBegin('endTime', Thrift.Type.I64, 9); + output.writeI64(this.endTime); + output.writeFieldEnd(); + } + if (this.interval !== null && this.interval !== undefined) { + output.writeFieldBegin('interval', Thrift.Type.I64, 10); + output.writeI64(this.interval); + output.writeFieldEnd(); + } + if (this.fetchSize !== null && this.fetchSize !== undefined) { + output.writeFieldBegin('fetchSize', Thrift.Type.I32, 11); + output.writeI32(this.fetchSize); + output.writeFieldEnd(); + } + if (this.timeout !== null && this.timeout !== undefined) { + output.writeFieldBegin('timeout', Thrift.Type.I64, 12); + output.writeI64(this.timeout); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSCreateMultiTimeseriesReq = module.exports.TSCreateMultiTimeseriesReq = function(args) { + this.sessionId = null; + this.paths = null; + this.dataTypes = null; + this.encodings = null; + this.compressors = null; + this.propsList = null; + this.tagsList = null; + this.attributesList = null; + this.measurementAliasList = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.paths !== undefined && args.paths !== null) { + this.paths = Thrift.copyList(args.paths, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field paths is unset!'); + } + if (args.dataTypes !== undefined && args.dataTypes !== null) { + this.dataTypes = Thrift.copyList(args.dataTypes, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dataTypes is unset!'); + } + if (args.encodings !== undefined && args.encodings !== null) { + this.encodings = Thrift.copyList(args.encodings, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field encodings is unset!'); + } + if (args.compressors !== undefined && args.compressors !== null) { + this.compressors = Thrift.copyList(args.compressors, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field compressors is unset!'); + } + if (args.propsList !== undefined && args.propsList !== null) { + this.propsList = Thrift.copyList(args.propsList, [Thrift.copyMap, null]); + } + if (args.tagsList !== undefined && args.tagsList !== null) { + this.tagsList = Thrift.copyList(args.tagsList, [Thrift.copyMap, null]); + } + if (args.attributesList !== undefined && args.attributesList !== null) { + this.attributesList = Thrift.copyList(args.attributesList, [Thrift.copyMap, null]); + } + if (args.measurementAliasList !== undefined && args.measurementAliasList !== null) { + this.measurementAliasList = Thrift.copyList(args.measurementAliasList, [null]); + } + } +}; +TSCreateMultiTimeseriesReq.prototype = {}; +TSCreateMultiTimeseriesReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.paths = []; + var _rtmp3357 = input.readListBegin(); + var _size356 = _rtmp3357.size || 0; + for (var _i358 = 0; _i358 < _size356; ++_i358) { + var elem359 = null; + elem359 = input.readString(); + this.paths.push(elem359); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.dataTypes = []; + var _rtmp3361 = input.readListBegin(); + var _size360 = _rtmp3361.size || 0; + for (var _i362 = 0; _i362 < _size360; ++_i362) { + var elem363 = null; + elem363 = input.readI32(); + this.dataTypes.push(elem363); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.LIST) { + this.encodings = []; + var _rtmp3365 = input.readListBegin(); + var _size364 = _rtmp3365.size || 0; + for (var _i366 = 0; _i366 < _size364; ++_i366) { + var elem367 = null; + elem367 = input.readI32(); + this.encodings.push(elem367); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.LIST) { + this.compressors = []; + var _rtmp3369 = input.readListBegin(); + var _size368 = _rtmp3369.size || 0; + for (var _i370 = 0; _i370 < _size368; ++_i370) { + var elem371 = null; + elem371 = input.readI32(); + this.compressors.push(elem371); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.LIST) { + this.propsList = []; + var _rtmp3373 = input.readListBegin(); + var _size372 = _rtmp3373.size || 0; + for (var _i374 = 0; _i374 < _size372; ++_i374) { + var elem375 = null; + elem375 = {}; + var _rtmp3377 = input.readMapBegin(); + var _size376 = _rtmp3377.size || 0; + for (var _i378 = 0; _i378 < _size376; ++_i378) { + var key379 = null; + var val380 = null; + key379 = input.readString(); + val380 = input.readString(); + elem375[key379] = val380; + } + input.readMapEnd(); + this.propsList.push(elem375); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.LIST) { + this.tagsList = []; + var _rtmp3382 = input.readListBegin(); + var _size381 = _rtmp3382.size || 0; + for (var _i383 = 0; _i383 < _size381; ++_i383) { + var elem384 = null; + elem384 = {}; + var _rtmp3386 = input.readMapBegin(); + var _size385 = _rtmp3386.size || 0; + for (var _i387 = 0; _i387 < _size385; ++_i387) { + var key388 = null; + var val389 = null; + key388 = input.readString(); + val389 = input.readString(); + elem384[key388] = val389; + } + input.readMapEnd(); + this.tagsList.push(elem384); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.LIST) { + this.attributesList = []; + var _rtmp3391 = input.readListBegin(); + var _size390 = _rtmp3391.size || 0; + for (var _i392 = 0; _i392 < _size390; ++_i392) { + var elem393 = null; + elem393 = {}; + var _rtmp3395 = input.readMapBegin(); + var _size394 = _rtmp3395.size || 0; + for (var _i396 = 0; _i396 < _size394; ++_i396) { + var key397 = null; + var val398 = null; + key397 = input.readString(); + val398 = input.readString(); + elem393[key397] = val398; + } + input.readMapEnd(); + this.attributesList.push(elem393); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 9: + if (ftype == Thrift.Type.LIST) { + this.measurementAliasList = []; + var _rtmp3400 = input.readListBegin(); + var _size399 = _rtmp3400.size || 0; + for (var _i401 = 0; _i401 < _size399; ++_i401) { + var elem402 = null; + elem402 = input.readString(); + this.measurementAliasList.push(elem402); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSCreateMultiTimeseriesReq.prototype.write = function(output) { + output.writeStructBegin('TSCreateMultiTimeseriesReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.paths !== null && this.paths !== undefined) { + output.writeFieldBegin('paths', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.paths.length); + for (var iter403 in this.paths) { + if (this.paths.hasOwnProperty(iter403)) { + iter403 = this.paths[iter403]; + output.writeString(iter403); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.dataTypes !== null && this.dataTypes !== undefined) { + output.writeFieldBegin('dataTypes', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.I32, this.dataTypes.length); + for (var iter404 in this.dataTypes) { + if (this.dataTypes.hasOwnProperty(iter404)) { + iter404 = this.dataTypes[iter404]; + output.writeI32(iter404); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.encodings !== null && this.encodings !== undefined) { + output.writeFieldBegin('encodings', Thrift.Type.LIST, 4); + output.writeListBegin(Thrift.Type.I32, this.encodings.length); + for (var iter405 in this.encodings) { + if (this.encodings.hasOwnProperty(iter405)) { + iter405 = this.encodings[iter405]; + output.writeI32(iter405); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.compressors !== null && this.compressors !== undefined) { + output.writeFieldBegin('compressors', Thrift.Type.LIST, 5); + output.writeListBegin(Thrift.Type.I32, this.compressors.length); + for (var iter406 in this.compressors) { + if (this.compressors.hasOwnProperty(iter406)) { + iter406 = this.compressors[iter406]; + output.writeI32(iter406); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.propsList !== null && this.propsList !== undefined) { + output.writeFieldBegin('propsList', Thrift.Type.LIST, 6); + output.writeListBegin(Thrift.Type.MAP, this.propsList.length); + for (var iter407 in this.propsList) { + if (this.propsList.hasOwnProperty(iter407)) { + iter407 = this.propsList[iter407]; + output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(iter407)); + for (var kiter408 in iter407) { + if (iter407.hasOwnProperty(kiter408)) { + var viter409 = iter407[kiter408]; + output.writeString(kiter408); + output.writeString(viter409); + } + } + output.writeMapEnd(); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.tagsList !== null && this.tagsList !== undefined) { + output.writeFieldBegin('tagsList', Thrift.Type.LIST, 7); + output.writeListBegin(Thrift.Type.MAP, this.tagsList.length); + for (var iter410 in this.tagsList) { + if (this.tagsList.hasOwnProperty(iter410)) { + iter410 = this.tagsList[iter410]; + output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(iter410)); + for (var kiter411 in iter410) { + if (iter410.hasOwnProperty(kiter411)) { + var viter412 = iter410[kiter411]; + output.writeString(kiter411); + output.writeString(viter412); + } + } + output.writeMapEnd(); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.attributesList !== null && this.attributesList !== undefined) { + output.writeFieldBegin('attributesList', Thrift.Type.LIST, 8); + output.writeListBegin(Thrift.Type.MAP, this.attributesList.length); + for (var iter413 in this.attributesList) { + if (this.attributesList.hasOwnProperty(iter413)) { + iter413 = this.attributesList[iter413]; + output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(iter413)); + for (var kiter414 in iter413) { + if (iter413.hasOwnProperty(kiter414)) { + var viter415 = iter413[kiter414]; + output.writeString(kiter414); + output.writeString(viter415); + } + } + output.writeMapEnd(); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.measurementAliasList !== null && this.measurementAliasList !== undefined) { + output.writeFieldBegin('measurementAliasList', Thrift.Type.LIST, 9); + output.writeListBegin(Thrift.Type.STRING, this.measurementAliasList.length); + for (var iter416 in this.measurementAliasList) { + if (this.measurementAliasList.hasOwnProperty(iter416)) { + iter416 = this.measurementAliasList[iter416]; + output.writeString(iter416); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var ServerProperties = module.exports.ServerProperties = function(args) { + this.version = null; + this.supportedTimeAggregationOperations = null; + this.timestampPrecision = null; + this.maxConcurrentClientNum = null; + this.thriftMaxFrameSize = null; + this.isReadOnly = null; + this.buildInfo = null; + this.logo = null; + if (args) { + if (args.version !== undefined && args.version !== null) { + this.version = args.version; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field version is unset!'); + } + if (args.supportedTimeAggregationOperations !== undefined && args.supportedTimeAggregationOperations !== null) { + this.supportedTimeAggregationOperations = Thrift.copyList(args.supportedTimeAggregationOperations, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field supportedTimeAggregationOperations is unset!'); + } + if (args.timestampPrecision !== undefined && args.timestampPrecision !== null) { + this.timestampPrecision = args.timestampPrecision; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timestampPrecision is unset!'); + } + if (args.maxConcurrentClientNum !== undefined && args.maxConcurrentClientNum !== null) { + this.maxConcurrentClientNum = args.maxConcurrentClientNum; + } + if (args.thriftMaxFrameSize !== undefined && args.thriftMaxFrameSize !== null) { + this.thriftMaxFrameSize = args.thriftMaxFrameSize; + } + if (args.isReadOnly !== undefined && args.isReadOnly !== null) { + this.isReadOnly = args.isReadOnly; + } + if (args.buildInfo !== undefined && args.buildInfo !== null) { + this.buildInfo = args.buildInfo; + } + if (args.logo !== undefined && args.logo !== null) { + this.logo = args.logo; + } + } +}; +ServerProperties.prototype = {}; +ServerProperties.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.version = input.readString(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.supportedTimeAggregationOperations = []; + var _rtmp3418 = input.readListBegin(); + var _size417 = _rtmp3418.size || 0; + for (var _i419 = 0; _i419 < _size417; ++_i419) { + var elem420 = null; + elem420 = input.readString(); + this.supportedTimeAggregationOperations.push(elem420); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.timestampPrecision = input.readString(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.I32) { + this.maxConcurrentClientNum = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I32) { + this.thriftMaxFrameSize = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.BOOL) { + this.isReadOnly = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.STRING) { + this.buildInfo = input.readString(); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.STRING) { + this.logo = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +ServerProperties.prototype.write = function(output) { + output.writeStructBegin('ServerProperties'); + if (this.version !== null && this.version !== undefined) { + output.writeFieldBegin('version', Thrift.Type.STRING, 1); + output.writeString(this.version); + output.writeFieldEnd(); + } + if (this.supportedTimeAggregationOperations !== null && this.supportedTimeAggregationOperations !== undefined) { + output.writeFieldBegin('supportedTimeAggregationOperations', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.supportedTimeAggregationOperations.length); + for (var iter421 in this.supportedTimeAggregationOperations) { + if (this.supportedTimeAggregationOperations.hasOwnProperty(iter421)) { + iter421 = this.supportedTimeAggregationOperations[iter421]; + output.writeString(iter421); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.timestampPrecision !== null && this.timestampPrecision !== undefined) { + output.writeFieldBegin('timestampPrecision', Thrift.Type.STRING, 3); + output.writeString(this.timestampPrecision); + output.writeFieldEnd(); + } + if (this.maxConcurrentClientNum !== null && this.maxConcurrentClientNum !== undefined) { + output.writeFieldBegin('maxConcurrentClientNum', Thrift.Type.I32, 4); + output.writeI32(this.maxConcurrentClientNum); + output.writeFieldEnd(); + } + if (this.thriftMaxFrameSize !== null && this.thriftMaxFrameSize !== undefined) { + output.writeFieldBegin('thriftMaxFrameSize', Thrift.Type.I32, 5); + output.writeI32(this.thriftMaxFrameSize); + output.writeFieldEnd(); + } + if (this.isReadOnly !== null && this.isReadOnly !== undefined) { + output.writeFieldBegin('isReadOnly', Thrift.Type.BOOL, 6); + output.writeBool(this.isReadOnly); + output.writeFieldEnd(); + } + if (this.buildInfo !== null && this.buildInfo !== undefined) { + output.writeFieldBegin('buildInfo', Thrift.Type.STRING, 7); + output.writeString(this.buildInfo); + output.writeFieldEnd(); + } + if (this.logo !== null && this.logo !== undefined) { + output.writeFieldBegin('logo', Thrift.Type.STRING, 8); + output.writeString(this.logo); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSSetSchemaTemplateReq = module.exports.TSSetSchemaTemplateReq = function(args) { + this.sessionId = null; + this.templateName = null; + this.prefixPath = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.templateName !== undefined && args.templateName !== null) { + this.templateName = args.templateName; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field templateName is unset!'); + } + if (args.prefixPath !== undefined && args.prefixPath !== null) { + this.prefixPath = args.prefixPath; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPath is unset!'); + } + } +}; +TSSetSchemaTemplateReq.prototype = {}; +TSSetSchemaTemplateReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.templateName = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.prefixPath = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSSetSchemaTemplateReq.prototype.write = function(output) { + output.writeStructBegin('TSSetSchemaTemplateReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.templateName !== null && this.templateName !== undefined) { + output.writeFieldBegin('templateName', Thrift.Type.STRING, 2); + output.writeString(this.templateName); + output.writeFieldEnd(); + } + if (this.prefixPath !== null && this.prefixPath !== undefined) { + output.writeFieldBegin('prefixPath', Thrift.Type.STRING, 3); + output.writeString(this.prefixPath); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSCreateSchemaTemplateReq = module.exports.TSCreateSchemaTemplateReq = function(args) { + this.sessionId = null; + this.name = null; + this.serializedTemplate = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.name !== undefined && args.name !== null) { + this.name = args.name; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field name is unset!'); + } + if (args.serializedTemplate !== undefined && args.serializedTemplate !== null) { + this.serializedTemplate = args.serializedTemplate; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field serializedTemplate is unset!'); + } + } +}; +TSCreateSchemaTemplateReq.prototype = {}; +TSCreateSchemaTemplateReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.name = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.serializedTemplate = input.readBinary(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSCreateSchemaTemplateReq.prototype.write = function(output) { + output.writeStructBegin('TSCreateSchemaTemplateReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.name !== null && this.name !== undefined) { + output.writeFieldBegin('name', Thrift.Type.STRING, 2); + output.writeString(this.name); + output.writeFieldEnd(); + } + if (this.serializedTemplate !== null && this.serializedTemplate !== undefined) { + output.writeFieldBegin('serializedTemplate', Thrift.Type.STRING, 3); + output.writeBinary(this.serializedTemplate); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSAppendSchemaTemplateReq = module.exports.TSAppendSchemaTemplateReq = function(args) { + this.sessionId = null; + this.name = null; + this.isAligned = null; + this.measurements = null; + this.dataTypes = null; + this.encodings = null; + this.compressors = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.name !== undefined && args.name !== null) { + this.name = args.name; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field name is unset!'); + } + if (args.isAligned !== undefined && args.isAligned !== null) { + this.isAligned = args.isAligned; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field isAligned is unset!'); + } + if (args.measurements !== undefined && args.measurements !== null) { + this.measurements = Thrift.copyList(args.measurements, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field measurements is unset!'); + } + if (args.dataTypes !== undefined && args.dataTypes !== null) { + this.dataTypes = Thrift.copyList(args.dataTypes, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dataTypes is unset!'); + } + if (args.encodings !== undefined && args.encodings !== null) { + this.encodings = Thrift.copyList(args.encodings, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field encodings is unset!'); + } + if (args.compressors !== undefined && args.compressors !== null) { + this.compressors = Thrift.copyList(args.compressors, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field compressors is unset!'); + } + } +}; +TSAppendSchemaTemplateReq.prototype = {}; +TSAppendSchemaTemplateReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.name = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.BOOL) { + this.isAligned = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.LIST) { + this.measurements = []; + var _rtmp3423 = input.readListBegin(); + var _size422 = _rtmp3423.size || 0; + for (var _i424 = 0; _i424 < _size422; ++_i424) { + var elem425 = null; + elem425 = input.readString(); + this.measurements.push(elem425); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.LIST) { + this.dataTypes = []; + var _rtmp3427 = input.readListBegin(); + var _size426 = _rtmp3427.size || 0; + for (var _i428 = 0; _i428 < _size426; ++_i428) { + var elem429 = null; + elem429 = input.readI32(); + this.dataTypes.push(elem429); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.LIST) { + this.encodings = []; + var _rtmp3431 = input.readListBegin(); + var _size430 = _rtmp3431.size || 0; + for (var _i432 = 0; _i432 < _size430; ++_i432) { + var elem433 = null; + elem433 = input.readI32(); + this.encodings.push(elem433); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.LIST) { + this.compressors = []; + var _rtmp3435 = input.readListBegin(); + var _size434 = _rtmp3435.size || 0; + for (var _i436 = 0; _i436 < _size434; ++_i436) { + var elem437 = null; + elem437 = input.readI32(); + this.compressors.push(elem437); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSAppendSchemaTemplateReq.prototype.write = function(output) { + output.writeStructBegin('TSAppendSchemaTemplateReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.name !== null && this.name !== undefined) { + output.writeFieldBegin('name', Thrift.Type.STRING, 2); + output.writeString(this.name); + output.writeFieldEnd(); + } + if (this.isAligned !== null && this.isAligned !== undefined) { + output.writeFieldBegin('isAligned', Thrift.Type.BOOL, 3); + output.writeBool(this.isAligned); + output.writeFieldEnd(); + } + if (this.measurements !== null && this.measurements !== undefined) { + output.writeFieldBegin('measurements', Thrift.Type.LIST, 4); + output.writeListBegin(Thrift.Type.STRING, this.measurements.length); + for (var iter438 in this.measurements) { + if (this.measurements.hasOwnProperty(iter438)) { + iter438 = this.measurements[iter438]; + output.writeString(iter438); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.dataTypes !== null && this.dataTypes !== undefined) { + output.writeFieldBegin('dataTypes', Thrift.Type.LIST, 5); + output.writeListBegin(Thrift.Type.I32, this.dataTypes.length); + for (var iter439 in this.dataTypes) { + if (this.dataTypes.hasOwnProperty(iter439)) { + iter439 = this.dataTypes[iter439]; + output.writeI32(iter439); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.encodings !== null && this.encodings !== undefined) { + output.writeFieldBegin('encodings', Thrift.Type.LIST, 6); + output.writeListBegin(Thrift.Type.I32, this.encodings.length); + for (var iter440 in this.encodings) { + if (this.encodings.hasOwnProperty(iter440)) { + iter440 = this.encodings[iter440]; + output.writeI32(iter440); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.compressors !== null && this.compressors !== undefined) { + output.writeFieldBegin('compressors', Thrift.Type.LIST, 7); + output.writeListBegin(Thrift.Type.I32, this.compressors.length); + for (var iter441 in this.compressors) { + if (this.compressors.hasOwnProperty(iter441)) { + iter441 = this.compressors[iter441]; + output.writeI32(iter441); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSPruneSchemaTemplateReq = module.exports.TSPruneSchemaTemplateReq = function(args) { + this.sessionId = null; + this.name = null; + this.path = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.name !== undefined && args.name !== null) { + this.name = args.name; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field name is unset!'); + } + if (args.path !== undefined && args.path !== null) { + this.path = args.path; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field path is unset!'); + } + } +}; +TSPruneSchemaTemplateReq.prototype = {}; +TSPruneSchemaTemplateReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.name = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.path = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSPruneSchemaTemplateReq.prototype.write = function(output) { + output.writeStructBegin('TSPruneSchemaTemplateReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.name !== null && this.name !== undefined) { + output.writeFieldBegin('name', Thrift.Type.STRING, 2); + output.writeString(this.name); + output.writeFieldEnd(); + } + if (this.path !== null && this.path !== undefined) { + output.writeFieldBegin('path', Thrift.Type.STRING, 3); + output.writeString(this.path); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSQueryTemplateReq = module.exports.TSQueryTemplateReq = function(args) { + this.sessionId = null; + this.name = null; + this.queryType = null; + this.measurement = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.name !== undefined && args.name !== null) { + this.name = args.name; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field name is unset!'); + } + if (args.queryType !== undefined && args.queryType !== null) { + this.queryType = args.queryType; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field queryType is unset!'); + } + if (args.measurement !== undefined && args.measurement !== null) { + this.measurement = args.measurement; + } + } +}; +TSQueryTemplateReq.prototype = {}; +TSQueryTemplateReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.name = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I32) { + this.queryType = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRING) { + this.measurement = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSQueryTemplateReq.prototype.write = function(output) { + output.writeStructBegin('TSQueryTemplateReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.name !== null && this.name !== undefined) { + output.writeFieldBegin('name', Thrift.Type.STRING, 2); + output.writeString(this.name); + output.writeFieldEnd(); + } + if (this.queryType !== null && this.queryType !== undefined) { + output.writeFieldBegin('queryType', Thrift.Type.I32, 3); + output.writeI32(this.queryType); + output.writeFieldEnd(); + } + if (this.measurement !== null && this.measurement !== undefined) { + output.writeFieldBegin('measurement', Thrift.Type.STRING, 4); + output.writeString(this.measurement); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSQueryTemplateResp = module.exports.TSQueryTemplateResp = function(args) { + this.status = null; + this.queryType = null; + this.result = null; + this.count = null; + this.measurements = null; + if (args) { + if (args.status !== undefined && args.status !== null) { + this.status = new common_ttypes.TSStatus(args.status); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); + } + if (args.queryType !== undefined && args.queryType !== null) { + this.queryType = args.queryType; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field queryType is unset!'); + } + if (args.result !== undefined && args.result !== null) { + this.result = args.result; + } + if (args.count !== undefined && args.count !== null) { + this.count = args.count; + } + if (args.measurements !== undefined && args.measurements !== null) { + this.measurements = Thrift.copyList(args.measurements, [null]); + } + } +}; +TSQueryTemplateResp.prototype = {}; +TSQueryTemplateResp.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.status = new common_ttypes.TSStatus(); + this.status.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I32) { + this.queryType = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.BOOL) { + this.result = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.I32) { + this.count = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.LIST) { + this.measurements = []; + var _rtmp3443 = input.readListBegin(); + var _size442 = _rtmp3443.size || 0; + for (var _i444 = 0; _i444 < _size442; ++_i444) { + var elem445 = null; + elem445 = input.readString(); + this.measurements.push(elem445); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSQueryTemplateResp.prototype.write = function(output) { + output.writeStructBegin('TSQueryTemplateResp'); + if (this.status !== null && this.status !== undefined) { + output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); + this.status.write(output); + output.writeFieldEnd(); + } + if (this.queryType !== null && this.queryType !== undefined) { + output.writeFieldBegin('queryType', Thrift.Type.I32, 2); + output.writeI32(this.queryType); + output.writeFieldEnd(); + } + if (this.result !== null && this.result !== undefined) { + output.writeFieldBegin('result', Thrift.Type.BOOL, 3); + output.writeBool(this.result); + output.writeFieldEnd(); + } + if (this.count !== null && this.count !== undefined) { + output.writeFieldBegin('count', Thrift.Type.I32, 4); + output.writeI32(this.count); + output.writeFieldEnd(); + } + if (this.measurements !== null && this.measurements !== undefined) { + output.writeFieldBegin('measurements', Thrift.Type.LIST, 5); + output.writeListBegin(Thrift.Type.STRING, this.measurements.length); + for (var iter446 in this.measurements) { + if (this.measurements.hasOwnProperty(iter446)) { + iter446 = this.measurements[iter446]; + output.writeString(iter446); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSUnsetSchemaTemplateReq = module.exports.TSUnsetSchemaTemplateReq = function(args) { + this.sessionId = null; + this.prefixPath = null; + this.templateName = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.prefixPath !== undefined && args.prefixPath !== null) { + this.prefixPath = args.prefixPath; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field prefixPath is unset!'); + } + if (args.templateName !== undefined && args.templateName !== null) { + this.templateName = args.templateName; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field templateName is unset!'); + } + } +}; +TSUnsetSchemaTemplateReq.prototype = {}; +TSUnsetSchemaTemplateReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.prefixPath = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.templateName = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSUnsetSchemaTemplateReq.prototype.write = function(output) { + output.writeStructBegin('TSUnsetSchemaTemplateReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.prefixPath !== null && this.prefixPath !== undefined) { + output.writeFieldBegin('prefixPath', Thrift.Type.STRING, 2); + output.writeString(this.prefixPath); + output.writeFieldEnd(); + } + if (this.templateName !== null && this.templateName !== undefined) { + output.writeFieldBegin('templateName', Thrift.Type.STRING, 3); + output.writeString(this.templateName); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSDropSchemaTemplateReq = module.exports.TSDropSchemaTemplateReq = function(args) { + this.sessionId = null; + this.templateName = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.templateName !== undefined && args.templateName !== null) { + this.templateName = args.templateName; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field templateName is unset!'); + } + } +}; +TSDropSchemaTemplateReq.prototype = {}; +TSDropSchemaTemplateReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.templateName = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSDropSchemaTemplateReq.prototype.write = function(output) { + output.writeStructBegin('TSDropSchemaTemplateReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.templateName !== null && this.templateName !== undefined) { + output.writeFieldBegin('templateName', Thrift.Type.STRING, 2); + output.writeString(this.templateName); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TCreateTimeseriesUsingSchemaTemplateReq = module.exports.TCreateTimeseriesUsingSchemaTemplateReq = function(args) { + this.sessionId = null; + this.devicePathList = null; + if (args) { + if (args.sessionId !== undefined && args.sessionId !== null) { + this.sessionId = args.sessionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!'); + } + if (args.devicePathList !== undefined && args.devicePathList !== null) { + this.devicePathList = Thrift.copyList(args.devicePathList, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field devicePathList is unset!'); + } + } +}; +TCreateTimeseriesUsingSchemaTemplateReq.prototype = {}; +TCreateTimeseriesUsingSchemaTemplateReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.sessionId = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.devicePathList = []; + var _rtmp3448 = input.readListBegin(); + var _size447 = _rtmp3448.size || 0; + for (var _i449 = 0; _i449 < _size447; ++_i449) { + var elem450 = null; + elem450 = input.readString(); + this.devicePathList.push(elem450); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TCreateTimeseriesUsingSchemaTemplateReq.prototype.write = function(output) { + output.writeStructBegin('TCreateTimeseriesUsingSchemaTemplateReq'); + if (this.sessionId !== null && this.sessionId !== undefined) { + output.writeFieldBegin('sessionId', Thrift.Type.I64, 1); + output.writeI64(this.sessionId); + output.writeFieldEnd(); + } + if (this.devicePathList !== null && this.devicePathList !== undefined) { + output.writeFieldBegin('devicePathList', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.devicePathList.length); + for (var iter451 in this.devicePathList) { + if (this.devicePathList.hasOwnProperty(iter451)) { + iter451 = this.devicePathList[iter451]; + output.writeString(iter451); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSyncIdentityInfo = module.exports.TSyncIdentityInfo = function(args) { + this.pipeName = null; + this.createTime = null; + this.version = null; + this.database = null; + if (args) { + if (args.pipeName !== undefined && args.pipeName !== null) { + this.pipeName = args.pipeName; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field pipeName is unset!'); + } + if (args.createTime !== undefined && args.createTime !== null) { + this.createTime = args.createTime; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field createTime is unset!'); + } + if (args.version !== undefined && args.version !== null) { + this.version = args.version; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field version is unset!'); + } + if (args.database !== undefined && args.database !== null) { + this.database = args.database; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field database is unset!'); + } + } +}; +TSyncIdentityInfo.prototype = {}; +TSyncIdentityInfo.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.pipeName = input.readString(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.createTime = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.version = input.readString(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRING) { + this.database = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSyncIdentityInfo.prototype.write = function(output) { + output.writeStructBegin('TSyncIdentityInfo'); + if (this.pipeName !== null && this.pipeName !== undefined) { + output.writeFieldBegin('pipeName', Thrift.Type.STRING, 1); + output.writeString(this.pipeName); + output.writeFieldEnd(); + } + if (this.createTime !== null && this.createTime !== undefined) { + output.writeFieldBegin('createTime', Thrift.Type.I64, 2); + output.writeI64(this.createTime); + output.writeFieldEnd(); + } + if (this.version !== null && this.version !== undefined) { + output.writeFieldBegin('version', Thrift.Type.STRING, 3); + output.writeString(this.version); + output.writeFieldEnd(); + } + if (this.database !== null && this.database !== undefined) { + output.writeFieldBegin('database', Thrift.Type.STRING, 4); + output.writeString(this.database); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSyncTransportMetaInfo = module.exports.TSyncTransportMetaInfo = function(args) { + this.fileName = null; + this.startIndex = null; + if (args) { + if (args.fileName !== undefined && args.fileName !== null) { + this.fileName = args.fileName; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field fileName is unset!'); + } + if (args.startIndex !== undefined && args.startIndex !== null) { + this.startIndex = args.startIndex; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field startIndex is unset!'); + } + } +}; +TSyncTransportMetaInfo.prototype = {}; +TSyncTransportMetaInfo.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.fileName = input.readString(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.startIndex = input.readI64(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSyncTransportMetaInfo.prototype.write = function(output) { + output.writeStructBegin('TSyncTransportMetaInfo'); + if (this.fileName !== null && this.fileName !== undefined) { + output.writeFieldBegin('fileName', Thrift.Type.STRING, 1); + output.writeString(this.fileName); + output.writeFieldEnd(); + } + if (this.startIndex !== null && this.startIndex !== undefined) { + output.writeFieldBegin('startIndex', Thrift.Type.I64, 2); + output.writeI64(this.startIndex); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TPipeTransferReq = module.exports.TPipeTransferReq = function(args) { + this.version = null; + this.type = null; + this.body = null; + if (args) { + if (args.version !== undefined && args.version !== null) { + this.version = args.version; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field version is unset!'); + } + if (args.type !== undefined && args.type !== null) { + this.type = args.type; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field type is unset!'); + } + if (args.body !== undefined && args.body !== null) { + this.body = args.body; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field body is unset!'); + } + } +}; +TPipeTransferReq.prototype = {}; +TPipeTransferReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.BYTE) { + this.version = input.readByte(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I16) { + this.type = input.readI16(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.body = input.readBinary(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TPipeTransferReq.prototype.write = function(output) { + output.writeStructBegin('TPipeTransferReq'); + if (this.version !== null && this.version !== undefined) { + output.writeFieldBegin('version', Thrift.Type.BYTE, 1); + output.writeByte(this.version); + output.writeFieldEnd(); + } + if (this.type !== null && this.type !== undefined) { + output.writeFieldBegin('type', Thrift.Type.I16, 2); + output.writeI16(this.type); + output.writeFieldEnd(); + } + if (this.body !== null && this.body !== undefined) { + output.writeFieldBegin('body', Thrift.Type.STRING, 3); + output.writeBinary(this.body); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TPipeTransferResp = module.exports.TPipeTransferResp = function(args) { + this.status = null; + this.body = null; + if (args) { + if (args.status !== undefined && args.status !== null) { + this.status = new common_ttypes.TSStatus(args.status); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); + } + if (args.body !== undefined && args.body !== null) { + this.body = args.body; + } + } +}; +TPipeTransferResp.prototype = {}; +TPipeTransferResp.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.status = new common_ttypes.TSStatus(); + this.status.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.body = input.readBinary(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TPipeTransferResp.prototype.write = function(output) { + output.writeStructBegin('TPipeTransferResp'); + if (this.status !== null && this.status !== undefined) { + output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); + this.status.write(output); + output.writeFieldEnd(); + } + if (this.body !== null && this.body !== undefined) { + output.writeFieldBegin('body', Thrift.Type.STRING, 2); + output.writeBinary(this.body); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TPipeSubscribeReq = module.exports.TPipeSubscribeReq = function(args) { + this.version = null; + this.type = null; + this.body = null; + if (args) { + if (args.version !== undefined && args.version !== null) { + this.version = args.version; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field version is unset!'); + } + if (args.type !== undefined && args.type !== null) { + this.type = args.type; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field type is unset!'); + } + if (args.body !== undefined && args.body !== null) { + this.body = args.body; + } + } +}; +TPipeSubscribeReq.prototype = {}; +TPipeSubscribeReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.BYTE) { + this.version = input.readByte(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I16) { + this.type = input.readI16(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.body = input.readBinary(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TPipeSubscribeReq.prototype.write = function(output) { + output.writeStructBegin('TPipeSubscribeReq'); + if (this.version !== null && this.version !== undefined) { + output.writeFieldBegin('version', Thrift.Type.BYTE, 1); + output.writeByte(this.version); + output.writeFieldEnd(); + } + if (this.type !== null && this.type !== undefined) { + output.writeFieldBegin('type', Thrift.Type.I16, 2); + output.writeI16(this.type); + output.writeFieldEnd(); + } + if (this.body !== null && this.body !== undefined) { + output.writeFieldBegin('body', Thrift.Type.STRING, 3); + output.writeBinary(this.body); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TPipeSubscribeResp = module.exports.TPipeSubscribeResp = function(args) { + this.status = null; + this.version = null; + this.type = null; + this.body = null; + if (args) { + if (args.status !== undefined && args.status !== null) { + this.status = new common_ttypes.TSStatus(args.status); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); + } + if (args.version !== undefined && args.version !== null) { + this.version = args.version; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field version is unset!'); + } + if (args.type !== undefined && args.type !== null) { + this.type = args.type; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field type is unset!'); + } + if (args.body !== undefined && args.body !== null) { + this.body = Thrift.copyList(args.body, [null]); + } + } +}; +TPipeSubscribeResp.prototype = {}; +TPipeSubscribeResp.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.status = new common_ttypes.TSStatus(); + this.status.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.BYTE) { + this.version = input.readByte(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I16) { + this.type = input.readI16(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.LIST) { + this.body = []; + var _rtmp3453 = input.readListBegin(); + var _size452 = _rtmp3453.size || 0; + for (var _i454 = 0; _i454 < _size452; ++_i454) { + var elem455 = null; + elem455 = input.readBinary(); + this.body.push(elem455); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TPipeSubscribeResp.prototype.write = function(output) { + output.writeStructBegin('TPipeSubscribeResp'); + if (this.status !== null && this.status !== undefined) { + output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); + this.status.write(output); + output.writeFieldEnd(); + } + if (this.version !== null && this.version !== undefined) { + output.writeFieldBegin('version', Thrift.Type.BYTE, 2); + output.writeByte(this.version); + output.writeFieldEnd(); + } + if (this.type !== null && this.type !== undefined) { + output.writeFieldBegin('type', Thrift.Type.I16, 3); + output.writeI16(this.type); + output.writeFieldEnd(); + } + if (this.body !== null && this.body !== undefined) { + output.writeFieldBegin('body', Thrift.Type.LIST, 4); + output.writeListBegin(Thrift.Type.STRING, this.body.length); + for (var iter456 in this.body) { + if (this.body.hasOwnProperty(iter456)) { + iter456 = this.body[iter456]; + output.writeBinary(iter456); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSBackupConfigurationResp = module.exports.TSBackupConfigurationResp = function(args) { + this.status = null; + this.enableOperationSync = null; + this.secondaryAddress = null; + this.secondaryPort = null; + if (args) { + if (args.status !== undefined && args.status !== null) { + this.status = new common_ttypes.TSStatus(args.status); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); + } + if (args.enableOperationSync !== undefined && args.enableOperationSync !== null) { + this.enableOperationSync = args.enableOperationSync; + } + if (args.secondaryAddress !== undefined && args.secondaryAddress !== null) { + this.secondaryAddress = args.secondaryAddress; + } + if (args.secondaryPort !== undefined && args.secondaryPort !== null) { + this.secondaryPort = args.secondaryPort; + } + } +}; +TSBackupConfigurationResp.prototype = {}; +TSBackupConfigurationResp.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.status = new common_ttypes.TSStatus(); + this.status.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.BOOL) { + this.enableOperationSync = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.secondaryAddress = input.readString(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.I32) { + this.secondaryPort = input.readI32(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSBackupConfigurationResp.prototype.write = function(output) { + output.writeStructBegin('TSBackupConfigurationResp'); + if (this.status !== null && this.status !== undefined) { + output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); + this.status.write(output); + output.writeFieldEnd(); + } + if (this.enableOperationSync !== null && this.enableOperationSync !== undefined) { + output.writeFieldBegin('enableOperationSync', Thrift.Type.BOOL, 2); + output.writeBool(this.enableOperationSync); + output.writeFieldEnd(); + } + if (this.secondaryAddress !== null && this.secondaryAddress !== undefined) { + output.writeFieldBegin('secondaryAddress', Thrift.Type.STRING, 3); + output.writeString(this.secondaryAddress); + output.writeFieldEnd(); + } + if (this.secondaryPort !== null && this.secondaryPort !== undefined) { + output.writeFieldBegin('secondaryPort', Thrift.Type.I32, 4); + output.writeI32(this.secondaryPort); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSConnectionInfo = module.exports.TSConnectionInfo = function(args) { + this.userName = null; + this.logInTime = null; + this.connectionId = null; + this.type = null; + if (args) { + if (args.userName !== undefined && args.userName !== null) { + this.userName = args.userName; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field userName is unset!'); + } + if (args.logInTime !== undefined && args.logInTime !== null) { + this.logInTime = args.logInTime; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field logInTime is unset!'); + } + if (args.connectionId !== undefined && args.connectionId !== null) { + this.connectionId = args.connectionId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field connectionId is unset!'); + } + if (args.type !== undefined && args.type !== null) { + this.type = args.type; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field type is unset!'); + } + } +}; +TSConnectionInfo.prototype = {}; +TSConnectionInfo.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.userName = input.readString(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.logInTime = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.connectionId = input.readString(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.I32) { + this.type = input.readI32(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSConnectionInfo.prototype.write = function(output) { + output.writeStructBegin('TSConnectionInfo'); + if (this.userName !== null && this.userName !== undefined) { + output.writeFieldBegin('userName', Thrift.Type.STRING, 1); + output.writeString(this.userName); + output.writeFieldEnd(); + } + if (this.logInTime !== null && this.logInTime !== undefined) { + output.writeFieldBegin('logInTime', Thrift.Type.I64, 2); + output.writeI64(this.logInTime); + output.writeFieldEnd(); + } + if (this.connectionId !== null && this.connectionId !== undefined) { + output.writeFieldBegin('connectionId', Thrift.Type.STRING, 3); + output.writeString(this.connectionId); + output.writeFieldEnd(); + } + if (this.type !== null && this.type !== undefined) { + output.writeFieldBegin('type', Thrift.Type.I32, 4); + output.writeI32(this.type); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSConnectionInfoResp = module.exports.TSConnectionInfoResp = function(args) { + this.connectionInfoList = null; + if (args) { + if (args.connectionInfoList !== undefined && args.connectionInfoList !== null) { + this.connectionInfoList = Thrift.copyList(args.connectionInfoList, [ttypes.TSConnectionInfo]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field connectionInfoList is unset!'); + } + } +}; +TSConnectionInfoResp.prototype = {}; +TSConnectionInfoResp.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.LIST) { + this.connectionInfoList = []; + var _rtmp3458 = input.readListBegin(); + var _size457 = _rtmp3458.size || 0; + for (var _i459 = 0; _i459 < _size457; ++_i459) { + var elem460 = null; + elem460 = new ttypes.TSConnectionInfo(); + elem460.read(input); + this.connectionInfoList.push(elem460); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSConnectionInfoResp.prototype.write = function(output) { + output.writeStructBegin('TSConnectionInfoResp'); + if (this.connectionInfoList !== null && this.connectionInfoList !== undefined) { + output.writeFieldBegin('connectionInfoList', Thrift.Type.LIST, 1); + output.writeListBegin(Thrift.Type.STRUCT, this.connectionInfoList.length); + for (var iter461 in this.connectionInfoList) { + if (this.connectionInfoList.hasOwnProperty(iter461)) { + iter461 = this.connectionInfoList[iter461]; + iter461.write(output); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; \ No newline at end of file diff --git a/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/common_types.js b/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/common_types.js new file mode 100644 index 0000000..2d98a8c --- /dev/null +++ b/cdsp/information-layer/handlers/src/iotdb/gen-nodejs/common_types.js @@ -0,0 +1,2879 @@ +// +// Autogenerated by Thrift Compiler (0.14.1) +// +// 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 Int64 = require('node-int64'); + + +var ttypes = module.exports = {}; +ttypes.TConsensusGroupType = { + 'ConfigRegion' : 0, + 'DataRegion' : 1, + 'SchemaRegion' : 2 +}; +ttypes.TRegionMigrateFailedType = { + 'AddPeerFailed' : 0, + 'RemovePeerFailed' : 1, + 'RemoveConsensusGroupFailed' : 2, + 'DeleteRegionFailed' : 3, + 'CreateRegionFailed' : 4, + 'Disconnect' : 5 +}; +ttypes.TRegionMaintainTaskStatus = { + 'TASK_NOT_EXIST' : 0, + 'PROCESSING' : 1, + 'SUCCESS' : 2, + 'FAIL' : 3 +}; +ttypes.ThrottleType = { + 'REQUEST_NUMBER' : 0, + 'REQUEST_SIZE' : 1, + 'WRITE_NUMBER' : 2, + 'WRITE_SIZE' : 3, + 'READ_NUMBER' : 4, + 'READ_SIZE' : 5 +}; +ttypes.TServiceType = { + 'ConfigNodeInternalService' : 0, + 'DataNodeInternalService' : 1, + 'DataNodeMPPService' : 2, + 'DataNodeExternalService' : 3 +}; +ttypes.TAggregationType = { + 'COUNT' : 0, + 'AVG' : 1, + 'SUM' : 2, + 'FIRST_VALUE' : 3, + 'LAST_VALUE' : 4, + 'MAX_TIME' : 5, + 'MIN_TIME' : 6, + 'MAX_VALUE' : 7, + 'MIN_VALUE' : 8, + 'EXTREME' : 9, + 'COUNT_IF' : 10, + 'TIME_DURATION' : 11, + 'MODE' : 12, + 'COUNT_TIME' : 13, + 'STDDEV' : 14, + 'STDDEV_POP' : 15, + 'STDDEV_SAMP' : 16, + 'VARIANCE' : 17, + 'VAR_POP' : 18, + 'VAR_SAMP' : 19, + 'MAX_BY' : 20, + 'MIN_BY' : 21, + 'UDAF' : 22, + 'FIRST' : 23, + 'LAST' : 24, + 'FIRST_BY' : 25, + 'LAST_BY' : 26, + 'MIN' : 27, + 'MAX' : 28 +}; +ttypes.TrainingState = { + 'PENDING' : 0, + 'RUNNING' : 1, + 'FINISHED' : 2, + 'FAILED' : 3, + 'DROPPING' : 4 +}; +var TEndPoint = module.exports.TEndPoint = function(args) { + this.ip = null; + this.port = null; + if (args) { + if (args.ip !== undefined && args.ip !== null) { + this.ip = args.ip; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field ip is unset!'); + } + if (args.port !== undefined && args.port !== null) { + this.port = args.port; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field port is unset!'); + } + } +}; +TEndPoint.prototype = {}; +TEndPoint.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.ip = input.readString(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I32) { + this.port = input.readI32(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TEndPoint.prototype.write = function(output) { + output.writeStructBegin('TEndPoint'); + if (this.ip !== null && this.ip !== undefined) { + output.writeFieldBegin('ip', Thrift.Type.STRING, 1); + output.writeString(this.ip); + output.writeFieldEnd(); + } + if (this.port !== null && this.port !== undefined) { + output.writeFieldBegin('port', Thrift.Type.I32, 2); + output.writeI32(this.port); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSStatus = module.exports.TSStatus = function(args) { + this.code = null; + this.message = null; + this.subStatus = null; + this.redirectNode = null; + this.needRetry = null; + if (args) { + if (args.code !== undefined && args.code !== null) { + this.code = args.code; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field code is unset!'); + } + if (args.message !== undefined && args.message !== null) { + this.message = args.message; + } + if (args.subStatus !== undefined && args.subStatus !== null) { + this.subStatus = Thrift.copyList(args.subStatus, [null]); + } + if (args.redirectNode !== undefined && args.redirectNode !== null) { + this.redirectNode = new ttypes.TEndPoint(args.redirectNode); + } + if (args.needRetry !== undefined && args.needRetry !== null) { + this.needRetry = args.needRetry; + } + } +}; +TSStatus.prototype = {}; +TSStatus.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I32) { + this.code = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.message = input.readString(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.LIST) { + this.subStatus = []; + var _rtmp31 = input.readListBegin(); + var _size0 = _rtmp31.size || 0; + for (var _i2 = 0; _i2 < _size0; ++_i2) { + var elem3 = null; + elem3 = new ttypes.TSStatus(); + elem3.read(input); + this.subStatus.push(elem3); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRUCT) { + this.redirectNode = new ttypes.TEndPoint(); + this.redirectNode.read(input); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.BOOL) { + this.needRetry = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSStatus.prototype.write = function(output) { + output.writeStructBegin('TSStatus'); + if (this.code !== null && this.code !== undefined) { + output.writeFieldBegin('code', Thrift.Type.I32, 1); + output.writeI32(this.code); + output.writeFieldEnd(); + } + if (this.message !== null && this.message !== undefined) { + output.writeFieldBegin('message', Thrift.Type.STRING, 2); + output.writeString(this.message); + output.writeFieldEnd(); + } + if (this.subStatus !== null && this.subStatus !== undefined) { + output.writeFieldBegin('subStatus', Thrift.Type.LIST, 3); + output.writeListBegin(Thrift.Type.STRUCT, this.subStatus.length); + for (var iter4 in this.subStatus) { + if (this.subStatus.hasOwnProperty(iter4)) { + iter4 = this.subStatus[iter4]; + iter4.write(output); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.redirectNode !== null && this.redirectNode !== undefined) { + output.writeFieldBegin('redirectNode', Thrift.Type.STRUCT, 4); + this.redirectNode.write(output); + output.writeFieldEnd(); + } + if (this.needRetry !== null && this.needRetry !== undefined) { + output.writeFieldBegin('needRetry', Thrift.Type.BOOL, 5); + output.writeBool(this.needRetry); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TConsensusGroupId = module.exports.TConsensusGroupId = function(args) { + this.type = null; + this.id = null; + if (args) { + if (args.type !== undefined && args.type !== null) { + this.type = args.type; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field type is unset!'); + } + if (args.id !== undefined && args.id !== null) { + this.id = args.id; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field id is unset!'); + } + } +}; +TConsensusGroupId.prototype = {}; +TConsensusGroupId.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I32) { + this.type = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I32) { + this.id = input.readI32(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TConsensusGroupId.prototype.write = function(output) { + output.writeStructBegin('TConsensusGroupId'); + if (this.type !== null && this.type !== undefined) { + output.writeFieldBegin('type', Thrift.Type.I32, 1); + output.writeI32(this.type); + output.writeFieldEnd(); + } + if (this.id !== null && this.id !== undefined) { + output.writeFieldBegin('id', Thrift.Type.I32, 2); + output.writeI32(this.id); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSeriesPartitionSlot = module.exports.TSeriesPartitionSlot = function(args) { + this.slotId = null; + if (args) { + if (args.slotId !== undefined && args.slotId !== null) { + this.slotId = args.slotId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field slotId is unset!'); + } + } +}; +TSeriesPartitionSlot.prototype = {}; +TSeriesPartitionSlot.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I32) { + this.slotId = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSeriesPartitionSlot.prototype.write = function(output) { + output.writeStructBegin('TSeriesPartitionSlot'); + if (this.slotId !== null && this.slotId !== undefined) { + output.writeFieldBegin('slotId', Thrift.Type.I32, 1); + output.writeI32(this.slotId); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TTimePartitionSlot = module.exports.TTimePartitionSlot = function(args) { + this.startTime = null; + if (args) { + if (args.startTime !== undefined && args.startTime !== null) { + this.startTime = args.startTime; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field startTime is unset!'); + } + } +}; +TTimePartitionSlot.prototype = {}; +TTimePartitionSlot.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.startTime = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TTimePartitionSlot.prototype.write = function(output) { + output.writeStructBegin('TTimePartitionSlot'); + if (this.startTime !== null && this.startTime !== undefined) { + output.writeFieldBegin('startTime', Thrift.Type.I64, 1); + output.writeI64(this.startTime); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TRegionReplicaSet = module.exports.TRegionReplicaSet = function(args) { + this.regionId = null; + this.dataNodeLocations = null; + if (args) { + if (args.regionId !== undefined && args.regionId !== null) { + this.regionId = new ttypes.TConsensusGroupId(args.regionId); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field regionId is unset!'); + } + if (args.dataNodeLocations !== undefined && args.dataNodeLocations !== null) { + this.dataNodeLocations = Thrift.copyList(args.dataNodeLocations, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dataNodeLocations is unset!'); + } + } +}; +TRegionReplicaSet.prototype = {}; +TRegionReplicaSet.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.regionId = new ttypes.TConsensusGroupId(); + this.regionId.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.dataNodeLocations = []; + var _rtmp36 = input.readListBegin(); + var _size5 = _rtmp36.size || 0; + for (var _i7 = 0; _i7 < _size5; ++_i7) { + var elem8 = null; + elem8 = new ttypes.TDataNodeLocation(); + elem8.read(input); + this.dataNodeLocations.push(elem8); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TRegionReplicaSet.prototype.write = function(output) { + output.writeStructBegin('TRegionReplicaSet'); + if (this.regionId !== null && this.regionId !== undefined) { + output.writeFieldBegin('regionId', Thrift.Type.STRUCT, 1); + this.regionId.write(output); + output.writeFieldEnd(); + } + if (this.dataNodeLocations !== null && this.dataNodeLocations !== undefined) { + output.writeFieldBegin('dataNodeLocations', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRUCT, this.dataNodeLocations.length); + for (var iter9 in this.dataNodeLocations) { + if (this.dataNodeLocations.hasOwnProperty(iter9)) { + iter9 = this.dataNodeLocations[iter9]; + iter9.write(output); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TNodeResource = module.exports.TNodeResource = function(args) { + this.cpuCoreNum = null; + this.maxMemory = null; + if (args) { + if (args.cpuCoreNum !== undefined && args.cpuCoreNum !== null) { + this.cpuCoreNum = args.cpuCoreNum; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field cpuCoreNum is unset!'); + } + if (args.maxMemory !== undefined && args.maxMemory !== null) { + this.maxMemory = args.maxMemory; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field maxMemory is unset!'); + } + } +}; +TNodeResource.prototype = {}; +TNodeResource.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I32) { + this.cpuCoreNum = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.maxMemory = input.readI64(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TNodeResource.prototype.write = function(output) { + output.writeStructBegin('TNodeResource'); + if (this.cpuCoreNum !== null && this.cpuCoreNum !== undefined) { + output.writeFieldBegin('cpuCoreNum', Thrift.Type.I32, 1); + output.writeI32(this.cpuCoreNum); + output.writeFieldEnd(); + } + if (this.maxMemory !== null && this.maxMemory !== undefined) { + output.writeFieldBegin('maxMemory', Thrift.Type.I64, 2); + output.writeI64(this.maxMemory); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TConfigNodeLocation = module.exports.TConfigNodeLocation = function(args) { + this.configNodeId = null; + this.internalEndPoint = null; + this.consensusEndPoint = null; + if (args) { + if (args.configNodeId !== undefined && args.configNodeId !== null) { + this.configNodeId = args.configNodeId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field configNodeId is unset!'); + } + if (args.internalEndPoint !== undefined && args.internalEndPoint !== null) { + this.internalEndPoint = new ttypes.TEndPoint(args.internalEndPoint); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field internalEndPoint is unset!'); + } + if (args.consensusEndPoint !== undefined && args.consensusEndPoint !== null) { + this.consensusEndPoint = new ttypes.TEndPoint(args.consensusEndPoint); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field consensusEndPoint is unset!'); + } + } +}; +TConfigNodeLocation.prototype = {}; +TConfigNodeLocation.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I32) { + this.configNodeId = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRUCT) { + this.internalEndPoint = new ttypes.TEndPoint(); + this.internalEndPoint.read(input); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRUCT) { + this.consensusEndPoint = new ttypes.TEndPoint(); + this.consensusEndPoint.read(input); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TConfigNodeLocation.prototype.write = function(output) { + output.writeStructBegin('TConfigNodeLocation'); + if (this.configNodeId !== null && this.configNodeId !== undefined) { + output.writeFieldBegin('configNodeId', Thrift.Type.I32, 1); + output.writeI32(this.configNodeId); + output.writeFieldEnd(); + } + if (this.internalEndPoint !== null && this.internalEndPoint !== undefined) { + output.writeFieldBegin('internalEndPoint', Thrift.Type.STRUCT, 2); + this.internalEndPoint.write(output); + output.writeFieldEnd(); + } + if (this.consensusEndPoint !== null && this.consensusEndPoint !== undefined) { + output.writeFieldBegin('consensusEndPoint', Thrift.Type.STRUCT, 3); + this.consensusEndPoint.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TDataNodeLocation = module.exports.TDataNodeLocation = function(args) { + this.dataNodeId = null; + this.clientRpcEndPoint = null; + this.internalEndPoint = null; + this.mPPDataExchangeEndPoint = null; + this.dataRegionConsensusEndPoint = null; + this.schemaRegionConsensusEndPoint = null; + if (args) { + if (args.dataNodeId !== undefined && args.dataNodeId !== null) { + this.dataNodeId = args.dataNodeId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dataNodeId is unset!'); + } + if (args.clientRpcEndPoint !== undefined && args.clientRpcEndPoint !== null) { + this.clientRpcEndPoint = new ttypes.TEndPoint(args.clientRpcEndPoint); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field clientRpcEndPoint is unset!'); + } + if (args.internalEndPoint !== undefined && args.internalEndPoint !== null) { + this.internalEndPoint = new ttypes.TEndPoint(args.internalEndPoint); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field internalEndPoint is unset!'); + } + if (args.mPPDataExchangeEndPoint !== undefined && args.mPPDataExchangeEndPoint !== null) { + this.mPPDataExchangeEndPoint = new ttypes.TEndPoint(args.mPPDataExchangeEndPoint); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field mPPDataExchangeEndPoint is unset!'); + } + if (args.dataRegionConsensusEndPoint !== undefined && args.dataRegionConsensusEndPoint !== null) { + this.dataRegionConsensusEndPoint = new ttypes.TEndPoint(args.dataRegionConsensusEndPoint); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dataRegionConsensusEndPoint is unset!'); + } + if (args.schemaRegionConsensusEndPoint !== undefined && args.schemaRegionConsensusEndPoint !== null) { + this.schemaRegionConsensusEndPoint = new ttypes.TEndPoint(args.schemaRegionConsensusEndPoint); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field schemaRegionConsensusEndPoint is unset!'); + } + } +}; +TDataNodeLocation.prototype = {}; +TDataNodeLocation.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I32) { + this.dataNodeId = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRUCT) { + this.clientRpcEndPoint = new ttypes.TEndPoint(); + this.clientRpcEndPoint.read(input); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRUCT) { + this.internalEndPoint = new ttypes.TEndPoint(); + this.internalEndPoint.read(input); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRUCT) { + this.mPPDataExchangeEndPoint = new ttypes.TEndPoint(); + this.mPPDataExchangeEndPoint.read(input); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.STRUCT) { + this.dataRegionConsensusEndPoint = new ttypes.TEndPoint(); + this.dataRegionConsensusEndPoint.read(input); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.STRUCT) { + this.schemaRegionConsensusEndPoint = new ttypes.TEndPoint(); + this.schemaRegionConsensusEndPoint.read(input); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TDataNodeLocation.prototype.write = function(output) { + output.writeStructBegin('TDataNodeLocation'); + if (this.dataNodeId !== null && this.dataNodeId !== undefined) { + output.writeFieldBegin('dataNodeId', Thrift.Type.I32, 1); + output.writeI32(this.dataNodeId); + output.writeFieldEnd(); + } + if (this.clientRpcEndPoint !== null && this.clientRpcEndPoint !== undefined) { + output.writeFieldBegin('clientRpcEndPoint', Thrift.Type.STRUCT, 2); + this.clientRpcEndPoint.write(output); + output.writeFieldEnd(); + } + if (this.internalEndPoint !== null && this.internalEndPoint !== undefined) { + output.writeFieldBegin('internalEndPoint', Thrift.Type.STRUCT, 3); + this.internalEndPoint.write(output); + output.writeFieldEnd(); + } + if (this.mPPDataExchangeEndPoint !== null && this.mPPDataExchangeEndPoint !== undefined) { + output.writeFieldBegin('mPPDataExchangeEndPoint', Thrift.Type.STRUCT, 4); + this.mPPDataExchangeEndPoint.write(output); + output.writeFieldEnd(); + } + if (this.dataRegionConsensusEndPoint !== null && this.dataRegionConsensusEndPoint !== undefined) { + output.writeFieldBegin('dataRegionConsensusEndPoint', Thrift.Type.STRUCT, 5); + this.dataRegionConsensusEndPoint.write(output); + output.writeFieldEnd(); + } + if (this.schemaRegionConsensusEndPoint !== null && this.schemaRegionConsensusEndPoint !== undefined) { + output.writeFieldBegin('schemaRegionConsensusEndPoint', Thrift.Type.STRUCT, 6); + this.schemaRegionConsensusEndPoint.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TAINodeLocation = module.exports.TAINodeLocation = function(args) { + this.aiNodeId = null; + this.internalEndPoint = null; + if (args) { + if (args.aiNodeId !== undefined && args.aiNodeId !== null) { + this.aiNodeId = args.aiNodeId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field aiNodeId is unset!'); + } + if (args.internalEndPoint !== undefined && args.internalEndPoint !== null) { + this.internalEndPoint = new ttypes.TEndPoint(args.internalEndPoint); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field internalEndPoint is unset!'); + } + } +}; +TAINodeLocation.prototype = {}; +TAINodeLocation.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I32) { + this.aiNodeId = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRUCT) { + this.internalEndPoint = new ttypes.TEndPoint(); + this.internalEndPoint.read(input); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TAINodeLocation.prototype.write = function(output) { + output.writeStructBegin('TAINodeLocation'); + if (this.aiNodeId !== null && this.aiNodeId !== undefined) { + output.writeFieldBegin('aiNodeId', Thrift.Type.I32, 1); + output.writeI32(this.aiNodeId); + output.writeFieldEnd(); + } + if (this.internalEndPoint !== null && this.internalEndPoint !== undefined) { + output.writeFieldBegin('internalEndPoint', Thrift.Type.STRUCT, 2); + this.internalEndPoint.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TDataNodeConfiguration = module.exports.TDataNodeConfiguration = function(args) { + this.location = null; + this.resource = null; + if (args) { + if (args.location !== undefined && args.location !== null) { + this.location = new ttypes.TDataNodeLocation(args.location); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field location is unset!'); + } + if (args.resource !== undefined && args.resource !== null) { + this.resource = new ttypes.TNodeResource(args.resource); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field resource is unset!'); + } + } +}; +TDataNodeConfiguration.prototype = {}; +TDataNodeConfiguration.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.location = new ttypes.TDataNodeLocation(); + this.location.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRUCT) { + this.resource = new ttypes.TNodeResource(); + this.resource.read(input); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TDataNodeConfiguration.prototype.write = function(output) { + output.writeStructBegin('TDataNodeConfiguration'); + if (this.location !== null && this.location !== undefined) { + output.writeFieldBegin('location', Thrift.Type.STRUCT, 1); + this.location.write(output); + output.writeFieldEnd(); + } + if (this.resource !== null && this.resource !== undefined) { + output.writeFieldBegin('resource', Thrift.Type.STRUCT, 2); + this.resource.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TAINodeConfiguration = module.exports.TAINodeConfiguration = function(args) { + this.location = null; + this.resource = null; + if (args) { + if (args.location !== undefined && args.location !== null) { + this.location = new ttypes.TAINodeLocation(args.location); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field location is unset!'); + } + if (args.resource !== undefined && args.resource !== null) { + this.resource = new ttypes.TNodeResource(args.resource); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field resource is unset!'); + } + } +}; +TAINodeConfiguration.prototype = {}; +TAINodeConfiguration.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.location = new ttypes.TAINodeLocation(); + this.location.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRUCT) { + this.resource = new ttypes.TNodeResource(); + this.resource.read(input); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TAINodeConfiguration.prototype.write = function(output) { + output.writeStructBegin('TAINodeConfiguration'); + if (this.location !== null && this.location !== undefined) { + output.writeFieldBegin('location', Thrift.Type.STRUCT, 1); + this.location.write(output); + output.writeFieldEnd(); + } + if (this.resource !== null && this.resource !== undefined) { + output.writeFieldBegin('resource', Thrift.Type.STRUCT, 2); + this.resource.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TFlushReq = module.exports.TFlushReq = function(args) { + this.isSeq = null; + this.storageGroups = null; + if (args) { + if (args.isSeq !== undefined && args.isSeq !== null) { + this.isSeq = args.isSeq; + } + if (args.storageGroups !== undefined && args.storageGroups !== null) { + this.storageGroups = Thrift.copyList(args.storageGroups, [null]); + } + } +}; +TFlushReq.prototype = {}; +TFlushReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.isSeq = input.readString(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.storageGroups = []; + var _rtmp311 = input.readListBegin(); + var _size10 = _rtmp311.size || 0; + for (var _i12 = 0; _i12 < _size10; ++_i12) { + var elem13 = null; + elem13 = input.readString(); + this.storageGroups.push(elem13); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TFlushReq.prototype.write = function(output) { + output.writeStructBegin('TFlushReq'); + if (this.isSeq !== null && this.isSeq !== undefined) { + output.writeFieldBegin('isSeq', Thrift.Type.STRING, 1); + output.writeString(this.isSeq); + output.writeFieldEnd(); + } + if (this.storageGroups !== null && this.storageGroups !== undefined) { + output.writeFieldBegin('storageGroups', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.storageGroups.length); + for (var iter14 in this.storageGroups) { + if (this.storageGroups.hasOwnProperty(iter14)) { + iter14 = this.storageGroups[iter14]; + output.writeString(iter14); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSettleReq = module.exports.TSettleReq = function(args) { + this.paths = null; + if (args) { + if (args.paths !== undefined && args.paths !== null) { + this.paths = Thrift.copyList(args.paths, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field paths is unset!'); + } + } +}; +TSettleReq.prototype = {}; +TSettleReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.LIST) { + this.paths = []; + var _rtmp316 = input.readListBegin(); + var _size15 = _rtmp316.size || 0; + for (var _i17 = 0; _i17 < _size15; ++_i17) { + var elem18 = null; + elem18 = input.readString(); + this.paths.push(elem18); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSettleReq.prototype.write = function(output) { + output.writeStructBegin('TSettleReq'); + if (this.paths !== null && this.paths !== undefined) { + output.writeFieldBegin('paths', Thrift.Type.LIST, 1); + output.writeListBegin(Thrift.Type.STRING, this.paths.length); + for (var iter19 in this.paths) { + if (this.paths.hasOwnProperty(iter19)) { + iter19 = this.paths[iter19]; + output.writeString(iter19); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSchemaNode = module.exports.TSchemaNode = function(args) { + this.nodeName = null; + this.nodeType = null; + if (args) { + if (args.nodeName !== undefined && args.nodeName !== null) { + this.nodeName = args.nodeName; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field nodeName is unset!'); + } + if (args.nodeType !== undefined && args.nodeType !== null) { + this.nodeType = args.nodeType; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field nodeType is unset!'); + } + } +}; +TSchemaNode.prototype = {}; +TSchemaNode.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.nodeName = input.readString(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.BYTE) { + this.nodeType = input.readByte(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSchemaNode.prototype.write = function(output) { + output.writeStructBegin('TSchemaNode'); + if (this.nodeName !== null && this.nodeName !== undefined) { + output.writeFieldBegin('nodeName', Thrift.Type.STRING, 1); + output.writeString(this.nodeName); + output.writeFieldEnd(); + } + if (this.nodeType !== null && this.nodeType !== undefined) { + output.writeFieldBegin('nodeType', Thrift.Type.BYTE, 2); + output.writeByte(this.nodeType); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSetConfigurationReq = module.exports.TSetConfigurationReq = function(args) { + this.configs = null; + this.nodeId = null; + if (args) { + if (args.configs !== undefined && args.configs !== null) { + this.configs = Thrift.copyMap(args.configs, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field configs is unset!'); + } + if (args.nodeId !== undefined && args.nodeId !== null) { + this.nodeId = args.nodeId; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field nodeId is unset!'); + } + } +}; +TSetConfigurationReq.prototype = {}; +TSetConfigurationReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.MAP) { + this.configs = {}; + var _rtmp321 = input.readMapBegin(); + var _size20 = _rtmp321.size || 0; + for (var _i22 = 0; _i22 < _size20; ++_i22) { + var key23 = null; + var val24 = null; + key23 = input.readString(); + val24 = input.readString(); + this.configs[key23] = val24; + } + input.readMapEnd(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I32) { + this.nodeId = input.readI32(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSetConfigurationReq.prototype.write = function(output) { + output.writeStructBegin('TSetConfigurationReq'); + if (this.configs !== null && this.configs !== undefined) { + output.writeFieldBegin('configs', Thrift.Type.MAP, 1); + output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.configs)); + for (var kiter25 in this.configs) { + if (this.configs.hasOwnProperty(kiter25)) { + var viter26 = this.configs[kiter25]; + output.writeString(kiter25); + output.writeString(viter26); + } + } + output.writeMapEnd(); + output.writeFieldEnd(); + } + if (this.nodeId !== null && this.nodeId !== undefined) { + output.writeFieldBegin('nodeId', Thrift.Type.I32, 2); + output.writeI32(this.nodeId); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSetTTLReq = module.exports.TSetTTLReq = function(args) { + this.pathPattern = null; + this.TTL = null; + this.isDataBase = null; + if (args) { + if (args.pathPattern !== undefined && args.pathPattern !== null) { + this.pathPattern = Thrift.copyList(args.pathPattern, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field pathPattern is unset!'); + } + if (args.TTL !== undefined && args.TTL !== null) { + this.TTL = args.TTL; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field TTL is unset!'); + } + if (args.isDataBase !== undefined && args.isDataBase !== null) { + this.isDataBase = args.isDataBase; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field isDataBase is unset!'); + } + } +}; +TSetTTLReq.prototype = {}; +TSetTTLReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.LIST) { + this.pathPattern = []; + var _rtmp328 = input.readListBegin(); + var _size27 = _rtmp328.size || 0; + for (var _i29 = 0; _i29 < _size27; ++_i29) { + var elem30 = null; + elem30 = input.readString(); + this.pathPattern.push(elem30); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.TTL = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.BOOL) { + this.isDataBase = input.readBool(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSetTTLReq.prototype.write = function(output) { + output.writeStructBegin('TSetTTLReq'); + if (this.pathPattern !== null && this.pathPattern !== undefined) { + output.writeFieldBegin('pathPattern', Thrift.Type.LIST, 1); + output.writeListBegin(Thrift.Type.STRING, this.pathPattern.length); + for (var iter31 in this.pathPattern) { + if (this.pathPattern.hasOwnProperty(iter31)) { + iter31 = this.pathPattern[iter31]; + output.writeString(iter31); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.TTL !== null && this.TTL !== undefined) { + output.writeFieldBegin('TTL', Thrift.Type.I64, 2); + output.writeI64(this.TTL); + output.writeFieldEnd(); + } + if (this.isDataBase !== null && this.isDataBase !== undefined) { + output.writeFieldBegin('isDataBase', Thrift.Type.BOOL, 3); + output.writeBool(this.isDataBase); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TShowTTLReq = module.exports.TShowTTLReq = function(args) { + this.pathPattern = null; + if (args) { + if (args.pathPattern !== undefined && args.pathPattern !== null) { + this.pathPattern = Thrift.copyList(args.pathPattern, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field pathPattern is unset!'); + } + } +}; +TShowTTLReq.prototype = {}; +TShowTTLReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.LIST) { + this.pathPattern = []; + var _rtmp333 = input.readListBegin(); + var _size32 = _rtmp333.size || 0; + for (var _i34 = 0; _i34 < _size32; ++_i34) { + var elem35 = null; + elem35 = input.readString(); + this.pathPattern.push(elem35); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TShowTTLReq.prototype.write = function(output) { + output.writeStructBegin('TShowTTLReq'); + if (this.pathPattern !== null && this.pathPattern !== undefined) { + output.writeFieldBegin('pathPattern', Thrift.Type.LIST, 1); + output.writeListBegin(Thrift.Type.STRING, this.pathPattern.length); + for (var iter36 in this.pathPattern) { + if (this.pathPattern.hasOwnProperty(iter36)) { + iter36 = this.pathPattern[iter36]; + output.writeString(iter36); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TFile = module.exports.TFile = function(args) { + this.fileName = null; + this.file = null; + if (args) { + if (args.fileName !== undefined && args.fileName !== null) { + this.fileName = args.fileName; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field fileName is unset!'); + } + if (args.file !== undefined && args.file !== null) { + this.file = args.file; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field file is unset!'); + } + } +}; +TFile.prototype = {}; +TFile.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.fileName = input.readString(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.file = input.readBinary(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TFile.prototype.write = function(output) { + output.writeStructBegin('TFile'); + if (this.fileName !== null && this.fileName !== undefined) { + output.writeFieldBegin('fileName', Thrift.Type.STRING, 1); + output.writeString(this.fileName); + output.writeFieldEnd(); + } + if (this.file !== null && this.file !== undefined) { + output.writeFieldBegin('file', Thrift.Type.STRING, 2); + output.writeBinary(this.file); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TFilesResp = module.exports.TFilesResp = function(args) { + this.status = null; + this.files = null; + if (args) { + if (args.status !== undefined && args.status !== null) { + this.status = new ttypes.TSStatus(args.status); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); + } + if (args.files !== undefined && args.files !== null) { + this.files = Thrift.copyList(args.files, [ttypes.TFile]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field files is unset!'); + } + } +}; +TFilesResp.prototype = {}; +TFilesResp.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.status = new ttypes.TSStatus(); + this.status.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.files = []; + var _rtmp338 = input.readListBegin(); + var _size37 = _rtmp338.size || 0; + for (var _i39 = 0; _i39 < _size37; ++_i39) { + var elem40 = null; + elem40 = new ttypes.TFile(); + elem40.read(input); + this.files.push(elem40); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TFilesResp.prototype.write = function(output) { + output.writeStructBegin('TFilesResp'); + if (this.status !== null && this.status !== undefined) { + output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); + this.status.write(output); + output.writeFieldEnd(); + } + if (this.files !== null && this.files !== undefined) { + output.writeFieldBegin('files', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRUCT, this.files.length); + for (var iter41 in this.files) { + if (this.files.hasOwnProperty(iter41)) { + iter41 = this.files[iter41]; + iter41.write(output); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSpaceQuota = module.exports.TSpaceQuota = function(args) { + this.diskSize = null; + this.deviceNum = null; + this.timeserieNum = null; + if (args) { + if (args.diskSize !== undefined && args.diskSize !== null) { + this.diskSize = args.diskSize; + } + if (args.deviceNum !== undefined && args.deviceNum !== null) { + this.deviceNum = args.deviceNum; + } + if (args.timeserieNum !== undefined && args.timeserieNum !== null) { + this.timeserieNum = args.timeserieNum; + } + } +}; +TSpaceQuota.prototype = {}; +TSpaceQuota.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.diskSize = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.deviceNum = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I64) { + this.timeserieNum = input.readI64(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSpaceQuota.prototype.write = function(output) { + output.writeStructBegin('TSpaceQuota'); + if (this.diskSize !== null && this.diskSize !== undefined) { + output.writeFieldBegin('diskSize', Thrift.Type.I64, 1); + output.writeI64(this.diskSize); + output.writeFieldEnd(); + } + if (this.deviceNum !== null && this.deviceNum !== undefined) { + output.writeFieldBegin('deviceNum', Thrift.Type.I64, 2); + output.writeI64(this.deviceNum); + output.writeFieldEnd(); + } + if (this.timeserieNum !== null && this.timeserieNum !== undefined) { + output.writeFieldBegin('timeserieNum', Thrift.Type.I64, 3); + output.writeI64(this.timeserieNum); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TTimedQuota = module.exports.TTimedQuota = function(args) { + this.timeUnit = null; + this.softLimit = null; + if (args) { + if (args.timeUnit !== undefined && args.timeUnit !== null) { + this.timeUnit = args.timeUnit; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field timeUnit is unset!'); + } + if (args.softLimit !== undefined && args.softLimit !== null) { + this.softLimit = args.softLimit; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field softLimit is unset!'); + } + } +}; +TTimedQuota.prototype = {}; +TTimedQuota.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.timeUnit = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.softLimit = input.readI64(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TTimedQuota.prototype.write = function(output) { + output.writeStructBegin('TTimedQuota'); + if (this.timeUnit !== null && this.timeUnit !== undefined) { + output.writeFieldBegin('timeUnit', Thrift.Type.I64, 1); + output.writeI64(this.timeUnit); + output.writeFieldEnd(); + } + if (this.softLimit !== null && this.softLimit !== undefined) { + output.writeFieldBegin('softLimit', Thrift.Type.I64, 2); + output.writeI64(this.softLimit); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TThrottleQuota = module.exports.TThrottleQuota = function(args) { + this.throttleLimit = null; + this.memLimit = null; + this.cpuLimit = null; + if (args) { + if (args.throttleLimit !== undefined && args.throttleLimit !== null) { + this.throttleLimit = Thrift.copyMap(args.throttleLimit, [ttypes.TTimedQuota]); + } + if (args.memLimit !== undefined && args.memLimit !== null) { + this.memLimit = args.memLimit; + } + if (args.cpuLimit !== undefined && args.cpuLimit !== null) { + this.cpuLimit = args.cpuLimit; + } + } +}; +TThrottleQuota.prototype = {}; +TThrottleQuota.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.MAP) { + this.throttleLimit = {}; + var _rtmp343 = input.readMapBegin(); + var _size42 = _rtmp343.size || 0; + for (var _i44 = 0; _i44 < _size42; ++_i44) { + var key45 = null; + var val46 = null; + key45 = input.readI32(); + val46 = new ttypes.TTimedQuota(); + val46.read(input); + this.throttleLimit[key45] = val46; + } + input.readMapEnd(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.memLimit = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I32) { + this.cpuLimit = input.readI32(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TThrottleQuota.prototype.write = function(output) { + output.writeStructBegin('TThrottleQuota'); + if (this.throttleLimit !== null && this.throttleLimit !== undefined) { + output.writeFieldBegin('throttleLimit', Thrift.Type.MAP, 1); + output.writeMapBegin(Thrift.Type.I32, Thrift.Type.STRUCT, Thrift.objectLength(this.throttleLimit)); + for (var kiter47 in this.throttleLimit) { + if (this.throttleLimit.hasOwnProperty(kiter47)) { + var viter48 = this.throttleLimit[kiter47]; + output.writeI32(kiter47); + viter48.write(output); + } + } + output.writeMapEnd(); + output.writeFieldEnd(); + } + if (this.memLimit !== null && this.memLimit !== undefined) { + output.writeFieldBegin('memLimit', Thrift.Type.I64, 2); + output.writeI64(this.memLimit); + output.writeFieldEnd(); + } + if (this.cpuLimit !== null && this.cpuLimit !== undefined) { + output.writeFieldBegin('cpuLimit', Thrift.Type.I32, 3); + output.writeI32(this.cpuLimit); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSetSpaceQuotaReq = module.exports.TSetSpaceQuotaReq = function(args) { + this.database = null; + this.spaceLimit = null; + if (args) { + if (args.database !== undefined && args.database !== null) { + this.database = Thrift.copyList(args.database, [null]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field database is unset!'); + } + if (args.spaceLimit !== undefined && args.spaceLimit !== null) { + this.spaceLimit = new ttypes.TSpaceQuota(args.spaceLimit); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field spaceLimit is unset!'); + } + } +}; +TSetSpaceQuotaReq.prototype = {}; +TSetSpaceQuotaReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.LIST) { + this.database = []; + var _rtmp350 = input.readListBegin(); + var _size49 = _rtmp350.size || 0; + for (var _i51 = 0; _i51 < _size49; ++_i51) { + var elem52 = null; + elem52 = input.readString(); + this.database.push(elem52); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRUCT) { + this.spaceLimit = new ttypes.TSpaceQuota(); + this.spaceLimit.read(input); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSetSpaceQuotaReq.prototype.write = function(output) { + output.writeStructBegin('TSetSpaceQuotaReq'); + if (this.database !== null && this.database !== undefined) { + output.writeFieldBegin('database', Thrift.Type.LIST, 1); + output.writeListBegin(Thrift.Type.STRING, this.database.length); + for (var iter53 in this.database) { + if (this.database.hasOwnProperty(iter53)) { + iter53 = this.database[iter53]; + output.writeString(iter53); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.spaceLimit !== null && this.spaceLimit !== undefined) { + output.writeFieldBegin('spaceLimit', Thrift.Type.STRUCT, 2); + this.spaceLimit.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSetThrottleQuotaReq = module.exports.TSetThrottleQuotaReq = function(args) { + this.userName = null; + this.throttleQuota = null; + if (args) { + if (args.userName !== undefined && args.userName !== null) { + this.userName = args.userName; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field userName is unset!'); + } + if (args.throttleQuota !== undefined && args.throttleQuota !== null) { + this.throttleQuota = new ttypes.TThrottleQuota(args.throttleQuota); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field throttleQuota is unset!'); + } + } +}; +TSetThrottleQuotaReq.prototype = {}; +TSetThrottleQuotaReq.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.userName = input.readString(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRUCT) { + this.throttleQuota = new ttypes.TThrottleQuota(); + this.throttleQuota.read(input); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSetThrottleQuotaReq.prototype.write = function(output) { + output.writeStructBegin('TSetThrottleQuotaReq'); + if (this.userName !== null && this.userName !== undefined) { + output.writeFieldBegin('userName', Thrift.Type.STRING, 1); + output.writeString(this.userName); + output.writeFieldEnd(); + } + if (this.throttleQuota !== null && this.throttleQuota !== undefined) { + output.writeFieldBegin('throttleQuota', Thrift.Type.STRUCT, 2); + this.throttleQuota.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TLicense = module.exports.TLicense = function(args) { + this.licenseIssueTimestamp = null; + this.expireTimestamp = null; + this.dataNodeNumLimit = null; + this.cpuCoreNumLimit = null; + this.deviceNumLimit = null; + this.sensorNumLimit = null; + this.disconnectionFromActiveNodeTimeLimit = null; + this.mlNodeNumLimit = null; + if (args) { + if (args.licenseIssueTimestamp !== undefined && args.licenseIssueTimestamp !== null) { + this.licenseIssueTimestamp = args.licenseIssueTimestamp; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field licenseIssueTimestamp is unset!'); + } + if (args.expireTimestamp !== undefined && args.expireTimestamp !== null) { + this.expireTimestamp = args.expireTimestamp; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field expireTimestamp is unset!'); + } + if (args.dataNodeNumLimit !== undefined && args.dataNodeNumLimit !== null) { + this.dataNodeNumLimit = args.dataNodeNumLimit; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dataNodeNumLimit is unset!'); + } + if (args.cpuCoreNumLimit !== undefined && args.cpuCoreNumLimit !== null) { + this.cpuCoreNumLimit = args.cpuCoreNumLimit; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field cpuCoreNumLimit is unset!'); + } + if (args.deviceNumLimit !== undefined && args.deviceNumLimit !== null) { + this.deviceNumLimit = args.deviceNumLimit; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field deviceNumLimit is unset!'); + } + if (args.sensorNumLimit !== undefined && args.sensorNumLimit !== null) { + this.sensorNumLimit = args.sensorNumLimit; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sensorNumLimit is unset!'); + } + if (args.disconnectionFromActiveNodeTimeLimit !== undefined && args.disconnectionFromActiveNodeTimeLimit !== null) { + this.disconnectionFromActiveNodeTimeLimit = args.disconnectionFromActiveNodeTimeLimit; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field disconnectionFromActiveNodeTimeLimit is unset!'); + } + if (args.mlNodeNumLimit !== undefined && args.mlNodeNumLimit !== null) { + this.mlNodeNumLimit = args.mlNodeNumLimit; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field mlNodeNumLimit is unset!'); + } + } +}; +TLicense.prototype = {}; +TLicense.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I64) { + this.licenseIssueTimestamp = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I64) { + this.expireTimestamp = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.I16) { + this.dataNodeNumLimit = input.readI16(); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I32) { + this.cpuCoreNumLimit = input.readI32(); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.I64) { + this.deviceNumLimit = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.I64) { + this.sensorNumLimit = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.I64) { + this.disconnectionFromActiveNodeTimeLimit = input.readI64(); + } else { + input.skip(ftype); + } + break; + case 9: + if (ftype == Thrift.Type.I16) { + this.mlNodeNumLimit = input.readI16(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TLicense.prototype.write = function(output) { + output.writeStructBegin('TLicense'); + if (this.licenseIssueTimestamp !== null && this.licenseIssueTimestamp !== undefined) { + output.writeFieldBegin('licenseIssueTimestamp', Thrift.Type.I64, 1); + output.writeI64(this.licenseIssueTimestamp); + output.writeFieldEnd(); + } + if (this.expireTimestamp !== null && this.expireTimestamp !== undefined) { + output.writeFieldBegin('expireTimestamp', Thrift.Type.I64, 2); + output.writeI64(this.expireTimestamp); + output.writeFieldEnd(); + } + if (this.dataNodeNumLimit !== null && this.dataNodeNumLimit !== undefined) { + output.writeFieldBegin('dataNodeNumLimit', Thrift.Type.I16, 4); + output.writeI16(this.dataNodeNumLimit); + output.writeFieldEnd(); + } + if (this.cpuCoreNumLimit !== null && this.cpuCoreNumLimit !== undefined) { + output.writeFieldBegin('cpuCoreNumLimit', Thrift.Type.I32, 5); + output.writeI32(this.cpuCoreNumLimit); + output.writeFieldEnd(); + } + if (this.deviceNumLimit !== null && this.deviceNumLimit !== undefined) { + output.writeFieldBegin('deviceNumLimit', Thrift.Type.I64, 6); + output.writeI64(this.deviceNumLimit); + output.writeFieldEnd(); + } + if (this.sensorNumLimit !== null && this.sensorNumLimit !== undefined) { + output.writeFieldBegin('sensorNumLimit', Thrift.Type.I64, 7); + output.writeI64(this.sensorNumLimit); + output.writeFieldEnd(); + } + if (this.disconnectionFromActiveNodeTimeLimit !== null && this.disconnectionFromActiveNodeTimeLimit !== undefined) { + output.writeFieldBegin('disconnectionFromActiveNodeTimeLimit', Thrift.Type.I64, 8); + output.writeI64(this.disconnectionFromActiveNodeTimeLimit); + output.writeFieldEnd(); + } + if (this.mlNodeNumLimit !== null && this.mlNodeNumLimit !== undefined) { + output.writeFieldBegin('mlNodeNumLimit', Thrift.Type.I16, 9); + output.writeI16(this.mlNodeNumLimit); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TLoadSample = module.exports.TLoadSample = function(args) { + this.cpuUsageRate = null; + this.memoryUsageRate = null; + this.diskUsageRate = null; + this.freeDiskSpace = null; + if (args) { + if (args.cpuUsageRate !== undefined && args.cpuUsageRate !== null) { + this.cpuUsageRate = args.cpuUsageRate; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field cpuUsageRate is unset!'); + } + if (args.memoryUsageRate !== undefined && args.memoryUsageRate !== null) { + this.memoryUsageRate = args.memoryUsageRate; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field memoryUsageRate is unset!'); + } + if (args.diskUsageRate !== undefined && args.diskUsageRate !== null) { + this.diskUsageRate = args.diskUsageRate; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field diskUsageRate is unset!'); + } + if (args.freeDiskSpace !== undefined && args.freeDiskSpace !== null) { + this.freeDiskSpace = args.freeDiskSpace; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field freeDiskSpace is unset!'); + } + } +}; +TLoadSample.prototype = {}; +TLoadSample.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.DOUBLE) { + this.cpuUsageRate = input.readDouble(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.DOUBLE) { + this.memoryUsageRate = input.readDouble(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.DOUBLE) { + this.diskUsageRate = input.readDouble(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.DOUBLE) { + this.freeDiskSpace = input.readDouble(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TLoadSample.prototype.write = function(output) { + output.writeStructBegin('TLoadSample'); + if (this.cpuUsageRate !== null && this.cpuUsageRate !== undefined) { + output.writeFieldBegin('cpuUsageRate', Thrift.Type.DOUBLE, 1); + output.writeDouble(this.cpuUsageRate); + output.writeFieldEnd(); + } + if (this.memoryUsageRate !== null && this.memoryUsageRate !== undefined) { + output.writeFieldBegin('memoryUsageRate', Thrift.Type.DOUBLE, 2); + output.writeDouble(this.memoryUsageRate); + output.writeFieldEnd(); + } + if (this.diskUsageRate !== null && this.diskUsageRate !== undefined) { + output.writeFieldBegin('diskUsageRate', Thrift.Type.DOUBLE, 3); + output.writeDouble(this.diskUsageRate); + output.writeFieldEnd(); + } + if (this.freeDiskSpace !== null && this.freeDiskSpace !== undefined) { + output.writeFieldBegin('freeDiskSpace', Thrift.Type.DOUBLE, 4); + output.writeDouble(this.freeDiskSpace); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TServiceProvider = module.exports.TServiceProvider = function(args) { + this.endPoint = null; + this.serviceType = null; + if (args) { + if (args.endPoint !== undefined && args.endPoint !== null) { + this.endPoint = new ttypes.TEndPoint(args.endPoint); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field endPoint is unset!'); + } + if (args.serviceType !== undefined && args.serviceType !== null) { + this.serviceType = args.serviceType; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field serviceType is unset!'); + } + } +}; +TServiceProvider.prototype = {}; +TServiceProvider.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.endPoint = new ttypes.TEndPoint(); + this.endPoint.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I32) { + this.serviceType = input.readI32(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TServiceProvider.prototype.write = function(output) { + output.writeStructBegin('TServiceProvider'); + if (this.endPoint !== null && this.endPoint !== undefined) { + output.writeFieldBegin('endPoint', Thrift.Type.STRUCT, 1); + this.endPoint.write(output); + output.writeFieldEnd(); + } + if (this.serviceType !== null && this.serviceType !== undefined) { + output.writeFieldBegin('serviceType', Thrift.Type.I32, 2); + output.writeI32(this.serviceType); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TSender = module.exports.TSender = function(args) { + this.dataNodeLocation = null; + this.configNodeLocation = null; + if (args) { + if (args.dataNodeLocation !== undefined && args.dataNodeLocation !== null) { + this.dataNodeLocation = new ttypes.TDataNodeLocation(args.dataNodeLocation); + } + if (args.configNodeLocation !== undefined && args.configNodeLocation !== null) { + this.configNodeLocation = new ttypes.TConfigNodeLocation(args.configNodeLocation); + } + } +}; +TSender.prototype = {}; +TSender.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.dataNodeLocation = new ttypes.TDataNodeLocation(); + this.dataNodeLocation.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRUCT) { + this.configNodeLocation = new ttypes.TConfigNodeLocation(); + this.configNodeLocation.read(input); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TSender.prototype.write = function(output) { + output.writeStructBegin('TSender'); + if (this.dataNodeLocation !== null && this.dataNodeLocation !== undefined) { + output.writeFieldBegin('dataNodeLocation', Thrift.Type.STRUCT, 1); + this.dataNodeLocation.write(output); + output.writeFieldEnd(); + } + if (this.configNodeLocation !== null && this.configNodeLocation !== undefined) { + output.writeFieldBegin('configNodeLocation', Thrift.Type.STRUCT, 2); + this.configNodeLocation.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TTestConnectionResult = module.exports.TTestConnectionResult = function(args) { + this.serviceProvider = null; + this.sender = null; + this.success = null; + this.reason = null; + if (args) { + if (args.serviceProvider !== undefined && args.serviceProvider !== null) { + this.serviceProvider = new ttypes.TServiceProvider(args.serviceProvider); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field serviceProvider is unset!'); + } + if (args.sender !== undefined && args.sender !== null) { + this.sender = new ttypes.TSender(args.sender); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sender is unset!'); + } + if (args.success !== undefined && args.success !== null) { + this.success = args.success; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field success is unset!'); + } + if (args.reason !== undefined && args.reason !== null) { + this.reason = args.reason; + } + } +}; +TTestConnectionResult.prototype = {}; +TTestConnectionResult.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.serviceProvider = new ttypes.TServiceProvider(); + this.serviceProvider.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRUCT) { + this.sender = new ttypes.TSender(); + this.sender.read(input); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.BOOL) { + this.success = input.readBool(); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRING) { + this.reason = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TTestConnectionResult.prototype.write = function(output) { + output.writeStructBegin('TTestConnectionResult'); + if (this.serviceProvider !== null && this.serviceProvider !== undefined) { + output.writeFieldBegin('serviceProvider', Thrift.Type.STRUCT, 1); + this.serviceProvider.write(output); + output.writeFieldEnd(); + } + if (this.sender !== null && this.sender !== undefined) { + output.writeFieldBegin('sender', Thrift.Type.STRUCT, 2); + this.sender.write(output); + output.writeFieldEnd(); + } + if (this.success !== null && this.success !== undefined) { + output.writeFieldBegin('success', Thrift.Type.BOOL, 3); + output.writeBool(this.success); + output.writeFieldEnd(); + } + if (this.reason !== null && this.reason !== undefined) { + output.writeFieldBegin('reason', Thrift.Type.STRING, 4); + output.writeString(this.reason); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TTestConnectionResp = module.exports.TTestConnectionResp = function(args) { + this.status = null; + this.resultList = null; + if (args) { + if (args.status !== undefined && args.status !== null) { + this.status = new ttypes.TSStatus(args.status); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); + } + if (args.resultList !== undefined && args.resultList !== null) { + this.resultList = Thrift.copyList(args.resultList, [ttypes.TTestConnectionResult]); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field resultList is unset!'); + } + } +}; +TTestConnectionResp.prototype = {}; +TTestConnectionResp.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.status = new ttypes.TSStatus(); + this.status.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.resultList = []; + var _rtmp355 = input.readListBegin(); + var _size54 = _rtmp355.size || 0; + for (var _i56 = 0; _i56 < _size54; ++_i56) { + var elem57 = null; + elem57 = new ttypes.TTestConnectionResult(); + elem57.read(input); + this.resultList.push(elem57); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TTestConnectionResp.prototype.write = function(output) { + output.writeStructBegin('TTestConnectionResp'); + if (this.status !== null && this.status !== undefined) { + output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); + this.status.write(output); + output.writeFieldEnd(); + } + if (this.resultList !== null && this.resultList !== undefined) { + output.writeFieldBegin('resultList', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRUCT, this.resultList.length); + for (var iter58 in this.resultList) { + if (this.resultList.hasOwnProperty(iter58)) { + iter58 = this.resultList[iter58]; + iter58.write(output); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TNodeLocations = module.exports.TNodeLocations = function(args) { + this.configNodeLocations = null; + this.dataNodeLocations = null; + if (args) { + if (args.configNodeLocations !== undefined && args.configNodeLocations !== null) { + this.configNodeLocations = Thrift.copyList(args.configNodeLocations, [ttypes.TConfigNodeLocation]); + } + if (args.dataNodeLocations !== undefined && args.dataNodeLocations !== null) { + this.dataNodeLocations = Thrift.copyList(args.dataNodeLocations, [ttypes.TDataNodeLocation]); + } + } +}; +TNodeLocations.prototype = {}; +TNodeLocations.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.LIST) { + this.configNodeLocations = []; + var _rtmp360 = input.readListBegin(); + var _size59 = _rtmp360.size || 0; + for (var _i61 = 0; _i61 < _size59; ++_i61) { + var elem62 = null; + elem62 = new ttypes.TConfigNodeLocation(); + elem62.read(input); + this.configNodeLocations.push(elem62); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.dataNodeLocations = []; + var _rtmp364 = input.readListBegin(); + var _size63 = _rtmp364.size || 0; + for (var _i65 = 0; _i65 < _size63; ++_i65) { + var elem66 = null; + elem66 = new ttypes.TDataNodeLocation(); + elem66.read(input); + this.dataNodeLocations.push(elem66); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TNodeLocations.prototype.write = function(output) { + output.writeStructBegin('TNodeLocations'); + if (this.configNodeLocations !== null && this.configNodeLocations !== undefined) { + output.writeFieldBegin('configNodeLocations', Thrift.Type.LIST, 1); + output.writeListBegin(Thrift.Type.STRUCT, this.configNodeLocations.length); + for (var iter67 in this.configNodeLocations) { + if (this.configNodeLocations.hasOwnProperty(iter67)) { + iter67 = this.configNodeLocations[iter67]; + iter67.write(output); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.dataNodeLocations !== null && this.dataNodeLocations !== undefined) { + output.writeFieldBegin('dataNodeLocations', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRUCT, this.dataNodeLocations.length); + for (var iter68 in this.dataNodeLocations) { + if (this.dataNodeLocations.hasOwnProperty(iter68)) { + iter68 = this.dataNodeLocations[iter68]; + iter68.write(output); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TShowConfigurationTemplateResp = module.exports.TShowConfigurationTemplateResp = function(args) { + this.status = null; + this.content = null; + if (args) { + if (args.status !== undefined && args.status !== null) { + this.status = new ttypes.TSStatus(args.status); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); + } + if (args.content !== undefined && args.content !== null) { + this.content = args.content; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field content is unset!'); + } + } +}; +TShowConfigurationTemplateResp.prototype = {}; +TShowConfigurationTemplateResp.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.status = new ttypes.TSStatus(); + this.status.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.content = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TShowConfigurationTemplateResp.prototype.write = function(output) { + output.writeStructBegin('TShowConfigurationTemplateResp'); + if (this.status !== null && this.status !== undefined) { + output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); + this.status.write(output); + output.writeFieldEnd(); + } + if (this.content !== null && this.content !== undefined) { + output.writeFieldBegin('content', Thrift.Type.STRING, 2); + output.writeString(this.content); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +var TShowConfigurationResp = module.exports.TShowConfigurationResp = function(args) { + this.status = null; + this.content = null; + if (args) { + if (args.status !== undefined && args.status !== null) { + this.status = new ttypes.TSStatus(args.status); + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!'); + } + if (args.content !== undefined && args.content !== null) { + this.content = args.content; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field content is unset!'); + } + } +}; +TShowConfigurationResp.prototype = {}; +TShowConfigurationResp.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.status = new ttypes.TSStatus(); + this.status.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.content = input.readString(); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +TShowConfigurationResp.prototype.write = function(output) { + output.writeStructBegin('TShowConfigurationResp'); + if (this.status !== null && this.status !== undefined) { + output.writeFieldBegin('status', Thrift.Type.STRUCT, 1); + this.status.write(output); + output.writeFieldEnd(); + } + if (this.content !== null && this.content !== undefined) { + output.writeFieldBegin('content', Thrift.Type.STRING, 2); + output.writeString(this.content); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; \ No newline at end of file diff --git a/cdsp/information-layer/handlers/src/iotdb/src/IoTDBHandler.ts b/cdsp/information-layer/handlers/src/iotdb/src/IoTDBHandler.ts index 3ede2fb..3b8f82a 100644 --- a/cdsp/information-layer/handlers/src/iotdb/src/IoTDBHandler.ts +++ b/cdsp/information-layer/handlers/src/iotdb/src/IoTDBHandler.ts @@ -1,16 +1,13 @@ import { SupportedMessageDataTypes } from "./../utils/iotdb-constants"; -import { Client as ThriftClient } from "../gen-nodejs/IClientRPCService"; -import { +const Client = require("../gen-nodejs/IClientRPCService"); +const { TSExecuteStatementReq, TSOpenSessionReq, - TSOpenSessionResp, TSProtocolVersion, TSCloseSessionReq, TSInsertRecordReq, - Int64, -} from "../gen-nodejs/IClientRPCService_types"; +}: any = require("../gen-nodejs/client_types"); import thrift from "thrift"; -import { IotDBInt64 } from "../utils/Int64"; import { HandlerBase } from "../../HandlerBase"; import { SessionDataSet } from "../utils/SessionDataSet"; import { IoTDBDataInterpreter } from "../utils/IoTDBDataInterpreter"; @@ -32,29 +29,23 @@ import { createErrorMessage } from "../../../../utils/error-message-helper"; import { WebSocket, Message, STATUS_ERRORS } from "../../../utils/data_types"; export class IoTDBHandler extends HandlerBase { - private client: ThriftClient | null; + private client: any = null; private sendMessageToClients: | ((ws: WebSocket, message: Message) => void) - | null; - private sessionId: Int64 | undefined; - private readonly protocolVersion: number; - private statementId: Int64 | undefined; - private readonly fetchSize: number; - private dataPointsSchema: SupportedDataPoints; + | null = null; + private sessionId: number | null = null; + private readonly protocolVersion: any = + TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V3; + private statementId: number | null = null; + private fetchSize: number; + private dataPointsSchema: SupportedDataPoints = {}; constructor() { super(); if (!databaseConfig) { throw new Error("Invalid database configuration."); } - - this.client = null; - this.sendMessageToClients = null; - this.sessionId = undefined; - this.protocolVersion = TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V3; - this.statementId = undefined; - this.fetchSize = databaseConfig.fetchSize; - this.dataPointsSchema = {}; + this.fetchSize = databaseConfig?.fetchSize ?? 1000; } async authenticateAndConnect( @@ -76,7 +67,7 @@ export class IoTDBHandler extends HandlerBase { `Connect to IoTDB, host: ${databaseConfig!.iotdbHost} port: ${databaseConfig!.iotdbPort}` ); - this.client = thrift.createClient(ThriftClient, connection); + this.client = thrift.createClient(Client, connection); connection.on("error", (error: Error) => { logError("thrift connection error", error); @@ -208,15 +199,14 @@ export class IoTDBHandler extends HandlerBase { password: databaseConfig!.iotdbPassword, client_protocol: this.protocolVersion, zoneId: databaseConfig!.timeZoneId, - configuration: new Map([["version", "V_0_13"]]), + configuration: { version: "V_0_13" }, }); try { if (!this.client) { throw new Error("Client is not initialized"); } - const resp: TSOpenSessionResp = - await this.client.openSession(openSessionReq); + const resp = await this.client.openSession(openSessionReq); if (this.protocolVersion !== resp.serverProtocolVersion) { logMessage( @@ -232,15 +222,14 @@ export class IoTDBHandler extends HandlerBase { } this.sessionId = resp.sessionId; - if (this.sessionId) { - this.statementId = await this.client?.requestStatementId( - this.sessionId - ); - } else { + + if (!this.sessionId) { throw new Error( "Session ID is undefined, cannot request statement ID." ); } + + this.statementId = await this.client.requestStatementId(this.sessionId); logMessage("Session started!"); } catch (error: unknown) { logError("Failed starting session with IoTDB", error); @@ -259,14 +248,14 @@ export class IoTDBHandler extends HandlerBase { const req = new TSCloseSessionReq({ sessionId: this.sessionId! }); try { - await this.client?.closeSession(req); + await this.client.closeSession(req); } catch (error: unknown) { logError( "Error occurs when closing session at server. Maybe server is down. Error message", error ); } finally { - this.sessionId = undefined; + this.sessionId = null; logMessage("Session closed!"); } } @@ -316,83 +305,6 @@ export class IoTDBHandler extends HandlerBase { return true; } - /** - * Queries the last fields from the database based on the provided message and sends the response to the client. - * - * @param message - The message object containing the query details. - * @param ws - The WebSocket connection to send the response to. - */ - private async queryLastFields( - message: Message, - ws: WebSocket - ): Promise> { - const { id: objectId, tree } = message; - - if (!tree || !(tree in databaseParams)) { - const errorMsg = `Invalid or undefined tree provided: ${tree}`; - logErrorStr(errorMsg); - this.sendMessageToClient( - ws, - createErrorMessage("read", STATUS_ERRORS.NOT_FOUND, errorMsg) - ); - return []; - } - const { databaseName, dataPointId } = - databaseParams[tree as keyof typeof databaseParams]; - const fieldsToSearch = this.extractDataPointsFromNodes(message).join(", "); - const sql = `SELECT ${fieldsToSearch} FROM ${databaseName} WHERE ${dataPointId} = '${objectId}' ORDER BY Time ASC`; - - try { - const sessionDataSet = await this.executeQueryStatement(sql); - - // Check if sessionDataSet is not an instance of SessionDataSet, and handle the error - if (!(sessionDataSet instanceof SessionDataSet)) { - throw new Error( - "Failed to retrieve session data. Invalid session dataset." - ); - } - - const mediaElements: any[] = []; - while (sessionDataSet.hasNext()) { - mediaElements.push(sessionDataSet.next()); - } - - const latestValues: Record = {}; - mediaElements.forEach((mediaElement) => { - const transformedMediaElement = Object.fromEntries( - Object.entries(mediaElement).map(([key, value]) => { - const newKey = this.transformDataPointsWithDots(key); - return [newKey, value]; - }) - ); - - const transformedObject = - IoTDBDataInterpreter.extractNodesFromTimeseries( - transformedMediaElement, - databaseName - ); - - Object.entries(transformedObject).forEach(([key, value]) => { - if (value !== null && !isNaN(value)) { - latestValues[key] = value; - } - }); - }); - - return Object.entries(latestValues).map(([name, value]) => ({ - name, - value, - })); - } catch (error: unknown) { - const errMsg = error instanceof Error ? error.message : "Unknown error"; - this.sendMessageToClient( - ws, - createErrorMessage("read", STATUS_ERRORS.SERVICE_UNAVAILABLE, errMsg) - ); - return []; - } - } - /** * Executes a SQL query statement asynchronously. * @@ -401,7 +313,9 @@ export class IoTDBHandler extends HandlerBase { * otherwise returns an empty object. * @throws - Throws an error if the session is not open. */ - private async executeQueryStatement(sql: string): Promise { + private async executeQueryStatement( + sql: string + ): Promise { try { if (!this.sessionId) { throw new Error("Session is not open. Please authenticate first."); @@ -418,22 +332,20 @@ export class IoTDBHandler extends HandlerBase { timeout: 0, }); - const resp = await this.client?.executeQueryStatement(request); + const resp = await this.client.executeQueryStatement(request); if (!resp || !resp.queryDataSet || !resp.queryDataSet.valueList) { - throw new Error("Failed to execute query or retrieve valid data."); + return {}; } return new SessionDataSet( - resp.columns ?? [], - resp.dataTypeList ?? [], - resp.columnNameIndexMap - ? Object.fromEntries(resp.columnNameIndexMap) - : {}, - resp.queryId ?? new IotDBInt64(-1), - this.client!, - this.statementId!, - this.sessionId!, + resp.columns, + resp.dataTypeList, + resp.columnNameIndexMap, + resp.queryId, + this.client, + this.statementId, + this.sessionId, resp.queryDataSet, - resp.ignoreTimeStamp ?? false + resp.ignoreTimeStamp ); } catch (error: unknown) { logError("Failed executing query statement", error); @@ -444,7 +356,6 @@ export class IoTDBHandler extends HandlerBase { /** * Inserts a record into the time series database. * @param deviceId - The ID of the device. - * @param timestamp - The timestamp of the record. * @param measurements - Array of measurement names. * @param dataTypes - Array of data types for each value. * @param values - Array of values to be inserted. @@ -490,11 +401,89 @@ export class IoTDBHandler extends HandlerBase { prefixPath: deviceId, measurements: measurements, values: valuesInBytes, - timestamp: new IotDBInt64(Date.now()), + timestamp: Date.now(), isAligned: isAligned, }); - return await this.client?.insertRecord(request); + return await this.client.insertRecord(request); + } + + /** + * Queries the last fields from the database based on the provided message and sends the response to the client. + * + * @param message - The message object containing the query details. + * @param ws - The WebSocket connection to send the response to. + */ + private async queryLastFields( + message: Message, + ws: WebSocket + ): Promise> { + const { id: objectId, tree } = message; + + if (!tree || !(tree in databaseParams)) { + const errorMsg = `Invalid or undefined tree provided: ${tree}`; + logErrorStr(errorMsg); + this.sendMessageToClient( + ws, + createErrorMessage("read", STATUS_ERRORS.NOT_FOUND, errorMsg) + ); + return []; + } + const { databaseName, dataPointId } = + databaseParams[tree as keyof typeof databaseParams]; + + const fieldsToSearch = this.extractDataPointsFromNodes(message).join(", "); + const sql = `SELECT ${fieldsToSearch} FROM ${databaseName} WHERE ${dataPointId} = '${objectId}' ORDER BY Time ASC`; + + try { + const sessionDataSet = await this.executeQueryStatement(sql); + + // Check if sessionDataSet is not an instance of SessionDataSet, and handle the error + if (!(sessionDataSet instanceof SessionDataSet)) { + throw new Error( + "Failed to retrieve session data. Invalid session dataset." + ); + } + + const mediaElements: any[] = []; + while (sessionDataSet.hasNext()) { + mediaElements.push(sessionDataSet.next()); + } + + const latestValues: Record = {}; + mediaElements.forEach((mediaElement) => { + const transformedMediaElement = Object.fromEntries( + Object.entries(mediaElement).map(([key, value]) => { + const newKey = this.transformDataPointsWithDots(key); + return [newKey, value]; + }) + ); + + const transformedObject = + IoTDBDataInterpreter.extractNodesFromTimeseries( + transformedMediaElement, + databaseName + ); + + Object.entries(transformedObject).forEach(([key, value]) => { + if (value !== null && !isNaN(value)) { + latestValues[key] = value; + } + }); + }); + + return Object.entries(latestValues).map(([name, value]) => ({ + name, + value, + })); + } catch (error: unknown) { + const errMsg = error instanceof Error ? error.message : "Unknown error"; + this.sendMessageToClient( + ws, + createErrorMessage("read", STATUS_ERRORS.SERVICE_UNAVAILABLE, errMsg) + ); + return []; + } } /** @@ -548,6 +537,4 @@ export class IoTDBHandler extends HandlerBase { } return data; } -} - -export default IoTDBHandler; +} \ No newline at end of file diff --git a/cdsp/information-layer/handlers/src/iotdb/utils/Int64.ts b/cdsp/information-layer/handlers/src/iotdb/utils/Int64.ts deleted file mode 100644 index 9f8b6a6..0000000 --- a/cdsp/information-layer/handlers/src/iotdb/utils/Int64.ts +++ /dev/null @@ -1,44 +0,0 @@ -// Implementing Int64 class that matches the structure expected by Thrift -import { Int64 } from "../gen-nodejs/IClientRPCService_types"; - -/** - * Represents a 64-bit integer for IoT applications. - * Implements the Int64 interface. - */ -export class IotDBInt64 implements Int64 { - private value: bigint; // Holds the 64-bit integer value - - /** - * Constructs an instance of IotDBInt64. - * @param input - An optional number or string to initialize the 64-bit integer. - * If no input is provided, it defaults to 0. - */ - constructor(input?: number | string) { - this.value = BigInt(input ?? 0); // Handle input as either number or string - } - - /** - * A placeholder constructor method that is not implemented. - * @param o - An optional number or string parameter. - * @throws {Error} Throws an error indicating that the method is not implemented. - */ - ["constructor"](o?: number | string): this { - throw new Error("Method not implemented."); - } - - /** - * Converts the 64-bit integer to its string representation. - * @returns {string} The string representation of the 64-bit integer. - */ - toString(): string { - return this.value.toString(); - } - - /** - * Converts the 64-bit integer to its JSON representation. - * @returns {string} The JSON representation of the 64-bit integer. - */ - toJson(): string { - return this.toString(); // You can customize this if needed - } -} diff --git a/cdsp/information-layer/handlers/src/iotdb/utils/IoTDBRpcDataSet.ts b/cdsp/information-layer/handlers/src/iotdb/utils/IoTDBRpcDataSet.ts index de8a98a..68b2e0f 100644 --- a/cdsp/information-layer/handlers/src/iotdb/utils/IoTDBRpcDataSet.ts +++ b/cdsp/information-layer/handlers/src/iotdb/utils/IoTDBRpcDataSet.ts @@ -1,5 +1,4 @@ import { IoTDBDataType } from "./iotdb-constants"; -import { Int64 } from "../gen-nodejs/IClientRPCService_types"; export class IoTDBRpcDataSet { // Static properties @@ -11,10 +10,10 @@ export class IoTDBRpcDataSet { private sql: string | null = null; private columnNameList: string[]; private columnTypeList: IoTDBDataType[]; - private queryId: Int64; + private queryId: number; private client: any; - private statementId: Int64; - private sessionId: Int64; + private statementId: number; + private sessionId: any; private queryDataSet: any; private ignoreTimestamp: boolean; private fetchSize: number; @@ -32,10 +31,10 @@ export class IoTDBRpcDataSet { columnNameList: string[], columnTypeList: IoTDBDataType[], columnNameIndex: { [key: string]: number } | null, - queryId: Int64, + queryId: number, client: any, - statementId: Int64, - sessionId: Int64, + statementId: number, + sessionId: any, queryDataSet: any, ignoreTimestamp: boolean, fetchSize: number @@ -173,7 +172,11 @@ export class IoTDBRpcDataSet { if (!this.isNull(i, this.rowsIndex)) { const valueBuffer = this.queryDataSet.valueList[i]; - const dataType = this.columnTypeDeduplicatedList[i]; + let dataType = this.columnTypeDeduplicatedList[i]; + + if (typeof dataType === "string") { + dataType = IoTDBDataType[dataType as keyof typeof IoTDBDataType]; + } switch (dataType) { case IoTDBDataType.BOOLEAN: @@ -211,13 +214,17 @@ export class IoTDBRpcDataSet { } private isNull(index: number, rowNum: number): boolean { - const bitmap = this.currentBitmap[index]; const shift = rowNum % 8; - const bitmapValue = bitmap.readUInt8(0); // Read the first byte as an unsigned integer + const bitmapValue: number = Buffer.isBuffer(this.currentBitmap[index]) + ? this.currentBitmap[index].readInt8(0) + : this.currentBitmap[index]; + return ((IoTDBRpcDataSet.FLAG >> shift) & (bitmapValue & 0xff)) === 0; } + private returnCurrentBitmapAsNumber() {} + private fetchResults(): void { this.rowsIndex = 0; } -} +} \ No newline at end of file diff --git a/cdsp/information-layer/handlers/src/iotdb/utils/SessionDataSet.ts b/cdsp/information-layer/handlers/src/iotdb/utils/SessionDataSet.ts index 364fdc2..f71a511 100644 --- a/cdsp/information-layer/handlers/src/iotdb/utils/SessionDataSet.ts +++ b/cdsp/information-layer/handlers/src/iotdb/utils/SessionDataSet.ts @@ -1,12 +1,11 @@ import { IoTDBDataType } from "./iotdb-constants"; import { IoTDBRpcDataSet } from "./IoTDBRpcDataSet"; import { IoTDBDataInterpreter } from "./IoTDBDataInterpreter"; -import { Int64 } from "../gen-nodejs/IClientRPCService_types"; // Define the dataTypeProcessors map with specific function types const dataTypeProcessors: { [key in IoTDBDataType]: ( - bytes: Uint8Array | Buffer, + bytes: Uint8Array | Buffer ) => number | bigint | string; } = { [IoTDBDataType.BOOLEAN]: (bytes) => @@ -29,12 +28,12 @@ export class SessionDataSet { columnNameList: string[], columnTypeList: IoTDBDataType[], columnNameIndex: { [key: string]: number }, - queryId: Int64, + queryId: number, client: any, - statementId: Int64, - sessionId: Int64, + statementId: number, + sessionId: any, queryDataSet: any, - ignoreTimestamp: boolean, + ignoreTimestamp: boolean ) { this.iotdbRpcDataSet = new IoTDBRpcDataSet( columnNameList, @@ -46,7 +45,7 @@ export class SessionDataSet { sessionId, queryDataSet, ignoreTimestamp, - 1024, // Buffer size or default value + 1024 // Buffer size or default value ); } @@ -66,7 +65,7 @@ export class SessionDataSet { private constructRowRecordFromValueArray(): { [key: string]: any } { const time64 = IoTDBDataInterpreter.extractTimestamp( - this.iotdbRpcDataSet.getTimeBytes(), + this.iotdbRpcDataSet.getTimeBytes() ); const obj: { [key: string]: any } = { timestamp: time64 }; @@ -86,12 +85,16 @@ export class SessionDataSet { if (!this.iotdbRpcDataSet.isNullByIndex(dataSetColumnIndex)) { const valueBytes = this.iotdbRpcDataSet.getValues()[location]; - const dataType = + let dataType = this.iotdbRpcDataSet.getColumnTypeDeduplicatedList()[location]; const tsName = this.iotdbRpcDataSet.findColumnNameByIndex(dataSetColumnIndex); if (dataType !== null && valueBytes !== null) { + if (typeof dataType === "string") { + dataType = IoTDBDataType[dataType as keyof typeof IoTDBDataType]; + } + if (dataTypeProcessors[dataType]) { obj[tsName] = dataTypeProcessors[dataType](valueBytes); } else { @@ -108,4 +111,4 @@ export class SessionDataSet { } return obj; } -} +} \ No newline at end of file diff --git a/cdsp/information-layer/package-lock.json b/cdsp/information-layer/package-lock.json index 0a6cafa..19cf691 100644 --- a/cdsp/information-layer/package-lock.json +++ b/cdsp/information-layer/package-lock.json @@ -12,7 +12,7 @@ "dotenv": "^16.4.5", "js-yaml": "^4.1.0", "realm": "^12.13.1", - "thrift": "^0.21.0", + "thrift": "^0.14.1", "uuid": "^10.0.0", "ws": "^8.18.0" }, @@ -27,7 +27,7 @@ "eslint": "^9.9.1", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.2.1", - "prettier": "3.3.3", + "prettier": "^3.3.3", "rimraf": "^6.0.1", "ts-jest": "^29.2.5", "typescript": "^5.6.2", @@ -6183,16 +6183,16 @@ "license": "MIT" }, "node_modules/thrift": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/thrift/-/thrift-0.21.0.tgz", - "integrity": "sha512-AW8rwHYjeqXisS8B1iwko2gkNMFwSRJ+bO/W0xTGqRspTD3lGHwZx438+pHdOJ3GwpRAnK7TKbjqPOrHAa7ZwQ==", + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/thrift/-/thrift-0.14.2.tgz", + "integrity": "sha512-bW8EaE6iw3hSt4HB2HpBdHW86Xpb9IUJfqufx4NwEu7OGuIpS0ISj+Yy1Z1Wvhfno6SPNhKRJ1qFXea84HcrOQ==", "license": "Apache-2.0", "dependencies": { "browser-or-node": "^1.2.1", "isomorphic-ws": "^4.0.1", "node-int64": "^0.4.0", "q": "^1.5.0", - "ws": "^5.2.3" + "ws": "^5.2.2" }, "engines": { "node": ">= 10.18.0" @@ -6738,4 +6738,4 @@ } } } -} +} \ No newline at end of file diff --git a/cdsp/information-layer/package.json b/cdsp/information-layer/package.json index 1a7e849..4b18254 100644 --- a/cdsp/information-layer/package.json +++ b/cdsp/information-layer/package.json @@ -18,7 +18,7 @@ "dotenv": "^16.4.5", "js-yaml": "^4.1.0", "realm": "^12.13.1", - "thrift": "^0.21.0", + "thrift": "^0.14.1", "uuid": "^10.0.0", "ws": "^8.18.0" }, @@ -39,4 +39,4 @@ "typescript": "^5.6.2", "typescript-eslint": "^8.4.0" } -} +} \ No newline at end of file From 7465d616b42be395dd954eefe24b2474346fdfa1 Mon Sep 17 00:00:00 2001 From: Sebastian Schleemilch Date: Wed, 30 Oct 2024 10:04:18 +0100 Subject: [PATCH 41/48] Switched README graph to mermaid Signed-off-by: Sebastian Schleemilch --- cdsp/information-layer/README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cdsp/information-layer/README.md b/cdsp/information-layer/README.md index b117028..054d169 100644 --- a/cdsp/information-layer/README.md +++ b/cdsp/information-layer/README.md @@ -9,15 +9,15 @@ Clients can interact with it using websockets and JSON payload. The information-layer consists of two logical components: - database handler: Interaction with the chosen database, configurable - router: API provider that connects to the database handler -``` - | CLOUD - +---------+ | +---------+ - | realm_h | <-> | realmDB | -+--------+ +--------+ +----------+ <-> +---------+ | +---------+ -| client | <-> | router | <-> | handlers | -+--------+ +--------+ +----------+ <-> +---------+ +-------+ - | iotdb_h | <-> | iotdb | - +---------+ +-------+ + +```mermaid +flowchart LR + client <--> router + router <--> handlers + handlers <--> realm_handler + handlers <--> iotdb_handler + realm_handler <--> realmdb + iotdb_handler <--> iotdb ``` # Hello World Setup From c078a059934d06157ff79a6f1956b2ecb0e34216 Mon Sep 17 00:00:00 2001 From: "Andre Wendel (Q290938)" Date: Mon, 4 Nov 2024 16:20:04 +0100 Subject: [PATCH 42/48] Subscription functionality for IoTDB data layer Signed-off-by: Andre Wendel --- .../handlers/src/HandlerBase.ts | 17 +- .../src/iotdb/config/database-params.ts | 4 +- .../handlers/src/iotdb/src/IoTDBHandler.ts | 222 +++------------ .../handlers/src/iotdb/src/Session.ts | 147 ++++++++++ .../src/iotdb/src/SubscriptionSimulator.ts | 253 ++++++++++++++++++ .../src/iotdb/utils/database-helper.ts | 54 ++++ .../src/realmdb/config/database-params.ts | 2 +- .../src/realmdb/src/RealmDbHandler.ts | 6 +- .../utils/{data_types.ts => data-types.ts} | 4 + .../router/src/websocket-server.ts | 21 +- .../router/utils/message-validator.ts | 2 +- .../utils/error-message-helper.ts | 2 +- cdsp/information-layer/utils/logger.ts | 1 + 13 files changed, 518 insertions(+), 217 deletions(-) create mode 100644 cdsp/information-layer/handlers/src/iotdb/src/Session.ts create mode 100644 cdsp/information-layer/handlers/src/iotdb/src/SubscriptionSimulator.ts create mode 100644 cdsp/information-layer/handlers/src/iotdb/utils/database-helper.ts rename cdsp/information-layer/handlers/utils/{data_types.ts => data-types.ts} (94%) diff --git a/cdsp/information-layer/handlers/src/HandlerBase.ts b/cdsp/information-layer/handlers/src/HandlerBase.ts index 4b7b00b..352e1bf 100644 --- a/cdsp/information-layer/handlers/src/HandlerBase.ts +++ b/cdsp/information-layer/handlers/src/HandlerBase.ts @@ -3,10 +3,11 @@ import yaml from "js-yaml"; import { Message, WebSocket, + WebSocketWithId, DataPointSchema, MessageBase, ErrorMessage, -} from "../utils/data_types"; +} from "../utils/data-types"; import { getDataPointsPath } from "../config/config"; import { logMessage, MessageType } from "../../utils/logger"; @@ -39,7 +40,7 @@ export abstract class HandlerBase { logMessage("unsubscribe_client() is not implemented", MessageType.WARNING); } - handleMessage(message: Message, ws: WebSocket): void { + handleMessage(message: Message, connectionId: string, ws: WebSocketWithId): void { try { switch (message.type) { case "read": @@ -81,10 +82,9 @@ export abstract class HandlerBase { * @returns - The transformed message. */ protected createUpdateMessage( - message: Pick, + id: string, tree: string, uuid: string, nodes: Array<{ name: string; value: any }> ): Message { - const { id, tree, uuid } = message; return { type: "update", tree, @@ -129,15 +129,6 @@ export abstract class HandlerBase { return node.replace(/\./g, "_"); } - /** - * Transforms a database field name by replacing underscores with dots. - * @param field - The database filed to transform. - * @returns - The transformed to message node replacing underscores by dots. - */ - protected transformDataPointsWithDots(field: string): string { - return field.replace(/\_/g, "."); - } - /** * Reads and parses a data points file in either JSON, YML, or YAML format. */ diff --git a/cdsp/information-layer/handlers/src/iotdb/config/database-params.ts b/cdsp/information-layer/handlers/src/iotdb/config/database-params.ts index 22f8e90..9ac5214 100644 --- a/cdsp/information-layer/handlers/src/iotdb/config/database-params.ts +++ b/cdsp/information-layer/handlers/src/iotdb/config/database-params.ts @@ -1,5 +1,5 @@ import { getEnvValue } from "../../../config/config"; -import { DatabaseParamsRecord } from "../../../utils/data_types"; +import { DatabaseParamsRecord } from "../../../utils/data-types"; /** * Defines the shape of the IoTDB configuration object. @@ -11,6 +11,7 @@ interface IotDBConfig { iotdbPassword: string; fetchSize: number; timeZoneId: string; + pollIntervalLenInSec: number; } /* @@ -42,6 +43,7 @@ const getDatabaseConfig = (): Readonly => { timeZoneId: getEnvValue("IOTDB_TIME_ZONE_ID") || Intl.DateTimeFormat().resolvedOptions().timeZone, + pollIntervalLenInSec: Number(getEnvValue("IOTDB_POLL_INTERVAL_LEN_IN_SEC")) || 5, }; return iotdb_config; diff --git a/cdsp/information-layer/handlers/src/iotdb/src/IoTDBHandler.ts b/cdsp/information-layer/handlers/src/iotdb/src/IoTDBHandler.ts index 3b8f82a..3514f7b 100644 --- a/cdsp/information-layer/handlers/src/iotdb/src/IoTDBHandler.ts +++ b/cdsp/information-layer/handlers/src/iotdb/src/IoTDBHandler.ts @@ -1,13 +1,11 @@ +import thrift from "thrift"; +import { Session } from "./Session"; +import { SubscriptionSimulator } from "./SubscriptionSimulator"; import { SupportedMessageDataTypes } from "./../utils/iotdb-constants"; const Client = require("../gen-nodejs/IClientRPCService"); const { - TSExecuteStatementReq, - TSOpenSessionReq, - TSProtocolVersion, - TSCloseSessionReq, TSInsertRecordReq, }: any = require("../gen-nodejs/client_types"); -import thrift from "thrift"; import { HandlerBase } from "../../HandlerBase"; import { SessionDataSet } from "../utils/SessionDataSet"; import { IoTDBDataInterpreter } from "../utils/IoTDBDataInterpreter"; @@ -22,22 +20,19 @@ import { logError, logErrorStr, logWithColor, - MessageType, COLORS, } from "../../../../utils/logger"; import { createErrorMessage } from "../../../../utils/error-message-helper"; -import { WebSocket, Message, STATUS_ERRORS } from "../../../utils/data_types"; +import { WebSocket, Message, STATUS_ERRORS, WebSocketWithId } from "../../../utils/data-types"; +import { transformSessionDataSet } from "../utils/database-helper"; export class IoTDBHandler extends HandlerBase { private client: any = null; private sendMessageToClients: | ((ws: WebSocket, message: Message) => void) | null = null; - private sessionId: number | null = null; - private readonly protocolVersion: any = - TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V3; - private statementId: number | null = null; - private fetchSize: number; + private session: Session; + private subscriptionSimulator: SubscriptionSimulator; private dataPointsSchema: SupportedDataPoints = {}; constructor() { @@ -45,7 +40,8 @@ export class IoTDBHandler extends HandlerBase { if (!databaseConfig) { throw new Error("Invalid database configuration."); } - this.fetchSize = databaseConfig?.fetchSize ?? 1000; + this.session = new Session(); + this.subscriptionSimulator = new SubscriptionSimulator(this.session, this.sendMessageToClient, this.createUpdateMessage); } async authenticateAndConnect( @@ -68,6 +64,7 @@ export class IoTDBHandler extends HandlerBase { ); this.client = thrift.createClient(Client, connection); + this.session.setClient(this.client); connection.on("error", (error: Error) => { logError("thrift connection error", error); @@ -83,14 +80,26 @@ export class IoTDBHandler extends HandlerBase { } } + protected subscribe(message: Message, ws: WebSocketWithId): void { + this.subscriptionSimulator.subscribe(message, ws); + } + + protected unsubscribe(message: Message, ws: WebSocketWithId): void { + this.subscriptionSimulator.unsubscribe(message, ws); + } + + unsubscribe_client(ws: WebSocketWithId): void { + this.subscriptionSimulator.unsubscribeClient(ws); + } + protected async read(message: Message, ws: WebSocket): Promise { if (this.areNodesValid(message, ws)) { try { - await this.openSessionIfNeeded(); + await this.session.openSession(); const responseNodes = await this.queryLastFields(message, ws); if (responseNodes.length > 0) { const responseMessage = this.createUpdateMessage( - message, + message.id, message.tree, message.uuid, responseNodes ); this.sendMessageToClient(ws, responseMessage); @@ -111,7 +120,7 @@ export class IoTDBHandler extends HandlerBase { createErrorMessage("read", STATUS_ERRORS.NOT_FOUND, errMsg) ); } finally { - await this.closeSessionIfNeeded(); + await this.session.closeSession(); } } } @@ -119,7 +128,7 @@ export class IoTDBHandler extends HandlerBase { protected async write(message: Message, ws: WebSocket): Promise { if (this.areNodesValid(message, ws)) { try { - await this.openSessionIfNeeded(); + await this.session.openSession(); const data = this.createObjectToInsert(message); let measurements: string[] = []; let dataTypes: string[] = []; @@ -155,7 +164,7 @@ export class IoTDBHandler extends HandlerBase { if (responseNodes.length) { const responseMessage = this.createUpdateMessage( - message, + message.id, message.tree, message.uuid, responseNodes ); this.sendMessageToClient(ws, responseMessage); @@ -180,98 +189,11 @@ export class IoTDBHandler extends HandlerBase { ) ); } finally { - await this.closeSessionIfNeeded(); + await this.session.closeSession(); } } } - /** - * Opens a session with the IoTDB server using the provided credentials and configuration. - */ - private async openSession(): Promise { - if (this.sessionId) { - logMessage("The session is already opened."); - return; - } - - const openSessionReq = new TSOpenSessionReq({ - username: databaseConfig!.iotdbUser, - password: databaseConfig!.iotdbPassword, - client_protocol: this.protocolVersion, - zoneId: databaseConfig!.timeZoneId, - configuration: { version: "V_0_13" }, - }); - - try { - if (!this.client) { - throw new Error("Client is not initialized"); - } - const resp = await this.client.openSession(openSessionReq); - - if (this.protocolVersion !== resp.serverProtocolVersion) { - logMessage( - "Protocol differ, Client version is " + - this.protocolVersion + - ", but Server version is " + - resp.serverProtocolVersion - ); - // version is less than 0.10 - if (resp.serverProtocolVersion === 0) { - throw new Error("Protocol not supported."); - } - } - - this.sessionId = resp.sessionId; - - if (!this.sessionId) { - throw new Error( - "Session ID is undefined, cannot request statement ID." - ); - } - - this.statementId = await this.client.requestStatementId(this.sessionId); - logMessage("Session started!"); - } catch (error: unknown) { - logError("Failed starting session with IoTDB", error); - } - } - - /** - * Closes the current session if it is not already closed. - */ - private async closeSession(): Promise { - if (!this.sessionId) { - logMessage("Session is already closed."); - return; - } - - const req = new TSCloseSessionReq({ sessionId: this.sessionId! }); - - try { - await this.client.closeSession(req); - } catch (error: unknown) { - logError( - "Error occurs when closing session at server. Maybe server is down. Error message", - error - ); - } finally { - this.sessionId = null; - logMessage("Session closed!"); - } - } - - private async openSessionIfNeeded(): Promise { - if (!this.sessionId) { - await this.openSession(); - } - } - - private async closeSessionIfNeeded(): Promise { - if (this.sessionId) { - this.closeSession(); - } - } - /** * Validates the nodes in a message against the schema of a media element. * @@ -305,54 +227,6 @@ export class IoTDBHandler extends HandlerBase { return true; } - /** - * Executes a SQL query statement asynchronously. - * - * @param sql - The SQL query statement to be executed. - * @returns - Returns a SessionDataSet object if the query is successful, - * otherwise returns an empty object. - * @throws - Throws an error if the session is not open. - */ - private async executeQueryStatement( - sql: string - ): Promise { - try { - if (!this.sessionId) { - throw new Error("Session is not open. Please authenticate first."); - } - if (!this.statementId) { - throw new Error("Missing statement ID"); - } - - const request = new TSExecuteStatementReq({ - sessionId: this.sessionId, - statement: sql, - statementId: this.statementId, - fetchSize: this.fetchSize, - timeout: 0, - }); - - const resp = await this.client.executeQueryStatement(request); - if (!resp || !resp.queryDataSet || !resp.queryDataSet.valueList) { - return {}; - } - return new SessionDataSet( - resp.columns, - resp.dataTypeList, - resp.columnNameIndexMap, - resp.queryId, - this.client, - this.statementId, - this.sessionId, - resp.queryDataSet, - resp.ignoreTimeStamp - ); - } catch (error: unknown) { - logError("Failed executing query statement", error); - throw error; - } - } - /** * Inserts a record into the time series database. * @param deviceId - The ID of the device. @@ -370,7 +244,7 @@ export class IoTDBHandler extends HandlerBase { values: any[], isAligned = false ): Promise { - if (!this.sessionId) { + if (!this.session.getSessionId()) { throw new Error("Session is not open. Please authenticate first."); } if ( @@ -397,7 +271,7 @@ export class IoTDBHandler extends HandlerBase { ); const request = new TSInsertRecordReq({ - sessionId: this.sessionId!, + sessionId: this.session.getSessionId()!, prefixPath: deviceId, measurements: measurements, values: valuesInBytes, @@ -436,7 +310,7 @@ export class IoTDBHandler extends HandlerBase { const sql = `SELECT ${fieldsToSearch} FROM ${databaseName} WHERE ${dataPointId} = '${objectId}' ORDER BY Time ASC`; try { - const sessionDataSet = await this.executeQueryStatement(sql); + const sessionDataSet = await this.session.executeQueryStatement(sql); // Check if sessionDataSet is not an instance of SessionDataSet, and handle the error if (!(sessionDataSet instanceof SessionDataSet)) { @@ -444,38 +318,8 @@ export class IoTDBHandler extends HandlerBase { "Failed to retrieve session data. Invalid session dataset." ); } - - const mediaElements: any[] = []; - while (sessionDataSet.hasNext()) { - mediaElements.push(sessionDataSet.next()); - } - - const latestValues: Record = {}; - mediaElements.forEach((mediaElement) => { - const transformedMediaElement = Object.fromEntries( - Object.entries(mediaElement).map(([key, value]) => { - const newKey = this.transformDataPointsWithDots(key); - return [newKey, value]; - }) - ); - - const transformedObject = - IoTDBDataInterpreter.extractNodesFromTimeseries( - transformedMediaElement, - databaseName - ); - - Object.entries(transformedObject).forEach(([key, value]) => { - if (value !== null && !isNaN(value)) { - latestValues[key] = value; - } - }); - }); - - return Object.entries(latestValues).map(([name, value]) => ({ - name, - value, - })); + return transformSessionDataSet(sessionDataSet, databaseName); + } catch (error: unknown) { const errMsg = error instanceof Error ? error.message : "Unknown error"; this.sendMessageToClient( diff --git a/cdsp/information-layer/handlers/src/iotdb/src/Session.ts b/cdsp/information-layer/handlers/src/iotdb/src/Session.ts new file mode 100644 index 0000000..baff40f --- /dev/null +++ b/cdsp/information-layer/handlers/src/iotdb/src/Session.ts @@ -0,0 +1,147 @@ +import { + TSOpenSessionReq, + TSCloseSessionReq, + TSProtocolVersion, + TSExecuteStatementReq, + } from "../gen-nodejs/client_types"; + import { logMessage, logError, logWithColor, COLORS } from "../../../../utils/logger"; + import { databaseConfig } from "../config/database-params"; + import { SessionDataSet } from "../utils/SessionDataSet"; + + const PROTOCOL_VERSION: number = TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V3; + + export class Session { + private client: any; + private sessionId: number | null = null; + private statementId: number | null = null; + private fetchSize: number; + + constructor() { + this.fetchSize = databaseConfig?.fetchSize ?? 1000; + } + + public getSessionId(): number | null { + return this.sessionId; + } + public getStatementId(): number | null { + return this.statementId; + } + public setClient(client: any) { + this.client = client; + } + + /** + * Opens a session with the IoTDB server using the provided credentials and configuration. + */ + async openSession(): Promise { + if (this.sessionId) { + logMessage("The session is already opened."); + return; + } + + const openSessionReq = new TSOpenSessionReq({ + username: databaseConfig!.iotdbUser, + password: databaseConfig!.iotdbPassword, + client_protocol: PROTOCOL_VERSION, + zoneId: databaseConfig!.timeZoneId, + configuration: { version: "V_0_13" }, + }); + + try { + const resp = await this.client.openSession(openSessionReq); + + if (PROTOCOL_VERSION !== resp.serverProtocolVersion) { + logMessage( + `Protocol differ, Client version is ${PROTOCOL_VERSION}, but Server version is ${resp.serverProtocolVersion}` + ); + if (resp.serverProtocolVersion === 0) { + throw new Error("Protocol not supported."); + } + } + + this.sessionId = resp.sessionId; + + if (!this.sessionId) { + throw new Error("Session ID is undefined, cannot request statement ID."); + } + + this.statementId = await this.client.requestStatementId(this.sessionId); + } catch (error: unknown) { + logError("Failed starting session with IoTDB", error); + } + } + + /** + * Closes the current session if it is not already closed. + */ + async closeSession(): Promise { + if (!this.sessionId) { + logMessage("Session is already closed."); + return; + } + + const req = new TSCloseSessionReq({ sessionId: this.sessionId! }); + + try { + await this.client.closeSession(req); + } catch (error: unknown) { + logError( + "Error occurs when closing session at server. Maybe server is down. Error message", + error + ); + } finally { + this.sessionId = null; + } + } + + + /** + * Executes a SQL query statement asynchronously. + * + * @param sql - The SQL query statement to be executed. + * @returns - Returns a SessionDataSet object if the query is successful, + * otherwise returns an empty object. + * @throws - Throws an error if the session is not open. + */ + async executeQueryStatement( + sql: string + ): Promise { + try { + if (!this.sessionId) { + throw new Error("Session is not open. Please authenticate first."); + } + if (!this.statementId) { + throw new Error("Missing statement ID"); + } + + const request = new TSExecuteStatementReq({ + sessionId: this.sessionId, + statement: sql, + statementId: this.statementId, + fetchSize: this.fetchSize, + timeout: 0, + }); + + const resp = await this.client.executeQueryStatement(request); + if (!resp || !resp.queryDataSet || !resp.queryDataSet.valueList) { + return {}; + } + return new SessionDataSet( + resp.columns, + resp.dataTypeList, + resp.columnNameIndexMap, + resp.queryId, + this.client, + this.statementId, + this.sessionId, + resp.queryDataSet, + resp.ignoreTimeStamp + ); + } catch (error: unknown) { + logError("Failed executing query statement", error); + throw error; + } + } + + } + \ No newline at end of file diff --git a/cdsp/information-layer/handlers/src/iotdb/src/SubscriptionSimulator.ts b/cdsp/information-layer/handlers/src/iotdb/src/SubscriptionSimulator.ts new file mode 100644 index 0000000..854bc6f --- /dev/null +++ b/cdsp/information-layer/handlers/src/iotdb/src/SubscriptionSimulator.ts @@ -0,0 +1,253 @@ +import { logMessage, logError, logErrorStr } from "../../../../utils/logger"; +import { databaseConfig, databaseParams } from "../config/database-params"; +import { Session } from "./Session"; +import { SessionDataSet } from "../utils/SessionDataSet"; +import { WebSocketWithId, Message, MessageBase, ErrorMessage, STATUS_ERRORS} from "../../../utils/data-types"; +import { createErrorMessage } from "../../../../utils/error-message-helper"; +import { transformSessionDataSet } from "../utils/database-helper"; + +type SubscriptionMap = Map; + +const RANDOM_STRING = ""; +const TREE_VSS = "VSS"; + +export class SubscriptionSimulator { + private intervalId: NodeJS.Timeout | null = null; + private session: Session; + private timeIntervalLowerLimit: number | undefined = undefined; + private subscriptions: SubscriptionMap = new Map(); + private sendMessageToClient: ( ws: WebSocketWithId, message: Message | MessageBase | ErrorMessage) => void; + private createUpdateMessage: (id: string, tree: string, uuid: string, nodes: Array<{ name: string; value: any }>) => Message; + + constructor(session: Session, + sendMessageToClient: (ws: WebSocketWithId, message: Message | MessageBase | ErrorMessage) => void, + createUpdateMessage: (id: string, tree: string, uuid: string, nodes: Array<{ name: string; value: any }>) => Message) + { + this.session = session; + this.notifyDatabaseChanges = this.notifyDatabaseChanges.bind(this); + this.sendMessageToClient = sendMessageToClient; + this.createUpdateMessage = createUpdateMessage; + } + + /** + * Creates a new subscription for the given websocket. + * + * A subscription is identified by an id/tree combination key. + * An associated client is represented by a websocket. + * If a subscription with this key does not exist, it is created with the client. + * If such a subscription already exists, but not for the given client, the client is added to the sunscription. + * If the subscription exists with this client, an error message is sent. + * If a subscription was created and there is no timer yet, a timer is started. + * @param message subscribe message + * @param wsOfNewSubscription websocket representing a client to be associated with the new subscription + * @returns void + */ + subscribe(message: Message, wsOfNewSubscription: WebSocketWithId): void { + const key = `${message.id}-${message.tree}`; + const websockets = this.subscriptions.get(key); + + if (websockets && websockets.some(ws => ws.id === wsOfNewSubscription.id)) { + this.sendMessageToClient(wsOfNewSubscription, + createErrorMessage( + "subscribe", + STATUS_ERRORS.BAD_REQUEST, + `Subscription already done to id ${message.id} and tree ${message.tree} for connection ${wsOfNewSubscription.id}`)); + return; + } + if (websockets) { + websockets.push(wsOfNewSubscription); + } else { + this.subscriptions.set(key, [wsOfNewSubscription]); + } + + if (this.intervalId === null) { + this.intervalId = setInterval(this.notifyDatabaseChanges, databaseConfig!.pollIntervalLenInSec * 1000); + this.intervalId.unref(); // Ensure timer doesn't keep the process alive + this.timeIntervalLowerLimit = Date.now(); + logMessage("started timer"); + } + logMessage("subscribed"); + this.logSubscriptions(); + } + + /** + * Removes a subscription for the given websocket. + * + * A subscription is identified by an id/tree combination key. + * An associated client is represented by a websocket. + * If a subscription with this key exists for the given client, the client is removed from the subscription. + * If there is no other client left for this subscription, the entire subscription is removed. + * If subscription does not exist, an error message is sent. + * If no subscription is left, the timer is stopped. + * @param message unsubscribe message + * @param wsOfSubscriptionToBeDeleted websocket to be removed from subscription + * @returns void + */ + unsubscribe(message: Message, wsOfSubscriptionToBeDeleted: WebSocketWithId): void { + const key = `${message.id}-${message.tree}`; + const websockets = this.subscriptions.get(key); + + if (!websockets) { + this.sendMessageToClient(wsOfSubscriptionToBeDeleted, + createErrorMessage( + "subscribe", + STATUS_ERRORS.BAD_REQUEST, + `Cannot unsubscribe. No subscription for id ${message.id}, tree ${message.tree} for connection ${wsOfSubscriptionToBeDeleted.id}.`)); + return; + } + const index = websockets.indexOf(wsOfSubscriptionToBeDeleted); + if (index > -1) { + websockets.splice(index, 1); + if (websockets.length === 0) { + this.subscriptions.delete(key); + } + } + + this.removeTimerIfNoSubscription(); + logMessage("unsubscribed"); + this.logSubscriptions(); + } + + /** + * Removes all subscriptions for a client. + * + * Checks all subscriptions and removes the given client from each of them. + * If a subscription is left with no client, the entire subscription is removed. + * If no subscription is left, the timer is stopped. + * @param ws websocket representing a client to be removed from all subscriptions + */ + unsubscribeClient(ws: WebSocketWithId): void { + this.removeWebSocketFromSubscriptions(ws); + this.removeTimerIfNoSubscription(); + logMessage("unsubscribed client"); + this.logSubscriptions(); + } + + /** + * Removes the timer if there is no subscription left. + */ + private removeTimerIfNoSubscription() { + if (this.intervalId !== null && + this.subscriptions.size === 0) { + clearInterval(this.intervalId); + this.intervalId = null; + this.timeIntervalLowerLimit = undefined; + logMessage("stopped timer"); + } + } + + /** + * Logs all subscriptions with their associated clients on the console. + * Clients are represented by the ID of the websocket. + */ + private logSubscriptions() : void { + let logString = "subscriptions:\n"; + for (const [key, websockets] of this.subscriptions.entries()) { + logString += `${key} ws ids: \n`; + websockets.forEach(ws => + logString += ` ${ws.id} \n` + ) + }; + logMessage(logString); + } + + /** + * Notifies subscribed clients about changes on data points during the last time interval. + * + * Checks for each subscription if there has been a change on the related data point in the last time interval. + * For each change, it sends an update message for each client subscribed for this data point. + * + * @returns void + */ + private async notifyDatabaseChanges() : Promise { + if (!this.timeIntervalLowerLimit) { + logErrorStr("time of last check is undefined. Cannot go for notifications."); + return; + } + + const timeIntervalUpperLimit = Date.now(); + await this.session.openSession(); + for (const [key, websockets] of this.subscriptions.entries()) { + const [id, tree] = key.split('-'); + + const updateMessage = await this.checkForChanges(id, timeIntervalUpperLimit); + if (updateMessage) { + websockets.forEach(ws => + this.sendMessageToClient(ws, updateMessage) + ); + } + } + await this.session.closeSession(); + this.timeIntervalLowerLimit = timeIntervalUpperLimit; + } + + /** + * Checks for changes for the given id in the last time interval. + * For each change it creates an update message for each client subscribed for this data point + * and returns the update message. + * + * @param id ID to be checked + * @param timeIntervalUpperLimit the upper limit of the time interval to be checked + * @returns generated update message + */ + private async checkForChanges(id: string, timeIntervalUpperLimit: number): Promise { + const { databaseName, dataPointId } = + databaseParams[TREE_VSS as keyof typeof databaseParams]; + + const sql = `SELECT * FROM ${databaseName} + WHERE ${dataPointId} = '${id}' + AND Time > ${this.timeIntervalLowerLimit} AND Time <= ${timeIntervalUpperLimit} + ORDER BY Time ASC`; + let updateMessage = undefined; + try { + const sessionDataSet = await this.session.executeQueryStatement(sql); + + // Check if sessionDataSet is not an instance of SessionDataSet, and handle the error + if (!(sessionDataSet instanceof SessionDataSet)) { + throw new Error( + "Failed to retrieve session data. Invalid session dataset." + ); + } + + const responseNodes = transformSessionDataSet(sessionDataSet, databaseName); + if (responseNodes.length > 0) { + updateMessage = this.createUpdateMessage( + id, "VSS", RANDOM_STRING, + responseNodes + ); + } + logMessage(`Processed ${responseNodes.length} changes for id ${id}`); + + } catch (error: unknown) { + logError("Unknown error", error); + } finally { + return updateMessage; + } + } + + /** + * Removes client from all subscriptions. + * + * Checks all subscriptions and removes the given client from each of them. + * If a subscription is left with no client, the entire subscription is removed. + * @param webSocketToBeRemoved websocket representing the client to be removed + */ + private removeWebSocketFromSubscriptions( + webSocketToBeRemoved: WebSocketWithId + ): void { + for (const [key, websockets] of this.subscriptions.entries()) { + // Find the index of the target WebSocket in the websockets array + const wsIndex = websockets.findIndex(ws => ws.id === webSocketToBeRemoved.id); + + // If found, remove the WebSocket from the array + if (wsIndex !== -1) { + websockets.splice(wsIndex, 1); // Remove the WebSocket at wsIndex + + // If websockets array is now empty, delete the subscription + if (websockets.length === 0) { + this.subscriptions.delete(key); + } + } + } + } +} diff --git a/cdsp/information-layer/handlers/src/iotdb/utils/database-helper.ts b/cdsp/information-layer/handlers/src/iotdb/utils/database-helper.ts new file mode 100644 index 0000000..32850b2 --- /dev/null +++ b/cdsp/information-layer/handlers/src/iotdb/utils/database-helper.ts @@ -0,0 +1,54 @@ +import { SessionDataSet } from "./SessionDataSet"; +import { IoTDBDataInterpreter } from "./IoTDBDataInterpreter"; + +/** + * Transforms a session data set to a set with the latest values of a vehicle. + * + * @param sessionDataSet the session data set to be transformed + * @param databaseName database name to be replaced during transformation + * @returns set of latest values of a vehicle + */ +export function transformSessionDataSet( + sessionDataSet: SessionDataSet, + databaseName: string + ): Array<{ name: string; value: any }> { + const mediaElements: any[] = []; + while (sessionDataSet.hasNext()) { + mediaElements.push(sessionDataSet.next()); + } + + const latestValues: Record = {}; + mediaElements.forEach((mediaElement) => { + const transformedMediaElement = Object.fromEntries( + Object.entries(mediaElement).map(([key, value]) => { + const newKey = transformDataPointsWithDots(key); + return [newKey, value]; + }) + ); + + const transformedObject = IoTDBDataInterpreter.extractNodesFromTimeseries( + transformedMediaElement, + databaseName + ); + + Object.entries(transformedObject).forEach(([key, value]) => { + if (value !== null && !isNaN(value)) { + latestValues[key] = value; + } + }); + }); + + return Object.entries(latestValues).map(([name, value]) => ({ + name, + value, + })); + } + + /** + * Transforms a database field name by replacing underscores with dots. + * @param field - The database filed to transform. + * @returns - The transformed to message node replacing underscores by dots. + */ + function transformDataPointsWithDots(field: string): string { + return field.replace(/\_/g, "."); + } diff --git a/cdsp/information-layer/handlers/src/realmdb/config/database-params.ts b/cdsp/information-layer/handlers/src/realmdb/config/database-params.ts index f1c5e64..f6f0876 100644 --- a/cdsp/information-layer/handlers/src/realmdb/config/database-params.ts +++ b/cdsp/information-layer/handlers/src/realmdb/config/database-params.ts @@ -1,5 +1,5 @@ import { getEnvValue } from "../../../config/config"; -import { DatabaseParamsRecord } from "../../../utils/data_types"; +import { DatabaseParamsRecord } from "../../../utils/data-types"; interface RealmDBConfig { storePath: string; diff --git a/cdsp/information-layer/handlers/src/realmdb/src/RealmDbHandler.ts b/cdsp/information-layer/handlers/src/realmdb/src/RealmDbHandler.ts index 37e3c46..e5e78b5 100644 --- a/cdsp/information-layer/handlers/src/realmdb/src/RealmDbHandler.ts +++ b/cdsp/information-layer/handlers/src/realmdb/src/RealmDbHandler.ts @@ -12,7 +12,7 @@ import { logErrorStr, } from "../../../../utils/logger"; import { createErrorMessage } from "../../../../utils/error-message-helper"; -import { WebSocket, Message, STATUS_ERRORS } from "../../../utils/data_types"; +import { WebSocket, Message, STATUS_ERRORS } from "../../../utils/data-types"; // Define a type for changes interface Changes { @@ -373,7 +373,7 @@ export class RealmDBHandler extends HandlerBase { ); const responseNodes = this.parseReadResponse(message, mediaElement); - return this.createUpdateMessage(message, responseNodes); + return this.createUpdateMessage(message.id, message.tree, message.uuid, responseNodes); } /** @@ -453,7 +453,7 @@ export class RealmDBHandler extends HandlerBase { mediaElement ); const updateMessage = this.createUpdateMessage( - messageHeader, + messageHeader.id, messageHeader.tree, messageHeader.uuid, responseNodes ); this.sendMessageToClient(ws, updateMessage); diff --git a/cdsp/information-layer/handlers/utils/data_types.ts b/cdsp/information-layer/handlers/utils/data-types.ts similarity index 94% rename from cdsp/information-layer/handlers/utils/data_types.ts rename to cdsp/information-layer/handlers/utils/data-types.ts index 9e2fd84..470b8d8 100644 --- a/cdsp/information-layer/handlers/utils/data_types.ts +++ b/cdsp/information-layer/handlers/utils/data-types.ts @@ -47,6 +47,10 @@ export interface WebSocket { send: (data: string) => void; } +export interface WebSocketWithId extends WebSocket { + id: string; +} + export interface DataPointSchema { [key: string]: any; } diff --git a/cdsp/information-layer/router/src/websocket-server.ts b/cdsp/information-layer/router/src/websocket-server.ts index aa6f93a..f74afb7 100644 --- a/cdsp/information-layer/router/src/websocket-server.ts +++ b/cdsp/information-layer/router/src/websocket-server.ts @@ -1,3 +1,4 @@ +import { v4 as uuidv4 } from 'uuid'; import WebSocket, { RawData } from "ws"; import { RealmDBHandler } from "../../handlers/src/realmdb/src/RealmDbHandler"; import { IoTDBHandler } from "../../handlers/src/iotdb/src/IoTDBHandler"; @@ -11,7 +12,7 @@ import { MessageType, COLORS, } from "../../utils/logger"; -import { Message } from "../../handlers/utils/data_types"; +import { Message, WebSocketWithId } from "../../handlers/utils/data-types"; // Define the handler as the base class type let handler: HandlerBase; @@ -35,13 +36,17 @@ switch (handlerType) { // WebSocket server creation const server = new WebSocket.Server({ port: 8080 }); -// Define clients array globally to store connected clients -let clients: WebSocket[] = []; +// Define clients Map globally to store connected clients +const clients = new Map(); // Handle new client connections server.on("connection", (ws: WebSocket) => { - logWithColor("* Client connected *", COLORS.YELLOW); - clients.push(ws); // Add client to the array + // add a uuid to the websocket connection + const connectionId = uuidv4(); + const wsWithId = ws as unknown as WebSocketWithId; + wsWithId.id = connectionId; + clients.set(connectionId, ws); // Add client to the Map + logWithColor(`Client connected with id ${connectionId}`, COLORS.YELLOW); // Handle messages from the client ws.on("message", (message: WebSocket.RawData) => { @@ -56,15 +61,15 @@ server.on("connection", (ws: WebSocket) => { }); } else { // Pass the validated message to the handler - handler.handleMessage(validatedMessage, ws); + handler.handleMessage(validatedMessage, connectionId, wsWithId); } }); // Handle client disconnection ws.on("close", () => { handler.unsubscribe_client(ws); // Remove all client listeners - clients = clients.filter((client) => client !== ws); // Remove client from array - logMessage("* Client disconnected *"); + clients.delete(connectionId); + logWithColor(`Client disconnected with ID ${connectionId}`, COLORS.ORANGE); }); }); diff --git a/cdsp/information-layer/router/utils/message-validator.ts b/cdsp/information-layer/router/utils/message-validator.ts index 4b24385..f9b5f3d 100644 --- a/cdsp/information-layer/router/utils/message-validator.ts +++ b/cdsp/information-layer/router/utils/message-validator.ts @@ -4,7 +4,7 @@ import { ErrorMessage, Message, STATUS_ERRORS, -} from "../../handlers/utils/data_types"; +} from "../../handlers/utils/data-types"; // Initialize AJV with specific options const ajv = new Ajv({ diff --git a/cdsp/information-layer/utils/error-message-helper.ts b/cdsp/information-layer/utils/error-message-helper.ts index 48d6218..145ef97 100644 --- a/cdsp/information-layer/utils/error-message-helper.ts +++ b/cdsp/information-layer/utils/error-message-helper.ts @@ -1,4 +1,4 @@ -import { ErrorMessage } from "../handlers/utils/data_types"; +import { ErrorMessage } from "../handlers/utils/data-types"; /** * Creates an error message object with the specified category, status code, and message. diff --git a/cdsp/information-layer/utils/logger.ts b/cdsp/information-layer/utils/logger.ts index da127d0..b3f3577 100644 --- a/cdsp/information-layer/utils/logger.ts +++ b/cdsp/information-layer/utils/logger.ts @@ -7,6 +7,7 @@ export enum COLORS { PALE_WHITE = "\x1b[37m", GREY = "\x1b[90m", YELLOW = "\x1b[33m", + ORANGE = "\x1b[38;5;208m", BOLD = "\x1b[1m", } From 21236aab76172a2385f82db78ee617e3194c5af8 Mon Sep 17 00:00:00 2001 From: Christian Muehlbauer Date: Wed, 13 Nov 2024 13:25:55 +0100 Subject: [PATCH 43/48] Locate another transformation function in transformations.ts, too transform underlines to dots Signed-off-by: Christian Muehlbauer --- .../handlers/src/HandlerBase.ts | 15 ++++----------- .../handlers/src/iotdb/src/IoTDBHandler.ts | 9 +++++---- .../src/iotdb/utils/database-helper.ts | 12 ++---------- .../handlers/src/realmdb/src/RealmDbHandler.ts | 7 ++++--- .../handlers/utils/transformations.ts | 18 ++++++++++++++++++ 5 files changed, 33 insertions(+), 28 deletions(-) create mode 100644 cdsp/information-layer/handlers/utils/transformations.ts diff --git a/cdsp/information-layer/handlers/src/HandlerBase.ts b/cdsp/information-layer/handlers/src/HandlerBase.ts index 352e1bf..92d14cc 100644 --- a/cdsp/information-layer/handlers/src/HandlerBase.ts +++ b/cdsp/information-layer/handlers/src/HandlerBase.ts @@ -10,6 +10,8 @@ import { } from "../utils/data-types"; import { getDataPointsPath } from "../config/config"; import { logMessage, MessageType } from "../../utils/logger"; +import { transformDataPointsWithUnderscores } from "../utils/transformations"; + export abstract class HandlerBase { // Default implementations of required functions @@ -120,15 +122,6 @@ export abstract class HandlerBase { }; } - /** - * Transforms a message node by replacing dots with underscores. - * @param node - The message node to transform. - * @returns - The transformed message node with dots replaced by underscores. - */ - protected transformDataPointsWithUnderscores(node: string): string { - return node.replace(/\./g, "_"); - } - /** * Reads and parses a data points file in either JSON, YML, or YAML format. */ @@ -188,7 +181,7 @@ export abstract class HandlerBase { const supportedDataPoints = this.extractDataTypes(dataPointObj); const result: { [key: string]: any } = {}; Object.entries(supportedDataPoints).forEach(([node, value]) => { - const underscored_node = this.transformDataPointsWithUnderscores(node); + const underscored_node = transformDataPointsWithUnderscores(node); if (value !== null) { result[underscored_node] = value; } @@ -210,7 +203,7 @@ export abstract class HandlerBase { const nodes = message.node ? [message.node] : message.nodes || []; const unknownFields = nodes.filter(({ name }) => { - const transformedName = this.transformDataPointsWithUnderscores(name); + const transformedName = transformDataPointsWithUnderscores(name); return !dataPointsSchema.hasOwnProperty(transformedName); }); diff --git a/cdsp/information-layer/handlers/src/iotdb/src/IoTDBHandler.ts b/cdsp/information-layer/handlers/src/iotdb/src/IoTDBHandler.ts index 3514f7b..4f271e8 100644 --- a/cdsp/information-layer/handlers/src/iotdb/src/IoTDBHandler.ts +++ b/cdsp/information-layer/handlers/src/iotdb/src/IoTDBHandler.ts @@ -25,6 +25,7 @@ import { import { createErrorMessage } from "../../../../utils/error-message-helper"; import { WebSocket, Message, STATUS_ERRORS, WebSocketWithId } from "../../../utils/data-types"; import { transformSessionDataSet } from "../utils/database-helper"; +import { transformDataPointsWithUnderscores } from "../../../utils/transformations"; export class IoTDBHandler extends HandlerBase { private client: any = null; @@ -344,11 +345,11 @@ export class IoTDBHandler extends HandlerBase { if (message.node) { dataPoints.push( - this.transformDataPointsWithUnderscores(message.node.name) + transformDataPointsWithUnderscores(message.node.name) ); } else if (message.nodes) { dataPoints = message.nodes.map((node) => - this.transformDataPointsWithUnderscores(node.name) + transformDataPointsWithUnderscores(node.name) ); } return dataPoints; @@ -372,11 +373,11 @@ export class IoTDBHandler extends HandlerBase { const data: Record = { [dataPointId]: id }; if (message.node) { - data[this.transformDataPointsWithUnderscores(message.node.name)] = + data[transformDataPointsWithUnderscores(message.node.name)] = message.node.value; } else if (message.nodes) { message.nodes.forEach((node) => { - data[this.transformDataPointsWithUnderscores(node.name)] = node.value; + data[transformDataPointsWithUnderscores(node.name)] = node.value; }); } return data; diff --git a/cdsp/information-layer/handlers/src/iotdb/utils/database-helper.ts b/cdsp/information-layer/handlers/src/iotdb/utils/database-helper.ts index 32850b2..18433e6 100644 --- a/cdsp/information-layer/handlers/src/iotdb/utils/database-helper.ts +++ b/cdsp/information-layer/handlers/src/iotdb/utils/database-helper.ts @@ -1,5 +1,6 @@ import { SessionDataSet } from "./SessionDataSet"; import { IoTDBDataInterpreter } from "./IoTDBDataInterpreter"; +import { transformDataPointsWithDots } from "../../../utils/transformations"; /** * Transforms a session data set to a set with the latest values of a vehicle. @@ -42,13 +43,4 @@ export function transformSessionDataSet( name, value, })); - } - - /** - * Transforms a database field name by replacing underscores with dots. - * @param field - The database filed to transform. - * @returns - The transformed to message node replacing underscores by dots. - */ - function transformDataPointsWithDots(field: string): string { - return field.replace(/\_/g, "."); - } + } \ No newline at end of file diff --git a/cdsp/information-layer/handlers/src/realmdb/src/RealmDbHandler.ts b/cdsp/information-layer/handlers/src/realmdb/src/RealmDbHandler.ts index e5e78b5..2d103f4 100644 --- a/cdsp/information-layer/handlers/src/realmdb/src/RealmDbHandler.ts +++ b/cdsp/information-layer/handlers/src/realmdb/src/RealmDbHandler.ts @@ -13,6 +13,7 @@ import { } from "../../../../utils/logger"; import { createErrorMessage } from "../../../../utils/error-message-helper"; import { WebSocket, Message, STATUS_ERRORS } from "../../../utils/data-types"; +import { transformDataPointsWithDots, transformDataPointsWithUnderscores } from "../../../utils/transformations"; // Define a type for changes interface Changes { @@ -32,7 +33,7 @@ function parseOnMediaElementChangeResponse( mediaElement: any ) { return changes.changedProperties.map((prop) => ({ - name: prop, + name: transformDataPointsWithDots(prop), value: mediaElement[prop], })); } @@ -109,7 +110,7 @@ export class RealmDBHandler extends HandlerBase { const transformAndAssign = (element: any, nodes: any[]) => { nodes.forEach(({ name, value }) => { - const prop = this.transformDataPointsWithUnderscores(name); + const prop = transformDataPointsWithUnderscores(name); element[prop] = value; }); }; @@ -391,7 +392,7 @@ export class RealmDBHandler extends HandlerBase { const data: { name: string; value: any }[] = []; const nodes = message.node ? [message.node] : message.nodes; nodes?.forEach((node: any) => { - const prop = this.transformDataPointsWithUnderscores(node.name); + const prop = transformDataPointsWithUnderscores(node.name); data.push({ name: node.name, value: queryResponseObj[prop], diff --git a/cdsp/information-layer/handlers/utils/transformations.ts b/cdsp/information-layer/handlers/utils/transformations.ts new file mode 100644 index 0000000..8f4f931 --- /dev/null +++ b/cdsp/information-layer/handlers/utils/transformations.ts @@ -0,0 +1,18 @@ + /** + * Transforms a database field name by replacing underscores with dots. + * @param field - The database filed to transform. + * @returns - The transformed to message node replacing underscores by dots. + */ + export function transformDataPointsWithDots(field: string): string { + return field.replace(/\_/g, "."); + } + + /** + * Transforms a message node by replacing dots with underscores. + * @param node - The message node to transform. + * @returns - The transformed message node with dots replaced by underscores. + */ + export function transformDataPointsWithUnderscores(node: string): string { + return node.replace(/\./g, "_"); + } + From 9693e64f08ebf9d29b4e6e2f86645a342cbe0d49 Mon Sep 17 00:00:00 2001 From: Christian Muehlbauer Date: Wed, 13 Nov 2024 14:24:31 +0100 Subject: [PATCH 44/48] Add instruction how to build and run tests only log if there have been changes Bugfix: copy tsconfig.json add a test Review: small changes Add configuration variable for polling interval in readme new unit tests, supress logger in tests More type safety when converting websocket Setup ubit tests with jest. write tests for SubscriptionSimulator Signed-off-by: Christian Muehlbauer --- cdsp/information-layer/Dockerfile | 1 + cdsp/information-layer/README.md | 19 ++ .../handlers/src/iotdb/README.md | 3 +- .../iotdb/src/SubscriptionSimulator.test.ts | 316 ++++++++++++++++++ .../src/iotdb/src/SubscriptionSimulator.ts | 6 +- .../src/iotdb/utils/database-helper.test.ts | 46 +++ cdsp/information-layer/jest.config.js | 8 + cdsp/information-layer/package-lock.json | 287 +++------------- cdsp/information-layer/package.json | 6 +- .../router/src/websocket-server.ts | 10 +- cdsp/information-layer/utils/logger.ts | 6 +- 11 files changed, 452 insertions(+), 256 deletions(-) create mode 100644 cdsp/information-layer/handlers/src/iotdb/src/SubscriptionSimulator.test.ts create mode 100644 cdsp/information-layer/handlers/src/iotdb/utils/database-helper.test.ts create mode 100644 cdsp/information-layer/jest.config.js diff --git a/cdsp/information-layer/Dockerfile b/cdsp/information-layer/Dockerfile index 495eebc..93cb984 100644 --- a/cdsp/information-layer/Dockerfile +++ b/cdsp/information-layer/Dockerfile @@ -3,6 +3,7 @@ FROM node:22.5.1 WORKDIR /app COPY package.json . +COPY tsconfig.json . COPY handlers ./handlers COPY utils ./utils COPY router ./router diff --git a/cdsp/information-layer/README.md b/cdsp/information-layer/README.md index 054d169..9f89808 100644 --- a/cdsp/information-layer/README.md +++ b/cdsp/information-layer/README.md @@ -22,6 +22,25 @@ flowchart LR # Hello World Setup +### Build the typescript application natively + +Make sure all libraries are installed +```bash +npm install +``` +Build the application +```bash +npm run build +``` +Run the unit tests +```bash +npx jest +``` +or +```bash +npx jest --verbose +``` + ## Backend Option 1: IoTDB ### Start the database diff --git a/cdsp/information-layer/handlers/src/iotdb/README.md b/cdsp/information-layer/handlers/src/iotdb/README.md index 88dc13f..1242c63 100644 --- a/cdsp/information-layer/handlers/src/iotdb/README.md +++ b/cdsp/information-layer/handlers/src/iotdb/README.md @@ -31,13 +31,14 @@ Create (if it does not exist) `/docker/.env` and add the following environment v # IOTDB CONFIGURATION # ####################### - # Access to iotdb-service. All this are optional, they have an predefine default value + # Access to iotdb-service. All these are optional, they have an predefine default value IOTDB_HOST="your-iotdb-host" # Docker container name for IoTDB or host, default container name "iotdb-service" IOTDB_PORT=6667 # Set this to the appropriate IotDB Port, default "6667" IOTDB_USER="your-iotdb-user" # Default "root" IOTDB_PASSWORD="your-iotdb-password" # Default "root" IOTDB_TIMEZONE="your-time-zone" # Default your local configured time zone FETCH_SIZE=10000 #number of rows that will be fetched from the database at a time when executing a query, default 10000 + IOTDB_POLL_INTERVAL_LEN_IN_SEC=5 #number of seconds of interval to poll for changes on the IoTDB ``` > [!WARNING] diff --git a/cdsp/information-layer/handlers/src/iotdb/src/SubscriptionSimulator.test.ts b/cdsp/information-layer/handlers/src/iotdb/src/SubscriptionSimulator.test.ts new file mode 100644 index 0000000..69a9b07 --- /dev/null +++ b/cdsp/information-layer/handlers/src/iotdb/src/SubscriptionSimulator.test.ts @@ -0,0 +1,316 @@ +jest.mock("../config/database-params", () => ({ + ...jest.requireActual("../config/database-params"), + databaseConfig: { + iotdbHost: "mock-host", + iotdbPort: 5678, + iotdbUser: "mock-user", + iotdbPassword: "mock-password", + fetchSize: 2000, + timeZoneId: "UTC", + pollIntervalLenInSec: 15, // Mocked interval for the test + }, +})); + +import { SubscriptionSimulator } from './SubscriptionSimulator'; +import { WebSocketWithId, Message } from '../../../utils/data-types'; +import { Session } from './Session'; +import { SessionDataSet } from "../utils/SessionDataSet"; +import { transformSessionDataSet } from "../utils/database-helper"; +import { IoTDBDataType } from '../utils/iotdb-constants'; + +// Mock the module where transformSessionDataSet is defined +jest.mock('../utils/database-helper', () => ({ + transformSessionDataSet: jest.fn(), // Ensure transformSessionDataSet is a mock function +})); + +describe('SubscriptionSimulator', () => { + let simulator: SubscriptionSimulator; + let mockSession: Session; + let mockWebSocket: WebSocketWithId; + let mockMessage: Message; + let mockKey: string; + let sendMessageToClientMock: jest.Mock; + let mockSessionDataSet: jest.Mocked; + + beforeEach(() => { + mockSession = new Session(); + + sendMessageToClientMock = jest.fn(); + simulator = new SubscriptionSimulator(mockSession, sendMessageToClientMock, jest.fn()); + + mockWebSocket = { id: 'ws1' } as WebSocketWithId; + mockMessage = { id: 'vehicle123', tree: 'VSS' } as Message; + mockKey = `${mockMessage.id}-${mockMessage.tree}`; + }); + + afterEach(() => { + jest.clearAllMocks(); + if (simulator["intervalId"]) { + clearInterval(simulator["intervalId"]); + simulator["intervalId"] = null; // Reset intervalId + } + jest.clearAllTimers(); // Clear any remaining active timers + }); + + /* + * subscribe + */ + + + test('calls sendMessageToClient if subscription with same WebSocket already exists', () => { + // Arrange: Manually add a subscription to simulate the "already exists" condition + simulator['subscriptions'].set(mockKey, [mockWebSocket]); + + // Act: Call subscribe with the existing WebSocket and message key + simulator.subscribe(mockMessage, mockWebSocket); + + // Assert: Check that sendMessageToClient was called with the expected error message + expect(sendMessageToClientMock).toHaveBeenCalledWith( + mockWebSocket, + expect.objectContaining({ + category: 'subscribe', + statusCode: 400, + message: expect.stringContaining('Subscription already done') + }) + ); + }); + + test('Creates a new subscription if no subscription with that key exists', () => { + // Arrange: Add a subscription with another key and the same websocket + const key = `otherId-${mockMessage.tree}`; + simulator['subscriptions'].set(key, [mockWebSocket]); + + // Act: Call subscribe with the existing WebSocket and another message key + simulator.subscribe(mockMessage, mockWebSocket); + + // Assert: Check that a new subscription was added + expect(simulator['subscriptions'].size).toBe(2); + expect(simulator['subscriptions'].has(mockKey)).toBe(true); + }); + + test('Adds a websocket to an existing subscription if websocket is not there yet', () => { + // Arrange: Add a subscription with same key and different websocket + const otherWebsocket = { id: 'otherWs' } as WebSocketWithId; + simulator['subscriptions'].set(mockKey, [otherWebsocket]); + + // Act: Call subscribe with another WebSocket and existing message key + simulator.subscribe(mockMessage, mockWebSocket); + + // Assert: Check that the existing subscription has a new websocket + expect(simulator['subscriptions'].size).toBe(1); + expect(simulator['subscriptions'].get(mockKey)?.length).toBe(2); + expect(simulator['subscriptions'].get(mockKey)).toEqual(expect.arrayContaining([otherWebsocket, mockWebSocket])); + }); + + test('starts a timer if no intervalId is set', () => { + // Arrange: Ensure there is no active interval + simulator['intervalId'] = null; + + // Act: Call subscribe to trigger the timer start + simulator.subscribe(mockMessage, mockWebSocket); + + // Assert: Check that intervalId is no longer null + expect(simulator['intervalId']).not.toBeNull(); + }); + + /* + * unsubscribe + */ + + test('remove websocket from existing subscription if websocket and subscription exist', () => { + // Arrange: Add a subscription with same key and same websocket + 1 other websocket + const otherWebsocket = { id: 'otherWs' } as WebSocketWithId; + simulator['subscriptions'].set(mockKey, [otherWebsocket, mockWebSocket]); + + // Act: Call subscribe with existing WebSocket and message key + simulator.unsubscribe(mockMessage, mockWebSocket); + + // Assert: Check that the subscription exists with only the other websocket left + expect(simulator['subscriptions'].size).toBe(1); + expect(simulator['subscriptions'].get(mockKey)).toEqual([otherWebsocket]); + }); + + test('remove subscription if websocket is the last one', () => { + // Arrange: Add a subscription with same key and same websocket + simulator['subscriptions'].set(mockKey, [mockWebSocket]); + + // Act: Call unsubscribe with existing WebSocket and message key + simulator.unsubscribe(mockMessage, mockWebSocket); + + // Assert: Check that the subscription has been removed + expect(simulator['subscriptions'].size).toBe(0); + }); + + test('calls sendMessageToClient if unsubscribe is done on non-existing subscription', () => { + // Arrange: Manually add a subscription with another key + const key = `otherId-${mockMessage.tree}`; + simulator['subscriptions'].set(key, [mockWebSocket]); + + // Act: Call unsubscribe with existing WebSocket and non-existing message key + simulator.unsubscribe(mockMessage, mockWebSocket); + + // Assert: Check that sendMessageToClient was called with the expected error message + expect(sendMessageToClientMock).toHaveBeenCalledWith( + mockWebSocket, + expect.objectContaining({ + category: 'unsubscribe', + statusCode: 400, + message: expect.stringContaining('Cannot unsubscribe') + }) + ); + }); + + test('stops the timer if there is no subscription left', () => { + // Arrange: create a subscription to start the timer + simulator.subscribe(mockMessage, mockWebSocket); + expect(simulator['intervalId']).not.toBeNull(); + + // Act: Call unsubscribe to trigger the timer removal + simulator.unsubscribe(mockMessage, mockWebSocket); + + // Assert: Check that intervalId is null + expect(simulator['intervalId']).toBeNull(); + }); + + /* + * unsubscribeClient + */ + + test('remove only subscriptions of one websocket', () => { + // Arrange: Add some subscriptions with different websockets + const otherWebsocket = { id: 'otherWs' } as WebSocketWithId; + simulator['subscriptions'].set('key-this-and-other', [otherWebsocket, mockWebSocket]); + simulator['subscriptions'].set('key-only-this', [mockWebSocket]); + simulator['subscriptions'].set('key-only-other', [otherWebsocket]); + + // Act: Call unsubscribeClient with existing WebSocket + simulator.unsubscribeClient(mockWebSocket); + + // Assert: Check that websockets were removed from subscriptions + expect(simulator['subscriptions'].size).toBe(2); + expect(simulator['subscriptions'].get('key-this-and-other')).toEqual([otherWebsocket]); + expect(simulator['subscriptions'].get('key-only-this')).toBe(undefined); + expect(simulator['subscriptions'].get('key-only-other')).toEqual([otherWebsocket]); + }); + + test('remove all subscriptions of websocket and none left', () => { + // Arrange: Add 2 subscriptions with the same websocket + simulator['subscriptions'].set(mockKey, [mockWebSocket]); + simulator['subscriptions'].set('other-key', [mockWebSocket]); + + // Act: Call unsubscribeClient with existing WebSocket + simulator.unsubscribeClient(mockWebSocket); + + // Assert: Check that the subscription has been removed + expect(simulator['subscriptions'].size).toBe(0); + }); + + test('stops the timer if there is no subscription left', () => { + // Arrange: create a subscription to start the timer + simulator.subscribe(mockMessage, mockWebSocket); + expect(simulator['intervalId']).not.toBeNull(); + + // Act: Call unsubscribeClient to trigger the timer removal + simulator.unsubscribeClient(mockWebSocket); + + // Assert: Check that intervalId is no longer null + expect(simulator['intervalId']).toBeNull(); + }); + + /* + * notifyDatabaseChanges + */ + + test('timeIntervalUpperLimit and timeIntervalLowerLimit form a series', async () => { + simulator["timeIntervalLowerLimit"] = Date.now(); + + // Wait a little to ensure a time difference in the next call + await new Promise(resolve => setTimeout(resolve, 10)); + + // Spy on `checkForChanges` + let timeIntervals: { lower: number; upper: number }[] = []; + + // Add an entry to `subscriptions` to ensure `checkForChanges` will be called + const mockWebSocket = { id: 'ws1' } as WebSocketWithId; + simulator['subscriptions'].set('vehicle123-VSS', [mockWebSocket]); + + (jest.spyOn(simulator as any, 'checkForChanges') as jest.Mock) + .mockImplementation((id: string, upperLimit: number) => { + timeIntervals.push({ + lower: simulator["timeIntervalLowerLimit"]!, // Current lower limit + upper: upperLimit, // Passed upper limit + }); + return Promise.resolve(undefined); // Simulate checkForChanges returning no updates + }); + + // First call + await (simulator as any).notifyDatabaseChanges(); + + // Wait a little to ensure a time difference in the next call + await new Promise(resolve => setTimeout(resolve, 10)); + + // Second call + await (simulator as any).notifyDatabaseChanges(); + + // Expect two interval records (one for each call) + expect(timeIntervals.length).toBe(2); + + const { lower: lower1, upper: upper1 } = timeIntervals[0]; + const { lower: lower2, upper: upper2 } = timeIntervals[1]; + + // Assertions + expect(upper1).toBeGreaterThan(lower1); // First interval: upper > lower + expect(upper2).toBeGreaterThan(lower2); // Second interval: upper > lower + expect(lower2).toBe(upper1); // Second interval's lower is the first interval's upper + }); + + test('calls sendMessageToClient if there is a matching subscription and update', async () => { + simulator["timeIntervalLowerLimit"] = Date.now(); + + // Add a subscription that should match the `id` in the mocked session data + simulator['subscriptions'].set('vehicle123-VSS', [mockWebSocket]); + + // Create a real `SessionDataSet` instance to pass the `instanceof` check + const mockSessionDataSet = new SessionDataSet( + ['root.Vehicles_Speed'], // columnNameList + [IoTDBDataType.FLOAT], // columnTypeList + { 'root.Vehicles_Speed': 0 }, // columnNameIndex + 1, // queryId + {}, // client + 1, // statementId + 1, // sessionId + {}, // queryDataSet + true // ignoreTimestamp + ); + + // Mock executeQueryStatement to return the mockSessionDataSet + jest.spyOn(mockSession, 'executeQueryStatement').mockResolvedValue(mockSessionDataSet); + + // Mock transformSessionDataSet to return non-empty array (indicating changes) + (transformSessionDataSet as jest.Mock).mockReturnValueOnce([ + { name: 'speed', value: 100 }, + ]); + + // Mock createUpdateMessage to return an update message + simulator["createUpdateMessage"] = jest.fn().mockReturnValue({ + type: "update", + id: 'vehicle123', + tree: 'VSS', + uuid: 'test-uuid', + nodes: [{ name: 'speed', value: 100 }], + } as Message); // Return type MessageWithNodes + + // Call notifyDatabaseChanges + await (simulator as any).notifyDatabaseChanges(); + + // Assert that sendMessageToClient was called with the matching websocket and update message + expect(sendMessageToClientMock).toHaveBeenCalledWith( + { id: 'ws1' }, // WebSocket in the subscription + expect.objectContaining({ + id: 'vehicle123', + type: 'update', + nodes: [{ name: 'speed', value: 100 }], + }) + ); + }); +}); diff --git a/cdsp/information-layer/handlers/src/iotdb/src/SubscriptionSimulator.ts b/cdsp/information-layer/handlers/src/iotdb/src/SubscriptionSimulator.ts index 854bc6f..deab037 100644 --- a/cdsp/information-layer/handlers/src/iotdb/src/SubscriptionSimulator.ts +++ b/cdsp/information-layer/handlers/src/iotdb/src/SubscriptionSimulator.ts @@ -90,7 +90,7 @@ export class SubscriptionSimulator { if (!websockets) { this.sendMessageToClient(wsOfSubscriptionToBeDeleted, createErrorMessage( - "subscribe", + "unsubscribe", STATUS_ERRORS.BAD_REQUEST, `Cannot unsubscribe. No subscription for id ${message.id}, tree ${message.tree} for connection ${wsOfSubscriptionToBeDeleted.id}.`)); return; @@ -216,7 +216,9 @@ export class SubscriptionSimulator { responseNodes ); } - logMessage(`Processed ${responseNodes.length} changes for id ${id}`); + if (responseNodes.length > 0) { + logMessage(`Processed ${responseNodes.length} changes for id ${id}`); + } } catch (error: unknown) { logError("Unknown error", error); diff --git a/cdsp/information-layer/handlers/src/iotdb/utils/database-helper.test.ts b/cdsp/information-layer/handlers/src/iotdb/utils/database-helper.test.ts new file mode 100644 index 0000000..6522221 --- /dev/null +++ b/cdsp/information-layer/handlers/src/iotdb/utils/database-helper.test.ts @@ -0,0 +1,46 @@ +import { transformSessionDataSet } from './database-helper'; +import { SessionDataSet } from './SessionDataSet'; + +describe('database-helper', () => { + let mockSessionDataSet: jest.Mocked; + + beforeEach(() => { + mockSessionDataSet = { + hasNext: jest.fn(), + next: jest.fn(), + } as unknown as jest.Mocked; + }); + + test('transforms SessionDataSet to array of name/value pairs', () => { + const mockDataRows = [ + { + "root.Vehicles_Speed": 60, + "root.Vehicles_FuelLevel": 0.8, + "root.Vehicles_CurrentLocation_Latitude": 34.052235, + "root.Vehicles_CurrentLocation_Longitude": -118.243683 + }, + { + "root.Vehicles_Speed": 65, + "root.Vehicles_FuelLevel": 0.75, + "root.Vehicles_CurrentLocation_Latitude": 34.052240, + "root.Vehicles_CurrentLocation_Longitude": -118.243680 + }, + { + "root.Vehicles_FuelLevel": 0.71, + } + ]; + + let index = 0; + mockSessionDataSet.hasNext.mockImplementation(() => index < mockDataRows.length); + mockSessionDataSet.next.mockImplementation(() => mockDataRows[index++]); + + const result = transformSessionDataSet(mockSessionDataSet, 'root.Vehicles'); + + expect(result).toEqual([ + { name: "Speed", value: 65 }, // Latest value for Speed + { name: "FuelLevel", value: 0.71 }, // Latest value for FuelLevel + { name: "CurrentLocation.Latitude", value: 34.052240 }, // Latest Latitude + { name: "CurrentLocation.Longitude", value: -118.243680 } // Latest Longitude + ]); + }); +}); diff --git a/cdsp/information-layer/jest.config.js b/cdsp/information-layer/jest.config.js new file mode 100644 index 0000000..6b17bf3 --- /dev/null +++ b/cdsp/information-layer/jest.config.js @@ -0,0 +1,8 @@ +/** @type {import('ts-jest').JestConfigWithTsJest} **/ +module.exports = { + testMatch: ["**/*.test.ts"], + testEnvironment: "node", + transform: { + "^.+.tsx?$": ["ts-jest",{}], + }, +}; \ No newline at end of file diff --git a/cdsp/information-layer/package-lock.json b/cdsp/information-layer/package-lock.json index 19cf691..056639b 100644 --- a/cdsp/information-layer/package-lock.json +++ b/cdsp/information-layer/package-lock.json @@ -18,6 +18,7 @@ }, "devDependencies": { "@types/ajv": "^0.0.5", + "@types/jest": "^29.5.14", "@types/js-yaml": "^4.0.9", "@types/node": "^22.7.0", "@types/thrift": "^0.10.17", @@ -27,10 +28,11 @@ "eslint": "^9.9.1", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.2.1", + "jest": "^29.7.0", "prettier": "^3.3.3", "rimraf": "^6.0.1", "ts-jest": "^29.2.5", - "typescript": "^5.6.2", + "typescript": "^5.6.3", "typescript-eslint": "^8.4.0" } }, @@ -40,7 +42,6 @@ "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", "dev": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" @@ -55,7 +56,6 @@ "integrity": "sha512-0xZJFNE5XMpENsgfHYTw8FbX4kv53mFLn2i3XPoq69LyhYSCBJtitaHx9QnsVTrsogI4Z3+HtEfZ2/GFPOtf5g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/highlight": "^7.25.7", "picocolors": "^1.0.0" @@ -70,7 +70,6 @@ "integrity": "sha512-ZsysZyXY4Tlx+Q53XdnOFmqwfB9QDTHYxaZYajWRoBLuLEAwI2UIbtxOjWh/cFaa9IKUlcB+DDuoskLuKu56JA==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=6.9.0" } @@ -81,7 +80,6 @@ "integrity": "sha512-Oixnb+DzmRT30qu9d3tJSQkxuygWm32DFykT4bRoORPa9hZ/L4KhVB/XiRm6KG+roIEM7DBQlmg27kw2HZkdZg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.25.7", @@ -113,7 +111,6 @@ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "license": "ISC", - "peer": true, "bin": { "semver": "bin/semver.js" } @@ -124,7 +121,6 @@ "integrity": "sha512-5Dqpl5fyV9pIAD62yK9P7fcA768uVPUyrQmqpqstHWgMma4feF1x/oFysBCVZLY5wJ2GkMUCdsNDnGZrPoR6rA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/types": "^7.25.7", "@jridgewell/gen-mapping": "^0.3.5", @@ -141,7 +137,6 @@ "integrity": "sha512-DniTEax0sv6isaw6qSQSfV4gVRNtw2rte8HHM45t9ZR0xILaufBRNkpMifCRiAPyvL4ACD6v0gfCwCmtOQaV4A==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/compat-data": "^7.25.7", "@babel/helper-validator-option": "^7.25.7", @@ -159,7 +154,6 @@ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "license": "ISC", - "peer": true, "bin": { "semver": "bin/semver.js" } @@ -170,7 +164,6 @@ "integrity": "sha512-o0xCgpNmRohmnoWKQ0Ij8IdddjyBFE4T2kagL/x6M3+4zUgc+4qTOUBoNe4XxDskt1HPKO007ZPiMgLDq2s7Kw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/traverse": "^7.25.7", "@babel/types": "^7.25.7" @@ -185,7 +178,6 @@ "integrity": "sha512-k/6f8dKG3yDz/qCwSM+RKovjMix563SLxQFo0UhRNo239SP6n9u5/eLtKD6EAjwta2JHJ49CsD8pms2HdNiMMQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/helper-module-imports": "^7.25.7", "@babel/helper-simple-access": "^7.25.7", @@ -205,7 +197,6 @@ "integrity": "sha512-eaPZai0PiqCi09pPs3pAFfl/zYgGaE6IdXtYvmf0qlcDTd3WCtO7JWCcRd64e0EQrcYgiHibEZnOGsSY4QSgaw==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=6.9.0" } @@ -216,7 +207,6 @@ "integrity": "sha512-FPGAkJmyoChQeM+ruBGIDyrT2tKfZJO8NcxdC+CWNJi7N8/rZpSxK7yvBJ5O/nF1gfu5KzN7VKG3YVSLFfRSxQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/traverse": "^7.25.7", "@babel/types": "^7.25.7" @@ -231,7 +221,6 @@ "integrity": "sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=6.9.0" } @@ -242,7 +231,6 @@ "integrity": "sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=6.9.0" } @@ -253,7 +241,6 @@ "integrity": "sha512-ytbPLsm+GjArDYXJ8Ydr1c/KJuutjF2besPNbIZnZ6MKUxi/uTA22t2ymmA4WFjZFpjiAMO0xuuJPqK2nvDVfQ==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=6.9.0" } @@ -264,7 +251,6 @@ "integrity": "sha512-Sv6pASx7Esm38KQpF/U/OXLwPPrdGHNKoeblRxgZRLXnAtnkEe4ptJPDtAZM7fBLadbc1Q07kQpSiGQ0Jg6tRA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/template": "^7.25.7", "@babel/types": "^7.25.7" @@ -279,7 +265,6 @@ "integrity": "sha512-iYyACpW3iW8Fw+ZybQK+drQre+ns/tKpXbNESfrhNnPLIklLbXr7MYJ6gPEd0iETGLOK+SxMjVvKb/ffmk+FEw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/helper-validator-identifier": "^7.25.7", "chalk": "^2.4.2", @@ -296,7 +281,6 @@ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "color-convert": "^1.9.0" }, @@ -310,7 +294,6 @@ "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -326,7 +309,6 @@ "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "color-name": "1.1.3" } @@ -336,8 +318,7 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@babel/highlight/node_modules/escape-string-regexp": { "version": "1.0.5", @@ -345,7 +326,6 @@ "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=0.8.0" } @@ -356,7 +336,6 @@ "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=4" } @@ -367,7 +346,6 @@ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "has-flag": "^3.0.0" }, @@ -381,7 +359,6 @@ "integrity": "sha512-HcttkxzdPucv3nNFmfOOMfFf64KgdJVqm1KaCm25dPGMLElo9nsLvXeJECQg8UzPuBGLyTSA0ZzqCtDSzKTEoQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/types": "^7.25.8" }, @@ -398,7 +375,6 @@ "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -412,7 +388,6 @@ "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -426,7 +401,6 @@ "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.12.13" }, @@ -440,7 +414,6 @@ "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.14.5" }, @@ -457,7 +430,6 @@ "integrity": "sha512-AqVo+dguCgmpi/3mYBdu9lkngOBlQ2w2vnNpa6gfiCxQZLzV4ZbhsXitJ2Yblkoe1VQwtHSaNmIaGll/26YWRw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.25.7" }, @@ -474,7 +446,6 @@ "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" }, @@ -488,7 +459,6 @@ "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -502,7 +472,6 @@ "integrity": "sha512-ruZOnKO+ajVL/MVx+PwNBPOkrnXTXoWMtte1MBpegfCArhqOe3Bj52avVj1huLLxNKYKXYaSxZ2F+woK1ekXfw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.25.7" }, @@ -519,7 +488,6 @@ "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" }, @@ -533,7 +501,6 @@ "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -547,7 +514,6 @@ "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" }, @@ -561,7 +527,6 @@ "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -575,7 +540,6 @@ "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -589,7 +553,6 @@ "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -603,7 +566,6 @@ "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.14.5" }, @@ -620,7 +582,6 @@ "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.14.5" }, @@ -637,7 +598,6 @@ "integrity": "sha512-rR+5FDjpCHqqZN2bzZm18bVYGaejGq5ZkpVCJLXor/+zlSrSoc4KWcHI0URVWjl/68Dyr1uwZUz/1njycEAv9g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.25.7" }, @@ -654,7 +614,6 @@ "integrity": "sha512-wRwtAgI3bAS+JGU2upWNL9lSlDcRCqD05BZ1n3X2ONLH1WilFP6O1otQjeMK/1g0pvYcXC7b/qVUB1keofjtZA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/code-frame": "^7.25.7", "@babel/parser": "^7.25.7", @@ -670,7 +629,6 @@ "integrity": "sha512-jatJPT1Zjqvh/1FyJs6qAHL+Dzb7sTb+xr7Q+gM1b+1oBsMsQQ4FkVKb6dFlJvLlVssqkRzV05Jzervt9yhnzg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/code-frame": "^7.25.7", "@babel/generator": "^7.25.7", @@ -690,7 +648,6 @@ "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=4" } @@ -701,7 +658,6 @@ "integrity": "sha512-JWtuCu8VQsMladxVz/P4HzHUGCAwpuqacmowgXFs5XjxIgKuNjnLokQzuVjlTvIzODaDmpjT3oxcC48vyk9EWg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/helper-string-parser": "^7.25.7", "@babel/helper-validator-identifier": "^7.25.7", @@ -716,8 +672,7 @@ "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", @@ -1038,7 +993,6 @@ "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", "dev": true, "license": "ISC", - "peer": true, "dependencies": { "camelcase": "^5.3.1", "find-up": "^4.1.0", @@ -1056,7 +1010,6 @@ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "sprintf-js": "~1.0.2" } @@ -1067,7 +1020,6 @@ "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -1082,7 +1034,6 @@ "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -1097,7 +1048,6 @@ "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "p-locate": "^4.1.0" }, @@ -1111,7 +1061,6 @@ "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "p-try": "^2.0.0" }, @@ -1128,7 +1077,6 @@ "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "p-limit": "^2.2.0" }, @@ -1142,7 +1090,6 @@ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=8" } @@ -1153,7 +1100,6 @@ "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=8" } @@ -1164,7 +1110,6 @@ "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", @@ -1183,7 +1128,6 @@ "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/console": "^29.7.0", "@jest/reporters": "^29.7.0", @@ -1232,7 +1176,6 @@ "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/fake-timers": "^29.7.0", "@jest/types": "^29.6.3", @@ -1249,7 +1192,6 @@ "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "expect": "^29.7.0", "jest-snapshot": "^29.7.0" @@ -1264,7 +1206,6 @@ "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "jest-get-type": "^29.6.3" }, @@ -1278,7 +1219,6 @@ "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/types": "^29.6.3", "@sinonjs/fake-timers": "^10.0.2", @@ -1297,7 +1237,6 @@ "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/environment": "^29.7.0", "@jest/expect": "^29.7.0", @@ -1314,7 +1253,6 @@ "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@bcoe/v8-coverage": "^0.2.3", "@jest/console": "^29.7.0", @@ -1372,7 +1310,6 @@ "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.18", "callsites": "^3.0.0", @@ -1388,7 +1325,6 @@ "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/console": "^29.7.0", "@jest/types": "^29.6.3", @@ -1405,7 +1341,6 @@ "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/test-result": "^29.7.0", "graceful-fs": "^4.2.9", @@ -1422,7 +1357,6 @@ "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/core": "^7.11.6", "@jest/types": "^29.6.3", @@ -1468,7 +1402,6 @@ "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", @@ -1484,7 +1417,6 @@ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=6.0.0" } @@ -1495,7 +1427,6 @@ "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=6.0.0" } @@ -1505,8 +1436,7 @@ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.25", @@ -1514,7 +1444,6 @@ "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" @@ -1592,7 +1521,6 @@ "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", "dev": true, "license": "BSD-3-Clause", - "peer": true, "dependencies": { "type-detect": "4.0.8" } @@ -1603,7 +1531,6 @@ "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", "dev": true, "license": "BSD-3-Clause", - "peer": true, "dependencies": { "@sinonjs/commons": "^3.0.0" } @@ -1621,7 +1548,6 @@ "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/parser": "^7.20.7", "@babel/types": "^7.20.7", @@ -1636,7 +1562,6 @@ "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/types": "^7.0.0" } @@ -1647,7 +1572,6 @@ "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/parser": "^7.1.0", "@babel/types": "^7.0.0" @@ -1659,7 +1583,6 @@ "integrity": "sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/types": "^7.20.7" } @@ -1677,7 +1600,6 @@ "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@types/node": "*" } @@ -1709,6 +1631,17 @@ "@types/istanbul-lib-report": "*" } }, + "node_modules/@types/jest": { + "version": "29.5.14", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.14.tgz", + "integrity": "sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, "node_modules/@types/js-yaml": { "version": "4.0.9", "resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.9.tgz", @@ -1755,8 +1688,7 @@ "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@types/thrift": { "version": "0.10.17", @@ -2078,7 +2010,6 @@ "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "type-fest": "^0.21.3" }, @@ -2121,7 +2052,6 @@ "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dev": true, "license": "ISC", - "peer": true, "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -2155,7 +2085,6 @@ "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/transform": "^29.7.0", "@types/babel__core": "^7.1.14", @@ -2178,7 +2107,6 @@ "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", "dev": true, "license": "BSD-3-Clause", - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", "@istanbuljs/load-nyc-config": "^1.0.0", @@ -2196,7 +2124,6 @@ "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", "dev": true, "license": "BSD-3-Clause", - "peer": true, "dependencies": { "@babel/core": "^7.12.3", "@babel/parser": "^7.14.7", @@ -2214,7 +2141,6 @@ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "license": "ISC", - "peer": true, "bin": { "semver": "bin/semver.js" } @@ -2225,7 +2151,6 @@ "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/template": "^7.3.3", "@babel/types": "^7.3.3", @@ -2242,7 +2167,6 @@ "integrity": "sha512-ldYss8SbBlWva1bs28q78Ju5Zq1F+8BrqBZZ0VFhLBvhh6lCpC2o3gDJi/5DRLs9FgYZCnmPYIVFU4lRXCkyUw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-bigint": "^7.8.3", @@ -2270,7 +2194,6 @@ "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "babel-plugin-jest-hoist": "^29.6.3", "babel-preset-current-node-syntax": "^1.0.0" @@ -2393,7 +2316,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "caniuse-lite": "^1.0.30001663", "electron-to-chromium": "^1.5.28", @@ -2426,7 +2348,6 @@ "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", "dev": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "node-int64": "^0.4.0" } @@ -2472,8 +2393,7 @@ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/callsites": { "version": "3.1.0", @@ -2491,7 +2411,6 @@ "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=6" } @@ -2515,8 +2434,7 @@ "url": "https://github.com/sponsors/ai" } ], - "license": "CC-BY-4.0", - "peer": true + "license": "CC-BY-4.0" }, "node_modules/chalk": { "version": "4.1.2", @@ -2541,7 +2459,6 @@ "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=10" } @@ -2573,8 +2490,7 @@ "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.1.tgz", "integrity": "sha512-cuSVIHi9/9E/+821Qjdvngor+xpnlwnuwIyZOaLmHBVdXL+gP+I6QQB9VkO7RI77YIcTV+S1W9AreJ5eN63JBA==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/cliui": { "version": "7.0.4", @@ -2594,7 +2510,6 @@ "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", "dev": true, "license": "MIT", - "peer": true, "engines": { "iojs": ">= 1.0.0", "node": ">= 0.12.0" @@ -2605,8 +2520,7 @@ "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/color-convert": { "version": "2.0.1", @@ -2640,8 +2554,7 @@ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/copyfiles": { "version": "2.4.1", @@ -2676,7 +2589,6 @@ "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/types": "^29.6.3", "chalk": "^4.0.0", @@ -2746,7 +2658,6 @@ "integrity": "sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ==", "dev": true, "license": "MIT", - "peer": true, "peerDependencies": { "babel-plugin-macros": "^3.1.0" }, @@ -2778,7 +2689,6 @@ "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -2798,7 +2708,6 @@ "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=8" } @@ -2809,7 +2718,6 @@ "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } @@ -2854,8 +2762,7 @@ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.36.tgz", "integrity": "sha512-HYTX8tKge/VNp6FGO+f/uVDmUkq+cEfcxYhKf15Akc4M5yxt5YmorwlAitKWjWhWQnKcDRBAQKXkhqqXMqcrjw==", "dev": true, - "license": "ISC", - "peer": true + "license": "ISC" }, "node_modules/emittery": { "version": "0.13.1", @@ -2863,7 +2770,6 @@ "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -2893,7 +2799,6 @@ "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "is-arrayish": "^0.2.1" } @@ -3104,7 +3009,6 @@ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true, "license": "BSD-2-Clause", - "peer": true, "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" @@ -3165,7 +3069,6 @@ "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.0", @@ -3189,7 +3092,6 @@ "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", "dev": true, - "peer": true, "engines": { "node": ">= 0.8.0" } @@ -3209,7 +3111,6 @@ "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/expect-utils": "^29.7.0", "jest-get-type": "^29.6.3", @@ -3300,7 +3201,6 @@ "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", "dev": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "bser": "2.1.1" } @@ -3456,7 +3356,6 @@ "os": [ "darwin" ], - "peer": true, "engines": { "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } @@ -3467,7 +3366,6 @@ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true, "license": "MIT", - "peer": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -3478,7 +3376,6 @@ "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=6.9.0" } @@ -3499,7 +3396,6 @@ "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=8.0.0" } @@ -3510,7 +3406,6 @@ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=10" }, @@ -3602,7 +3497,6 @@ "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "function-bind": "^1.1.2" }, @@ -3615,8 +3509,7 @@ "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/human-signals": { "version": "2.1.0", @@ -3624,7 +3517,6 @@ "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true, "license": "Apache-2.0", - "peer": true, "engines": { "node": ">=10.17.0" } @@ -3682,7 +3574,6 @@ "integrity": "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "pkg-dir": "^4.2.0", "resolve-cwd": "^3.0.0" @@ -3736,8 +3627,7 @@ "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/is-core-module": { "version": "2.15.1", @@ -3745,7 +3635,6 @@ "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "hasown": "^2.0.2" }, @@ -3782,7 +3671,6 @@ "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=6" } @@ -3816,7 +3704,6 @@ "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=8" }, @@ -3853,7 +3740,6 @@ "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", "dev": true, "license": "BSD-3-Clause", - "peer": true, "engines": { "node": ">=8" } @@ -3864,7 +3750,6 @@ "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", "dev": true, "license": "BSD-3-Clause", - "peer": true, "dependencies": { "@babel/core": "^7.23.9", "@babel/parser": "^7.23.9", @@ -3882,7 +3767,6 @@ "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dev": true, "license": "BSD-3-Clause", - "peer": true, "dependencies": { "istanbul-lib-coverage": "^3.0.0", "make-dir": "^4.0.0", @@ -3898,7 +3782,6 @@ "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", "dev": true, "license": "BSD-3-Clause", - "peer": true, "dependencies": { "debug": "^4.1.1", "istanbul-lib-coverage": "^3.0.0", @@ -3914,7 +3797,6 @@ "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", "dev": true, "license": "BSD-3-Clause", - "peer": true, "dependencies": { "html-escaper": "^2.0.0", "istanbul-lib-report": "^3.0.0" @@ -3964,7 +3846,6 @@ "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/core": "^29.7.0", "@jest/types": "^29.6.3", @@ -3992,7 +3873,6 @@ "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "execa": "^5.0.0", "jest-util": "^29.7.0", @@ -4008,7 +3888,6 @@ "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/environment": "^29.7.0", "@jest/expect": "^29.7.0", @@ -4041,7 +3920,6 @@ "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/core": "^29.7.0", "@jest/test-result": "^29.7.0", @@ -4076,7 +3954,6 @@ "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, "license": "ISC", - "peer": true, "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", @@ -4092,7 +3969,6 @@ "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", @@ -4112,7 +3988,6 @@ "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true, "license": "ISC", - "peer": true, "engines": { "node": ">=12" } @@ -4123,7 +3998,6 @@ "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/core": "^7.11.6", "@jest/test-sequencer": "^29.7.0", @@ -4170,7 +4044,6 @@ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=8" }, @@ -4184,7 +4057,6 @@ "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "chalk": "^4.0.0", "diff-sequences": "^29.6.3", @@ -4201,7 +4073,6 @@ "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "detect-newline": "^3.0.0" }, @@ -4215,7 +4086,6 @@ "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/types": "^29.6.3", "chalk": "^4.0.0", @@ -4233,7 +4103,6 @@ "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/environment": "^29.7.0", "@jest/fake-timers": "^29.7.0", @@ -4252,7 +4121,6 @@ "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } @@ -4263,7 +4131,6 @@ "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/types": "^29.6.3", "@types/graceful-fs": "^4.1.3", @@ -4290,7 +4157,6 @@ "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "jest-get-type": "^29.6.3", "pretty-format": "^29.7.0" @@ -4305,7 +4171,6 @@ "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "chalk": "^4.0.0", "jest-diff": "^29.7.0", @@ -4322,7 +4187,6 @@ "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/code-frame": "^7.12.13", "@jest/types": "^29.6.3", @@ -4344,7 +4208,6 @@ "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", @@ -4360,7 +4223,6 @@ "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=6" }, @@ -4379,7 +4241,6 @@ "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } @@ -4390,7 +4251,6 @@ "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "chalk": "^4.0.0", "graceful-fs": "^4.2.9", @@ -4412,7 +4272,6 @@ "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "jest-regex-util": "^29.6.3", "jest-snapshot": "^29.7.0" @@ -4427,7 +4286,6 @@ "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/console": "^29.7.0", "@jest/environment": "^29.7.0", @@ -4461,7 +4319,6 @@ "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/environment": "^29.7.0", "@jest/fake-timers": "^29.7.0", @@ -4496,7 +4353,6 @@ "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/core": "^7.11.6", "@babel/generator": "^7.7.2", @@ -4547,7 +4403,6 @@ "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/types": "^29.6.3", "camelcase": "^6.2.0", @@ -4566,7 +4421,6 @@ "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=10" }, @@ -4580,7 +4434,6 @@ "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/test-result": "^29.7.0", "@jest/types": "^29.6.3", @@ -4601,7 +4454,6 @@ "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@types/node": "*", "jest-util": "^29.7.0", @@ -4618,7 +4470,6 @@ "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -4634,8 +4485,7 @@ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/js-yaml": { "version": "4.1.0", @@ -4655,7 +4505,6 @@ "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", "dev": true, "license": "MIT", - "peer": true, "bin": { "jsesc": "bin/jsesc" }, @@ -4675,8 +4524,7 @@ "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/json-schema-traverse": { "version": "1.0.0", @@ -4720,7 +4568,6 @@ "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=6" } @@ -4731,7 +4578,6 @@ "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=6" } @@ -4755,8 +4601,7 @@ "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/locate-path": { "version": "6.0.0", @@ -4794,7 +4639,6 @@ "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, "license": "ISC", - "peer": true, "dependencies": { "yallist": "^3.0.2" } @@ -4805,7 +4649,6 @@ "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "semver": "^7.5.3" }, @@ -4829,7 +4672,6 @@ "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", "dev": true, "license": "BSD-3-Clause", - "peer": true, "dependencies": { "tmpl": "1.0.5" } @@ -4839,8 +4681,7 @@ "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/merge2": { "version": "1.4.1", @@ -4872,7 +4713,6 @@ "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=6" } @@ -4988,8 +4828,7 @@ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/noms": { "version": "0.0.0", @@ -5008,7 +4847,6 @@ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -5019,7 +4857,6 @@ "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "path-key": "^3.0.0" }, @@ -5042,7 +4879,6 @@ "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "mimic-fn": "^2.1.0" }, @@ -5109,7 +4945,6 @@ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=6" } @@ -5140,7 +4975,6 @@ "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", @@ -5195,8 +5029,7 @@ "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/path-scurry": { "version": "2.0.0", @@ -5230,8 +5063,7 @@ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", "dev": true, - "license": "ISC", - "peer": true + "license": "ISC" }, "node_modules/picomatch": { "version": "2.3.1", @@ -5252,7 +5084,6 @@ "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">= 6" } @@ -5263,7 +5094,6 @@ "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "find-up": "^4.0.0" }, @@ -5277,7 +5107,6 @@ "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -5292,7 +5121,6 @@ "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "p-locate": "^4.1.0" }, @@ -5306,7 +5134,6 @@ "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "p-try": "^2.0.0" }, @@ -5323,7 +5150,6 @@ "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "p-limit": "^2.2.0" }, @@ -5402,7 +5228,6 @@ "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", @@ -5418,7 +5243,6 @@ "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=10" }, @@ -5439,7 +5263,6 @@ "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "kleur": "^3.0.3", "sisteransi": "^1.0.5" @@ -5483,8 +5306,7 @@ "url": "https://opencollective.com/fast-check" } ], - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/q": { "version": "1.5.1", @@ -5538,8 +5360,7 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/readable-stream": { "version": "1.0.34", @@ -5606,7 +5427,6 @@ "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "is-core-module": "^2.13.0", "path-parse": "^1.0.7", @@ -5625,7 +5445,6 @@ "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "resolve-from": "^5.0.0" }, @@ -5639,7 +5458,6 @@ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=8" } @@ -5660,7 +5478,6 @@ "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=10" } @@ -5830,8 +5647,7 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true, - "license": "ISC", - "peer": true + "license": "ISC" }, "node_modules/simple-concat": { "version": "1.0.1", @@ -5883,8 +5699,7 @@ "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/slash": { "version": "3.0.0", @@ -5892,7 +5707,6 @@ "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=8" } @@ -5903,7 +5717,6 @@ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, "license": "BSD-3-Clause", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -5914,7 +5727,6 @@ "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -5925,8 +5737,7 @@ "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", "dev": true, - "license": "BSD-3-Clause", - "peer": true + "license": "BSD-3-Clause" }, "node_modules/stack-utils": { "version": "2.0.6", @@ -5934,7 +5745,6 @@ "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "escape-string-regexp": "^2.0.0" }, @@ -5948,7 +5758,6 @@ "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=8" } @@ -5966,7 +5775,6 @@ "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "char-regex": "^1.0.2", "strip-ansi": "^6.0.0" @@ -6039,7 +5847,6 @@ "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=8" } @@ -6050,7 +5857,6 @@ "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=6" } @@ -6083,7 +5889,6 @@ "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">= 0.4" }, @@ -6165,7 +5970,6 @@ "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", "dev": true, "license": "ISC", - "peer": true, "dependencies": { "@istanbuljs/schema": "^0.1.2", "glob": "^7.1.4", @@ -6263,8 +6067,7 @@ "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", "dev": true, - "license": "BSD-3-Clause", - "peer": true + "license": "BSD-3-Clause" }, "node_modules/to-fast-properties": { "version": "2.0.0", @@ -6272,7 +6075,6 @@ "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=4" } @@ -6400,7 +6202,6 @@ "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=4" } @@ -6411,7 +6212,6 @@ "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true, "license": "(MIT OR CC0-1.0)", - "peer": true, "engines": { "node": ">=10" }, @@ -6494,7 +6294,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.0" @@ -6541,7 +6340,6 @@ "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", "dev": true, "license": "ISC", - "peer": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.12", "@types/istanbul-lib-coverage": "^2.0.1", @@ -6557,7 +6355,6 @@ "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", "dev": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "makeerror": "1.0.12" } @@ -6637,7 +6434,6 @@ "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", "dev": true, "license": "ISC", - "peer": true, "dependencies": { "imurmurhash": "^0.1.4", "signal-exit": "^3.0.7" @@ -6692,8 +6488,7 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true, - "license": "ISC", - "peer": true + "license": "ISC" }, "node_modules/yargs": { "version": "16.2.0", @@ -6738,4 +6533,4 @@ } } } -} \ No newline at end of file +} diff --git a/cdsp/information-layer/package.json b/cdsp/information-layer/package.json index 4b18254..20d55c9 100644 --- a/cdsp/information-layer/package.json +++ b/cdsp/information-layer/package.json @@ -24,6 +24,7 @@ }, "devDependencies": { "@types/ajv": "^0.0.5", + "@types/jest": "^29.5.14", "@types/js-yaml": "^4.0.9", "@types/node": "^22.7.0", "@types/thrift": "^0.10.17", @@ -33,10 +34,11 @@ "eslint": "^9.9.1", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.2.1", + "jest": "^29.7.0", "prettier": "^3.3.3", "rimraf": "^6.0.1", "ts-jest": "^29.2.5", - "typescript": "^5.6.2", + "typescript": "^5.6.3", "typescript-eslint": "^8.4.0" } -} \ No newline at end of file +} diff --git a/cdsp/information-layer/router/src/websocket-server.ts b/cdsp/information-layer/router/src/websocket-server.ts index f74afb7..38bc5e9 100644 --- a/cdsp/information-layer/router/src/websocket-server.ts +++ b/cdsp/information-layer/router/src/websocket-server.ts @@ -42,9 +42,8 @@ const clients = new Map(); // Handle new client connections server.on("connection", (ws: WebSocket) => { // add a uuid to the websocket connection - const connectionId = uuidv4(); - const wsWithId = ws as unknown as WebSocketWithId; - wsWithId.id = connectionId; + const wsWithId = addIdToWebsocket(ws); + const connectionId = wsWithId.id; clients.set(connectionId, ws); // Add client to the Map logWithColor(`Client connected with id ${connectionId}`, COLORS.YELLOW); @@ -88,6 +87,11 @@ handler.authenticateAndConnect(sendMessageToClients); // Log server start logWithColor(`Web-Socket server started on ws://localhost:8080\n`, COLORS.BOLD); +function addIdToWebsocket(ws: WebSocket): WebSocketWithId { + return Object.assign(ws, { id: uuidv4() }); +} + + function rawDataToString(message: RawData): string { if (typeof message === "string") { return message; diff --git a/cdsp/information-layer/utils/logger.ts b/cdsp/information-layer/utils/logger.ts index b3f3577..1e34fb9 100644 --- a/cdsp/information-layer/utils/logger.ts +++ b/cdsp/information-layer/utils/logger.ts @@ -75,8 +75,10 @@ export function logMessage( } const logEntry = `\n${COLORS.PALE_WHITE}${dateTimeNow}${COLORS.RESET} ${color}${labelText}${COLORS.RESET}`; - console.log(logEntry); - console.log(featureStr); + if (process.env.NODE_ENV !== 'test') { + console.log(logEntry); + console.log(featureStr); + } } /** From d9da312e48b1bf0e663bd6c297a5f4d433a0dbc6 Mon Sep 17 00:00:00 2001 From: Christian Muehlbauer Date: Thu, 14 Nov 2024 11:28:49 +0100 Subject: [PATCH 45/48] change _ to . notation in readme Signed-off-by: Christian Muehlbauer --- cdsp/information-layer/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cdsp/information-layer/README.md b/cdsp/information-layer/README.md index 9f89808..4db7e87 100644 --- a/cdsp/information-layer/README.md +++ b/cdsp/information-layer/README.md @@ -128,9 +128,9 @@ Schema: "id": "123", // The VIN "uuid": "testClient", // The unique client ID // For reading one - "node": { "name": "Vehicle_Speed" }, + "node": { "name": "Vehicle.Speed" }, // For reading N - "nodes": [{ "name": "Vehicle_Speed" },{ "name": "Vehicle_TraveledDistance" }] + "nodes": [{ "name": "Vehicle.Speed" },{ "name": "Vehicle.TraveledDistance" }] } ``` @@ -162,9 +162,9 @@ Schema: "id": "123", // The VIN "uuid": "testClient", // The unique client ID // For writing one - "node": { "name": "Vehicle_Speed", "value": 300 }, + "node": { "name": "Vehicle.Speed", "value": 300 }, // For writing N - "nodes": [{ "name": "Vehicle_Speed", "value": 300 },{ "name": "Vehicle_TraveledDistance", "value": 100000 }] + "nodes": [{ "name": "Vehicle.Speed", "value": 300 },{ "name": "Vehicle.TraveledDistance", "value": 100000 }] } ``` Example: From c76f57a3600c7800553f0162d75f90a5daaca35c Mon Sep 17 00:00:00 2001 From: q632394 Date: Tue, 26 Nov 2024 16:22:07 +0100 Subject: [PATCH 46/48] Transform Json data into RDF triples using SHACL shapes and SPARQL queries Create end to end integration test Create a websocket interface to allow dependency injection in order to test the client Rename files to use the naming convention Add triples to RDF Server Add feature to rewirte and mantain the triple output messages Correct collection of old triples after update messages Correct test to use the acutal observation identifier COVESA:Websocket client Integration JSON-to-RDF Converter Add variable description Update minimum CMake version to 3.25 to have the be compatible with FindBoost Policy CMP0167 Update CMakeLists for Linux compatibility Update Required cmake version because it is required in the serd project Code refactoring Remove unnecessary check of serd installation, it is not required any more since CMake-Serd is included in the project Adapt code to use the CMake-Serd library Move triple writer files to the correct project folder Fix Code to use the File Handler interface Use interface convention Transform JSON Data into RDF Triples Using SHACL Shapes and SPARQL Queries Remove the test output result Check serd library installation Signed-off-by: q632394 --- cdsp/knowledge-layer/CMakeLists.txt | 84 +++- cdsp/knowledge-layer/README.md | 39 +- .../rdf-writer/CMakeLists.txt | 25 ++ .../json-rdf-convertor/rdf-writer/README.md | 31 +- .../rdf-writer/src/triple_assembler.cpp | 327 ++++++++++++++ .../rdf-writer/src/triple_assembler.h | 61 +++ .../rdf-writer/src/triple_writer.cpp | 368 +++++++++++++++ .../rdf-writer/src/triple_writer.h | 59 +++ .../rdf-writer/tests/CMakeLists.txt | 27 ++ .../tests/serd_library_tests/CMakeLists.txt | 6 + .../tests/serd_library_tests/README.md | 35 ++ .../serd_triple_writer_example.cpp | 114 +++++ .../tests/triple_assembler_unit_test.cpp | 425 ++++++++++++++++++ .../tests/triple_writer_integration_test.cpp | 261 +++++++++++ .../json-rdf-convertor/utils/README.md | 1 - .../json-rdf-convertor/utils/data_structs.h | 74 --- .../utils/file_handler_impl.cpp | 48 ++ .../utils/file_handler_impl.h | 18 + .../json-rdf-convertor/utils/i_file_handler.h | 15 + .../json-rdf-convertor/utils/utils.h | 89 ---- .../connector/utils/data_types.h | 36 +- .../connector/utils/helper.cpp | 134 +++++- cdsp/knowledge-layer/connector/utils/helper.h | 14 +- .../connector/utils/message_utils.cpp | 61 ++- .../connector/utils/message_utils.h | 4 +- .../connector/utils/model_config.cpp | 33 +- .../connector/utils/model_config.h | 2 + .../connector/websocket-client/CMakeLists.txt | 28 +- .../connector/websocket-client/README.md | 2 +- .../connector/websocket-client/main.cpp | 50 ++- .../real_websocket_connection.cpp | 79 ++++ .../real_websocket_connection.h | 43 ++ .../websocket-client/tests/CMakeLists.txt | 18 + .../tests/mock_websocket_connection.h | 86 ++++ .../websocket_client_integration_test.cpp | 254 +++++++++++ .../websocket-client/websocket_client.cpp | 163 ++++--- .../websocket-client/websocket_client.h | 48 +- .../websocket-client/websocket_interface.h | 59 +++ .../examples/use-case/.gitignore | 2 + .../examples/use-case/README.md | 2 + .../model/output/generated_triples.ttl | 72 +-- ...tion_data_property.rq => data_property.rq} | 2 +- ..._object_property.rq => object_property.rq} | 6 +- ..._vss_data_property.rq => data_property.rq} | 10 +- ..._object_property.rq => object_property.rq} | 6 +- .../model/shacl/observation_shacl.ttl | 2 +- .../use-case/model/shacl/vss_shacl.ttl | 126 +++--- .../symbolic-reasoner/rdfox/CMakeLists.txt | 18 + .../symbolic-reasoner/rdfox/README.md | 10 +- .../symbolic-reasoner/rdfox/src/README.md | 26 +- .../{rdfox-adapter.cpp => rdfox_adapter.cpp} | 14 +- .../src/{rdfox-adapter.h => rdfox_adapter.h} | 7 +- .../rdfox/tests/CMakeLists.txt | 48 +- .../rdfox-service-test/CMakeLists.txt | 4 +- .../rdfox-service-test/rdfox_test_main.cpp | 0 .../tests/rdfox_adapter_integration_test.cpp | 111 +++++ ...r_unit.cpp => rdfox_adapter_unit_test.cpp} | 54 ++- .../tests/test_rdfox_adapter_integration.cpp | 78 ---- cdsp/knowledge-layer/tests/CMakeLists.txt | 26 ++ .../common_fixtures/init_config_fixture.cpp | 26 ++ .../common_fixtures/init_config_fixture.h | 13 + .../common_fixtures/model_config_fixture.cpp | 32 ++ .../common_fixtures/model_config_fixture.h | 10 + .../common_fixtures/server_data_fixture.cpp | 21 + .../common_fixtures/server_data_fixture.h | 11 + .../tests/utils/random_utils.cpp | 31 ++ .../tests/utils/random_utils.h | 16 + .../tests/utils/utc_date_utils.cpp | 48 ++ .../tests/utils/utc_date_utils.h | 16 + .../knowledge-layer/tests/utils/vin_utils.cpp | 38 ++ cdsp/knowledge-layer/tests/utils/vin_utils.h | 19 + 71 files changed, 3540 insertions(+), 586 deletions(-) create mode 100644 cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/CMakeLists.txt create mode 100644 cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/src/triple_assembler.cpp create mode 100644 cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/src/triple_assembler.h create mode 100644 cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/src/triple_writer.cpp create mode 100644 cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/src/triple_writer.h create mode 100644 cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/tests/CMakeLists.txt create mode 100644 cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/tests/serd_library_tests/CMakeLists.txt create mode 100644 cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/tests/serd_library_tests/README.md create mode 100644 cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/tests/serd_library_tests/serd_triple_writer_example.cpp create mode 100644 cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/tests/triple_assembler_unit_test.cpp create mode 100644 cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/tests/triple_writer_integration_test.cpp delete mode 100644 cdsp/knowledge-layer/connector/json-rdf-convertor/utils/README.md delete mode 100644 cdsp/knowledge-layer/connector/json-rdf-convertor/utils/data_structs.h create mode 100644 cdsp/knowledge-layer/connector/json-rdf-convertor/utils/file_handler_impl.cpp create mode 100644 cdsp/knowledge-layer/connector/json-rdf-convertor/utils/file_handler_impl.h create mode 100644 cdsp/knowledge-layer/connector/json-rdf-convertor/utils/i_file_handler.h delete mode 100644 cdsp/knowledge-layer/connector/json-rdf-convertor/utils/utils.h create mode 100644 cdsp/knowledge-layer/connector/websocket-client/real_websocket_connection.cpp create mode 100644 cdsp/knowledge-layer/connector/websocket-client/real_websocket_connection.h create mode 100644 cdsp/knowledge-layer/connector/websocket-client/tests/CMakeLists.txt create mode 100644 cdsp/knowledge-layer/connector/websocket-client/tests/mock_websocket_connection.h create mode 100644 cdsp/knowledge-layer/connector/websocket-client/tests/websocket_client_integration_test.cpp create mode 100644 cdsp/knowledge-layer/connector/websocket-client/websocket_interface.h create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/.gitignore rename cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/default/{query_observation_data_property.rq => data_property.rq} (82%) rename cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/default/{query_observation_object_property.rq => object_property.rq} (57%) rename cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/vss/{query_vss_data_property.rq => data_property.rq} (63%) rename cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/vss/{query_vss_object_property.rq => object_property.rq} (60%) create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/rdfox/CMakeLists.txt rename cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/{rdfox-adapter.cpp => rdfox_adapter.cpp} (93%) rename cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/{rdfox-adapter.h => rdfox_adapter.h} (86%) rename cdsp/knowledge-layer/symbolic-reasoner/rdfox/{ => tests}/rdfox-service-test/CMakeLists.txt (84%) rename cdsp/knowledge-layer/symbolic-reasoner/rdfox/{ => tests}/rdfox-service-test/rdfox_test_main.cpp (100%) create mode 100644 cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/rdfox_adapter_integration_test.cpp rename cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/{test_rdfox_adapter_unit.cpp => rdfox_adapter_unit_test.cpp} (86%) delete mode 100644 cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/test_rdfox_adapter_integration.cpp create mode 100644 cdsp/knowledge-layer/tests/CMakeLists.txt create mode 100644 cdsp/knowledge-layer/tests/common_fixtures/init_config_fixture.cpp create mode 100644 cdsp/knowledge-layer/tests/common_fixtures/init_config_fixture.h create mode 100644 cdsp/knowledge-layer/tests/common_fixtures/model_config_fixture.cpp create mode 100644 cdsp/knowledge-layer/tests/common_fixtures/model_config_fixture.h create mode 100644 cdsp/knowledge-layer/tests/common_fixtures/server_data_fixture.cpp create mode 100644 cdsp/knowledge-layer/tests/common_fixtures/server_data_fixture.h create mode 100644 cdsp/knowledge-layer/tests/utils/random_utils.cpp create mode 100644 cdsp/knowledge-layer/tests/utils/random_utils.h create mode 100644 cdsp/knowledge-layer/tests/utils/utc_date_utils.cpp create mode 100644 cdsp/knowledge-layer/tests/utils/utc_date_utils.h create mode 100644 cdsp/knowledge-layer/tests/utils/vin_utils.cpp create mode 100644 cdsp/knowledge-layer/tests/utils/vin_utils.h diff --git a/cdsp/knowledge-layer/CMakeLists.txt b/cdsp/knowledge-layer/CMakeLists.txt index e7e16b9..4fc581a 100644 --- a/cdsp/knowledge-layer/CMakeLists.txt +++ b/cdsp/knowledge-layer/CMakeLists.txt @@ -1,26 +1,66 @@ -cmake_minimum_required(VERSION 3.10) - +cmake_minimum_required(VERSION 3.25) project(knowledge-layer) # C++ standard set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) -# Find Boost libraries -find_package(Boost 1.86.0 REQUIRED COMPONENTS system filesystem thread) +# Set the policy related to changes in handling the FindBoost module +cmake_policy(SET CMP0167 NEW) -if(WIN32) - include_directories(${Boost_INCLUDE_DIRS}) -endif() +# Find Boost libraries +find_package(Boost 1.86 REQUIRED COMPONENTS system filesystem thread) -# FetchContent to include nlohmann/json +# FetchContent to include dependencies include(FetchContent) + +# ######################## +# nlohmann/json dependency +# ######################## + FetchContent_Declare( - json - GIT_REPOSITORY https://github.com/nlohmann/json.git - GIT_TAG v3.11.3 + json + GIT_REPOSITORY https://github.com/nlohmann/json.git + GIT_TAG v3.11.3 ) FetchContent_MakeAvailable(json) +# ##################### +# serd-cmake dependency +# ##################### + +FetchContent_Declare( + serd + GIT_REPOSITORY https://github.com/jtsylve/serd-cmake.git + GIT_TAG e4ace09 # Hash of the last stable commit +) + +# Ensure SERD_BUILD_SERDI is OFF to prevent building serdi executable +set(SERD_BUILD_SERDI OFF CACHE BOOL "" FORCE) +FetchContent_MakeAvailable(serd) + +# Exclude serdi target from all builds if it exists +if (TARGET serdi) + set_target_properties(serdi PROPERTIES EXCLUDE_FROM_ALL TRUE EXCLUDE_FROM_DEFAULT_BUILD TRUE) +endif() + +# Set SERD_LIBRARIES variable +set(SERD_LIBRARIES serd) + +# ##################### +# GoogleTest dependency +# ##################### + +set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) +FetchContent_Declare( + googletest + GIT_REPOSITORY https://github.com/google/googletest.git + GIT_TAG v1.15.2 +) +FetchContent_MakeAvailable(googletest) + +# #################### + # Output directory for the executable set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) @@ -30,9 +70,25 @@ set(PROJECT_ROOT_DIR "${CMAKE_SOURCE_DIR}") # Pass the root directory to your C++ code add_compile_definitions(PROJECT_ROOT="${PROJECT_ROOT_DIR}") +# Enable testing enable_testing() -# Add subdirectory for the websocket-client +# Add subdirectories for project modules and tests +add_subdirectory(connector/json-rdf-convertor/rdf-writer) add_subdirectory(connector/websocket-client) -add_subdirectory(symbolic-reasoner/rdfox/rdfox-service-test) -add_subdirectory(symbolic-reasoner/rdfox/tests) \ No newline at end of file +add_subdirectory(connector/websocket-client/tests) +add_subdirectory(connector/json-rdf-convertor/rdf-writer/tests) +add_subdirectory(connector/json-rdf-convertor/rdf-writer/tests/serd_library_tests) +add_subdirectory(symbolic-reasoner/rdfox) +add_subdirectory(symbolic-reasoner/rdfox/tests) +add_subdirectory(symbolic-reasoner/rdfox/tests/rdfox-service-test) +add_subdirectory(tests) + +# Define the main executable target +add_executable(reasoner_client connector/websocket-client/main.cpp) + +# Link the websocket_client library to main +target_link_libraries(reasoner_client + PRIVATE + websocket_client +) \ No newline at end of file diff --git a/cdsp/knowledge-layer/README.md b/cdsp/knowledge-layer/README.md index f06c6e0..1be414d 100644 --- a/cdsp/knowledge-layer/README.md +++ b/cdsp/knowledge-layer/README.md @@ -6,7 +6,7 @@ This project contains a WebSocket client built in C++17, which communicates with Before setting up the project, make sure you have the following installed: -- **CMake** (version 3.10 or higher) +- **CMake** (version 3.25 or higher) - **Boost** (version 1.86.0 or higher) - **g++/clang++** with C++17 support - **Homebrew** (for macOS users) @@ -75,7 +75,6 @@ Before setting up the project, make sure you have the following installed: Make sure you have Windows SDK 10 installed. To check start the Visual Studio Installer (https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/) and look for Visual Studio Build Tools. Here look for the component 'Desktop development with C++' and install it if required. - ## Project Setup **Build the WebSocket Client**: @@ -99,16 +98,21 @@ Before setting up the project, make sure you have the following installed: If the build is successful, the WebSocket client executable will be generated in the `build/bin/` directory. -## Running the WebSocket Client +## Running the Reasoner WebSocket Client -### Environment Variables +The [Reasoner client](./connector/websocket-client/README.md) integrates with both the WebSocket server and the RDFox triple store. The client processes incoming messages and generates RDF triples, which are then stored in RDFox. -The project requires certain environment variables to work with the WebSocket server’s host and port. By default, the WebSocket client connects to the `information-layer`. See how to configure these variables [here](../information-layer/README.md). +### Websocket Server and RDFox Configuration +The project requires certain environment variables to work with the WebSocket server and RDFox server. By default, the WebSocket client connects to the Web Socket server located in the [`information-layer`](../information-layer/README.md), and the RDFox server started as a [Docker container](/docker/README.md#rdfox-restful-api). -- **HOST_WEBSOCKET_SERVER:** Specifies the hostname of the WebSocket server. The default is `localhost`. +- **HOST_WEBSOCKET_SERVER:** Specifies the hostname of the WebSocket server. The default is `127.0.0.1`. - **PORT_WEBSOCKET_SERVER:** Specifies the port for connecting to the WebSocket server. The default is `8080`. - **OBJECT_ID:** The object id is required to subscribe and retrieve information for a specific object (e.g. VIN (Vehicle Identification Number) for VSS (Vehicle Signal Specification) data). Use the object id (in this case VIN) configured in the [`information-layer`](../information-layer/README.md). +- **HOST_RDFOX_SERVER:** Hostname of the RDFox server. The default is `127.0.0.1`. +- **PORT_RDFOX_SERVER:** Port for RDFox server. The default is `12110`. +- **AUTH_RDFOX_SERVER_BASE64:** Base64-encoded credentials for RDFox authentication. The default is `cm9vdDphZG1pbg==` (For `root:admin` encoded in base64). +- **RDFOX_DATASTORE:** Data store used in RDFox server to store the generated data. The default is `ds-test`. You can customize the WebSocket server configuration by adding the following environment variables in the `/docker/.env` file. Below is an example of what the file could look like: @@ -120,17 +124,32 @@ You can customize the WebSocket server configuration by adding the following env HOST_WEBSOCKET_SERVER="your_custom_host" PORT_WEBSOCKET_SERVER="your_custom_port" OBJECT_ID="OBJECT_ID_TO_SUBSCRIBE" + +################################## +# RDFox CONFIGURATION # +################################## + +HOST_RDFOX_SERVER="your_custom_rdfox_server_host" +PORT_RDFOX_SERVER="your_custom_rdfox_server_port" +AUTH_RDFOX_SERVER_BASE64="your_custom_rdfox_server_authentication" +RDFOX_DATASTORE="your_custom_rdfox_server_data_store" ``` -### Start the Websocket Client +### Start the Reasoner Websocket Client After successfully building the client, you can run it with the following command (VIN is required, if any docker for the knowledge layer is running): ```bash -VIN= ./build/bin/websocket_client +OBJECT_ID= ./build/bin/reasoner_client ``` To display a list of available environment variables and their default values, run the application with the `--help` flag: ```bash -./websocket_client --help -``` \ No newline at end of file +./reasoner_client --help +``` + +### Using RDFox API in the Client + +The WebSocket client integrates with the [TripleAssembler](./connector/json-rdf-convertor/rdf-writer/README.md) component, which utilizes the[RDFox API](/docker/README.md#rdfox-restful-api) to process incoming data into RDF triples. The triples are then stored in RDFox for reasoning and querying. + +This integration allows the Reasoner client to interpret data, create RDF triples, and store them in a semantic knowledge graph, enabling rich queries and reasoning capabilities. \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/CMakeLists.txt b/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/CMakeLists.txt new file mode 100644 index 0000000..1011601 --- /dev/null +++ b/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/CMakeLists.txt @@ -0,0 +1,25 @@ +# Define the rdf-writer library +add_library(rdf_writer + src/triple_assembler.cpp + src/triple_writer.cpp + ../utils/file_handler_impl.cpp + ../../utils/helper.cpp +) + +# Include directories +target_include_directories(rdf_writer + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/src + ${serd_SOURCE_DIR}/include + ${PROJECT_ROOT_DIR}/connector/json-rdf-convertor/utils + ${PROJECT_ROOT_DIR}/connector/utils +) + +# Link libraries +target_link_libraries(rdf_writer + PUBLIC + rdfox + ${SERD_LIBRARIES} + PRIVATE + nlohmann_json::nlohmann_json +) \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/README.md b/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/README.md index fd9e641..4b26c24 100644 --- a/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/README.md +++ b/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/README.md @@ -1 +1,30 @@ -tbd \ No newline at end of file +# RDF Triple Assembler + +RDF Triple Assembler transforms structured data into RDF triples using the [RDFAdapter](/cdsp/knowledge-layer/symbolic-reasoner/rdfox/README.md) and `TripleWriter` components. It enables developers to convert messages into RDF (Resource Description Framework) triples for semantic data storage and query purposes. + +## Components + +### TripleAssembler + +`TripleAssembler` processes data messages, extracting nodes, querying RDF properties, and calling [`TripleWriter`](#rdf-triple-writer) to generate triples. The main function is `transformMessageToRDFTriple`, which converts each node in the message into RDF triples and stores them in the configured output file. + +### RDF Triple Writer + +`TripleWriter` creates and manages RDF triples using the [Serd library](https://drobilla.net/software/serd.html). It supports adding object and data triples with prefixes, generating the RDF output in any of this formats: + +- [Turtle](https://www.w3.org/TR/turtle/) is often used for readability and compactness, making it ideal for documents that will be read and edited by humans. +- [N-Triples](https://www.w3.org/TR/n-triples/) is suitable for large datasets or streaming because of its simplicity and line-based structure, which is easy to parse. +- [N-Quads](https://www.w3.org/TR/n-quads/) is useful when you need to include additional contextual information (e.g., the source or graph of a triple). +- [TriG](https://www.w3.org/TR/trig/) provides a structured way to group related triples, making it useful for complex datasets with multiple contexts or named graphs. + +**Example Usage** +```cpp +TripleWriter writer; +writer.setTripleIdentifier("ExampleID"); +writer.addRDFObjectToTriple("prefix car: ", std::make_tuple("car:Vehicle", "car:hasPart", "car:Engine")); +std::string rdf_output = writer.generateTripleOutput(RDFSyntaxType::TURTLE); +``` + +# Testing + +An Integration [test](../tests/) is provided to ensure functionality. Tests cover the main components (`TripleAssembler`, `TripleWriter`) to verify to verify message transformation, RDF generation, and error handling. \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/src/triple_assembler.cpp b/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/src/triple_assembler.cpp new file mode 100644 index 0000000..5599e85 --- /dev/null +++ b/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/src/triple_assembler.cpp @@ -0,0 +1,327 @@ +#include "triple_assembler.h" + +#include +#include +#include +#include + +#include "helper.h" + +using json = nlohmann::json; + +TripleAssembler::TripleAssembler(const ModelConfig& model_config, RDFoxAdapter& adapter, + IFileHandler& file_reader, TripleWriter& triple_writer) + : model_config_(model_config), + rdfox_adapter_(adapter), + file_handler_(file_reader), + triple_writer_(triple_writer) {} + +/** + * @brief Initializes the TripleAssembler by checking the data store and loading SHACL shapes. + * + * @throws std::runtime_error If the data store is unavailable or if SHACL shapes cannot be loaded. + */ +void TripleAssembler::initialize() { + if (!rdfox_adapter_.checkDataStore()) { + throw std::runtime_error("Initialization failed: Unable to generate triples."); + } + if (!model_config_.shacl_shapes_files.empty()) { + for (const auto& file : model_config_.shacl_shapes_files) { + const std::string ttl_data = file_handler_.readFile(file); + if (ttl_data.empty() || !rdfox_adapter_.loadData(ttl_data)) { + throw std::runtime_error( + "No SHACL shapes could be loaded. The triples cannot be generated."); + } + } + } else { + throw std::runtime_error( + "No SHACL shapes were found to load. The triples cannot be generated."); + } +} + +/** + * Transforms a DataMessage into RDF triples and stores them. + * + * This function checks the availability of the RDFox datastore and, if available, + * processes each node in the DataMessage to generate RDF triples. The generated + * triples are then stored using the triple writer. + * + * @param message The DataMessage containing nodes and metadata to be transformed into RDF triples. + * @throws std::runtime_error If the datastore is not available. + */ +void TripleAssembler::transformMessageToRDFTriple(const DataMessage& message) { + if (!rdfox_adapter_.checkDataStore()) { + throw std::runtime_error("Failed to call datastore. The triples cannot be generated."); + } + + // Add the identifier to the triples that will be generated + triple_writer_.initiateTriple(message.header.id); + std::string msg_tree = Helper::toLowerCase(message.header.tree); + for (const auto node : message.nodes) { + try { + generateTriplesFromNode(node, msg_tree, message.header.date_time); + } catch (const std::exception& e) { + std::cerr << "An error occurred creating the TTL triples: " << e.what() << std::endl; + } + } + + // Get the document of the generated triples + std::string generated_triples = + triple_writer_.generateTripleOutput(model_config_.reasoner_settings.output_format); + + if (!generated_triples.empty()) { + storeTripleOutput(generated_triples); + } else { + std::cout << "Any triples have been generated for the update message"; + } +} + +/** + * @brief Generates RDF triples from a given node and its associated metadata. + * + * This function processes a node by extracting its object and data elements, + * querying necessary prefixes and values, and then adding these as RDF objects + * and data to the triple writer. + * + * @param node The node containing the name and value to be transformed into RDF triples. + * @param msg_tree The message tree structure used for querying RDF data. + * @param msg_date_time The date and time associated with the message, used in the Triples + * observations. + */ +void TripleAssembler::generateTriplesFromNode(const Node& node, const std::string& msg_tree, + const std::string& msg_date_time) { + // Split node data point into object and data elements + const auto [object_elements, data_element] = extractObjectsAndDataElements(node.name); + + // Query and add RDF Objects + for (std::size_t i = 1; i < object_elements.size(); ++i) { + const auto [prefixes, rdf_object_values] = + getQueryPrefixesAndData(msg_tree, "object", object_elements[i - 1], object_elements[i]); + + triple_writer_.addRDFObjectToTriple(prefixes, rdf_object_values); + } + + // Query and add RDF Data + const auto [prefixes, rdf_data_values] = getQueryPrefixesAndData( + msg_tree, "data", object_elements[object_elements.size() - 1], data_element); + + triple_writer_.addRDFDataToTriple(prefixes, rdf_data_values, node.value, msg_date_time); +} + +/** + * Extracts objects and data elements from a given node name. + * + * @param node_name The node name to be processed, expected to be in the format + * of dot-separated elements. + * @return A pair where the first element is a vector of strings representing + * the objects, and the second element is a string representing the + * data element. + * @throws std::runtime_error if the node name contains fewer than two elements. + */ +std::pair, std::string> TripleAssembler::extractObjectsAndDataElements( + const std::string& node_name) { + std::vector elements; + std::stringstream ss(node_name); + std::string token; + + // Split the node name by dots + while (std::getline(ss, token, '.')) { + elements.push_back(token); + } + + // At least two elements are required to create a triple + if (elements.size() < 2) { + throw std::runtime_error("The message node must contain at least two elements: " + + node_name); + } + // Separate the last element as `data_element` + std::string data_element = elements.back(); + elements.pop_back(); + + return {elements, data_element}; +} + +/** + * @brief Retrieves SPARQL query prefixes and data elements for RDF triple generation. + * + * This method constructs a SPARQL query based on the provided message tree and property type. + * It attempts to retrieve the query from a specified file path. If the query is not found, + * it defaults to a query from a "default" path. + * + * @param message_tree The path or identifier for the message tree to query. + * @param property_type The type of property ("object" or "data") to query. + * @param subject_class The class name of the subject in the RDF triple. + * @param object_class The class name of the object in the RDF triple. + * @return A pair consisting of: + * - A string containing the extracted prefixes from the SPARQL query. + * - A tuple containing the extracted three elements from the query result. + * + * @throws std::runtime_error If the SPARQL query cannot be retrieved or executed. + */ +std::pair> +TripleAssembler::getQueryPrefixesAndData(const std::string& message_tree, + const std::string& property_type, + const std::string& subject_class, + const std::string& object_class) { + std::string sparql_query = getQueryFromFilePath(message_tree, property_type); + + if (sparql_query.empty()) { + sparql_query = getQueryFromFilePath("default", property_type); + } + + if (sparql_query.empty()) { + throw std::runtime_error("Failed to querying " + property_type + + " properties in the model config. The triples cannot be " + "generated."); + } + + replaceAllSparqlVariables(sparql_query, "%A%", subject_class); + replaceAllSparqlVariables(sparql_query, "%B%", object_class); + + const std::string query_result = rdfox_adapter_.queryData(sparql_query); + const auto element_values = extractElementValuesFromQuery(query_result); + const std::string prefixes = extractPrefixesFromQuery(sparql_query); + return std::make_pair(prefixes, element_values); +} + +/** + * @brief Retrieves a SPARQL query from a file based on the specified tree and property type. + * + * @param tree The identifier for the message tree to search for query files. + * @param property_type The type of property for which the query is needed. + * @return A string containing the SPARQL query if found, or an empty string if no matching file is + * found. + */ +std::string TripleAssembler::getQueryFromFilePath(const std::string& tree, + const std::string& property_type) { + auto it = model_config_.triple_assembler_queries_files.find(tree); + if (it != model_config_.triple_assembler_queries_files.end()) { + const std::vector& files = it->second; + for (const auto& file : files) { + if (file.find(property_type + "_property") != std::string::npos) { + return file_handler_.readFile(file); + } + } + } + return ""; +} + +/** + * @brief Replaces all occurrences of a specified variable in a SPARQL query string. + * + * @param query The SPARQL query string in which the variable replacement will occur. + * @param from The variable name to be replaced in the query string. + * @param to The new value that will replace the specified variable in the query string. + */ +void TripleAssembler::replaceAllSparqlVariables(std::string& query, const std::string& from, + const std::string& to) { + size_t start_pos = 0; + while ((start_pos = query.find(from, start_pos)) != std::string::npos) { + query.replace(start_pos, from.length(), to); + start_pos += to.length(); + } +} + +/** + * @brief Extracts subject, predicate, and object values from a query string. + * + * @param query The input query string from which to extract values. + * @return A tuple containing the subject, predicate, and object as strings. + */ +std::tuple TripleAssembler::extractElementValuesFromQuery( + const std::string& query) { + std::istringstream stream(query); + std::string line; + + // Skip the first line + std::getline(stream, line); + + // Read the second line + std::getline(stream, line); + + // Extract the three values + std::istringstream second_line_stream(line); + std::string subject, predicate, object; + second_line_stream >> subject >> predicate >> object; + + return std::make_tuple(subject, predicate, object); +} + +/** + * @brief Extracts prefix declarations from a SPARQL query string. + * + * @param query The input SPARQL query string from which to extract prefix declarations. + * @return A string containing all prefix declarations found in the query, each on a new line. + */ +std::string TripleAssembler::extractPrefixesFromQuery(const std::string& query) { + // Regular expression to match lines that start with "prefix" and capture the entire line + std::regex prefix_regex(R"((prefix\s+\w+:\s+<[^>]+>))", std::regex::icase); + std::smatch match; + std::string result; + std::istringstream stream(query); + std::string line; + + // Iterate through each line and check if it matches the prefix pattern + while (std::getline(stream, line)) { + if (std::regex_search(line, match, prefix_regex)) { + result += line + "\n"; + } + } + + return result; +} + +/** + * @brief Stores the triple output to a file. + * + * This function constructs a file name using the configured output file path, + * the current timestamp, and the appropriate file extension. It then writes + * the provided triple output to this file. + * + * @param triple_output The string containing the triple output to be stored. + */ +void TripleAssembler::storeTripleOutput(const std::string& triple_output) { + if (!rdfox_adapter_.loadData(triple_output)) { + std::cerr << "It was a problem loading triple data to RDF-Server" << std::endl; + } + + // create file name + const std::string file_name = model_config_.output_file_path + "gen_rdf_triple_" + + Helper::getFormattedTimestamp("%H", false, true) + + getFileExtension(); + + // Add the current time to the log + std::ostringstream output; + output << "# Output from " << Helper::getFormattedTimestamp("%Y-%m-%dT%H:%M:%S", true, true) + << "\n\n" + << triple_output << "\n\n"; + + // Write the file + file_handler_.writeFile(file_name, output.str(), true); + std::cout << "A triple has been generated under: " << file_name << std::endl; +} + +/** + * @brief Determines the file extension based on the configured RDF output format. + * + * This function retrieves the appropriate file extension for the RDF output format + * specified in the model configuration. It supports various RDF serialization formats + * such as Turtle, N-Quads, N-Triples, and TriG. + * + * @return A string representing the file extension for the current RDF syntax type. + * @throws std::runtime_error If the RDF syntax type is unsupported. + */ +std::string TripleAssembler::getFileExtension() { + switch (model_config_.reasoner_settings.output_format) { + case RDFSyntaxType::TURTLE: + return ".ttl"; + case RDFSyntaxType::NQUADS: + return ".nq"; + case RDFSyntaxType::NTRIPLES: + return ".nt"; + case RDFSyntaxType::TRIG: + return ".trig"; + default: + throw std::runtime_error("Unsupported Serd syntax format"); + } +} \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/src/triple_assembler.h b/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/src/triple_assembler.h new file mode 100644 index 0000000..6b6a52a --- /dev/null +++ b/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/src/triple_assembler.h @@ -0,0 +1,61 @@ +#ifndef TRIPLE_ASSEMBLER_H +#define TRIPLE_ASSEMBLER_H + +#include +#include +#include +#include + +#include "../../utils/i_file_handler.h" +#include "data_types.h" +#include "rdfox_adapter.h" +#include "triple_writer.h" + +class TripleAssembler { + public: + TripleAssembler(const ModelConfig& model_config, RDFoxAdapter& adapter, + IFileHandler& file_reader, TripleWriter& triple_writer); + + void initialize(); + + virtual void transformMessageToRDFTriple(const DataMessage& message); + + ~TripleAssembler() = default; + + protected: + virtual void generateTriplesFromNode(const Node& node, const std::string& msg_tree, + const std::string& msg_date_time); + + virtual void storeTripleOutput(const std::string& triple_output); + + private: + RDFoxAdapter& rdfox_adapter_; + IFileHandler& file_handler_; + TripleWriter& triple_writer_; + const ModelConfig& model_config_; + + const std::vector> json_data_; + + std::pair, std::string> extractObjectsAndDataElements( + const std::string& node_name); + + std::pair> + + getQueryPrefixesAndData(const std::string& message_tree, const std::string& property_type, + const std::string& subject_class, const std::string& object_class); + + std::string getQueryFromFilePath(const std::string& query_key, + const std::string& property_type); + + void replaceAllSparqlVariables(std::string& query, const std::string& from, + const std::string& to); + + std::tuple extractElementValuesFromQuery( + const std::string& input); + + std::string extractPrefixesFromQuery(const std::string& query); + + std::string getFileExtension(); +}; + +#endif // TRIPLE_ASSEMBLER_H \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/src/triple_writer.cpp b/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/src/triple_writer.cpp new file mode 100644 index 0000000..cf14944 --- /dev/null +++ b/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/src/triple_writer.cpp @@ -0,0 +1,368 @@ +#include "triple_writer.h" + +#include +#include +#include + +#include "helper.h" + +// Global string to store the Serd output +std::string serd_output; + +/** + * @brief Writes serialized data to a string. + * + * This function appends the serialized data from the buffer to the internal + * string representation. It is used to capture the output of a serialization + * process into a string. + * + * @param buf Pointer to the buffer containing the serialized data. + * @param len The length of the data in the buffer. + * @param stream A pointer to the stream, not used in this implementation. + * @return The number of bytes written to the string, which is equal to len. + */ +unsigned long write_serd_output_to_string(const void* buf, unsigned long len, void* stream) { + serd_output.append(static_cast(buf), len); + return len; +} + +/** + * @brief Initiates the TripleWriter. + * + * This function initiates and assigns a new identifier to the triple. + * + * @param identifier The new identifier for the triple. + * + * @throws std::runtime_error If the provided identifier is an empty string. + */ +void TripleWriter::initiateTriple(const std::string& identifier) { + if (identifier.empty()) + throw std::runtime_error("Triple identifier cannot be empty"); + identifier_ = identifier; + rdf_triples_definitions_.clear(); + unique_rdf_prefix_definitions_.clear(); + observation_counter_ = 0; +} + +/** + * @brief Adds an RDF object to a triple by processing its components. + * + * This function takes RDF object values and prefixes, processes them to extract + * necessary components, and constructs RDF triples. The triples are then added + * to the internal list of triple definitions. + * + * @param prefixes A string containing the prefixes to be added to the system list. + * @param rdf_object_values A tuple containing three strings representing RDF object values: + * - The first element is the class 1 RDF element. + * - The second element is the object property RDF element. + * - The third element is the class 2 RDF element. + */ +void TripleWriter::addRDFObjectToTriple( + const std::string& prefixes, + const std::tuple& rdf_object_values) { + // Add all prefixes in the system list + addSuportedPrefixes(prefixes); + + // Split prefix and identifier for each RDF object value + const auto [class_1_prefix, class_1_identifier] = + extract_prefix_and_identifier_from_rdf_element(std::get<0>(rdf_object_values)); + const auto [object_property_prefix, object_property_identifier] = + extract_prefix_and_identifier_from_rdf_element(std::get<1>(rdf_object_values)); + const auto [class_2_prefix, class_2_identifier] = + extract_prefix_and_identifier_from_rdf_element(std::get<2>(rdf_object_values)); + + // Create identifiers instances for each class + const std::string class_1_instance_uri = createInstanceUri(class_1_prefix, class_1_identifier); + const std::string class_2_instance_uri = createInstanceUri(class_2_prefix, class_2_identifier); + + TripleNodes triple_nodes; + + // Create triples + triple_nodes.subject = std::make_pair(SERD_CURIE, class_1_instance_uri); + triple_nodes.predicate = + std::make_pair(SERD_URI, "http://www.w3.org/1999/02/22-rdf-syntax-ns#type"); + triple_nodes.object = std::make_pair(SERD_CURIE, class_1_prefix + ":" + class_1_identifier); + rdf_triples_definitions_.push_back(triple_nodes); + + triple_nodes.predicate = + std::make_pair(SERD_CURIE, object_property_prefix + ":" + object_property_identifier); + triple_nodes.object = std::make_pair(SERD_CURIE, class_2_instance_uri); + rdf_triples_definitions_.push_back(triple_nodes); +} + +/** + * @brief Adds RDF data to a triple by processing its components and additional values. + * + * This function takes RDF data values, prefixes, a literal value, and a dateTime, + * processes them to extract necessary components, and constructs RDF triples. + * The triples are then added to the internal list of triple definitions. + * + * @param prefixes A string containing the prefixes to be added to the system list. + * @param rdf_data_values A tuple containing three strings representing RDF data values: + * - The first element is the class 1 RDF element. + * - The second element is the data property RDF element. + * - The third element is the data type RDF element. + * @param value A string representing the literal value to be added to the triple. + * @param dataTime A string representing the dateTime value to be added to the triple. + * @throws std::runtime_error If the value or dataTime is empty. + */ +void TripleWriter::addRDFDataToTriple( + const std::string& prefixes, + const std::tuple& rdf_data_values, + const std::string& value, const std::string& dataTime) { + if (value.empty() || dataTime.empty()) { + throw std::runtime_error("Triple value or dataTime cannot be empty"); + } + // Add all prefixes in the system list + addSuportedPrefixes(prefixes); + + // Insert a prefix to the definitions list that will be used for the observation + unique_rdf_prefix_definitions_.emplace("sosa", "http://www.w3.org/ns/sosa/"); + unique_rdf_prefix_definitions_.emplace("xsd", "http://www.w3.org/2001/XMLSchema#"); + + // Split prefix and identifier for each RDF data value + const auto [class_1_prefix, class_1_identifier] = + extract_prefix_and_identifier_from_rdf_element(std::get<0>(rdf_data_values)); + const auto [data_property_prefix, data_property_identifier] = + extract_prefix_and_identifier_from_rdf_element(std::get<1>(rdf_data_values)); + const auto [data_type_prefix, data_type_identifier] = + extract_prefix_and_identifier_from_rdf_element(std::get<2>(rdf_data_values)); + + TripleNodes triple_nodes; + + // Create identifiers instances for each class + const auto [dateTime, _] = Helper::parseISO8601ToTime(dataTime); + const std::string nowDataTime = + Helper::getFormattedTimestamp("%Y%m%d%H%M%S", false, false, dateTime); + const std::string class_1_instance_uri = createInstanceUri(class_1_prefix, class_1_identifier); + std::stringstream observation_instance_uri; + observation_instance_uri << class_1_prefix << ":" << "Observation" << nowDataTime << "O" + << observation_counter_++; + + // Create triples + triple_nodes.subject = std::make_pair(SERD_CURIE, class_1_instance_uri); + triple_nodes.predicate = + std::make_pair(SERD_URI, "http://www.w3.org/1999/02/22-rdf-syntax-ns#type"); + triple_nodes.object = std::make_pair(SERD_CURIE, class_1_prefix + ":" + class_1_identifier); + rdf_triples_definitions_.push_back(triple_nodes); + + triple_nodes.subject = std::make_pair(SERD_CURIE, observation_instance_uri.str()); + triple_nodes.object = std::make_pair(SERD_CURIE, "sosa:Observation"); + rdf_triples_definitions_.push_back(triple_nodes); + + triple_nodes.predicate = std::make_pair(SERD_CURIE, "sosa:hasFeatureOfInterest"); + triple_nodes.object = std::make_pair(SERD_CURIE, class_1_instance_uri); + rdf_triples_definitions_.push_back(triple_nodes); + + triple_nodes.predicate = std::make_pair(SERD_CURIE, "sosa:hasSimpleResult"); + triple_nodes.object = std::make_pair(SERD_LITERAL, value); + triple_nodes.datatype = + std::make_pair(SERD_CURIE, data_type_prefix + ":" + data_type_identifier); + rdf_triples_definitions_.push_back(triple_nodes); + + triple_nodes.predicate = std::make_pair(SERD_CURIE, "sosa:observedProperty"); + triple_nodes.object = + std::make_pair(SERD_CURIE, data_property_prefix + ":" + data_property_identifier); + triple_nodes.datatype = std::nullopt; + rdf_triples_definitions_.push_back(triple_nodes); + + triple_nodes.predicate = std::make_pair(SERD_CURIE, "sosa:phenomenonTime"); + triple_nodes.object = std::make_pair(SERD_LITERAL, dataTime); + triple_nodes.datatype = std::make_pair(SERD_CURIE, "xsd:dateTime"); + rdf_triples_definitions_.push_back(triple_nodes); +} + +/** + * @brief Generates a serialized RDF triple output in the specified format. + * + * This function creates a new Serd environment and writer to serialize RDF triples + * into a string format specified by the input parameter. It sets up the necessary + * namespaces and writes the triples using the Serd library. + * + * @param format The RDF syntax type to use for serialization. + * @return A string containing the serialized RDF triples. + */ +std::string TripleWriter::generateTripleOutput(const RDFSyntaxType& format) { + serd_output.clear(); + + SerdEnv* serd_env = serd_env_new(nullptr); + SerdSyntax serd_format = getSerdSyntax(format); + + // Create the writer with the base URI + SerdWriter* serd_writer = serd_writer_new(serd_format, SERD_STYLE_ABBREVIATED, serd_env, + nullptr, write_serd_output_to_string, this); + + // Declare namespaces + for (const auto& [prefix, uri] : unique_rdf_prefix_definitions_) { + SerdNode car_prefix = serd_node_from_string(SERD_CURIE, (const uint8_t*) prefix.c_str()); + SerdNode car_uri = serd_node_from_string(SERD_URI, (const uint8_t*) uri.c_str()); + serd_writer_set_prefix(serd_writer, &car_prefix, &car_uri); + } + + // Write triples + for (const TripleNodes& triple_nodes : rdf_triples_definitions_) { + SerdNode subject_node = serd_node_from_string( + triple_nodes.subject.first, (const uint8_t*) triple_nodes.subject.second.c_str()); + SerdNode predicate_node = serd_node_from_string( + triple_nodes.predicate.first, (const uint8_t*) triple_nodes.predicate.second.c_str()); + SerdNode object_node = serd_node_from_string( + triple_nodes.object.first, (const uint8_t*) triple_nodes.object.second.c_str()); + + const SerdNode* datatype_node_ptr = nullptr; + if (triple_nodes.datatype) { + SerdNode datatype_node = + serd_node_from_string(triple_nodes.datatype->first, + (const uint8_t*) triple_nodes.datatype->second.c_str()); + datatype_node_ptr = &datatype_node; + } + serd_writer_write_statement(serd_writer, 0, nullptr, &subject_node, &predicate_node, + &object_node, datatype_node_ptr, nullptr); + } + + // End the document + serd_writer_finish(serd_writer); + + // Free resources + serd_writer_free(serd_writer); + serd_env_free(serd_env); + + return Helper::trimTrailingNewlines(serd_output); +} + +void TripleWriter::clear_log_definitions() { + rdf_triples_definitions_.clear(); + unique_rdf_prefix_definitions_.clear(); +} + +/** + * @brief Converts an RDF syntax type to the corresponding Serd syntax. + * + * @param format The RDF syntax type to be converted. + * @return The corresponding Serd syntax type. + * @throws std::runtime_error if the RDF syntax type is unsupported. + */ +SerdSyntax TripleWriter::getSerdSyntax(const RDFSyntaxType& format) { + switch (format) { + case RDFSyntaxType::TURTLE: + return SerdSyntax::SERD_TURTLE; + break; + case RDFSyntaxType::NQUADS: + return SerdSyntax::SERD_NQUADS; + break; + case RDFSyntaxType::NTRIPLES: + return SerdSyntax::SERD_NTRIPLES; + break; + case RDFSyntaxType::TRIG: + return SerdSyntax::SERD_TRIG; + break; + default: + throw std::runtime_error("Unsupported Serd syntax format"); + } +} + +/** + * @brief Adds prefixes to the internal supported prefixes storage from a given string. + * + * This function processes a string containing multiple prefix definitions, + * each on a new line, and extracts the prefix and its corresponding URI using + * a regular expression. The extracted prefixes and URIs are then stored in + * an internal data structure for later use. + * + * @param prefixes A string containing prefix definitions, each in the format + * "prefix : ", separated by new lines. + */ +void TripleWriter::addSuportedPrefixes(const std::string& prefixes) { + if (!prefixes.empty()) { + // Regular expression to capture prefix and URI + std::regex pattern(R"(prefix\s+(\w+):\s+<([^>]+)>)"); + + std::istringstream stream(prefixes); + std::string line; + + while (std::getline(stream, line)) { + auto [prefix, uri] = extract_tuple_from_string(pattern, line); + unique_supported_prefixes_.emplace(prefix, uri); + } + } else { + throw std::runtime_error("Prefixes cannot be empty"); + } +} + +/** + * @brief Extracts namespace prefix and identifier value from an RDF element. + * + * @param element RDF element string in angle brackets. + * @return Tuple of namespace prefix and identifier value. + * @throws std::runtime_error If format is unsupported. + */ +std::tuple TripleWriter::extract_prefix_and_identifier_from_rdf_element( + const std::string& element) { + if (!element.empty()) { + // Regular expression to capture prefix and URI + std::regex pattern(R"(http://([^#]+)#([^>]+)>)"); + + auto [rdf_namespace, identifier] = extract_tuple_from_string(pattern, element); + addTriplePrefix(rdf_namespace); + return std::make_tuple(rdf_namespace, identifier); + } else { + throw std::runtime_error("The RDF element cannot be empty"); + } +} + +/** + * @brief Adds a prefix to the triple prefixes if it matches a URI. + * + * This function searches through the unique supported prefixes and checks if the given URI contains + * the specified prefix. If a match is found, the prefix and URI are added to the unique tuple + * prefixes. + * + * @param prefix The prefix to be added to the triple prefixes. + */ +void TripleWriter::addTriplePrefix(std::string& prefix) { + std::string found_prefix; + + // Search and add a URI and prefix to the triple prefixes + for (const auto& [system_prefix, uri] : unique_supported_prefixes_) { + if (uri.find(prefix) != std::string::npos) { + unique_rdf_prefix_definitions_.emplace(system_prefix, uri); + prefix = system_prefix; + break; + } + } +} + +/** + * @brief Creates a URI for an instance using the provided prefix and name. + * + * @param prefix The prefix to be used in the URI. + * @param name The name to be used in the URI. + * @return A string representing the constructed URI. + * @throws std::runtime_error if the triple identifier has not been set. + */ +std::string TripleWriter::createInstanceUri(const std::string& prefix, const std::string& name) { + if (identifier_.empty()) { + throw std::runtime_error("Triple identifier has not been set"); + } + return prefix + ":" + name + identifier_; +} + +/** + * @brief Extracts a tuple of strings from a given input string using a regex pattern. + * + * @param pattern The regex pattern used to search the input string. It should be designed to + * capture two groups. + * @param value The input string to be searched using the regex pattern. + * @return A tuple containing the two captured groups as strings. + * @throws std::runtime_error If the input string does not match the pattern or does not capture + * exactly two groups. + */ +std::tuple TripleWriter::extract_tuple_from_string(std::regex pattern, + std::string value) { + std::smatch matches; + // Check if the pattern matches + if (std::regex_search(value, matches, pattern) && matches.size() == 3) { + return std::make_tuple(matches[1], matches[2]); + } else { + throw std::runtime_error("Unsupported input format: " + value); + } +} diff --git a/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/src/triple_writer.h b/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/src/triple_writer.h new file mode 100644 index 0000000..5a156d8 --- /dev/null +++ b/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/src/triple_writer.h @@ -0,0 +1,59 @@ +#ifndef TRIPLE_WRITER_H +#define TRIPLE_WRITER_H + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "data_types.h" + +struct TripleNodes { + std::pair subject; + std::pair predicate; + std::pair object; + std::optional> datatype; +}; + +class TripleWriter { + public: + virtual void initiateTriple(const std::string& identifier); + virtual void addRDFObjectToTriple( + const std::string& prefixes, + const std::tuple& rdf_object_values); + virtual void addRDFDataToTriple( + const std::string& prefixes, + const std::tuple& rdf_data_values, + const std::string& value, const std::string& dataTime); + + virtual std::string generateTripleOutput(const RDFSyntaxType& format); + + virtual void clear_log_definitions(); + + ~TripleWriter() = default; + + private: + std::string identifier_; + int observation_counter_ = 0; + + std::unordered_map unique_supported_prefixes_; + std::map unique_rdf_prefix_definitions_; + std::vector rdf_triples_definitions_; + + SerdSyntax getSerdSyntax(const RDFSyntaxType& format); + void addSuportedPrefixes(const std::string& prefixes); + void addTriplePrefix(std::string& prefix); + std::string createInstanceUri(const std::string& prefix, const std::string& name); + std::tuple extract_tuple_from_string(std::regex pattern, + std::string value); + + std::tuple extract_prefix_and_identifier_from_rdf_element( + const std::string& element); +}; + +#endif // TRIPLE_WRITER_H diff --git a/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/tests/CMakeLists.txt b/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/tests/CMakeLists.txt new file mode 100644 index 0000000..5eefbf1 --- /dev/null +++ b/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/tests/CMakeLists.txt @@ -0,0 +1,27 @@ +# Add the integration test executable for TripleWriter +add_executable(triple_writer_integration_tests triple_writer_integration_test.cpp) +target_link_libraries(triple_writer_integration_tests + PRIVATE + GTest::gtest_main + rdf_writer +) + +# Add the unit test executable for TripleAssembler +add_executable(triple_assembler_unit_tests triple_assembler_unit_test.cpp) +target_link_libraries(triple_assembler_unit_tests + PRIVATE + GTest::gtest_main + GTest::gmock + rdf_writer +) + +# Add unit and integration tests to CTest +add_test(NAME TripleWriterIntegrationTests COMMAND triple_writer_integration_tests) +add_test(NAME TripleAssemblerUnitTests COMMAND triple_assembler_unit_tests) + +# Define custom output directory for test binaries +set_target_properties(triple_writer_integration_tests PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/tests") +set_target_properties(triple_assembler_unit_tests PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/tests") + +# Ensure tests are built with the all target +add_custom_target(rdf_writer_tests ALL DEPENDS triple_writer_integration_tests triple_assembler_unit_tests) \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/tests/serd_library_tests/CMakeLists.txt b/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/tests/serd_library_tests/CMakeLists.txt new file mode 100644 index 0000000..a51f287 --- /dev/null +++ b/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/tests/serd_library_tests/CMakeLists.txt @@ -0,0 +1,6 @@ +# Define and link Serd to your example executable +add_executable(serd_triple_writer_example serd_triple_writer_example.cpp) +target_link_libraries(serd_triple_writer_example ${SERD_LIBRARIES} Boost::system Boost::filesystem Boost::thread nlohmann_json) + +# Use defined output directory for the executable +set_target_properties(serd_triple_writer_example PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/tests) \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/tests/serd_library_tests/README.md b/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/tests/serd_library_tests/README.md new file mode 100644 index 0000000..c219cd1 --- /dev/null +++ b/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/tests/serd_library_tests/README.md @@ -0,0 +1,35 @@ +# Serd Installation Test + +This simple application explains how to work with the Serd library. Serd is a lightweight C library for parsing and serializing RDF data. For more information, refer to the [Serd](https://drobilla.net/software/serd.html) and [Serd C API](https://drobilla.gitlab.io/serd/doc/html/api/serd.html) documentation. + +## Purpose + +### Serd triple writer `serd_triple_writer_test.cpp` using `Serd C API` + +This C++ program demonstrates how to use the Serd library to create and write RDF triples in Turtle format to standard output. The example defines RDF resources, namespaces, and data literals, and writes statements (triples) describing a Vehicle entity and its attributes. + +Key sections of the code: + +1. **Setting Up the Serd Environment:** Initializes a Serd environment, defines a base URI and creates the Serd writer configured to output in Turtle format. +2. **Namespace Declaration:** Defines different namespaces to be used. +3. **Creating RDF Nodes:** Defines nodes for subject, predicate, and object URIs, as well as literal values. +4. **Writing RDF Statements:** Writes the RDF triples. +5. **Cleaning Up:** Frees allocated resources and finalizes the writer. + +Output + +The program outputs RDF triples in Turtle format to standard output. Example output: + +```turtle +@prefix ex: . +@prefix xsd: . + +ex:Vehicle123 a ex:Vehicle ; + ex:hasSpeed "120"^^xsd:int . +``` + +After the project is compiled, it can be run with: + +```bash +./serd_triple_writer_example +``` \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/tests/serd_library_tests/serd_triple_writer_example.cpp b/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/tests/serd_library_tests/serd_triple_writer_example.cpp new file mode 100644 index 0000000..65afe79 --- /dev/null +++ b/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/tests/serd_library_tests/serd_triple_writer_example.cpp @@ -0,0 +1,114 @@ +#include + +#include +#include + +// Global string to store the Serd output +std::string serd_output; + +// Custom write function to append output to the serd_output string +unsigned long write_to_string(const void* buf, unsigned long len, void* stream) { + serd_output.append(static_cast(buf), len); + return len; +} + +int main() { + // Create a Serd environment for writing Turtle format + SerdEnv* env = serd_env_new(nullptr); + + // Create the writer with the output directed to write_to_string + SerdWriter* writer = serd_writer_new(SERD_TURTLE, SERD_STYLE_ABBREVIATED, env, nullptr, + write_to_string, nullptr); + + // Declare namespaces + SerdNode car_prefix = serd_node_from_string(SERD_CURIE, (const uint8_t*) "car"); + SerdNode car_uri = + serd_node_from_string(SERD_URI, (const uint8_t*) "http://example.ontology.com/car#"); + serd_writer_set_prefix(writer, &car_prefix, &car_uri); + + SerdNode xsd_prefix = serd_node_from_string(SERD_CURIE, (const uint8_t*) "xsd"); + SerdNode xsd_uri = + serd_node_from_string(SERD_URI, (const uint8_t*) "http://www.w3.org/2001/XMLSchema#"); + serd_writer_set_prefix(writer, &xsd_prefix, &xsd_uri); + + SerdNode sosa_prefix = serd_node_from_string(SERD_CURIE, (const uint8_t*) "sosa"); + SerdNode sosa_uri = + serd_node_from_string(SERD_URI, (const uint8_t*) "http://www.w3.org/ns/sosa/"); + serd_writer_set_prefix(writer, &sosa_prefix, &sosa_uri); + + SerdNode other_prefix = serd_node_from_string(SERD_CURIE, (const uint8_t*) "other"); + SerdNode other_uri = serd_node_from_string(SERD_URI, (const uint8_t*) "http://www.other.com/"); + serd_writer_set_prefix(writer, &other_prefix, &other_uri); + + // Define URIs and literals for the triples + SerdNode vehicle_subject = + serd_node_from_string(SERD_CURIE, (const uint8_t*) "car:VehicleWBY11CF080CH470711"); + SerdNode type_predicate = serd_node_from_string( + SERD_URI, (const uint8_t*) "http://www.w3.org/1999/02/22-rdf-syntax-ns#type"); + SerdNode vehicle_object = serd_node_from_string(SERD_CURIE, (const uint8_t*) "car:Vehicle"); + + SerdNode has_part = serd_node_from_string(SERD_CURIE, (const uint8_t*) "car:hasPart"); + SerdNode powertrain_object = + serd_node_from_string(SERD_CURIE, (const uint8_t*) "car:PowertrainWBY11CF080CH470711"); + SerdNode powertrain_type = serd_node_from_string(SERD_CURIE, (const uint8_t*) "car:Powertrain"); + + SerdNode transmission_object = + serd_node_from_string(SERD_CURIE, (const uint8_t*) "car:TransmissionWBY11CF080CH470711"); + SerdNode transmission_type = + serd_node_from_string(SERD_CURIE, (const uint8_t*) "car:Transmission"); + + // Observation triples + std::string test = "car:Observation20181116155027"; + + SerdNode observation = serd_node_from_string(SERD_CURIE, (const uint8_t*) test.c_str()); + SerdNode observation_type = + serd_node_from_string(SERD_CURIE, (const uint8_t*) "sosa:Observation"); + SerdNode feature_of_interest = + serd_node_from_string(SERD_CURIE, (const uint8_t*) "sosa:hasFeatureOfInterest"); + SerdNode observed_property = + serd_node_from_string(SERD_CURIE, (const uint8_t*) "sosa:observedProperty"); + SerdNode current_energy = + serd_node_from_string(SERD_CURIE, (const uint8_t*) "car:CurrentEnergy"); + SerdNode has_result = + serd_node_from_string(SERD_CURIE, (const uint8_t*) "sosa:hasSimpleResult"); + SerdNode result_value = serd_node_from_string(SERD_LITERAL, (const uint8_t*) "98.6"); + SerdNode xsd_float = serd_node_from_string(SERD_CURIE, (const uint8_t*) "xsd:float"); + SerdNode phenomenon_time = + serd_node_from_string(SERD_CURIE, (const uint8_t*) "sosa:phenomenonTime"); + SerdNode time_value = serd_node_from_string( + SERD_LITERAL, (const uint8_t*) "\"2018-11-16 15:50:27\"^^xsd:dateTime"); + + // Write triples for vehicle and parts + serd_writer_write_statement(writer, 0, nullptr, &vehicle_subject, &type_predicate, + &vehicle_object, nullptr, nullptr); + serd_writer_write_statement(writer, 0, nullptr, &vehicle_subject, &has_part, &powertrain_object, + nullptr, nullptr); + serd_writer_write_statement(writer, 0, nullptr, &powertrain_object, &type_predicate, + &powertrain_type, nullptr, nullptr); + serd_writer_write_statement(writer, 0, nullptr, &powertrain_object, &has_part, + &transmission_object, nullptr, nullptr); + serd_writer_write_statement(writer, 0, nullptr, &transmission_object, &type_predicate, + &transmission_type, nullptr, nullptr); + + // Write observation triples + serd_writer_write_statement(writer, 0, nullptr, &observation, &type_predicate, + &observation_type, nullptr, nullptr); + serd_writer_write_statement(writer, 0, nullptr, &observation, &feature_of_interest, + &transmission_object, nullptr, nullptr); + serd_writer_write_statement(writer, 0, nullptr, &observation, &has_result, &result_value, + &xsd_float, nullptr); + serd_writer_write_statement(writer, 0, nullptr, &observation, &observed_property, + ¤t_energy, nullptr, nullptr); + serd_writer_write_statement(writer, 0, nullptr, &observation, &phenomenon_time, &time_value, + nullptr, nullptr); + + // Finish and release resources + serd_writer_finish(writer); + serd_writer_free(writer); + serd_env_free(env); + + // Output the result + std::cout << "Generated RDF triples:\n" << serd_output << std::endl; + + return 0; +} \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/tests/triple_assembler_unit_test.cpp b/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/tests/triple_assembler_unit_test.cpp new file mode 100644 index 0000000..227a35a --- /dev/null +++ b/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/tests/triple_assembler_unit_test.cpp @@ -0,0 +1,425 @@ +#include +#include + +#include +#include +#include + +#include "data_types.h" +#include "rdfox_adapter.h" +#include "triple_assembler.h" + +struct TestParamsTransformMessageToRDFTriple { + DataMessage message; + std::vector query_object; + std::string query_data; + std::vector object_triple_result; + std::string data_triple_result; +}; + +class MockTripleAssembler : public TripleAssembler { + public: + MockTripleAssembler(const ModelConfig& model_config, RDFoxAdapter& adapter, + IFileHandler& file_reader, TripleWriter& triple_writer) + : TripleAssembler(model_config, adapter, file_reader, triple_writer) {} + + MOCK_METHOD(void, generateTriplesFromNode, + (const Node& node, const std::string& msg_tree, const std::string& msg_date_time), + (override)); + MOCK_METHOD(void, storeTripleOutput, (const std::string& triple_output), (override)); +}; + +class MockRDFoxAdapter : public RDFoxAdapter { + public: + MockRDFoxAdapter() : RDFoxAdapter("localhost", "8080", "test_auth", "test_ds") {} + + MOCK_METHOD(bool, checkDataStore, (), (override)); + MOCK_METHOD1(loadData, bool(const std::string& ttl_data)); + MOCK_METHOD(std::string, queryData, (const std::string& sparql_query), (override)); +}; + +class MockFileHandler : public IFileHandler { + public: + MOCK_METHOD(std::string, readFile, (const std::string& file_path), (override)); + MOCK_METHOD(void, writeFile, + (const std::string& file_path, const std::string& content, bool append_data), + (override)); +}; + +class MockTripleWriter : public TripleWriter { + public: + MOCK_METHOD(void, initiateTriple, (const std::string&), (override)); + MOCK_METHOD(void, addRDFObjectToTriple, + (const std::string&, (const std::tuple&) ), + (override)); + MOCK_METHOD(void, addRDFDataToTriple, + ((const std::string&), (const std::tuple&), + (const std::string&), (const std::string&) ), + (override)); + MOCK_METHOD(std::string, generateTripleOutput, (const RDFSyntaxType&), (override)); +}; + +class TripleAssemblerUnitTest : public ::testing::Test { + protected: + TripleAssembler* triple_assembler; + DataMessage message_feature; + + // Set up mock RDFoxAdapter + MockRDFoxAdapter mock_adapter; + MockFileHandler mock_file_handler; + MockTripleWriter mock_triple_writer; + + // Create a mock ModelConfig + ModelConfig model_config; + + void SetUp() override { + // Mock functions to be call and expectations + triple_assembler = + new TripleAssembler(model_config, mock_adapter, mock_file_handler, mock_triple_writer); + } + + void setUpModelBase() { + model_config.shacl_shapes_files = {"shacl_shape1.ttl", "shacl_shape2.ttl"}; + model_config.triple_assembler_queries_files = { + {"vss", {"data_property.rq", "object_property.rq"}}}; + model_config.reasoner_settings.output_format = RDFSyntaxType::TURTLE; + model_config.output_file_path = "/outputs/triple_assembler_unit_test/"; + } + + void setUpMessage() { + message_feature.header.id = "WBY11CF080CH470711"; + message_feature.header.tree = "VSS"; + message_feature.header.date_time = "2023-01-01T12:00:00Z"; + + Node node_1; + node_1.name = "Vehicle.Powertrain.TractionBattery.StateOfCharge.CurrentEnergy"; + node_1.value = "98.6"; + + message_feature.nodes.push_back(node_1); + } + + void TearDown() override { delete triple_assembler; } +}; + +/** + * @brief Unit test for successful initialization of the Triple Assembler. + * + * This test sets up the model base and mocks various components to simulate + * the initialization process of the Triple Assembler. It verifies that the + * initialization completes without throwing exceptions. + */ +TEST_F(TripleAssemblerUnitTest, InitializeSuccess) { + // Set up the model base for the test + setUpModelBase(); + + // Mock the data store check to return true, indicating the data store is available + EXPECT_CALL(mock_adapter, checkDataStore()).WillOnce(testing::Return(true)); + + // Mock reading SHACL shape files and returning predefined data + EXPECT_CALL(mock_file_handler, readFile(testing::StrEq("shacl_shape1.ttl"))) + .WillOnce(testing::Return("data1")); + EXPECT_CALL(mock_file_handler, readFile(testing::StrEq("shacl_shape2.ttl"))) + .WillOnce(testing::Return("data2")); + + // Mock loading data into the adapter and returning success + EXPECT_CALL(mock_adapter, loadData(testing::StrEq("data1"))).WillOnce(testing::Return(true)); + EXPECT_CALL(mock_adapter, loadData(testing::StrEq("data2"))).WillOnce(testing::Return(true)); + + // Assert that the initialization process does not throw any exceptions + EXPECT_NO_THROW(triple_assembler->initialize()); +} + +/** + * @brief Unit test for transforming a message to RDF triples successfully. + * + * This test sets up a message and model base, then mocks various components + * to simulate the transformation of a message into RDF triples. It verifies + * that the transformation process completes with the expected behaviour without throwing + * exceptions. + */ +TEST_F(TripleAssemblerUnitTest, TransformMessageToRDFTripleSuccess) { + // Set up the initial message and model base for the test + setUpMessage(); + setUpModelBase(); + + // Mock the data store check to return true, indicating the data store is available + EXPECT_CALL(mock_adapter, checkDataStore()).WillOnce(testing::Return(true)); + + // Mock setting the triple identifier using the message header ID + EXPECT_CALL(mock_triple_writer, + initiateTriple("WBY11CF080CH470711")) // ID is the same from message header id + .Times(1); + + // Define SHACL queries for object and data properties + const std::string query_object = R"(prefix ex: +prefix otr: + +SELECT some_object_query)"; + + const std::string query_data = R"(prefix ex: +prefix so: + +SELECT some_data_query)"; + + // Mock reading the SHACL query files for object and data properties + EXPECT_CALL(mock_file_handler, + readFile(::testing::StrEq( + "object_property.rq"))) // File is the same from model config for message + // tree VSS data + .Times(3) + .WillRepeatedly(testing::Return(query_object)); + + EXPECT_CALL(mock_file_handler, + readFile(::testing::StrEq( + "data_property.rq"))) // File is the same from model config for message tree + // VSS data + .Times(1) + .WillRepeatedly(testing::Return(query_data)); + + // Define mock responses for the SHACL queries + std::string query_object_response = + R"(?class1 ?object_property ?class2 + )"; + + std::string query_data_response = + R"(?class1 ?data_property ?datatype + )"; + + // Mock querying data using the SHACL queries and returning predefined responses + EXPECT_CALL(mock_adapter, queryData(query_object)) + .Times(3) + .WillRepeatedly(testing::Return(query_object_response)); + + EXPECT_CALL(mock_adapter, queryData(query_data)) + .Times(1) + .WillRepeatedly(testing::Return(query_data_response)); + + // Define tuples for RDF object and data elements + const std::tuple object_elements = std::make_tuple( + "", "", + ""); + + const std::tuple data_elements = std::make_tuple( + "", "", + ""); + + // Define prefixes for RDF object and data + const std::string object_prefixes = R"(prefix ex: +prefix otr: +)"; + + const std::string data_prefixes = R"(prefix ex: +prefix so: +)"; + + // Mock adding RDF object and data to triples + EXPECT_CALL(mock_triple_writer, addRDFObjectToTriple(object_prefixes, object_elements)) + .Times(3); + + EXPECT_CALL(mock_triple_writer, + addRDFDataToTriple(data_prefixes, data_elements, message_feature.nodes.at(0).value, + message_feature.header.date_time)) + .Times(1); + + // Define a dummy Turtle (TTL) output for the RDF triples + std::string dummy_ttl = + R"(@prefix ex: . + +ex:Class_1WBY11CF080CH470711 + a ex:Class_1 ; + ex:hasPart car:Class_2WBY11CF080CH470711 . + +car:Observation20181116155027O0 + a sosa:Observation ; + sosa:hasFeatureOfInterest car:Class_2WBY11CF080CH470711 ; + sosa:hasSimpleResult "98.6"^^xsd:float ; + sosa:observedProperty car:Data_Q ; + sosa:phenomenonTime """"2018-11-16 15:50:27"^^xsd:dateTime""" .)"; + + // Mock generating the triple output and returning the dummy TTL + EXPECT_CALL(mock_triple_writer, + generateTripleOutput(model_config.reasoner_settings.output_format)) + .Times(1) + .WillOnce(testing::Return(dummy_ttl)); + + // Mock writing the triple output to a file + EXPECT_CALL(mock_file_handler, + writeFile(::testing::_, ::testing::Not(::testing::IsEmpty()), ::testing::Eq(true))) + .Times(1); + + // Assert that the transformation process does not throw any exceptions + EXPECT_NO_THROW(triple_assembler->transformMessageToRDFTriple(message_feature)); +} + +/** + * @brief Unit test for transforming a multi-node message to RDF triples with exception handling. + * + * This test sets up a message with multiple nodes, including one that simulates an error. + * It verifies the transformation of the message into RDF triples, ensuring that exceptions + * are handled correctly during the process. + */ +TEST_F(TripleAssemblerUnitTest, + TransformMessageMultiNodeToRDFTripleWithAnExceptionGeneratingTriplesSuccess) { + setUpMessage(); + setUpModelBase(); + + // Add two nodes more to the `message_feature` + + Node node_2; + node_2.name = "Vehicle.FuelLevel"; + node_2.value = "75"; + message_feature.nodes.push_back(node_2); + + Node node_3; + node_3.name = "InvalidNode"; // Simulate an error for this node + node_3.value = "error_value"; + message_feature.nodes.push_back(node_3); + + // Mock data store has been setup + EXPECT_CALL(mock_adapter, checkDataStore()).WillOnce(testing::Return(true)); + EXPECT_CALL(mock_triple_writer, + initiateTriple("WBY11CF080CH470711")) // ID is the same from message header id + .Times(1); + + // Mock the file reader to extract the SHACL query + // - Only the first node uses the object query in, it in its name 5 elements + EXPECT_CALL(mock_file_handler, readFile(::testing::StrEq("object_property.rq"))) + .Times(3) + .WillRepeatedly(::testing::Return("MOCK QUERY FOR OBJECTS PROPERTY")); + // - Node one and two read the data query, the third one has throw an error, which should be + // logged. + EXPECT_CALL(mock_file_handler, readFile(::testing::StrEq("data_property.rq"))) + .Times(2) + .WillRepeatedly(::testing::Return("MOCK QUERY FOR DATA PROPERTY")); + + // Mock the SHACL queries responses (first and second node) + EXPECT_CALL(mock_adapter, queryData("MOCK QUERY FOR OBJECTS PROPERTY")).Times(3); + EXPECT_CALL(mock_adapter, queryData("MOCK QUERY FOR DATA PROPERTY")).Times(2); + + // Mock the data added to the RDF triples (only first node) + EXPECT_CALL(mock_triple_writer, addRDFObjectToTriple(::testing::_, ::testing::_)).Times(3); + + // Mock the data triple writer adding the values of the correct nodes one and two + EXPECT_CALL(mock_triple_writer, + addRDFDataToTriple(::testing::_, ::testing::_, ::testing::Eq("98.6"), ::testing::_)) + .Times(1); + EXPECT_CALL(mock_triple_writer, + addRDFDataToTriple(::testing::_, ::testing::_, ::testing::Eq("75"), ::testing::_)) + .Times(1); + + // Mock generate the triples (only first two nodes) + EXPECT_CALL(mock_triple_writer, generateTripleOutput(::testing::_)) + .Times(1) + .WillRepeatedly(testing::Return("some_triple")); + ; + + // Mock write triple output file (only first two nodes) + EXPECT_CALL(mock_file_handler, writeFile(::testing::_, ::testing::_, ::testing::Eq(true))) + .Times(1); + + // Assert + EXPECT_NO_THROW(triple_assembler->transformMessageToRDFTriple(message_feature)); +} + +/** + * @brief Unit test for initialization failure of the Triple Assembler when no RDF data store is + * set. + */ +TEST_F(TripleAssemblerUnitTest, InitializeFailWhenAnyRDFDataStoreIsSet) { + // Mock the data store check to return false, indicating the data store is not available + EXPECT_CALL(mock_adapter, checkDataStore()).WillOnce(testing::Return(false)); + + // Ensure that no file reading operations are attempted + EXPECT_CALL(mock_file_handler, readFile(testing::_)).Times(0); + + // Assert that the initialization process throws a runtime error due to missing data store + EXPECT_THROW(triple_assembler->initialize(), std::runtime_error); +} + +/** + * @brief Unit test for the failure of TripleAssembler initialization when SHACL shapes are empty. + */ +TEST_F(TripleAssemblerUnitTest, InitializeFailIfShaclShapesAreEmptyInTheModelConfig) { + // Create a mock ModelConfig with an empty list of SHACL shapes files + model_config.shacl_shapes_files = {}; // This cannot be empty for successful initialization + + // Mock functions + EXPECT_CALL(mock_adapter, checkDataStore()).WillOnce(testing::Return(true)); + + // Expect no file reads to occur since SHACL shapes are empty + EXPECT_CALL(mock_file_handler, readFile(testing::_)).Times(0); + + // Attempt to initialize the TripleAssembler and expect a runtime error to be thrown + EXPECT_THROW(triple_assembler->initialize(), std::runtime_error); +} + +/** + * @brief Unit test for initializing the TripleAssembler with empty SHACL shape content. + */ +TEST_F(TripleAssemblerUnitTest, InitializeFailIfShaclShapesContentIsEmpty) { + // Create a mock ModelConfig with a SHACL shape file + model_config.shacl_shapes_files = {"shacl_shape.ttl"}; + + // Mock functions + EXPECT_CALL(mock_adapter, checkDataStore()).WillOnce(testing::Return(true)); + + // Simulate reading the SHACL shape file and returning empty content + EXPECT_CALL(mock_file_handler, readFile(testing::StrEq("shacl_shape.ttl"))) + .WillOnce(testing::Return("")); // The content cannot be empty + + // Ensure no data loading is attempted with empty content + EXPECT_CALL(mock_adapter, loadData(testing::_)).Times(0); + + // Attempt to initialize the TripleAssembler and expect a runtime error + TripleAssembler assembler(model_config, mock_adapter, mock_file_handler, mock_triple_writer); + EXPECT_THROW(triple_assembler->initialize(), std::runtime_error); +} + +/** + * @brief Unit test for handling failure during the initialization of the TripleAssembler + * when loading data from SHACL shapes goes wrong. + */ +TEST_F(TripleAssemblerUnitTest, InitializeFailsIfLoadingDataFromShaclShapesGoesWrong) { + // Create a mock ModelConfig with a SHACL shape file + model_config.shacl_shapes_files = {"shacl_shape.ttl"}; + + // Mock functions + EXPECT_CALL(mock_adapter, checkDataStore()).WillOnce(testing::Return(true)); + EXPECT_CALL(mock_file_handler, readFile(testing::StrEq("shacl_shape.ttl"))) + .WillOnce(testing::Return("data")); + + // Simulate a failure in loading the data, returning false + EXPECT_CALL(mock_adapter, loadData(testing::StrEq("data"))) + .WillOnce(testing::Return(false)); // Fail loading data + + // Initialize TripleAssembler and expect a runtime error to be thrown + TripleAssembler assembler(model_config, mock_adapter, mock_file_handler, mock_triple_writer); + EXPECT_THROW(triple_assembler->initialize(), std::runtime_error); +} + +/** + * @brief Unit test for handling failure when transforming a message to RDF triples + * due to the absence of an RDF data store. + */ +TEST_F(TripleAssemblerUnitTest, TransformMessageToRDFTripleFailsWhenAnyRDFDataStoreIsSet) { + // Set up the initial message for the test + setUpMessage(); + + // Mock the data store check to return false, indicating the data store is not available + EXPECT_CALL(mock_adapter, checkDataStore()).WillOnce(testing::Return(false)); + + // Ensure that no other functions are called since the data store is not set up + EXPECT_CALL(mock_triple_writer, initiateTriple(::testing::_)).Times(0); + EXPECT_CALL(mock_file_handler, readFile(::testing::_)).Times(0); + EXPECT_CALL(mock_file_handler, writeFile(::testing::_, ::testing::_, ::testing::_)).Times(0); + EXPECT_CALL(mock_adapter, queryData(::testing::_)).Times(0); + EXPECT_CALL(mock_triple_writer, addRDFObjectToTriple(::testing::_, ::testing::_)).Times(0); + EXPECT_CALL(mock_triple_writer, + addRDFDataToTriple(::testing::_, ::testing::_, ::testing::_, ::testing::_)) + .Times(0); + EXPECT_CALL(mock_triple_writer, generateTripleOutput(::testing::_)).Times(0); + + // Assert that the transformation process throws a runtime error due to the missing data store + EXPECT_THROW(triple_assembler->transformMessageToRDFTriple(message_feature), + std::runtime_error); +} diff --git a/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/tests/triple_writer_integration_test.cpp b/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/tests/triple_writer_integration_test.cpp new file mode 100644 index 0000000..9823469 --- /dev/null +++ b/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/tests/triple_writer_integration_test.cpp @@ -0,0 +1,261 @@ +#include + +#include +#include +#include + +#include "triple_writer.h" + +class TripleWriterIntegrationTest : public ::testing::Test { + protected: + TripleWriter* triple_writer; + std::string prefixes_fixture; + const std::string vin = "WBY11CF080CH470711"; + + void SetUp() override { + triple_writer = new TripleWriter(); + prefixes_fixture = + R"(prefix car: + prefix middleware: + prefix sh: + prefix val: + prefix xsd: )"; + } + + void TearDown() override { delete triple_writer; } + + void SetUpRDFObjects(const std::string& prefixes_input) { + // RDF Object Triples + std::vector> object_triples = { + {"", + "", + ""}, + + {"", + "", + ""}, + + {"", + "", + ""}}; + + for (const auto& triple : object_triples) { + triple_writer->addRDFObjectToTriple(prefixes_input, triple); + } + } + + void SetUpRDFData(const std::string& prefixes_input) { + // RDF Data Triple + triple_writer->addRDFDataToTriple( + prefixes_input, + std::make_tuple("", + "", + ""), + "98.6", "2018-11-16T15:50:27"); + } +}; + +/** + * @brief Test case for writing RDF triples in Turtle format. + */ +TEST_F(TripleWriterIntegrationTest, WriteRDFTripleInTurtleFormat) { + triple_writer->initiateTriple(vin); + SetUpRDFObjects(prefixes_fixture); + SetUpRDFData(prefixes_fixture); + + std::string expected_RDF_triple = R"(@prefix car: . +@prefix sosa: . +@prefix xsd: . + +car:VehicleWBY11CF080CH470711 + a car:Vehicle ; + car:hasPart car:PowertrainWBY11CF080CH470711 . + +car:PowertrainWBY11CF080CH470711 + a car:Powertrain ; + car:hasPart car:TractionBatteryWBY11CF080CH470711 . + +car:TractionBatteryWBY11CF080CH470711 + a car:TractionBattery ; + car:hasSignal car:StateOfChargeWBY11CF080CH470711 . + +car:StateOfChargeWBY11CF080CH470711 + a car:StateOfCharge . + +car:Observation20181116155027O0 + a sosa:Observation ; + sosa:hasFeatureOfInterest car:StateOfChargeWBY11CF080CH470711 ; + sosa:hasSimpleResult "98.6"^^xsd:float ; + sosa:observedProperty car:CurrentEnergy ; + sosa:phenomenonTime "2018-11-16T15:50:27"^^xsd:dateTime .)"; + + // Run and Assert + std::string result_triple_writer = triple_writer->generateTripleOutput(RDFSyntaxType::TURTLE); + ASSERT_EQ(result_triple_writer, expected_RDF_triple); +} + +/** + * @brief Test case for writing RDF triples in N-Triples format. + */ +TEST_F(TripleWriterIntegrationTest, WriteRDFTripleInNTriplesFormat) { + triple_writer->initiateTriple(vin); + SetUpRDFObjects(prefixes_fixture); + SetUpRDFData(prefixes_fixture); + + std::string expected_RDF_triple = + R"( . + . + . + . + . + . + . + . + . + "98.6"^^ . + . + "2018-11-16T15:50:27"^^ .)"; + + // Run and Assert + std::string result_triple_writer = triple_writer->generateTripleOutput(RDFSyntaxType::NTRIPLES); + ASSERT_EQ(result_triple_writer, expected_RDF_triple); +} + +/** + * @brief Test case for writing RDF triples in N-Quads format. + */ +TEST_F(TripleWriterIntegrationTest, WriteRDFTripleInNQuatdsFormat) { + triple_writer->initiateTriple(vin); + SetUpRDFObjects(prefixes_fixture); + SetUpRDFData(prefixes_fixture); + + std::string expected_RDF_triple = + R"( . + . + . + . + . + . + . + . + . + "98.6"^^ . + . + "2018-11-16T15:50:27"^^ .)"; + + // Run and Assert + std::string result_triple_writer = triple_writer->generateTripleOutput(RDFSyntaxType::NQUADS); + ASSERT_EQ(result_triple_writer, expected_RDF_triple); +} + +/** + * @brief Test case for writing RDF triples in TriG format. + */ +TEST_F(TripleWriterIntegrationTest, WriteRDFTripleInTriGFormat) { + triple_writer->initiateTriple(vin); + SetUpRDFObjects(prefixes_fixture); + SetUpRDFData(prefixes_fixture); + + std::string expected_RDF_triple = R"(@prefix car: . +@prefix sosa: . +@prefix xsd: . + +car:VehicleWBY11CF080CH470711 + a car:Vehicle ; + car:hasPart car:PowertrainWBY11CF080CH470711 . + +car:PowertrainWBY11CF080CH470711 + a car:Powertrain ; + car:hasPart car:TractionBatteryWBY11CF080CH470711 . + +car:TractionBatteryWBY11CF080CH470711 + a car:TractionBattery ; + car:hasSignal car:StateOfChargeWBY11CF080CH470711 . + +car:StateOfChargeWBY11CF080CH470711 + a car:StateOfCharge . + +car:Observation20181116155027O0 + a sosa:Observation ; + sosa:hasFeatureOfInterest car:StateOfChargeWBY11CF080CH470711 ; + sosa:hasSimpleResult "98.6"^^xsd:float ; + sosa:observedProperty car:CurrentEnergy ; + sosa:phenomenonTime "2018-11-16T15:50:27"^^xsd:dateTime .)"; + // Run and Assert + std::string result_triple_writer = triple_writer->generateTripleOutput(RDFSyntaxType::TRIG); + ASSERT_EQ(result_triple_writer, expected_RDF_triple); +} + +/** + * @brief Test case for handling incorrect RDF prefix format. + * + * This test verifies that the system throws a runtime error when attempting + * to set up RDF objects with prefixes that are incorrectly formatted. + * It ensures that the TripleWriter correctly identifies and handles + * malformed prefix strings. + */ +TEST_F(TripleWriterIntegrationTest, FailAddingRDFObjectToTripleSendingPrefixesWithWrongFormat) { + // Define a string with incorrectly formatted RDF prefixes. + const std::string wrong_prefixes = R"(prefix this_is_not_a_prefix + prefix car: + prefix middleware: )"; + + // Expect a runtime error to be thrown when setting up RDF objects with the wrong prefixes. + EXPECT_THROW(SetUpRDFObjects(wrong_prefixes), std::runtime_error); +} + +/** + * @brief Test case for handling wrong data components. + * + * This test verifies that adding an RDF object to a triple with incorrect data components + * results in a runtime error. + */ +TEST_F(TripleWriterIntegrationTest, FailAddingRDFObjectToTripleSendingWrongDataComponents) { + const auto data_components = + std::make_tuple("this_is_wrong", "", + ""); + + EXPECT_THROW(triple_writer->addRDFObjectToTriple(prefixes_fixture, data_components), + std::runtime_error); +} + +/** + * @brief Test case for handling incorrect RDF data setup with malformed prefixes. + */ +TEST_F(TripleWriterIntegrationTest, FailAddingRDFDataToTripleSendingPrefixesWithWrongFormat) { + const std::string wrong_prefixes = R"(prefix this_is_not_a_prefix + prefix car: + prefix middleware: )"; + EXPECT_THROW(SetUpRDFData(wrong_prefixes), std::runtime_error); +} + +/** + * @brief Test case for handling incorrect RDF data components in TripleWriter. + * + * This test verifies that attempting to add RDF data to a triple with incorrect or incomplete + * data components results in a runtime error. + */ +TEST_F(TripleWriterIntegrationTest, FailAddingRDFDataToTripleSendingWrongDataComponents) { + const auto data_components = + std::make_tuple("", "", + ""); + + EXPECT_THROW(triple_writer->addRDFDataToTriple(prefixes_fixture, data_components, "98.6", + "2018-11-16T15:50:27"), + std::runtime_error); +} +/** + * @brief Test case for handling failure when adding RDF data with an incorrect data value. + * + * This test verifies that the TripleWriter throws a runtime error when attempting to add + * RDF data to a triple with an empty data value. + */ +TEST_F(TripleWriterIntegrationTest, FailAddingRDFDataToTripleSendingWrongDataValue) { + const auto data_components = std::make_tuple("", + "", + ""); + + EXPECT_THROW(triple_writer->addRDFDataToTriple(prefixes_fixture, data_components, "", + "2018-11-16T15:50:27"), + std::runtime_error); +} \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/json-rdf-convertor/utils/README.md b/cdsp/knowledge-layer/connector/json-rdf-convertor/utils/README.md deleted file mode 100644 index fd9e641..0000000 --- a/cdsp/knowledge-layer/connector/json-rdf-convertor/utils/README.md +++ /dev/null @@ -1 +0,0 @@ -tbd \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/json-rdf-convertor/utils/data_structs.h b/cdsp/knowledge-layer/connector/json-rdf-convertor/utils/data_structs.h deleted file mode 100644 index eb3eeec..0000000 --- a/cdsp/knowledge-layer/connector/json-rdf-convertor/utils/data_structs.h +++ /dev/null @@ -1,74 +0,0 @@ -/// -/// @file -/// @copyright Copyright (C) 2017-2023, Bayerische Motoren Werke Aktiengesellschaft (BMW AG) -/// - -#ifndef DATA_STRUCTS_DATA_STRUCTS_H -#define DATA_STRUCTS_DATA_STRUCTS_H - -#include -#include -#include - -struct MessageHeader -{ - std::string id; - std::string type; - std::string tree; - std::string date_time; - std::string timestamp; - std::chrono::duration time_stamp; -}; - -struct Node -{ - std::string name; - std::string date_time; - std::string timestamp; - std::vector values; - std::chrono::duration time_stamp; -}; - -struct Data -{ - MessageHeader header; - std::vector nodes; -}; - -struct DataPoint -{ - std::string name; - std::string value; -}; - -struct InferredResult -{ - std::string entity_id; - std::vector data; -}; - -struct ProgramOptions -{ - std::string map; - std::string output_ttl; - std::string persist_data; - std::string entity_id; - - bool enable_message_log; - bool test_rules; - bool dummy_server; -}; - -struct QueryData -{ - std::string name_one; - std::string name_two; - std::string has_statement; - std::string data_type; - std::string prefix_name_one; - std::string prefix_name_two; - std::string prefix_data_type; - std::string prefix_has_statement; -}; - -#endif // DATA_STRUCTS_DATA_STRUCTS_H diff --git a/cdsp/knowledge-layer/connector/json-rdf-convertor/utils/file_handler_impl.cpp b/cdsp/knowledge-layer/connector/json-rdf-convertor/utils/file_handler_impl.cpp new file mode 100644 index 0000000..c0d7fe7 --- /dev/null +++ b/cdsp/knowledge-layer/connector/json-rdf-convertor/utils/file_handler_impl.cpp @@ -0,0 +1,48 @@ +#include "file_handler_impl.h" + +#include +#include +#include + +/** + * @brief Reads the contents of a file and returns it as a string. + * + * @param file_path The path to the file to be read. + * @return A string containing the contents of the file. + * @throws std::runtime_error If the file cannot be opened. + */ +std::string FileHandlerImpl::readFile(const std::string& file_path) { + std::ifstream file(file_path); + if (!file.is_open()) { + throw std::runtime_error("Failed to read file: " + file_path); + } + return std::string((std::istreambuf_iterator(file)), std::istreambuf_iterator()); +} + +/** + * @brief Writes the given content to a file specified by the file path, with support for appending + * or overwriting data. + * + * @param file_path The path to the file where the content will be written. + * @param content The content to be written to the file. + * @param append_data A boolean indicating whether to append the content (`true`) + * or overwrite the file (`false`). The mode is reset to overwrite if + * the file path differs from the last recorded file name. + * @throws std::runtime_error If the file cannot be opened for writing. + */ +void FileHandlerImpl::writeFile(const std::string& file_path, const std::string& content, + bool append_data) { + if (file_path != last_recorded_file_name_) { + last_recorded_file_name_ = file_path; + append_data = false; + } + + // Determine the open mode based on the 'append' boolean + std::ios_base::openmode mode = append_data ? std::ios::app : std::ios::trunc; + + std::ofstream file(last_recorded_file_name_, mode); + if (!file.is_open()) { + throw std::runtime_error("Failed to open file for writing: " + last_recorded_file_name_); + } + file << content; +} diff --git a/cdsp/knowledge-layer/connector/json-rdf-convertor/utils/file_handler_impl.h b/cdsp/knowledge-layer/connector/json-rdf-convertor/utils/file_handler_impl.h new file mode 100644 index 0000000..8028979 --- /dev/null +++ b/cdsp/knowledge-layer/connector/json-rdf-convertor/utils/file_handler_impl.h @@ -0,0 +1,18 @@ +#ifndef FILE_HANDLER_IMPL_H +#define FILE_HANDLER_IMPL_H + +#include + +#include "i_file_handler.h" + +class FileHandlerImpl : public IFileHandler { + public: + std::string readFile(const std::string& file_path) override; + void writeFile(const std::string& file_path, const std::string& content, + bool append_data) override; + + private: + std::string last_recorded_file_name_; +}; + +#endif // FILE_HANDLER_IMPL_H \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/json-rdf-convertor/utils/i_file_handler.h b/cdsp/knowledge-layer/connector/json-rdf-convertor/utils/i_file_handler.h new file mode 100644 index 0000000..dde2707 --- /dev/null +++ b/cdsp/knowledge-layer/connector/json-rdf-convertor/utils/i_file_handler.h @@ -0,0 +1,15 @@ +#ifndef I_FILE_HANDLER_H +#define I_FILE_HANDLER_H + +#include + +// Interface for file operations +class IFileHandler { + public: + virtual std::string readFile(const std::string& file_path) = 0; + virtual void writeFile(const std::string& file_path, const std::string& content, + bool append_data = false) = 0; + virtual ~IFileHandler() = default; +}; + +#endif // I_FILE_HANDLER_H \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/json-rdf-convertor/utils/utils.h b/cdsp/knowledge-layer/connector/json-rdf-convertor/utils/utils.h deleted file mode 100644 index f163215..0000000 --- a/cdsp/knowledge-layer/connector/json-rdf-convertor/utils/utils.h +++ /dev/null @@ -1,89 +0,0 @@ -/// -/// @file -/// @copyright Copyright (C) 2017-2023, Bayerische Motoren Werke Aktiengesellschaft (BMW AG) -/// - -#ifndef UTILS_UTILS_H -#define UTILS_UTILS_H - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "data_structs.h" - -namespace utils -{ -namespace parser -{ -Data GetVehicleFeatureDataFromString(const std::string& string_feature); - -void RemoveChars(const char chars_to_remove[], std::string& string); - -void RemoveSubstring(const std::string& to_erase, std::string& string_feature); - -void SubstituteCharacter(std::string& input, char a, char b); - -Json::Value ParseJsonFromStream(const std::string& input_json); - -Json::Value ParseJsonFromString(const std::string& input_json); - -std::string FindDataTypesInJsonStream(const Json::Value& json_value, - const std::string& name_structure, - std::unordered_map& data_types_map); - -std::chrono::duration GetChronoTimeFromDateTime(const std::string& date_time_string); - -std::chrono::duration> GetChronoTimeInMinutesFromTime(const std::string& time_string); - -std::string GetHourPartFromDateTime(const std::string& date_time); - -std::string GetHourPartFromDateTimeAndSum(const std::string& start_time, const std::string& end_time); - -std::vector ParseWhenMultiNode(const Json::Value& nodes); - -Node ParseWhenSingleNode(const Json::Value& node); - -} // namespace parser - -void WriteStringToFile(const std::string& string_to_write); - -std::vector GetCurrentInferenceResultInJsonFormat(const std::vector& result, - const std::string& type, - const std::string& tree, - const std::string& id, - const bool is_test); - -std::vector ConvertCurrentInferenceResultToJson(const std::vector& result, - const std::string& type, - const std::string& tree, - const std::string& id); - -Json::Value GroupMessages(const Json::Value& message_1, const Json::Value& message2); - - -std::string GetIntials(const std::string input_string); - - -template -std::string to_string_with_precision(const T a_value, const int n = 15) -{ - std::ostringstream out; - out.precision(n); - out << std::fixed << a_value; - return out.str(); -} -} // namespace utils - -#endif diff --git a/cdsp/knowledge-layer/connector/utils/data_types.h b/cdsp/knowledge-layer/connector/utils/data_types.h index 2b4950d..07fd47f 100644 --- a/cdsp/knowledge-layer/connector/utils/data_types.h +++ b/cdsp/knowledge-layer/connector/utils/data_types.h @@ -3,13 +3,23 @@ #include #include +#include #include #include #include +#include "helper.h" + +enum class RDFSyntaxType { + TURTLE, ///< Terse triples http://www.w3.org/TR/turtle + NTRIPLES, ///< Line-based triples http://www.w3.org/TR/n-triples/ + NQUADS, ///< Line-based quads http://www.w3.org/TR/n-quads/ + TRIG, ///< Terse quads http://www.w3.org/TR/trig/ +}; + struct ReasonerSettings { std::string inference_engine; - std::string output_format; + RDFSyntaxType output_format; std::vector supported_tree_types; }; @@ -28,6 +38,7 @@ struct ServerData { std::string host; std::string port; std::string auth_base64; + std::optional data_store; }; struct InitConfig { @@ -67,6 +78,12 @@ struct ErrorMessage { int errorCode; }; +struct CategoryMessage { + std::string category; + std::string message; + int statusCode; +}; + enum class MessageType { READ, WRITE, @@ -74,7 +91,7 @@ enum class MessageType { UNSUBSCRIBE, }; -inline std::string messageTypeToString(MessageType type) { +inline std::string messageTypeToString(const MessageType& type) { switch (type) { case MessageType::READ: return "read"; @@ -87,6 +104,21 @@ inline std::string messageTypeToString(MessageType type) { default: throw std::runtime_error("Unsupported message type"); } +}; + +inline RDFSyntaxType reasonerOutputFormatToRDFSyntaxType(const std::string& type) { + std::string lowerCaseType = Helper::toLowerCase(type); + if (lowerCaseType == "turtle") { + return RDFSyntaxType::TURTLE; + } else if (lowerCaseType == "ntriples") { + return RDFSyntaxType::NTRIPLES; + } else if (lowerCaseType == "nquads") { + return RDFSyntaxType::NQUADS; + } else if (lowerCaseType == "trig") { + return RDFSyntaxType::TRIG; + } else { + throw std::runtime_error("Unsupported RDF output format"); + } } #endif // DATA_TYPES_DATA_TYPES_H \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/utils/helper.cpp b/cdsp/knowledge-layer/connector/utils/helper.cpp index 6df262b..4af4e49 100644 --- a/cdsp/knowledge-layer/connector/utils/helper.cpp +++ b/cdsp/knowledge-layer/connector/utils/helper.cpp @@ -1,6 +1,119 @@ #include "helper.h" #include +#include +#include +#include +#include +#include + +// Define the private namespace for internal helper functions +namespace { +std::tm getCurrentTime(bool useUTC) { + auto now = std::chrono::system_clock::now(); + auto now_time_t = std::chrono::system_clock::to_time_t(now); + return useUTC ? *std::gmtime(&now_time_t) : *std::localtime(&now_time_t); +} + +int getCurrentMilliseconds() { + auto now = std::chrono::system_clock::now(); + return (std::chrono::duration_cast(now.time_since_epoch()) % 1000) + .count(); +} + +std::string formatTime(const std::tm& time, const std::string& format) { + std::ostringstream oss; + oss << std::put_time(&time, format.c_str()); + return oss.str(); +} + +std::string addMilliseconds(const std::string& formattedTime, int milliseconds) { + std::ostringstream oss; + oss << formattedTime << '.' << std::setw(3) << std::setfill('0') << milliseconds; + return oss.str(); +} +} // namespace + +// Public functions +namespace Helper { +/** + * @brief Formats a timestamp based on the provided time, format, and optional milliseconds. + * + * This function generates a formatted timestamp string based on the provided time components. + * If a time structure (`std::tm`) is provided, it formats it directly. Otherwise, it uses the + * current time. The function can include milliseconds and append a 'Z' to indicate UTC if + * specified. + * + * @param format The desired format of the timestamp string (e.g., "%Y-%m-%dT%H:%M:%S"). + * @param includeMilliseconds A boolean indicating whether milliseconds should be appended to the + * timestamp. + * @param useUTC A boolean indicating whether the timestamp should be in UTC format (adds 'Z' to the + * end if `T` is in the format). + * @param tm An optional `std::tm` structure containing the time to format. If not provided, the + * current time is used. + * @param milliseconds An optional integer representing milliseconds to include. Ignored if + * `includeMilliseconds` is false. + * @return A string containing the formatted timestamp. + */ +std::string getFormattedTimestamp(const std::string& format, bool includeMilliseconds, bool useUTC, + const std::optional& customTime, + const std::optional& customMilliseconds) { + std::tm time = customTime.has_value() ? customTime.value() : getCurrentTime(useUTC); + int milliseconds = customMilliseconds.has_value() + ? customMilliseconds.value() + : (includeMilliseconds ? getCurrentMilliseconds() : 0); + + std::string formattedTime = formatTime(time, format); + + if (includeMilliseconds) { + formattedTime = addMilliseconds(formattedTime, milliseconds); + } + + if (useUTC && format.find("T") != std::string::npos) { + formattedTime += 'Z'; + } + + return formattedTime; +} + +/** + * @brief Parses an ISO 8601 formatted datetime string into a `std::tm` structure and extracts + * milliseconds. + * + * This function takes a datetime string in ISO 8601 format (e.g., "2024-11-12T07:45:34.404Z") + * and parses it into a `std::tm` structure representing the date and time up to seconds. + * If milliseconds are present in the string, they are also extracted as an integer. + * + * @param isoString The ISO 8601 formatted datetime string to parse. + * Expected format: "YYYY-MM-DDTHH:MM:SS[.sss]Z" + * Milliseconds (".sss") are optional. + * @return A tuple containing: + * - `std::optional`: The parsed date and time as a `std::tm` structure. + * If parsing fails, this will be `std::nullopt`. + * - `std::optional`: The milliseconds as an integer, if available. If no + * milliseconds are present in the string, this will be `std::nullopt`. + */ +std::tuple, std::optional> parseISO8601ToTime( + const std::string& isoString) { + std::tm tm = {}; + std::optional milliseconds = std::nullopt; + + // Parse the date and time components up to seconds + std::istringstream iss(isoString); + iss >> std::get_time(&tm, "%Y-%m-%dT%H:%M:%S"); + if (iss.fail()) { + std::cout << "Failed to parse datetime" << std::endl; + return {std::nullopt, std::nullopt}; + } + + // Check for milliseconds in the format .sss + if (isoString.find('.') != std::string::npos) { + std::string millisStr = isoString.substr(isoString.find('.') + 1, 3); + milliseconds = std::stoi(millisStr); + } + + return {tm, milliseconds}; +} /** * @brief Converts a given string to lowercase. @@ -10,7 +123,7 @@ * @param input The input string to be converted. * @return A new string with all characters in lowercase. */ -std::string toLowercase(const std::string& input) { +std::string toLowerCase(const std::string& input) { std::string result = input; std::transform(result.begin(), result.end(), result.begin(), [](unsigned char c) { return std::tolower(c); }); @@ -31,3 +144,22 @@ std::string toUppercase(const std::string& input) { [](unsigned char c) { return std::toupper(c); }); return result; } + +/** + * @brief Removes trailing newline characters from a string. + * + * This function iterates over the input string from the end and removes + * any newline characters ('\n') it encounters until a non-newline character + * is found or the string becomes empty. + * + * @param str The input string from which trailing newlines are to be removed. + * @return A new string with trailing newline characters removed. + */ +std::string trimTrailingNewlines(const std::string& str) { + std::string trimmed = str; + while (!trimmed.empty() && trimmed.back() == '\n') { + trimmed.pop_back(); + } + return trimmed; +} +} // namespace Helper \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/utils/helper.h b/cdsp/knowledge-layer/connector/utils/helper.h index 91ecaf5..9fd635f 100644 --- a/cdsp/knowledge-layer/connector/utils/helper.h +++ b/cdsp/knowledge-layer/connector/utils/helper.h @@ -1,9 +1,19 @@ #ifndef HELPER_H #define HELPER_H +#include #include +#include -std::string toLowercase(const std::string& input); +namespace Helper { +std::string getFormattedTimestamp(const std::string& format, bool includeMilliseconds = false, + bool useUTC = true, + const std::optional& tm = std::nullopt, + const std::optional& milliseconds = std::nullopt); +std::tuple, std::optional> parseISO8601ToTime( + const std::string& isoString); +std::string toLowerCase(const std::string& input); std::string toUppercase(const std::string& input); - +std::string trimTrailingNewlines(const std::string& str); +} // namespace Helper #endif // HELPER_H \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/utils/message_utils.cpp b/cdsp/knowledge-layer/connector/utils/message_utils.cpp index 76d1f22..13b3420 100644 --- a/cdsp/knowledge-layer/connector/utils/message_utils.cpp +++ b/cdsp/knowledge-layer/connector/utils/message_utils.cpp @@ -64,6 +64,42 @@ void createReadMessage(const std::string& uuid, const std::string& tree, const s reply_messages_queue.push_back(std::move(message)); } +/** + * @brief Parses a JSON object into a `CategoryMessage` structure. + * + * This function extracts the `category`, `message`, and `statusCode` fields + * from a JSON object and assigns them to a `CategoryMessage` structure (e.g. in case of message + * validation error). It verifies the existence and type of each field, throwing an exception if any + * field is missing or has an unexpected type. + * + * @param json_message The JSON object to parse. + * @return A `CategoryMessage` structure populated with the parsed data. + * @throws std::runtime_error if any required field is missing or has an incorrect type. + */ +CategoryMessage parseCategoryMessage(const json& json_message) { + CategoryMessage category_message; + + if (json_message.contains("category") && json_message["category"].is_string()) { + category_message.category = json_message["category"].get(); + } else { + throw std::runtime_error("Invalid or missing 'category' field in JSON message"); + } + + if (json_message.contains("message") && json_message["message"].is_string()) { + category_message.message = json_message["message"].get(); + } else { + throw std::runtime_error("Invalid or missing 'message' field in JSON message"); + } + + if (json_message.contains("statusCode") && json_message["statusCode"].is_number_integer()) { + category_message.statusCode = json_message["statusCode"].get(); + } else { + throw std::runtime_error("Invalid or missing 'statusCode' field in JSON message"); + } + + return category_message; +} + /** * @brief Parses a JSON message to extract error information and constructs an ErrorMessage object. * @@ -173,16 +209,23 @@ DataMessage parseSuccessMessage(const json& json_message) { } /** - * @brief Parses and displays a JSON message, returning either a DataMessage or an ErrorMessage. + * @brief Parses a JSON message string and returns a corresponding message object. + * + * This function parses the given JSON string and determines whether the message + * represents an error, category (e.g. validation error), or data message. Based on the content, it + * will return either an `ErrorMessage`, `CategoryMessage`, or `DataMessage`. * - * This function takes a JSON string, parses it, and prints the parsed JSON to the standard output. - * Depending on the content of the JSON, it will return either a DataMessage or an ErrorMessage. + * @param message The JSON string containing the message data. + * @return A `std::variant` containing one of `DataMessage`, `ErrorMessage`, or `CategoryMessage` + * depending on the type of message parsed. + * - If the JSON contains an "error" field, an `ErrorMessage` is returned. + * - If the JSON contains a "category" field, a `CategoryMessage` is returned. + * - Otherwise, a `DataMessage` is returned by parsing the success message. * - * @param message The JSON string to be parsed and displayed. - * @return std::variant The parsed message, which can be either a - * DataMessage or an ErrorMessage. + * @throws std::exception if the JSON parsing fails or if required fields are missing. */ -std::variant displayAndParseMessage(const std::string& message) { +std::variant displayAndParseMessage( + const std::string& message) { json json_message = json::parse(message); std::cout << "Received message: " << json_message.dump() << std::endl << std::endl; @@ -190,5 +233,9 @@ std::variant displayAndParseMessage(const std::string return parseErrorMessage(json_message); } + if (json_message.contains("category")) { + return parseCategoryMessage(json_message); + } + return parseSuccessMessage(json_message); } \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/utils/message_utils.h b/cdsp/knowledge-layer/connector/utils/message_utils.h index 268949f..7435b44 100644 --- a/cdsp/knowledge-layer/connector/utils/message_utils.h +++ b/cdsp/knowledge-layer/connector/utils/message_utils.h @@ -21,12 +21,14 @@ void createReadMessage(const std::string& uuid, const std::string& tree, const s const std::vector& data_points, std::vector& reply_messages_queue); +CategoryMessage parseCategoryMessage(const json& json_message); ErrorMessage parseErrorMessage(const json& json_message); std::string nodeValueToString(const json& json_value); DataMessage parseSuccessMessage(const json& json_message); -std::variant displayAndParseMessage(const std::string& message); +std::variant displayAndParseMessage( + const std::string& message); #endif // MESSAGE_UTILS_H \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/utils/model_config.cpp b/cdsp/knowledge-layer/connector/utils/model_config.cpp index cb985db..d184fd1 100644 --- a/cdsp/knowledge-layer/connector/utils/model_config.cpp +++ b/cdsp/knowledge-layer/connector/utils/model_config.cpp @@ -1,9 +1,10 @@ -#include +#include "model_config.h" #include #include #include "helper.h" + /** * @brief Reads a file and returns a list of required data points. * @@ -17,8 +18,7 @@ */ std::vector getClientRequiredDataPoints(std::string file_name) { std::vector required_data; - std::string root = - std::string(PROJECT_ROOT) + "/symbolic-reasoner/examples/use-case/model/" + file_name; + std::string root = createConfigPath(file_name); std::ifstream file(root); if (!file) { throw std::runtime_error("Invalid required Data Points file: " + file_name); @@ -123,11 +123,11 @@ void loadModelConfig(const std::string& config_file, ModelConfig& model_config) "Error in the model_config.json file. Missing required field"; for (const auto& tree_type : config_json["reasoner_settings"]["supported_tree_types"]) { - std::string lc_tree_type = toLowercase(tree_type.get()); + std::string lc_tree_type = Helper::toLowerCase(tree_type.get()); // Read supported tree types model_config.reasoner_settings.supported_tree_types.push_back( - toUppercase(tree_type.get())); + Helper::toUppercase(tree_type.get())); // Read system data points for a tree type if (!config_json["inputs"].contains(lc_tree_type + "_data")) { @@ -142,7 +142,7 @@ void loadModelConfig(const std::string& config_file, ModelConfig& model_config) std::vector query_list; for (const auto& query : config_json["queries"]["triple_assembler_helper"][lc_tree_type]) { - query_list.push_back(query.get()); + query_list.push_back(createConfigPath(query.get())); } model_config.triple_assembler_queries_files[lc_tree_type] = query_list; } else { @@ -158,36 +158,41 @@ void loadModelConfig(const std::string& config_file, ModelConfig& model_config) } // Read output file path - model_config.output_file_path = config_json["output"].get(); + model_config.output_file_path = createConfigPath(config_json["output"].get()); // Read ontologies files for (const auto& ontology : config_json["ontologies"]) { - model_config.ontology_files.push_back(ontology.get()); + model_config.ontology_files.push_back(createConfigPath(ontology.get())); } // Read SHACL shapes files for (const auto& shacl : config_json["shacl"]) { - model_config.shacl_shapes_files.push_back(shacl.get()); + model_config.shacl_shapes_files.push_back(createConfigPath(shacl.get())); } // Read default triple assembler helpers std::vector query_list; for (const auto& query : config_json["queries"]["triple_assembler_helper"]["default"]) { - query_list.push_back(query.get()); + query_list.push_back(createConfigPath(query.get())); } model_config.triple_assembler_queries_files["default"] = query_list; // Read rules paths for (const auto& rule : config_json["rules"]) { - model_config.rules_files.push_back(rule.get()); + model_config.rules_files.push_back(createConfigPath(rule.get())); } // Read output queries path - model_config.output_queries_path = config_json["queries"]["output"].get(); + model_config.output_queries_path = + createConfigPath(config_json["queries"]["output"].get()); // Read reasoner settings model_config.reasoner_settings.inference_engine = config_json["reasoner_settings"]["inference_engine"].get(); - model_config.reasoner_settings.output_format = - config_json["reasoner_settings"]["output_format"].get(); + model_config.reasoner_settings.output_format = reasonerOutputFormatToRDFSyntaxType( + config_json["reasoner_settings"]["output_format"].get()); +} + +std::string createConfigPath(const std::string& config_file) { + return std::string(PROJECT_ROOT) + "/symbolic-reasoner/examples/use-case/model/" + config_file; } diff --git a/cdsp/knowledge-layer/connector/utils/model_config.h b/cdsp/knowledge-layer/connector/utils/model_config.h index 98f866c..9725f96 100644 --- a/cdsp/knowledge-layer/connector/utils/model_config.h +++ b/cdsp/knowledge-layer/connector/utils/model_config.h @@ -2,6 +2,7 @@ #define MESSAGE_MODEL_CONFIG_H #include +#include #include "data_types.h" @@ -9,5 +10,6 @@ using json = nlohmann::json; void validateJsonFields(const json& config_json); void loadModelConfig(const std::string& config_file, ModelConfig& model_config); +std::string createConfigPath(const std::string& config_file); #endif // MESSAGE_MODE_CONFIG_H \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/websocket-client/CMakeLists.txt b/cdsp/knowledge-layer/connector/websocket-client/CMakeLists.txt index ab27158..67c3244 100644 --- a/cdsp/knowledge-layer/connector/websocket-client/CMakeLists.txt +++ b/cdsp/knowledge-layer/connector/websocket-client/CMakeLists.txt @@ -1,22 +1,28 @@ -# Define the WebSocket client target -add_executable( - websocket_client main.cpp +# Define the websocket_client library +add_library(websocket_client websocket_client.cpp + real_websocket_connection.cpp ../utils/message_utils.cpp - ../utils/helper.cpp ../utils/model_config.cpp ) -# Link libraries -target_link_libraries(websocket_client Boost::system Boost::filesystem Boost::thread) -target_link_libraries(websocket_client nlohmann_json::nlohmann_json) -target_include_directories(websocket_client PRIVATE ${CMAKE_SOURCE_DIR}/connector/utils) +# Include directories +target_include_directories(websocket_client + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} +) +# Link dependencies +target_link_libraries(websocket_client + PUBLIC + rdf_writer + Boost::system + Boost::filesystem + Boost::thread + nlohmann_json::nlohmann_json +) # On Windows link winsock, too if(WIN32) target_link_libraries(websocket_client ws2_32) endif() - -# Use defined output directory for the executable -set_target_properties(websocket_client PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/websocket-client/README.md b/cdsp/knowledge-layer/connector/websocket-client/README.md index 17efc5b..e22d202 100644 --- a/cdsp/knowledge-layer/connector/websocket-client/README.md +++ b/cdsp/knowledge-layer/connector/websocket-client/README.md @@ -1,3 +1,3 @@ -# Websocket-Client +# Reasoner - Websocket-Client This project starts a [WebSocket client](main.cpp) that connects to a WebSocket server, sends JSON messages, and handles incoming responses. The client dynamically reads the server’s host and port from the environment variables or falls back to default values if none are provided. diff --git a/cdsp/knowledge-layer/connector/websocket-client/main.cpp b/cdsp/knowledge-layer/connector/websocket-client/main.cpp index ed0cbeb..ed606fd 100644 --- a/cdsp/knowledge-layer/connector/websocket-client/main.cpp +++ b/cdsp/knowledge-layer/connector/websocket-client/main.cpp @@ -1,6 +1,4 @@ -#include -#include - +#include #include #include #include @@ -8,6 +6,10 @@ #include #include +#include "file_handler_impl.h" +#include "model_config.h" +#include "triple_assembler.h" +#include "triple_writer.h" #include "websocket_client.h" using json = nlohmann::json; @@ -21,6 +23,7 @@ std::string ModelConfigurationFile{std::string(PROJECT_ROOT) + std::string DefaultRDFoxServer{"127.0.0.1"}; std::string DefaultPortRDFoxServer{"12110"}; std::string DefaultAuthRDFoxServerBase64{"cm9vdDphZG1pbg=="}; // For 'root:admin' encoded in base64 +std::string DefaultRDFoxDatastore{"ds-test"}; std::string getEnvVariable(const std::string& envVar, const std::string& defaultValue = "") { const char* valueEnv = std::getenv(envVar.c_str()); @@ -59,6 +62,9 @@ void displayHelp() { std::cout << std::left << std::setw(35) << "AUTH_RDFOX_SERVER_BASE64" << std::setw(65) << "Authentication credentials for RDFox Server encoded in base64" << getEnvVariable("AUTH_RDFOX_SERVER_BASE64", DefaultAuthRDFoxServerBase64) << "\n"; + std::cout << std::left << std::setw(35) << "RDFOX_DATASTORE" << std::setw(65) + << "Datastore name of the RDFox server" + << getEnvVariable("RDFOX_DATASTORE", DefaultRDFoxDatastore) << "\n"; std::cout << "\n" << bold << "Description:\n" << reset; std::cout << "This client connects to a WebSocket server and processes incoming messages based " @@ -88,9 +94,11 @@ InitConfig AddInitConfig() { init_config.uuid = boost::uuids::to_string(uuidGenerator()); init_config.oid = getEnvVariable("OBJECT_ID"); init_config.model_config = model_config; - init_config.rdfox_server.host = getEnvVariable("HOST_RDFOX_SERVER"); - init_config.rdfox_server.port = getEnvVariable("PORT_RDFOX_SERVER"); - init_config.rdfox_server.auth_base64 = getEnvVariable("AUTH_RDFOX_SERVER_BASE64"); + init_config.rdfox_server.host = getEnvVariable("HOST_RDFOX_SERVER", DefaultRDFoxServer); + init_config.rdfox_server.port = getEnvVariable("PORT_RDFOX_SERVER", DefaultPortRDFoxServer); + init_config.rdfox_server.auth_base64 = + getEnvVariable("AUTH_RDFOX_SERVER_BASE64", DefaultAuthRDFoxServerBase64); + init_config.rdfox_server.data_store = getEnvVariable("RDFOX_DATASTORE", DefaultRDFoxDatastore); return init_config; } @@ -101,14 +109,36 @@ int main(int argc, char* argv[]) { return EXIT_SUCCESS; } try { + // Initialize configuration InitConfig init_config = AddInitConfig(); - std ::cout << "** Starting client! **" << std::endl; - auto client = std::make_shared(init_config); + + // Initialize TripleAssembler + RDFoxAdapter rdfox_adapter(init_config.rdfox_server.host, init_config.rdfox_server.port, + init_config.rdfox_server.auth_base64, + init_config.rdfox_server.data_store.value()); + rdfox_adapter.initialize(); + + // Initialize TripleAssembler + FileHandlerImpl file_handler; + TripleWriter triple_writer; + TripleAssembler triple_assembler(init_config.model_config, rdfox_adapter, file_handler, + triple_writer); + triple_assembler.initialize(); + + std::cout << std::endl << "** Starting client! **" << std::endl; + + // Create the WebSocketClient + auto client = std::make_shared(init_config, triple_assembler); + + // Initialize the RealWebSocketConnection with the WebSocketClient + client->initializeConnection(); + + // Run the WebSocket client client->run(); return EXIT_SUCCESS; } catch (const std::exception& e) { - std::cout << "Error: " << e.what() << std::endl; + std::cerr << "Error: " << e.what() << std::endl; return EXIT_FAILURE; } -} +} \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/websocket-client/real_websocket_connection.cpp b/cdsp/knowledge-layer/connector/websocket-client/real_websocket_connection.cpp new file mode 100644 index 0000000..4bb5928 --- /dev/null +++ b/cdsp/knowledge-layer/connector/websocket-client/real_websocket_connection.cpp @@ -0,0 +1,79 @@ +#include "real_websocket_connection.h" + +#include + +RealWebSocketConnection::RealWebSocketConnection(net::io_context& io_context, + std::weak_ptr client) + : resolver_(io_context), ws_(io_context), client_(std::move(client)) {} + +void RealWebSocketConnection::asyncResolve(const std::string& host, const std::string& port) { + resolver_.async_resolve(host, port, + beast::bind_front_handler(&RealWebSocketConnection::onResolve, this)); +} + +void RealWebSocketConnection::onResolve(beast::error_code ec, tcp::resolver::results_type results) { + if (ec) { + return Fail(ec, "Resolve failed"); + } + resolve_results_ = results; + asyncConnect(); +} + +void RealWebSocketConnection::asyncConnect() { + if (auto client = client_.lock()) { + auto shared_client = client; // Ensure shared_ptr is captured + net::async_connect(ws_.next_layer(), resolve_results_.begin(), resolve_results_.end(), + [shared_client](boost::system::error_code ec, + boost::asio::ip::tcp::resolver::iterator iterator) { + shared_client->onConnect(ec, iterator); + }); + } else { + std::cerr << "Failed to lock WebSocketClient. Client may have been destroyed.\n"; + } +} + +void RealWebSocketConnection::asyncHandshake() { + if (auto client = client_.lock()) { + auto shared_client = client; // Ensure shared_ptr is captured + ws_.async_handshake( + client->getInitConfig().websocket_server.host, "/", + [shared_client](boost::system::error_code ec) { shared_client->handshake(ec); }); + } else { + std::cerr << "Failed to lock WebSocketClient. Client may have been destroyed.\n"; + } +} + +void RealWebSocketConnection::asyncWrite(const json& message) { + if (auto client = client_.lock()) { + auto shared_client = client; // Ensure shared_ptr is captured + ws_.async_write( + net::buffer(message.dump()), + [shared_client](boost::system::error_code ec, std::size_t bytes_transferred) { + shared_client->onSendMessage(ec, bytes_transferred); + }); + } else { + std::cerr << "Failed to lock WebSocketClient. Client may have been destroyed.\n"; + } +} + +void RealWebSocketConnection::asyncRead() { + if (auto client = client_.lock()) { + auto shared_client = client; // Ensure shared_ptr is captured + ws_.async_read(buffer_, + [shared_client](boost::beast::error_code ec, std::size_t bytes_transferred) { + shared_client->onReceiveMessage(ec, bytes_transferred); + }); + } else { + std::cerr << "Failed to lock WebSocketClient. Client may have been destroyed.\n"; + } +} + +void RealWebSocketConnection::Fail(beast::error_code ec, const char* what) { + std::cerr << what << ": " << ec.message() << "\n"; +} + +std::string RealWebSocketConnection::getReceivedMessage() { + return boost::beast::buffers_to_string(buffer_.data()); +} + +void RealWebSocketConnection::consumeBuffer(std::size_t bytes) { buffer_.consume(bytes); } \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/websocket-client/real_websocket_connection.h b/cdsp/knowledge-layer/connector/websocket-client/real_websocket_connection.h new file mode 100644 index 0000000..2962167 --- /dev/null +++ b/cdsp/knowledge-layer/connector/websocket-client/real_websocket_connection.h @@ -0,0 +1,43 @@ +#ifndef REAL_WEBSOCKET_CONNECTION_H +#define REAL_WEBSOCKET_CONNECTION_H + +#include +#include +#include +#include +#include +#include + +#include "websocket_client.h" +#include "websocket_interface.h" + +namespace beast = boost::beast; +namespace net = boost::asio; +using tcp = net::ip::tcp; +using json = nlohmann::json; + +class RealWebSocketConnection : public WebSocketClientInterface { + public: + RealWebSocketConnection(net::io_context& io_context, std::weak_ptr client); + + void asyncResolve(const std::string& host, const std::string& port) override; + void asyncConnect() override; + void asyncHandshake() override; + void asyncWrite(const json& message) override; + void asyncRead() override; + + std::string getReceivedMessage() override; + void consumeBuffer(std::size_t bytes) override; + + private: + tcp::resolver resolver_; + tcp::resolver::results_type resolve_results_; + beast::websocket::stream ws_; + std::weak_ptr client_; + beast::flat_buffer buffer_; + + void onResolve(beast::error_code ec, tcp::resolver::results_type results); + void Fail(beast::error_code ec, const char* what); +}; + +#endif // REAL_WEBSOCKET_CONNECTION_H diff --git a/cdsp/knowledge-layer/connector/websocket-client/tests/CMakeLists.txt b/cdsp/knowledge-layer/connector/websocket-client/tests/CMakeLists.txt new file mode 100644 index 0000000..221ec66 --- /dev/null +++ b/cdsp/knowledge-layer/connector/websocket-client/tests/CMakeLists.txt @@ -0,0 +1,18 @@ +# Add the integration test executable for WebsocketClient +add_executable(websocket_client_integration_tests websocket_client_integration_test.cpp) +target_link_libraries(websocket_client_integration_tests + PRIVATE + GTest::gtest_main + GTest::gmock + websocket_client + test_fixtures +) + +# Add unit and integration tests to CTest +add_test(NAME WebsocketClientIntegrationTests COMMAND websocket_client_integration_tests) + +# Define custom output directory for test binaries +set_target_properties(websocket_client_integration_tests PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/tests") + +# Ensure tests are built with the all target +add_custom_target(websocket_client_tests ALL DEPENDS websocket_client_integration_tests) \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/websocket-client/tests/mock_websocket_connection.h b/cdsp/knowledge-layer/connector/websocket-client/tests/mock_websocket_connection.h new file mode 100644 index 0000000..2b59158 --- /dev/null +++ b/cdsp/knowledge-layer/connector/websocket-client/tests/mock_websocket_connection.h @@ -0,0 +1,86 @@ +#ifndef MOCK_WEBSOCKET_CONNECTION_H +#define MOCK_WEBSOCKET_CONNECTION_H + +#include +#include +#include + +#include "websocket_interface.h" + +class MockWebSocketConnection : public WebSocketClientInterface { + public: + MockWebSocketConnection() : resolved_(false), connected_(false) {}; + + void asyncResolve(const std::string& host, const std::string& port) override { + resolved_ = true; + if (onResolveCallback_) { + onResolveCallback_(); + } + } + + void asyncConnect() override { + if (resolved_) { + connected_ = true; + if (onConnectCallback_) + onConnectCallback_(); + } + } + + void asyncHandshake() override { + if (connected_) { + if (onHandshakeCallback_) + onHandshakeCallback_(); + } + } + + void asyncWrite(const json& message) override { + sent_messages_.push(message.dump()); + if (onWriteCallback_) + onWriteCallback_(message.dump()); + } + + void asyncRead() override { + if (!received_messages_.empty()) { + buffer_ = received_messages_.front(); + received_messages_.pop(); + if (onReadCallback_) + onReadCallback_(); + } + } + + std::string getReceivedMessage() override { return buffer_; } + + void consumeBuffer(std::size_t bytes) override { + // Mock: no-op + } + + // Test setup methods + void addReceivedMessage(const std::string& message) { received_messages_.push(message); } + + void setOnResolveCallback(std::function callback) { onResolveCallback_ = callback; } + + void setOnConnectCallback(std::function callback) { onConnectCallback_ = callback; } + + void setOnHandshakeCallback(std::function callback) { onHandshakeCallback_ = callback; } + + void setOnWriteCallback(std::function callback) { + onWriteCallback_ = callback; + } + + void setOnReadCallback(std::function callback) { onReadCallback_ = callback; } + + private: + bool resolved_; + bool connected_; + std::queue received_messages_; + std::queue sent_messages_; + std::string buffer_; + + std::function onResolveCallback_; + std::function onConnectCallback_; + std::function onHandshakeCallback_; + std::function onWriteCallback_; + std::function onReadCallback_; +}; + +#endif // MOCK_WEBSOCKET_CONNECTION_H \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/websocket-client/tests/websocket_client_integration_test.cpp b/cdsp/knowledge-layer/connector/websocket-client/tests/websocket_client_integration_test.cpp new file mode 100644 index 0000000..d95a416 --- /dev/null +++ b/cdsp/knowledge-layer/connector/websocket-client/tests/websocket_client_integration_test.cpp @@ -0,0 +1,254 @@ +#include + +#include + +#include "file_handler_impl.h" +#include "init_config_fixture.h" +#include "mock_websocket_connection.h" +#include "model_config.h" +#include "random_utils.h" +#include "rdfox_adapter.h" +#include "triple_assembler.h" +#include "triple_writer.h" +#include "utc_date_utils.h" +#include "vin_utils.h" +#include "websocket_client.h" + +class WebSocketClientIntegrationTest : public ::testing::Test { + protected: + void SetUp() override { + // get a random object id (VIN) + const std::string vin(VinUtils::getRandomVinString()); + + ModelConfig model_config; + loadModelConfig(std::string(PROJECT_ROOT) + + "/symbolic-reasoner/examples/use-case/model/model_config.json", + model_config); + + init_config_ = InitConfigFixture::getValidInitConfig(vin); + init_config_.model_config = model_config; + + // Initialize RDFoxAdapter + rdfox_adapter_ = std::make_shared( + init_config_.rdfox_server.host, init_config_.rdfox_server.port, + init_config_.rdfox_server.auth_base64, init_config_.rdfox_server.data_store.value()); + rdfox_adapter_->initialize(); + + // Initialize TripleAssembler + triple_assembler_ = std::make_shared( + init_config_.model_config, *rdfox_adapter_, file_handler_, triple_writer_); + triple_assembler_->initialize(); + + // Initialize Mock WebSocket connection + mock_connection_ = std::make_shared(); + + // Create WebSocketClient with mock WebSocket connection + client_ = + std::make_shared(init_config_, *triple_assembler_, mock_connection_); + } + + void TearDown() override { // Delete the test data store after all tests have completed + ASSERT_TRUE(rdfox_adapter_->deleteDataStore()) << "Failed to clean up the test data store."; + } + + const std::string createObservationId(const std::string& date_time) { + const auto [dateTime, _] = Helper::parseISO8601ToTime(date_time); + return Helper::getFormattedTimestamp("%Y%m%d%H%M%S", false, false, dateTime); + } + + const std::string createObservationQuery( + const std::string& vin, const std::string& observation_id, const std::string& class_name, + const std::string& observed_property, const std::string& node_value, + const std::string& node_type, const std::string& date_time) { + return R"( + PREFIX car: + PREFIX sosa: + PREFIX xsd: + + SELECT ?exists WHERE { + { + car:)" + + class_name + R"()" + vin + R"( a car:)" + class_name + R"( . + car:Observation)" + + observation_id + R"( a sosa:Observation ; + sosa:hasFeatureOfInterest car:)" + + class_name + R"()" + vin + R"( ; + sosa:hasSimpleResult ")" + + node_value + R"("^^xsd:)" + node_type + R"( ; + sosa:observedProperty car:)" + + observed_property + R"( ; + sosa:phenomenonTime ")" + + date_time + R"("^^xsd:dateTime . + } + BIND(true AS ?exists) + } LIMIT 1 + )"; + } + + const std::string createUpdateMessage(const std::string& vin, const std::string& date_time, + const std::vector& nodes) { + std::ostringstream message; + message << R"({ + "type": "update", + "tree": "VSS", + "id": ")" + << vin << R"(", + "dateTime": ")" + << date_time << R"(", + "uuid": "test", + "nodes": [)"; + + for (size_t i = 0; i < nodes.size(); ++i) { + const auto& node = nodes[i]; + message << R"({ + "name": ")" + << node.name << R"(", + "value": )" + << node.value << R"(})"; + + if (i < nodes.size() - 1) { + message << ","; + } + } + + message << R"(]})"; + return message.str(); + } + + InitConfig init_config_; + std::shared_ptr rdfox_adapter_; + std::shared_ptr triple_assembler_; + FileHandlerImpl file_handler_; + TripleWriter triple_writer_; + std::shared_ptr mock_connection_; + std::shared_ptr client_; +}; + +TEST_F(WebSocketClientIntegrationTest, FullFlowTest) { + const std::string date_time(UtcDateUtils::generateRandomUtcDate()); + const std::vector nodes = { + {"Vehicle.Speed", std::to_string(RandomUtils::generateRandomFloat(0, 300))}}; + + // Simulate a message from the server + mock_connection_->addReceivedMessage(createUpdateMessage(init_config_.oid, date_time, nodes)); + + // Mock WebSocket behavior + mock_connection_->setOnResolveCallback([&]() { + std::cout << "Mock: Resolved WebSocket server." << std::endl; + mock_connection_->asyncConnect(); + }); + + mock_connection_->setOnConnectCallback([&]() { + std::cout << "Mock: Connected to WebSocket server." << std::endl; + mock_connection_->asyncHandshake(); + }); + + mock_connection_->setOnHandshakeCallback([&]() { + std::cout << "Mock: Handshake completed." << std::endl; + mock_connection_->asyncRead(); + }); + + mock_connection_->setOnReadCallback([&]() { + std::cout << "Mock: Read message from server." << std::endl; + client_->onReceiveMessage({}, mock_connection_->getReceivedMessage().size()); + }); + + // Run the WebSocket client + client_->run(); + + // Verify RDFox Data + const std::string expected_observation_id(createObservationId(date_time) + "O0"); + std::string sparql_query(createObservationQuery(init_config_.oid, expected_observation_id, + "Vehicle", "speed", nodes.at(0).value, "float", + date_time)); + + std::string result = rdfox_adapter_->queryData(sparql_query); + + // Assert data exists in RDFox + ASSERT_TRUE(result.find("true") != std::string::npos) << "Triple was not found in RDFox!"; +} + +TEST_F(WebSocketClientIntegrationTest, FullFlowTestMultiNodes) { + // Data for update message 1 + const std::string date_time_msg1(UtcDateUtils::generateRandomUtcDate()); + const std::vector nodes_msg_1 = { + {"Vehicle.Speed", std::to_string(RandomUtils::generateRandomFloat(0, 300))}, + {"Vehicle.Powertrain.TractionBattery.StateOfCharge.CurrentEnergy", + std::to_string(RandomUtils::generateRandomFloat(0, 100))}}; + + // Data for update message 2 + const std::string date_time_msg2(UtcDateUtils::generateRandomUtcDate()); + const std::string observation_id_msg_2(createObservationId(date_time_msg2)); + const std::vector nodes_msg_2 = { + {"Vehicle.Chassis.SteeringWheel.Angle", + std::to_string(RandomUtils::generateRandomInt(0, 100))}, + {"Vehicle.Powertrain.TractionBattery.StateOfCharge.CurrentEnergy", + std::to_string(RandomUtils::generateRandomFloat(0, 100))}}; + + // Simulate a message from the server + mock_connection_->addReceivedMessage( + createUpdateMessage(init_config_.oid, date_time_msg1, nodes_msg_1)); + mock_connection_->addReceivedMessage( + createUpdateMessage(init_config_.oid, date_time_msg2, nodes_msg_2)); + + // Mock WebSocket behavior + mock_connection_->setOnResolveCallback([&]() { + std::cout << "Mock: Resolved WebSocket server." << std::endl; + mock_connection_->asyncConnect(); + }); + + mock_connection_->setOnConnectCallback([&]() { + std::cout << "Mock: Connected to WebSocket server." << std::endl; + mock_connection_->asyncHandshake(); + }); + + mock_connection_->setOnHandshakeCallback([&]() { + std::cout << "Mock: Handshake completed." << std::endl; + mock_connection_->asyncRead(); + }); + + mock_connection_->setOnReadCallback([&]() { + std::cout << "Mock: Read message from server." << std::endl; + client_->onReceiveMessage({}, mock_connection_->getReceivedMessage().size()); + }); + + // Run the WebSocket client + client_->run(); + + // Verify RDFox Data Nodes Message 1 + const std::string exp_ob_id_msg_1_qry_1(createObservationId(date_time_msg1) + "O0"); + std::string sparql_query_msg_1_qry_1( + createObservationQuery(init_config_.oid, exp_ob_id_msg_1_qry_1, "Vehicle", "speed", + nodes_msg_1.at(0).value, "float", date_time_msg1)); + + const std::string exp_obs_id_msg_1_qry_2(createObservationId(date_time_msg1) + "O1"); + std::string sparql_query_msg_1_qry_2( + createObservationQuery(init_config_.oid, exp_obs_id_msg_1_qry_2, "StateOfCharge", + "currentEnergy", nodes_msg_1.at(1).value, "float", date_time_msg1)); + + // Verify RDFox Data Nodes Message 2 + const std::string exp_obs_id_msg_2_qry_1(createObservationId(date_time_msg2) + "O0"); + std::string sparql_query_msg_2_qry_1( + createObservationQuery(init_config_.oid, exp_obs_id_msg_2_qry_1, "SteeringWheel", "angle", + nodes_msg_2.at(0).value, "int", date_time_msg2)); + + const std::string exp_obs_id_msg_2_qry_2(createObservationId(date_time_msg2) + "O1"); + std::string sparql_query_msg_2_qry_2( + createObservationQuery(init_config_.oid, exp_obs_id_msg_2_qry_2, "StateOfCharge", + "currentEnergy", nodes_msg_2.at(1).value, "float", date_time_msg2)); + + std::string result_msg_1_qry_1 = rdfox_adapter_->queryData(sparql_query_msg_1_qry_1); + std::string result_msg_1_qry_2 = rdfox_adapter_->queryData(sparql_query_msg_1_qry_2); + std::string result_msg_2_qry_1 = rdfox_adapter_->queryData(sparql_query_msg_2_qry_1); + std::string result_msg_2_qry_2 = rdfox_adapter_->queryData(sparql_query_msg_2_qry_2); + + // Assert data exists in RDFox + ASSERT_TRUE(result_msg_1_qry_1.find("true") != std::string::npos) + << "Triple for message 1, node 1 was not found in RDFox!"; + ASSERT_TRUE(result_msg_1_qry_2.find("true") != std::string::npos) + << "Triple for message 1, node 2 was not found in RDFox!"; + ASSERT_TRUE(result_msg_2_qry_1.find("true") != std::string::npos) + << "Triple for message 2, node 1 was not found in RDFox!"; + ASSERT_TRUE(result_msg_2_qry_2.find("true") != std::string::npos) + << "Triple for message 2, node 2 was not found in RDFox!"; +} \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/websocket-client/websocket_client.cpp b/cdsp/knowledge-layer/connector/websocket-client/websocket_client.cpp index af9f2ad..c548a1b 100644 --- a/cdsp/knowledge-layer/connector/websocket-client/websocket_client.cpp +++ b/cdsp/knowledge-layer/connector/websocket-client/websocket_client.cpp @@ -4,18 +4,43 @@ #include #include "helper.h" +#include "real_websocket_connection.h" namespace { -void Fail(beast::error_code error_code, const std::string& what) { - std::cerr << what << ": " << error_code.message() << "\n"; +/** + * @brief Logs errors encountered during asynchronous operations. + * + * @param ec The Boost.Beast error code. + * @param what Description of the operation that failed. + */ +void Fail(const boost::system::error_code& ec, const std::string& what) { + std::cerr << what << ": " << ec.message() << "\n"; } -std::string createLogErrorMessage(ErrorMessage& error) { +/** + * @brief Creates a log message for a received category message. + * + * @param categoryMessage The CategoryMessage object. + * @return A string containing the formatted log message. + */ +std::string createLogCategoryMessage(const CategoryMessage& categoryMessage) { + return "Received a message category: " + categoryMessage.category + + "\nMessage: " + categoryMessage.message + + "\nStatus Code: " + std::to_string(categoryMessage.statusCode); +} + +/** + * @brief Creates a log message for a received error message. + * + * @param error The ErrorMessage object. + * @return A string containing the formatted log message. + */ +std::string createLogErrorMessage(const ErrorMessage& error) { std::string errorDetails; if (std::holds_alternative(error.error)) { errorDetails = std::get(error.error); } else { - const std::vector& nodes = std::get>(error.error); + const auto& nodes = std::get>(error.error); for (const auto& node : nodes) { errorDetails += "\n - Node: " + node.name + ": " + node.status; } @@ -26,116 +51,138 @@ std::string createLogErrorMessage(ErrorMessage& error) { } } // namespace -WebSocketClient::WebSocketClient(const InitConfig& init_config) - : resolver_(io_context_), ws_(io_context_), init_config_(init_config) {} +/** + * @brief Constructor for the WebSocketClient. + * + * @param init_config Configuration for initializing the client. + * @param triple_assembler Reference to the TripleAssembler for processing messages. + * @param connection Optional custom WebSocket connection implementation. + */ +WebSocketClient::WebSocketClient(const InitConfig& init_config, TripleAssembler& triple_assembler, + std::shared_ptr connection) + : init_config_(init_config), + triple_assembler_(triple_assembler), + io_context_(), + connection_(std::move(connection)) {} + +void WebSocketClient::initializeConnection() { + if (!connection_) { + auto self = shared_from_this(); + connection_ = std::make_shared(io_context_, self); + } +} +/** + * @brief Starts the WebSocket client's execution flow. + */ void WebSocketClient::run() { - resolver_.async_resolve( - init_config_.websocket_server.host, init_config_.websocket_server.port, - beast::bind_front_handler(&WebSocketClient::onResolve, shared_from_this())); - - // Run the io_context to process asynchronous events + connection_->asyncResolve(init_config_.websocket_server.host, + init_config_.websocket_server.port); + // Run the IO context to process asynchronous events io_context_.run(); } -void WebSocketClient::onResolve(beast::error_code ec, tcp::resolver::results_type results) { - if (ec) { - return Fail(ec, "Resolve failed:"); - } - net::async_connect(ws_.next_layer(), results.begin(), results.end(), - beast::bind_front_handler(&WebSocketClient::onConnect, shared_from_this())); -} +/** + * @brief Provides access to the client's configuration. + * + * @return The current InitConfig object. + */ +const InitConfig& WebSocketClient::getInitConfig() const { return init_config_; } +// Callbacks for connection lifecycle and message handling void WebSocketClient::onConnect(boost::system::error_code ec, - tcp::resolver::iterator /*end_point*/) { + boost::asio::ip::tcp::resolver::iterator iterator) { if (ec) { return Fail(ec, "Connection failed:"); } - ws_.async_handshake(init_config_.websocket_server.host, "/", - beast::bind_front_handler(&WebSocketClient::handshake, shared_from_this())); + connection_->asyncHandshake(); } -void WebSocketClient::handshake(beast::error_code ec) { +void WebSocketClient::handshake(boost::system::error_code ec) { if (ec) { return Fail(ec, "Handshake failed:"); } - std::cout << "Connected to WebSocket server: " << init_config_.websocket_server.host - << std::endl - << std::endl; + + std::cout << "Connected to WebSocket server: " << init_config_.websocket_server.host << "\n\n"; for (const std::string& tree_type : init_config_.model_config.reasoner_settings.supported_tree_types) { createSubscription(init_config_.uuid, init_config_.oid, tree_type, reply_messages_queue_); - createReadMessage(init_config_.uuid, tree_type, init_config_.oid, - init_config_.model_config.system_data_points[toLowercase(tree_type)], - reply_messages_queue_); + createReadMessage( + init_config_.uuid, tree_type, init_config_.oid, + init_config_.model_config.system_data_points[Helper::toLowerCase(tree_type)], + reply_messages_queue_); } writeReplyMessagesOnQueue(); } -void WebSocketClient::sendMessage(const json& message) { - ws_.async_write(net::buffer(message.dump()), - beast::bind_front_handler(&WebSocketClient::onSendMessage, shared_from_this())); -} +/** + * @brief Sends a JSON message to the WebSocket server. + * + * @param message The JSON message to be sent. + */ +void WebSocketClient::sendMessage(const json& message) { connection_->asyncWrite(message); } void WebSocketClient::onSendMessage(boost::system::error_code ec, std::size_t bytes_transferred) { if (ec) { return Fail(ec, "write"); } - std::cout << "Message send! " << bytes_transferred << " bytes transferred" << std::endl - << std::endl; - receiveMessage(); + std::cout << "Message sent! " << bytes_transferred << " bytes transferred\n\n"; + connection_->asyncRead(); } -void WebSocketClient::receiveMessage() { - ws_.async_read( - buffer_, beast::bind_front_handler(&WebSocketClient::onReceiveMessage, shared_from_this())); -} - -void WebSocketClient::onReceiveMessage(beast::error_code ec, std::size_t bytes_transferred) { +void WebSocketClient::onReceiveMessage(boost::beast::error_code ec, std::size_t bytes_transferred) { if (ec) { return Fail(ec, "read"); } - const auto received_message = - std::make_shared(boost::beast::buffers_to_string(buffer_.data())); - buffer_.consume(bytes_transferred); // Clear the buffer for the next message + const auto received_message = std::make_shared(connection_->getReceivedMessage()); + connection_->consumeBuffer(bytes_transferred); // Clear the buffer for the next message processMessage(received_message); } -void WebSocketClient::processMessage(std::shared_ptr const& message) { - boost::asio::post( - ws_.get_executor(), - beast::bind_front_handler(&WebSocketClient::onProcessMessage, shared_from_this(), message)); -} - -void WebSocketClient::onProcessMessage(std::shared_ptr const& message) { +/** + * @brief Processes a message received from the WebSocket server. + * + * @param message The message to process. + */ +void WebSocketClient::processMessage(const std::shared_ptr& message) { response_messages_queue_.push_back(message); - - std::string prio_message = *response_messages_queue_.begin()->get(); + auto prio_message = *response_messages_queue_.front(); response_messages_queue_.erase(response_messages_queue_.begin()); const auto parsed_message = displayAndParseMessage(prio_message); if (std::holds_alternative(parsed_message)) { - ErrorMessage error = std::get(parsed_message); + auto error = std::get(parsed_message); throw std::runtime_error(createLogErrorMessage(error)); + } else if (std::holds_alternative(parsed_message)) { + auto error = std::get(parsed_message); + throw std::runtime_error(createLogCategoryMessage(error)); + } else { + DataMessage data_message = std::get(parsed_message); + try { + triple_assembler_.transformMessageToRDFTriple(data_message); + } catch (const std::exception& e) { + std::cerr << "Error transforming message to RDF triple: " << e.what() << std::endl; + } } - DataMessage data_message = std::get(parsed_message); - if (!reply_messages_queue_.empty()) { writeReplyMessagesOnQueue(); } else { - receiveMessage(); + connection_->asyncRead(); } } +/** + * @brief Sends messages queued in the reply_messages_queue_. + */ void WebSocketClient::writeReplyMessagesOnQueue() { json reply_message = reply_messages_queue_.front(); reply_messages_queue_.erase(reply_messages_queue_.begin()); std::cout << "Sending queue message: " << reply_message.dump() << std::endl; sendMessage(reply_message); -} +} \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/websocket-client/websocket_client.h b/cdsp/knowledge-layer/connector/websocket-client/websocket_client.h index 8a8922a..da49b62 100644 --- a/cdsp/knowledge-layer/connector/websocket-client/websocket_client.h +++ b/cdsp/knowledge-layer/connector/websocket-client/websocket_client.h @@ -1,45 +1,49 @@ +#ifndef WEBSOCKET_CLIENT_H +#define WEBSOCKET_CLIENT_H + #include #include -#include -#include -#include +#include #include #include #include #include "data_types.h" #include "message_utils.h" +#include "triple_assembler.h" +#include "websocket_interface.h" namespace beast = boost::beast; -namespace websocket = beast::websocket; namespace net = boost::asio; using tcp = net::ip::tcp; using json = nlohmann::json; class WebSocketClient : public std::enable_shared_from_this { public: - WebSocketClient(const InitConfig& init_config); + WebSocketClient(const InitConfig& init_config, TripleAssembler& triple_assembler, + std::shared_ptr connection = nullptr); + + void initializeConnection(); void run(); void sendMessage(const json& message); + const InitConfig& getInitConfig() const; + void onConnect(boost::system::error_code ec, tcp::resolver::iterator iterator); + void handshake(boost::system::error_code ec); + void onSendMessage(boost::system::error_code ec, std::size_t bytes_transferred); + void onReceiveMessage(beast::error_code ec, std::size_t bytes_transferred); private: - void onResolve(beast::error_code error_code, tcp::resolver::results_type results); - void onConnect(boost::system::error_code error_code, tcp::resolver::iterator end_point); - void handshake(beast::error_code error_code); - void receiveMessage(); - void onReceiveMessage(beast::error_code error_code, std::size_t bytes_transferred); - void onSendMessage(boost::system::error_code ec, std::size_t bytes_transferred); - void processMessage(std::shared_ptr const& ss); - void onProcessMessage(std::shared_ptr const& ss); + TripleAssembler& triple_assembler_; + InitConfig init_config_; + net::io_context io_context_; - void writeReplyMessagesOnQueue(); + std::vector reply_messages_queue_; + std::vector> response_messages_queue_; - std::vector reply_messages_queue_{}; - std::vector> response_messages_queue_{}; - net::io_context io_context_; - websocket::stream ws_; - tcp::resolver resolver_; - beast::flat_buffer buffer_; + std::shared_ptr connection_; - InitConfig init_config_; -}; \ No newline at end of file + void processMessage(const std::shared_ptr& message); + void writeReplyMessagesOnQueue(); +}; + +#endif // WEBSOCKET_CLIENT_H \ No newline at end of file diff --git a/cdsp/knowledge-layer/connector/websocket-client/websocket_interface.h b/cdsp/knowledge-layer/connector/websocket-client/websocket_interface.h new file mode 100644 index 0000000..547b658 --- /dev/null +++ b/cdsp/knowledge-layer/connector/websocket-client/websocket_interface.h @@ -0,0 +1,59 @@ +#ifndef WEBSOCKET_INTERFACE_H +#define WEBSOCKET_INTERFACE_H + +#include +#include +#include + +using json = nlohmann::json; + +class WebSocketClientInterface { + public: + virtual ~WebSocketClientInterface() = default; + + /** + * @brief Resolve the WebSocket server's host and port. + * + * @param host The WebSocket server's hostname or IP address. + * @param port The WebSocket server's port. + */ + virtual void asyncResolve(const std::string& host, const std::string& port) = 0; + + /** + * @brief Establish a connection to the resolved host and port. + */ + virtual void asyncConnect() = 0; + + /** + * @brief Perform the WebSocket handshake. + */ + virtual void asyncHandshake() = 0; + + /** + * @brief Send a JSON message asynchronously. + * + * @param message The JSON message to send. + */ + virtual void asyncWrite(const json& message) = 0; + + /** + * @brief Start asynchronously reading messages. + */ + virtual void asyncRead() = 0; + + /** + * @brief Retrieve the most recent message received from the WebSocket. + * + * @return The received message as a string. + */ + virtual std::string getReceivedMessage() = 0; + + /** + * @brief Consume (clear) a portion of the WebSocket's buffer after reading. + * + * @param bytes_transferred The number of bytes to consume. + */ + virtual void consumeBuffer(std::size_t bytes) = 0; +}; + +#endif // WEBSOCKET_INTERFACE_H \ No newline at end of file diff --git a/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/.gitignore b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/.gitignore new file mode 100644 index 0000000..6fedcb6 --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/.gitignore @@ -0,0 +1,2 @@ +# Ingnore new generated triples +model/output/ \ No newline at end of file diff --git a/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/README.md b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/README.md index 9aa12bd..6fd0bad 100644 --- a/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/README.md +++ b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/README.md @@ -38,6 +38,8 @@ The `model_config.json` is structured to provide: "output": "output/generated_triples.ttl" ``` - **output**: Defines the path to the file where the reasoner will store the results of the inference process. The output will be generated in the format defined in the [reasoner settings](#reasoner-settings) (in this case a turtle `.ttl`). + > [!IMPORTANT] Do not add the generated files to the repository + > - The generated files are into `.gitignore` file, they must be use locally only. #### Queries ```json diff --git a/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/output/generated_triples.ttl b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/output/generated_triples.ttl index 3542e5d..e5c7840 100644 --- a/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/output/generated_triples.ttl +++ b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/output/generated_triples.ttl @@ -1,72 +1,72 @@ -bmw:VehicleWBY11CF080CH470711 a bmw:Vehicle. +car:VehicleWBY11CF080CH470711 a car:Vehicle. -bmw:ChassisWBY11CF080CH470711 a bmw:Chassis. +car:ChassisWBY11CF080CH470711 a car:Chassis. -bmw:VehicleWBY11CF080CH470711 bmw:hasPart bmw:ChassisWBY11CF080CH470711. +car:VehicleWBY11CF080CH470711 car:hasPart car:ChassisWBY11CF080CH470711. -bmw:SteeringWheelWBY11CF080CH470711 a bmw:SteeringWheel. -bmw:VehicleWBY11CF080CH470711 bmw:hasPart bmw:SteeringWheelWBY11CF080CH470711. +car:SteeringWheelWBY11CF080CH470711 a car:SteeringWheel. +car:VehicleWBY11CF080CH470711 car:hasPart car:SteeringWheelWBY11CF080CH470711. -bmw:CurrentLocationWBY11CF080CH470711 a bmw:CurrentLocation. -bmw:VehicleWBY11CF080CH470711 bmw:hasSignal bmw:CurrentLocationWBY11CF080CH470711. +car:CurrentLocationWBY11CF080CH470711 a car:CurrentLocation. +car:VehicleWBY11CF080CH470711 car:hasSignal car:CurrentLocationWBY11CF080CH470711. -bmw:PowertrainWBY11CF080CH470711 a bmw:Powertrain. +car:PowertrainWBY11CF080CH470711 a car:Powertrain. -bmw:VehicleWBY11CF080CH470711 bmw:hasPart bmw:PowertrainWBY11CF080CH470711. +car:VehicleWBY11CF080CH470711 car:hasPart car:PowertrainWBY11CF080CH470711. -bmw:TransmissionWBY11CF080CH470711 a bmw:Transmission. +car:TransmissionWBY11CF080CH470711 a car:Transmission. -bmw:PowertrainWBY11CF080CH470711 bmw:hasPart bmw:TransmissionWBY11CF080CH470711. +car:PowertrainWBY11CF080CH470711 car:hasPart car:TransmissionWBY11CF080CH470711. -bmw:TractionBatteryWBY11CF080CH470711 a bmw:TractionBattery. +car:TractionBatteryWBY11CF080CH470711 a car:TractionBattery. -bmw:PowertrainWBY11CF080CH470711 bmw:hasPart bmw:TractionBatteryWBY11CF080CH470711. +car:PowertrainWBY11CF080CH470711 car:hasPart car:TractionBatteryWBY11CF080CH470711. -bmw:StateOfChargeWBY11CF080CH470711 a bmw:StateOfCharge. +car:StateOfChargeWBY11CF080CH470711 a car:StateOfCharge. -bmw:TractionBatteryWBY11CF080CH470711 bmw:hasSignal bmw:StateOfChargeWBY11CF080CH470711. +car:TractionBatteryWBY11CF080CH470711 car:hasSignal car:StateOfChargeWBY11CF080CH470711. -bmw:Observation20181116155027 a sosa:Observation ; # observation_dateTime - sosa:hasFeatureOfInterest bmw:CurrentLocationWBY11CF080CH470711 ; #last second element of the the data point +car:Observation20181116155027 a sosa:Observation ; # observation_dateTime + sosa:hasFeatureOfInterest car:CurrentLocationWBY11CF080CH470711 ; #last second element of the the data point sosa:hasSimpleResult "30"^^xsd:double ; # value - sosa:observedProperty bmw:latitude ; #last element of the data point + sosa:observedProperty car:latitude ; #last element of the data point sosa:phenomenonTime "2018-11-16 15:50:27"^^xsd:dateTime .#dateTime -bmw:Observation20181116155027 a sosa:Observation ; - sosa:hasFeatureOfInterest bmw:CurrentLocationWBY11CF080CH470711 ; +car:Observation20181116155027 a sosa:Observation ; + sosa:hasFeatureOfInterest car:CurrentLocationWBY11CF080CH470711 ; sosa:hasSimpleResult "50"^^xsd:double ; - sosa:observedProperty bmw:longitude ; + sosa:observedProperty car:longitude ; sosa:phenomenonTime "2018-11-16 15:50:27"^^xsd:dateTime . -bmw:Observation20181116155027 a sosa:Observation ; - sosa:hasFeatureOfInterest bmw:VehicleWBY11CF080CH470711 ; +car:Observation20181116155027 a sosa:Observation ; + sosa:hasFeatureOfInterest car:VehicleWBY11CF080CH470711 ; sosa:hasSimpleResult "50"^^xsd:int ; - sosa:observedProperty bmw:speed ; + sosa:observedProperty car:speed ; sosa:phenomenonTime "2018-11-16 15:50:27"^^xsd:dateTime . -bmw:Observation20181116155027 a sosa:Observation ; - sosa:hasFeatureOfInterest bmw:SteeringWheelWBY11CF080CH470711 ; +car:Observation20181116155027 a sosa:Observation ; + sosa:hasFeatureOfInterest car:SteeringWheelWBY11CF080CH470711 ; sosa:hasSimpleResult "10"^^xsd:int ; - sosa:observedProperty bmw:angle ; + sosa:observedProperty car:angle ; sosa:phenomenonTime "2018-11-16 15:50:27"^^xsd:dateTime . -bmw:Observation20181116155027 a sosa:Observation ; - sosa:hasFeatureOfInterest bmw:TransmissionWBY11CF080CH470711 ; +car:Observation20181116155027 a sosa:Observation ; + sosa:hasFeatureOfInterest car:TransmissionWBY11CF080CH470711 ; sosa:hasSimpleResult "10"^^xsd:int ; - sosa:observedProperty bmw:currentGear ; + sosa:observedProperty car:currentGear ; sosa:phenomenonTime "2018-11-16 15:50:27"^^xsd:dateTime . -bmw:Observation20181116155027 a sosa:Observation ; - sosa:hasFeatureOfInterest bmw:StateOfChargeWBY11CF080CH470711 ; +car:Observation20181116155027 a sosa:Observation ; + sosa:hasFeatureOfInterest car:StateOfChargeWBY11CF080CH470711 ; sosa:hasSimpleResult "98.6"^^xsd:float ; - sosa:observedProperty bmw:CurrentEnergy ; + sosa:observedProperty car:CurrentEnergy ; sosa:phenomenonTime "2018-11-16 15:50:27"^^xsd:dateTime . -bmw:Observation20181116155027 a sosa:Observation ; - sosa:hasFeatureOfInterest bmw:TractionBatteryWBY11CF080CH470711 ; +car:Observation20181116155027 a sosa:Observation ; + sosa:hasFeatureOfInterest car:TractionBatteryWBY11CF080CH470711 ; sosa:hasSimpleResult "55"^^xsd:int ; - sosa:observedProperty bmw:NominalVoltage ; + sosa:observedProperty car:NominalVoltage ; sosa:phenomenonTime "2018-11-16 15:50:27"^^xsd:dateTime . \ No newline at end of file diff --git a/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/default/query_observation_data_property.rq b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/default/data_property.rq similarity index 82% rename from cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/default/query_observation_data_property.rq rename to cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/default/data_property.rq index d62a449..f45ac9b 100644 --- a/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/default/query_observation_data_property.rq +++ b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/default/data_property.rq @@ -1,5 +1,5 @@ prefix sh: -prefix val: +prefix val: SELECT ?class1 ?data_property ?datatype WHERE { diff --git a/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/default/query_observation_object_property.rq b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/default/object_property.rq similarity index 57% rename from cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/default/query_observation_object_property.rq rename to cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/default/object_property.rq index 578d806..d970f29 100644 --- a/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/default/query_observation_object_property.rq +++ b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/default/object_property.rq @@ -1,10 +1,8 @@ -prefix pdmo: -prefix bmw: +prefix car: prefix middleware: prefix sh: -prefix val: +prefix val: prefix xsd: -prefix ut: SELECT ?class1 ?object_property diff --git a/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/vss/query_vss_data_property.rq b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/vss/data_property.rq similarity index 63% rename from cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/vss/query_vss_data_property.rq rename to cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/vss/data_property.rq index 11d85e2..b354f9e 100644 --- a/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/vss/query_vss_data_property.rq +++ b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/vss/data_property.rq @@ -1,10 +1,8 @@ -prefix pdmo: -prefix bmw: +prefix car: prefix middleware: prefix sh: -prefix val: +prefix val: prefix xsd: -prefix ut: SELECT ?class1 ?data_property ?datatype @@ -16,6 +14,4 @@ prefix ut: sh:datatype ?datatype ]. FILTER (contains("%B%", ?data_point_name)) #The first value is from the data sigle point - } - - + } \ No newline at end of file diff --git a/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/vss/query_vss_object_property.rq b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/vss/object_property.rq similarity index 60% rename from cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/vss/query_vss_object_property.rq rename to cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/vss/object_property.rq index 4222b3f..0f1880e 100644 --- a/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/vss/query_vss_object_property.rq +++ b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/queries/triple_assembler_helper/vss/object_property.rq @@ -1,10 +1,8 @@ -prefix pdmo: -prefix bmw: +prefix car: prefix middleware: prefix sh: -prefix val: +prefix val: prefix xsd: -prefix ut: SELECT ?class1 ?object_property ?class2 diff --git a/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/shacl/observation_shacl.ttl b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/shacl/observation_shacl.ttl index 3867fd0..791cf2b 100644 --- a/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/shacl/observation_shacl.ttl +++ b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/shacl/observation_shacl.ttl @@ -1,7 +1,7 @@ @prefix sh: . @prefix sosa: . @prefix xsd: . -@prefix val: . +@prefix val: . # Shape to validate an Observation val:ObservationShape a sh:NodeShape ; diff --git a/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/shacl/vss_shacl.ttl b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/shacl/vss_shacl.ttl index af446be..705eff8 100644 --- a/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/shacl/vss_shacl.ttl +++ b/cdsp/knowledge-layer/symbolic-reasoner/examples/use-case/model/shacl/vss_shacl.ttl @@ -2,24 +2,24 @@ @prefix rdfs: . @prefix sh: . @prefix xsd: . -@prefix bmw: . +@prefix car: . @prefix val: . val:VehicleShape a sh:NodeShape ; sh:name "Vehicle" ; - sh:targetClass bmw:Vehicle ; + sh:targetClass car:Vehicle ; sh:property [ sh:name "VIN" ; - sh:path bmw:vin ; + sh:path car:vin ; sh:datatype xsd:string ; sh:minCount 1 ; sh:maxCount 1 ; ] ; sh:property [ sh:name "CurrentLocation" ; - sh:path bmw:hasSignal ; - sh:class bmw:CurrentLocation ; + sh:path car:hasSignal ; + sh:class car:CurrentLocation ; sh:node val:CurrentLocationShape ; sh:nodeKind sh:IRI ; sh:minCount 0 ; @@ -27,22 +27,22 @@ val:VehicleShape a sh:NodeShape ; ] ; sh:property [ sh:name "Speed" ; - sh:path bmw:speed ; + sh:path car:speed ; sh:datatype xsd:float ; sh:minCount 0 ; sh:maxCount 1 ; ] ; sh:property [ sh:name "PWFStatus" ; - sh:path bmw:PWFStatus ; + sh:path car:PWFStatus ; sh:datatype xsd:string ; sh:minCount 0 ; sh:maxCount 1 ; ] ; sh:property [ sh:name "Cabin" ; - sh:path bmw:hasPart ; - sh:class bmw:Cabin ; + sh:path car:hasPart ; + sh:class car:Cabin ; sh:node val:CabinShape ; sh:nodeKind sh:IRI ; sh:minCount 0 ; @@ -50,8 +50,8 @@ val:VehicleShape a sh:NodeShape ; ] ; sh:property [ sh:name "Powertrain" ; - sh:path bmw:hasPart ; - sh:class bmw:Powertrain ; + sh:path car:hasPart ; + sh:class car:Powertrain ; sh:node val:PowertrainShape ; sh:nodeKind sh:IRI ; sh:minCount 0 ; @@ -59,8 +59,8 @@ val:VehicleShape a sh:NodeShape ; ] ; sh:property [ sh:name "Chassis" ; - sh:path bmw:hasPart ; - sh:class bmw:Chassis ; + sh:path car:hasPart ; + sh:class car:Chassis ; sh:node val:ChassisShape ; sh:nodeKind sh:IRI ; sh:minCount 0 ; @@ -69,11 +69,11 @@ val:VehicleShape a sh:NodeShape ; val:ChassisShape a sh:NodeShape; sh:name "Chassis"; - sh:targetClass bmw:Chassis; + sh:targetClass car:Chassis; sh:property [ sh:name "SteeringWheel" ; - sh:path bmw:hasPart ; - sh:class bmw:SteeringWheel ; + sh:path car:hasPart ; + sh:class car:SteeringWheel ; sh:node val:SteeringWheelShape ; sh:nodeKind sh:IRI ; sh:minCount 1 ; @@ -81,10 +81,10 @@ val:ChassisShape a sh:NodeShape; val:SteeringWheelShape a sh:NodeShape; sh:name "SteeringWheel"; - sh:targetClass bmw:SteeringWheel; + sh:targetClass car:SteeringWheel; sh:property [ sh:name "Angle" ; - sh:path bmw:angle ; + sh:path car:angle ; sh:datatype xsd:int; sh:minCount 1 ; ] . @@ -92,10 +92,10 @@ val:SteeringWheelShape a sh:NodeShape; val:CurrentLocationShape a sh:NodeShape ; sh:name "CurrentLocation" ; - sh:targetClass bmw:CurrentLocation ; + sh:targetClass car:CurrentLocation ; sh:property [ sh:name "Latitude" ; - sh:path bmw:latitude ; + sh:path car:latitude ; sh:datatype xsd:double ; sh:minInclusive -90 ; sh:maxInclusive 90 ; @@ -106,7 +106,7 @@ val:CurrentLocationShape a sh:NodeShape ; ] ; sh:property [ sh:name "Longitude" ; - sh:path bmw:longitude ; + sh:path car:longitude ; sh:datatype xsd:double ; sh:minInclusive -180 ; sh:maxInclusive 180 ; @@ -117,7 +117,7 @@ val:CurrentLocationShape a sh:NodeShape ; ] ; sh:property [ sh:name "Timestamp" ; - sh:path bmw:timestamp ; + sh:path car:timestamp ; sh:datatype xsd:long ; val:unit "iso8601" ; sh:description "Timestamp from GNSS system for current location, formatted according to ISO 8601 with UTC time zone." ; @@ -126,7 +126,7 @@ val:CurrentLocationShape a sh:NodeShape ; ] ; sh:property [ sh:name "Heading" ; - sh:path bmw:heading ; + sh:path car:heading ; sh:datatype xsd:double ; sh:minInclusive 0 ; sh:maxInclusive 360 ; @@ -138,11 +138,11 @@ val:CurrentLocationShape a sh:NodeShape ; val:PowertrainShape a sh:NodeShape; sh:name "Powertrain"; - sh:targetClass bmw:Powertrain; + sh:targetClass car:Powertrain; sh:property [ sh:name "TractionBattery" ; - sh:path bmw:hasPart ; - sh:class bmw:TractionBattery ; + sh:path car:hasPart ; + sh:class car:TractionBattery ; sh:node val:TractionBatteryShape ; sh:nodeKind sh:IRI ; sh:minCount 0 ; @@ -150,8 +150,8 @@ val:PowertrainShape a sh:NodeShape; ] ; sh:property [ sh:name "Transmission" ; - sh:path bmw:hasPart ; - sh:class bmw:Transmission ; + sh:path car:hasPart ; + sh:class car:Transmission ; sh:node val:TransmissionShape ; sh:nodeKind sh:IRI ; sh:minCount 0 ; @@ -160,10 +160,10 @@ val:PowertrainShape a sh:NodeShape; val:TractionBatteryShape a sh:NodeShape; sh:name "TractionBattery"; - sh:targetClass bmw:TractionBattery ; + sh:targetClass car:TractionBattery ; sh:property [ sh:name "NominalVoltage" ; - sh:path bmw:nominalVoltage ; + sh:path car:nominalVoltage ; sh:datatype xsd:int ; sh:description "Nominal voltage typically refers to voltage of fully charged battery when delivering rated capacity." ; sh:minCount 0 ; @@ -171,8 +171,8 @@ val:TractionBatteryShape a sh:NodeShape; ] ; sh:property [ sh:name "StateOfCharge" ; - sh:path bmw:hasSignal ; - sh:class bmw:StateOfCharge; + sh:path car:hasSignal ; + sh:class car:StateOfCharge; sh:node val:StateOfChargeNodeShape; sh:nodeKind sh:IRI ; sh:description "Information on the state of charge of the vehicle's high voltage battery." ; @@ -182,10 +182,10 @@ val:TractionBatteryShape a sh:NodeShape; val:StateOfChargeNodeShape a sh:NodeShape ; sh:name "StateOfCharge" ; - sh:targetClass bmw:StateOfCharge ; + sh:targetClass car:StateOfCharge ; sh:property [ sh:name "CurrentEnergy" ; - sh:path bmw:currentEnergy ; + sh:path car:currentEnergy ; sh:datatype xsd:float ; sh:description "Physical state of charge of high voltage battery expressed in kWh." ; sh:minCount 0 ; @@ -195,10 +195,10 @@ val:StateOfChargeNodeShape a sh:NodeShape ; val:TransmissionShape a sh:NodeShape ; sh:name "Transmission" ; - sh:targetClass bmw:Transmission ; + sh:targetClass car:Transmission ; sh:property [ sh:name "CurrentGear" ; - sh:path bmw:currentGear ; + sh:path car:currentGear ; sh:datatype xsd:int ; sh:description "Is item open or closed? True = Fully or partially open. False = Fully closed." ; sh:minCount 0 ; @@ -208,11 +208,11 @@ val:TransmissionShape a sh:NodeShape ; val:CabinShape a sh:NodeShape ; sh:name "Cabin" ; - sh:targetClass bmw:Cabin ; + sh:targetClass car:Cabin ; sh:property [ sh:name "Light" ; - sh:path bmw:hasPart ; - sh:class bmw:CabinLight ; + sh:path car:hasPart ; + sh:class car:CabinLight ; sh:node val:CabinLightShape ; sh:nodeKind sh:IRI ; sh:minCount 0 ; @@ -220,8 +220,8 @@ val:CabinShape a sh:NodeShape ; ] ; sh:property [ sh:name "Door" ; - sh:path bmw:hasPart ; - sh:class bmw:CabinDoor ; + sh:path car:hasPart ; + sh:class car:CabinDoor ; sh:node val:CabinDoorShape ; sh:minCount 0 ; sh:maxCount 1 ; @@ -229,9 +229,9 @@ val:CabinShape a sh:NodeShape ; val:CabinDoorShape a sh:NodeShape ; sh:name "Door" ; - sh:targetClass bmw:CabinDoor ; + sh:targetClass car:CabinDoor ; sh:property [ - sh:path bmw:position ; + sh:path car:position ; sh:name "Row" ; sh:in ("Row1" "Row2") ; sh:datatype xsd:string ; @@ -239,7 +239,7 @@ val:CabinDoorShape a sh:NodeShape ; sh:maxCount 1 ; ] ; sh:property [ - sh:path bmw:position ; + sh:path car:position ; sh:name "Driver" ; sh:in ("Driver") ; sh:datatype xsd:string ; @@ -248,7 +248,7 @@ val:CabinDoorShape a sh:NodeShape ; ] ; sh:property [ sh:name "Passenger" ; - sh:path bmw:position ; + sh:path car:position ; sh:in ("Passenger") ; sh:datatype xsd:string ; sh:minCount 0 ; @@ -256,8 +256,8 @@ val:CabinDoorShape a sh:NodeShape ; ] ; sh:property [ sh:name "Window" ; - sh:path bmw:hasPart ; - sh:class bmw:Window ; + sh:path car:hasPart ; + sh:class car:Window ; sh:node val:WindowShape ; sh:nodeKind sh:IRI ; sh:minCount 0 ; @@ -266,10 +266,10 @@ val:CabinDoorShape a sh:NodeShape ; val:WindowShape a sh:NodeShape ; sh:name "Window" ; - sh:targetClass bmw:Window ; + sh:targetClass car:Window ; sh:property [ sh:name "IsOpen" ; - sh:path bmw:isOpen ; + sh:path car:isOpen ; sh:datatype xsd:boolean ; sh:description "Is item open or closed? True = Fully or partially open. False = Fully closed." ; sh:minCount 0 ; @@ -277,7 +277,7 @@ val:WindowShape a sh:NodeShape ; ] ; sh:property [ sh:name "Position" ; - sh:path bmw:windowPosition ; + sh:path car:windowPosition ; sh:datatype xsd:int ; sh:minInclusive 0 ; sh:maxInclusive 100 ; @@ -288,7 +288,7 @@ val:WindowShape a sh:NodeShape ; ] ; sh:property [ sh:name "Switch" ; - sh:path bmw:switch ; + sh:path car:switch ; sh:datatype xsd:string ; sh:in ("INACTIVE" "CLOSE" "OPEN" "ONE_SHOT_CLOSE" "ONE_SHOT_OPEN") ; sh:description "Switch controlling sliding action such as window, sunroof, or blind." ; @@ -298,11 +298,11 @@ val:WindowShape a sh:NodeShape ; val:CabinLightShape a sh:NodeShape ; sh:name "Light" ; - sh:targetClass bmw:CabinLight ; + sh:targetClass car:CabinLight ; sh:property [ sh:name "AmbientLight" ; - sh:path bmw:hasPart ; - sh:class bmw:AmbientLight ; + sh:path car:hasPart ; + sh:class car:AmbientLight ; sh:node val:AmbientLightShape ; sh:nodeKind sh:IRI ; sh:minCount 0 ; @@ -310,8 +310,8 @@ val:CabinLightShape a sh:NodeShape ; ] ; sh:property [ sh:name "SpotLight" ; - sh:path bmw:hasPart ; - sh:class bmw:SpotLight ; + sh:path car:hasPart ; + sh:class car:SpotLight ; sh:node val:SpotLightShape ; sh:nodeKind sh:IRI ; sh:minCount 0 ; @@ -320,9 +320,9 @@ val:CabinLightShape a sh:NodeShape ; val:AmbientLightShape a sh:NodeShape ; sh:name "AmbientLight" ; - sh:targetClass bmw:AmbientLight ; + sh:targetClass car:AmbientLight ; sh:property [ - sh:path bmw:position ; + sh:path car:position ; sh:name "Row" ; sh:in ("Row1" "Row2") ; sh:datatype xsd:string ; @@ -330,7 +330,7 @@ val:AmbientLightShape a sh:NodeShape ; sh:maxCount 1 ; ] ; sh:property [ - sh:path bmw:position ; + sh:path car:position ; sh:name "Driver" ; sh:in ("Driver") ; sh:datatype xsd:string ; @@ -338,7 +338,7 @@ val:AmbientLightShape a sh:NodeShape ; sh:maxCount 1 ; ] ; sh:property [ - sh:path bmw:position ; + sh:path car:position ; sh:name "Passenger" ; sh:in ("Passenger") ; sh:datatype xsd:string ; @@ -347,7 +347,7 @@ val:AmbientLightShape a sh:NodeShape ; ] ; sh:property [ sh:name "Colour" ; - sh:path bmw:lightColor ; + sh:path car:lightColor ; sh:datatype xsd:string ; sh:description "Hexadecimal color code represented as a 3-byte RGB (i.e. Red, Green, and Blue) value preceded by a hash symbol '#'."; sh:minCount 0 ; @@ -355,7 +355,7 @@ val:AmbientLightShape a sh:NodeShape ; ] ; sh:property [ sh:name "Intensity" ; - sh:path bmw:lightIntensity ; + sh:path car:lightIntensity ; sh:datatype xsd:integer ; sh:minInclusive 1 ; sh:maxInclusive 100 ; @@ -366,7 +366,7 @@ val:AmbientLightShape a sh:NodeShape ; ] ; sh:property [ sh:name "IsLightOn" ; - sh:path bmw:lightIsLightOn ; + sh:path car:lightIsLightOn ; sh:datatype xsd:boolean ; sh:description "Indicates whether the light is turned on. True = On, False = Off." ; sh:minCount 0 ; diff --git a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/CMakeLists.txt b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/CMakeLists.txt new file mode 100644 index 0000000..dbf096b --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/CMakeLists.txt @@ -0,0 +1,18 @@ +# Define the rdfox library +add_library(rdfox + src/rdfox_adapter.cpp +) + +# Include directories +target_include_directories(rdfox + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/src + ${Boost_INCLUDE_DIRS} +) + +# Link dependencies +target_link_libraries(rdfox + PRIVATE + Boost::system + Boost::thread +) \ No newline at end of file diff --git a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/README.md b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/README.md index 5d8d99d..f592bc9 100644 --- a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/README.md +++ b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/README.md @@ -5,18 +5,18 @@ This folder contains the necessary files to interact with RDFox, a high-performa ## How to Use RDFox -For instructions on how to start the RDFox service required for this project, see [this guide](../../../../docker/README.md#rdfox-restful-api). +For instructions on how to start the RDFox service required for this project, see [this guide](/docker/README.md#rdfox-restful-api). -### RDFox Adapter +### RDF Triple Assembler -See how to interact with the RDFox server using the [RDFox adapter](./src/README.md#rdfoxadapter). +See how to interact with the RDFox server using the [RDF assembler](/cdsp/knowledge-layer/connector/json-rdf-convertor/rdf-writer/README.md). This project is designed to transform structured data messages into RDF triples, providing a streamlined way to produce linked data for knowledge graphs, ontologies, or semantic applications. Using TripleAssembler, users can process messages and generate triples that can be serialized in various RDF formats such as Turtle, N-Triples, or TriG. ### Getting Started -This project includes a small C++ application to verify that the RDFox service has been configured and started correctly. After compiling the project, you should be able to run the application from [`./rdfox-service-test/rdfox_test_main.cpp`](./rdfox-service-test/rdfox_test_main.cpp). The RDFox Test executable will be generated in the `/cdsp/knowledge-layer/build/bin/` directory. You can run it with the following command: +This project includes a small C++ application to verify that the RDFox service has been configured and started correctly. After compiling the project, you should be able to run the application from [`./rdfox-service-test/rdfox_test_main.cpp`](./rdfox-service-test/rdfox_test_main.cpp). The RDFox Test executable will be generated in the `/cdsp/knowledge-layer/build/bin/tests/` directory. You can run it with the following command: ```bash -$ ./websocket_client +$ ./rdfox_test # Data store list: # ?Name ?UniqueID ?Persistent ?Online ?Parameters diff --git a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/README.md b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/README.md index 099f931..cf0861f 100644 --- a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/README.md +++ b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/README.md @@ -1,25 +1,27 @@ # RDFoxAdapter -The RDFoxAdapter class provides an interface for interacting with an RDFox server over HTTP. It enables operations like checking the existence of a datastore, creating a datastore, loading data in Turtle format, querying using SPARQL, and deleting a datastore. +`RDFoxAdapter` is responsible for communicating with the RDFox server over HTTP. It checks if the datastore is active, loads RDF data, and queries the RDF data using [SPARQL](https://www.w3.org/TR/sparql11-query/). > [!NOTE] Data store > When the RDFoxAdapter initializes creates (if is does not exists) a datastore called `vehicle_ds` in the RDFox server. - -## Features +> +> ## Features - **Initialize a Datastore:** Checks if a specified datastore exists on the RDFox server. If not, it creates the datastore. - **Load Data:** Loads Turtle data into a specified datastore. - **Query Data:** Executes SPARQL queries against the RDFox datastore and retrieves results. - **Delete Datastore:** Removes a specified datastore from the RDFox server. -- **Send HTTP Requests:** Supports sending GET and POST HTTP requests to interact with RDFox. -## Methods +**Example Usage** + +```cpp +RDFoxAdapter adapter("", "", "", ""); +if (adapter.checkDataStore()) { + adapter.loadData(""); + std::string result = adapter.queryData("SELECT ?s ?p ?o WHERE { ?s ?p ?o }"); +} +``` -- **initialize():** Ensures the datastore is present; creates it if missing. -- **loadData(const std::string& ttl_data):** Loads Turtle data into the datastore. -- **queryData(const std::string& sparql_query):** Executes a SPARQL query and returns the result. -- **deleteDataStore():** Deletes the datastore if it exists. +# Testing -> [!NOTE] See test -> - [../tests/test_rdfox_adapter_integration.cpp](../tests/test_rdfox_adapter_integration.cpp) -> - [../tests/test_rdfox_adapter_unit.cpp](../tests/test_rdfox_adapter_unit.cpp) \ No newline at end of file +Unit and Integration [tests](../tests/) are provided to ensure functionality. Tests cover the main components (`RDFoxAdapter`) to verify RDF data transfer, and error handling. diff --git a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/rdfox-adapter.cpp b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/rdfox_adapter.cpp similarity index 93% rename from cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/rdfox-adapter.cpp rename to cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/rdfox_adapter.cpp index cdf2622..f1ce27c 100644 --- a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/rdfox-adapter.cpp +++ b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/rdfox_adapter.cpp @@ -1,4 +1,4 @@ -#include "rdfox-adapter.h" +#include "rdfox_adapter.h" #include @@ -8,9 +8,7 @@ RDFoxAdapter::RDFoxAdapter(const std::string& host, const std::string& port, : host_(host), port_(port), auth_header_base64_("Basic " + auth_base64), - data_store_(data_store) { - std::cout << "Initializing RDFox adapter..." << std::endl; -} + data_store_(data_store) {} /** * @brief Initializes the RDFoxAdapter by ensuring the data store is created. @@ -24,16 +22,18 @@ RDFoxAdapter::RDFoxAdapter(const std::string& host, const std::string& port, * @throws std::runtime_error if the data store creation fails. */ void RDFoxAdapter::initialize() { + std::cout << "Initializing RDFox adapter ... " << std::endl; + std::cout << " - Starting data store: " << data_store_ << std::endl; // checks if the data store exists, create it if not if (checkDataStore()) { - std::cout << "Data store '" + data_store_ + "' is already created." << std::endl; + std::cout << " - Data store '" + data_store_ + "' is already created." << std::endl; } else { - std::cout << "Data store '" << data_store_ << "' does not exist. Creating it..." + std::cout << " - Data store '" << data_store_ << "' does not exist. Creating it..." << std::endl; // Creates a data store std::string target = "/datastores/" + data_store_; if (sendPostRequest(target, "", "application/json")) { - std::cout << "Data store '" << data_store_ << "' created successfully." << std::endl; + std::cout << " - Data store '" << data_store_ << "' created successfully." << std::endl; } else { throw std::runtime_error("Failed to create datastore '" + data_store_ + "'"); } diff --git a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/rdfox-adapter.h b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/rdfox_adapter.h similarity index 86% rename from cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/rdfox-adapter.h rename to cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/rdfox_adapter.h index 66bcfb1..6f07ec2 100644 --- a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/rdfox-adapter.h +++ b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/src/rdfox_adapter.h @@ -17,10 +17,11 @@ class RDFoxAdapter { const std::string& data_store); void initialize(); - bool loadData(const std::string& ttl_data); - std::string queryData(const std::string& sparql_query); - bool checkDataStore(); + virtual bool loadData(const std::string& ttl_data); + virtual std::string queryData(const std::string& sparql_query); + virtual bool checkDataStore(); bool deleteDataStore(); + virtual ~RDFoxAdapter() = default; protected: virtual bool sendRequest(http::verb method, const std::string& target, const std::string& body, diff --git a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/CMakeLists.txt b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/CMakeLists.txt index f52b87c..07b0641 100644 --- a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/CMakeLists.txt +++ b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/CMakeLists.txt @@ -1,38 +1,26 @@ -# GoogleTest integration -include(FetchContent) -FetchContent_Declare( - googletest - GIT_REPOSITORY https://github.com/google/googletest.git - GIT_TAG v1.15.2 +# Add the unit test executable for RDFoxAdapter +add_executable(rdfox_adapter_unit_tests rdfox_adapter_unit_test.cpp) +target_link_libraries(rdfox_adapter_unit_tests + PRIVATE + GTest::gtest_main + GTest::gmock + rdfox ) -# Disable installing gtest (we don't need to install it) -set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) -FetchContent_MakeAvailable(googletest) -# Add the RDFox adapter source files -add_library(rdfox_adapter STATIC ../src/rdfox-adapter.cpp) -target_include_directories(rdfox_adapter PUBLIC ../src) -target_link_libraries(rdfox_adapter Boost::system Boost::filesystem Boost::thread nlohmann_json) - -# Add the unit test executable -add_executable(rdfox_unit_tests test_rdfox_adapter_unit.cpp) -target_include_directories(rdfox_unit_tests PUBLIC ../src) -target_link_libraries(rdfox_unit_tests GTest::gtest GTest::gtest_main GTest::gmock rdfox_adapter) - -# Add the integration test executable -add_executable(rdfox_integration_tests test_rdfox_adapter_integration.cpp) -target_include_directories(rdfox_integration_tests PUBLIC ../src) -target_link_libraries(rdfox_integration_tests GTest::gtest GTest::gtest_main rdfox_adapter) +# Add the integration test executable for RDFoxAdapter +add_executable(rdfox_adapter_integration_tests rdfox_adapter_integration_test.cpp) +target_link_libraries(rdfox_adapter_integration_tests + PRIVATE + GTest::gtest_main + rdfox) # Add unit and integration tests to CTest -add_test(NAME RDFoxAdapterUnitTests COMMAND rdfox_unit_tests) -add_test(NAME RDFoxAdapterIntegrationTests COMMAND rdfox_integration_tests) +add_test(NAME RDFoxAdapterUnitTests COMMAND rdfox_adapter_unit_tests) +add_test(NAME RDFoxAdapterIntegrationTests COMMAND rdfox_adapter_integration_tests) # Define custom output directory for test binaries -set_target_properties(rdfox_unit_tests PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") -set_target_properties(rdfox_integration_tests PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") +set_target_properties(rdfox_adapter_unit_tests PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/tests") +set_target_properties(rdfox_adapter_integration_tests PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/tests") # Ensure tests are built with the all target -add_custom_target(tests ALL - DEPENDS rdfox_unit_tests rdfox_integration_tests -) \ No newline at end of file +add_custom_target(tests ALL DEPENDS rdfox_adapter_unit_tests rdfox_adapter_integration_tests) \ No newline at end of file diff --git a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-service-test/CMakeLists.txt b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/rdfox-service-test/CMakeLists.txt similarity index 84% rename from cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-service-test/CMakeLists.txt rename to cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/rdfox-service-test/CMakeLists.txt index 2f60cab..98dee09 100644 --- a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-service-test/CMakeLists.txt +++ b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/rdfox-service-test/CMakeLists.txt @@ -2,9 +2,7 @@ add_executable( rdfox_test rdfox_test_main.cpp ) - -# Link Boost libraries target_link_libraries(rdfox_test Boost::system Boost::filesystem Boost::thread) # Use defined output directory for the executable -set_target_properties(rdfox_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) \ No newline at end of file +set_target_properties(rdfox_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/tests) \ No newline at end of file diff --git a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-service-test/rdfox_test_main.cpp b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/rdfox-service-test/rdfox_test_main.cpp similarity index 100% rename from cdsp/knowledge-layer/symbolic-reasoner/rdfox/rdfox-service-test/rdfox_test_main.cpp rename to cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/rdfox-service-test/rdfox_test_main.cpp diff --git a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/rdfox_adapter_integration_test.cpp b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/rdfox_adapter_integration_test.cpp new file mode 100644 index 0000000..e16bd4e --- /dev/null +++ b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/rdfox_adapter_integration_test.cpp @@ -0,0 +1,111 @@ +#include + +#include + +#include "rdfox_adapter.h" + +class RDFoxAdapterIntegrationTest : public ::testing::Test { + protected: + RDFoxAdapter* adapter; + + std::string host = "localhost"; + std::string port = "12110"; + std::string auth_base64 = "cm9vdDphZG1pbg=="; // Base64 encoded authorization string + std::string data_store = "test_ds"; + + void SetUp() override { + adapter = new RDFoxAdapter(host, port, auth_base64, data_store); + adapter->initialize(); + + // Initial load to ensure datastore is accessible + if (!adapter->checkDataStore()) { + FAIL() << "Failed to ensure the data store is set up."; + } + } + + void TearDown() override { + // Delete the test data store after all tests have completed + ASSERT_TRUE(adapter->deleteDataStore()) << "Failed to clean up the test data store."; + + // Clean up the adapter instance + delete adapter; + } +}; + +/** + * @brief Test to verify the initialization of the data store in RDFoxAdapter. + * + * This test checks the implicit initialization of the data store during the + * setup phase of RDFoxAdapter. If the data store already exists or is created + * successfully, no error will be thrown. Additional assertions can be added + * to verify specific behaviors if needed. + */ +TEST_F(RDFoxAdapterIntegrationTest, DataStoreInitializationTest) { SUCCEED(); } + +/** + * @brief Test to verify the loading of Turtle data into the RDFox data store. + * + * This test creates a simple Turtle data string and attempts to load it into + * the RDFox data store using the RDFoxAdapter. The test asserts that the data + * is loaded successfully. If the loading fails, an error message is displayed. + */ +TEST_F(RDFoxAdapterIntegrationTest, LoadDataTest) { + // Define a Turtle data string with a namespace prefix and a single triple + std::string ttlData = R"( + @prefix car: . + car:Vehicle1 a car:Vehicle . + )"; + + // Attempt to load the Turtle data into the data store and assert success + ASSERT_TRUE(adapter->loadData(ttlData)) << "Failed to load Turtle data into the store"; +} + +/** + * @brief Test to verify querying data from the RDFox data store. + * + * This test loads a simple Turtle data string into the RDFox data store and + * performs a SPARQL query to retrieve all triples. The test asserts that the + * data is loaded successfully and that the query returns the expected results. + * Specifically, it checks for the presence of a subject, predicate, and object + * in the query results. + */ +TEST_F(RDFoxAdapterIntegrationTest, QueryDataTest) { + // Define a Turtle data string with a namespace prefix and a single triple + std::string ttlData = R"( + @prefix car: . + car:Vehicle1 a car:Vehicle . + )"; + + // Attempt to load the Turtle data into the data store and assert success + ASSERT_TRUE(adapter->loadData(ttlData)) << "Failed to load Turtle data into the store"; + + // Define a SPARQL query to select all triples in the data store + std::string sparqlQuery = "SELECT ?s ?p ?o WHERE { ?s ?p ?o }"; + + // Execute the SPARQL query and store the result + std::string result = adapter->queryData(sparqlQuery); + + // Asserts + ASSERT_FALSE(result.empty()) << "SPARQL query returned no results"; + EXPECT_TRUE(result.find("") != std::string::npos) + << "Result does not contain the expected subject."; + EXPECT_TRUE(result.find("") != + std::string::npos) + << "Result does not contain the expected predicate."; + EXPECT_TRUE(result.find("") != std::string::npos) + << "Result does not contain the expected object."; +} + +/** + * @brief Test to verify the deletion of the data store in RDFoxAdapter. + * + * This test checks the existence of a data store, attempts to delete it, + * and then verifies that it no longer exists. The test ensures that the + * data store can be successfully deleted and does not persist after deletion. + */ +TEST_F(RDFoxAdapterIntegrationTest, DeleteDataStoreTest) { + // Asserts + ASSERT_TRUE(adapter->checkDataStore()) << "Any data store has been created."; + ASSERT_TRUE(adapter->deleteDataStore()) << "Failed to delete the data store."; + ASSERT_FALSE(adapter->checkDataStore()) << "The datastore might still exist or be recreated."; +} diff --git a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/test_rdfox_adapter_unit.cpp b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/rdfox_adapter_unit_test.cpp similarity index 86% rename from cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/test_rdfox_adapter_unit.cpp rename to cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/rdfox_adapter_unit_test.cpp index 7834418..c9cd094 100644 --- a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/test_rdfox_adapter_unit.cpp +++ b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/rdfox_adapter_unit_test.cpp @@ -1,7 +1,7 @@ #include #include -#include "../src/rdfox-adapter.h" +#include "rdfox_adapter.h" class MockRDFoxAdapter : public RDFoxAdapter { public: @@ -11,7 +11,9 @@ class MockRDFoxAdapter : public RDFoxAdapter { const std::string&, const std::string&, std::string&)); }; -// Test checking nonexistent RDFox datastore. +/** + * @brief Unit test for RDFoxAdapter to check the behavior when a datastore does not exist. + */ TEST(RDFoxAdapterTest, CheckNonexistentDatastore) { MockRDFoxAdapter mock_adapter; @@ -23,7 +25,9 @@ TEST(RDFoxAdapterTest, CheckNonexistentDatastore) { EXPECT_FALSE(mock_adapter.checkDataStore()); } -// Test checking existent RDFox datastore. +/** + * @brief Unit test for RDFoxAdapter to verify the behavior when a datastore exists. + */ TEST(RDFoxAdapterTest, CheckExistentDatastore) { MockRDFoxAdapter mock_adapter; @@ -35,7 +39,9 @@ TEST(RDFoxAdapterTest, CheckExistentDatastore) { EXPECT_TRUE(mock_adapter.checkDataStore()); } -// Test the initialization of the RDFoxAdapter and creation of the datastore. +/** + * @brief Unit test for RDFoxAdapter to verify the initialization process creates a datastore. + */ TEST(RDFoxAdapterTest, InitializationCreatesDatastore) { MockRDFoxAdapter mock_adapter; @@ -51,8 +57,10 @@ TEST(RDFoxAdapterTest, InitializationCreatesDatastore) { EXPECT_NO_THROW(mock_adapter.initialize()); } - -// Test the initialization of the RDFoxAdapter when datastore already exists. +/** + * @brief Unit test for RDFoxAdapter to verify the behavior during initialization + * when a datastore already exists. + */ TEST(RDFoxAdapterTest, InitializationWithExistingDatastore) { MockRDFoxAdapter mock_adapter; @@ -69,7 +77,9 @@ TEST(RDFoxAdapterTest, InitializationWithExistingDatastore) { EXPECT_NO_THROW(mock_adapter.initialize()); } -// Test loading data into the RDFox datastore. +/** + * @brief Unit test for RDFoxAdapter to verify the behavior when loading data into a datastore. + */ TEST(RDFoxAdapterTest, LoadDataSuccess) { MockRDFoxAdapter mock_adapter; std::string ttl_data = "@prefix : . :test a :Entity ."; @@ -82,7 +92,9 @@ TEST(RDFoxAdapterTest, LoadDataSuccess) { EXPECT_TRUE(mock_adapter.loadData(ttl_data)); } -// Test querying data from the RDFox datastore. +/** + * @brief Unit test for RDFoxAdapter to verify successful data querying. + */ TEST(RDFoxAdapterTest, QueryDataSuccess) { MockRDFoxAdapter mock_adapter; std::string sparql_query = "SELECT ?s WHERE { ?s ?p ?o . }"; @@ -96,7 +108,9 @@ TEST(RDFoxAdapterTest, QueryDataSuccess) { EXPECT_EQ(mock_adapter.queryData(sparql_query), mock_response); } -// Test deleting the RDFox datastore. +/** + * @brief Unit test for RDFoxAdapter to verify successful deletion of a datastore. + */ TEST(RDFoxAdapterTest, DeleteDataStoreSuccess) { MockRDFoxAdapter mock_adapter; @@ -113,7 +127,10 @@ TEST(RDFoxAdapterTest, DeleteDataStoreSuccess) { EXPECT_TRUE(mock_adapter.deleteDataStore()); } -// Test any error deleting the RDFox datastore that does not exists. +/** + * @brief Unit test for RDFoxAdapter to verify the behavior when attempting to delete a nonexistent + * datastore. + */ TEST(RDFoxAdapterTest, DeleteNonexistentDataStoreSuccess) { MockRDFoxAdapter mock_adapter; @@ -130,7 +147,9 @@ TEST(RDFoxAdapterTest, DeleteNonexistentDataStoreSuccess) { EXPECT_TRUE(mock_adapter.deleteDataStore()); } -// Test handling a failed request during datastore creation. +/** + * @brief Unit test for RDFoxAdapter to verify behavior when datastore creation fails. + */ TEST(RDFoxAdapterTest, FailedToCreateDataStore) { MockRDFoxAdapter mock_adapter; @@ -148,7 +167,9 @@ TEST(RDFoxAdapterTest, FailedToCreateDataStore) { EXPECT_THROW(mock_adapter.initialize(), std::runtime_error); } -// Test loading data when the request fails. +/** + * @brief Unit test for RDFoxAdapter to verify behavior when loading data fails. + */ TEST(RDFoxAdapterTest, LoadDataFailure) { MockRDFoxAdapter mock_adapter; std::string ttl_data = "@prefix : . :test a :Entity ."; @@ -161,7 +182,9 @@ TEST(RDFoxAdapterTest, LoadDataFailure) { EXPECT_FALSE(mock_adapter.loadData(ttl_data)); } -// Test querying data when the request fails. +/** + * @brief Unit test for RDFoxAdapter to verify behavior when a SPARQL query fails. + */ TEST(RDFoxAdapterTest, QueryDataFailure) { MockRDFoxAdapter mock_adapter; std::string sparql_query = "SELECT ?s WHERE { ?s ?p ?o . }"; @@ -175,7 +198,10 @@ TEST(RDFoxAdapterTest, QueryDataFailure) { EXPECT_EQ(mock_adapter.queryData(sparql_query), ""); } -// Test deleting the RDFox datastore when delete request fails. +/** + * @brief Unit test for RDFoxAdapter to verify the behavior when attempting to delete a datastore + * fails. + */ TEST(RDFoxAdapterTest, DeleteDataStoreFailure) { MockRDFoxAdapter mock_adapter; diff --git a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/test_rdfox_adapter_integration.cpp b/cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/test_rdfox_adapter_integration.cpp deleted file mode 100644 index 8cb8a74..0000000 --- a/cdsp/knowledge-layer/symbolic-reasoner/rdfox/tests/test_rdfox_adapter_integration.cpp +++ /dev/null @@ -1,78 +0,0 @@ -#include - -#include - -#include "../src/rdfox-adapter.h" - -class RDFoxAdapterIntegrationTest : public ::testing::Test { - protected: - RDFoxAdapter* adapter; - - std::string host = "localhost"; - std::string port = "12110"; - std::string auth_base64 = "cm9vdDphZG1pbg=="; // Base64 encoded authorization string - std::string data_store = "test_ds"; - - void SetUp() override { - adapter = new RDFoxAdapter(host, port, auth_base64, data_store); - adapter->initialize(); - - // Initial load to ensure datastore is accessible - if (!adapter->checkDataStore()) { - FAIL() << "Failed to ensure the data store is set up."; - } - } - - void TearDown() override { - // Delete the test data store after all tests have completed - // ASSERT_TRUE(adapter->deleteDataStore()) << "Failed to clean up the test data store."; - adapter->deleteDataStore(); - - // Clean up the adapter instance - delete adapter; - } -}; - -// Integration Test: Ensure RDFoxAdapter can create a data store and retrieve it -TEST_F(RDFoxAdapterIntegrationTest, DataStoreInitializationTest) { - // This test is implicitly done during the setup phase of RDFoxAdapter - // If the data store exists or is created, no error will be thrown - // You can further assert behavior here if needed - SUCCEED(); -} - -TEST_F(RDFoxAdapterIntegrationTest, LoadDataTest) { - std::string ttlData = R"( - @prefix bmw: . - bmw:Vehicle1 a bmw:Vehicle . - )"; - - // Try loading data into the data store - ASSERT_TRUE(adapter->loadData(ttlData)) << "Failed to load Turtle data into the store"; -} - -TEST_F(RDFoxAdapterIntegrationTest, QueryDataTest) { - std::string ttlData = R"( - @prefix bmw: . - bmw:Vehicle1 a bmw:Vehicle . - )"; - ASSERT_TRUE(adapter->loadData(ttlData)) << "Failed to load Turtle data into the store"; - - std::string sparqlQuery = "SELECT ?s ?p ?o WHERE { ?s ?p ?o }"; - std::string result = adapter->queryData(sparqlQuery); - - ASSERT_FALSE(result.empty()) << "SPARQL query returned no results"; - EXPECT_TRUE(result.find("") != std::string::npos) - << "Result does not contain the expected subject."; - EXPECT_TRUE(result.find("") != - std::string::npos) - << "Result does not contain the expected predicate."; - EXPECT_TRUE(result.find("") != std::string::npos) - << "Result does not contain the expected object."; -} - -TEST_F(RDFoxAdapterIntegrationTest, DeleteDataStoreTest) { - ASSERT_TRUE(adapter->checkDataStore()) << "Any data store has been created."; - ASSERT_TRUE(adapter->deleteDataStore()) << "Failed to delete the data store."; - ASSERT_FALSE(adapter->checkDataStore()) << "The datastore might still exist or be recreated."; -} \ No newline at end of file diff --git a/cdsp/knowledge-layer/tests/CMakeLists.txt b/cdsp/knowledge-layer/tests/CMakeLists.txt new file mode 100644 index 0000000..b9781b3 --- /dev/null +++ b/cdsp/knowledge-layer/tests/CMakeLists.txt @@ -0,0 +1,26 @@ +# Define the test_fixtures library +add_library(test_fixtures + common_fixtures/init_config_fixture.cpp + common_fixtures/model_config_fixture.cpp + common_fixtures/server_data_fixture.cpp + utils/utc_date_utils.cpp + utils/vin_utils.cpp + utils/random_utils.cpp +) + +# Include directories +target_include_directories(test_fixtures + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/common_fixtures + ${CMAKE_CURRENT_SOURCE_DIR}/utils + PRIVATE + ${PROJECT_ROOT_DIR}/connector/utils +) + +# Link dependencies +target_link_libraries(test_fixtures + PUBLIC + Boost::system + Boost::filesystem + Boost::thread +) \ No newline at end of file diff --git a/cdsp/knowledge-layer/tests/common_fixtures/init_config_fixture.cpp b/cdsp/knowledge-layer/tests/common_fixtures/init_config_fixture.cpp new file mode 100644 index 0000000..c5f1a5f --- /dev/null +++ b/cdsp/knowledge-layer/tests/common_fixtures/init_config_fixture.cpp @@ -0,0 +1,26 @@ +#include "init_config_fixture.h" + +#include +#include +#include + +#include "model_config_fixture.h" +#include "server_data_fixture.h" + +InitConfig InitConfigFixture::getValidInitConfig(const std::string& oid) { + // Set default values for the fixture + InitConfig config; + config.uuid = generateUUID(); + config.websocket_server = ServerDataFixture::getValidWebsocketServerData(); + config.rdfox_server = ServerDataFixture::getValidRDFoxServerData(); + config.oid = oid; + config.model_config = ModelConfigFixture::getValidModelConfig(); + return config; +} + +// Create a random UUID generator +std::string InitConfigFixture::generateUUID() { + boost::uuids::random_generator generator; + boost::uuids::uuid uuid = generator(); + return boost::uuids::to_string(uuid); +} \ No newline at end of file diff --git a/cdsp/knowledge-layer/tests/common_fixtures/init_config_fixture.h b/cdsp/knowledge-layer/tests/common_fixtures/init_config_fixture.h new file mode 100644 index 0000000..1280931 --- /dev/null +++ b/cdsp/knowledge-layer/tests/common_fixtures/init_config_fixture.h @@ -0,0 +1,13 @@ +#ifndef INIT_CONFIG_FIXTURE_H +#define INIT_CONFIG_FIXTURE_H + +#include "data_types.h" +class InitConfigFixture { + public: + static InitConfig getValidInitConfig(const std::string& oid); + + private: + static std::string generateUUID(); +}; + +#endif // INIT_CONFIG_FIXTURE_H \ No newline at end of file diff --git a/cdsp/knowledge-layer/tests/common_fixtures/model_config_fixture.cpp b/cdsp/knowledge-layer/tests/common_fixtures/model_config_fixture.cpp new file mode 100644 index 0000000..3ed55f5 --- /dev/null +++ b/cdsp/knowledge-layer/tests/common_fixtures/model_config_fixture.cpp @@ -0,0 +1,32 @@ +#include "model_config_fixture.h" + +ModelConfig ModelConfigFixture::getValidModelConfig() { + // Set default values for the fixture + ReasonerSettings settings; + settings.inference_engine = "RDFox"; + settings.output_format = RDFSyntaxType::TURTLE; + settings.supported_tree_types = {"vss"}; + + ModelConfig config; + config.system_data_points = { + {"vss", + {"Vehicle.Chassis.SteeringWheel.Angle", "Vehicle.CurrentLocation.Latitude", + "Vehicle.CurrentLocation.Longitude", "Vehicle.Powertrain.TractionBattery.NominalVoltage", + "Vehicle.Powertrain.TractionBattery.StateOfCharge.CurrentEnergy", + "Vehicle.Powertrain.Transmission.CurrentGear", "Vehicle.Speed"}}}; + + config.output_file_path = "output/"; + config.ontology_files = {"ontologies/example_ontology.ttl"}; + config.shacl_shapes_files = {"shacl/vss_shacl.ttl", "shacl/observation_shacl.ttl"}; + config.triple_assembler_queries_files = { + {"default", {}}, + {"vss", + {"queries/triple_assembler_helper/vss/data_property.rq", + "queries/triple_assembler_helper/vss/object_property.rq"}}}; + + config.output_queries_path = "queries/output/"; + config.rules_files = {"rules/insight_rules.ttl"}; + config.reasoner_settings = settings; + + return config; +} \ No newline at end of file diff --git a/cdsp/knowledge-layer/tests/common_fixtures/model_config_fixture.h b/cdsp/knowledge-layer/tests/common_fixtures/model_config_fixture.h new file mode 100644 index 0000000..93f87da --- /dev/null +++ b/cdsp/knowledge-layer/tests/common_fixtures/model_config_fixture.h @@ -0,0 +1,10 @@ +#ifndef MODEL_CONIFIG_FIXTURE_H +#define MODEL_CONIFIG_FIXTURE_H + +#include "data_types.h" +class ModelConfigFixture { + public: + static ModelConfig getValidModelConfig(); +}; + +#endif // MODEL_CONIFIG_FIXTURE_H \ No newline at end of file diff --git a/cdsp/knowledge-layer/tests/common_fixtures/server_data_fixture.cpp b/cdsp/knowledge-layer/tests/common_fixtures/server_data_fixture.cpp new file mode 100644 index 0000000..c62236f --- /dev/null +++ b/cdsp/knowledge-layer/tests/common_fixtures/server_data_fixture.cpp @@ -0,0 +1,21 @@ +#include "server_data_fixture.h" + +ServerData ServerDataFixture::getValidWebsocketServerData() { + // Set default values for the fixture + ServerData data; + data.host = "127.0.0.1"; + data.port = "8080"; + data.auth_base64 = ""; + data.data_store = std::nullopt; + return data; +} + +ServerData ServerDataFixture::getValidRDFoxServerData() { + // Set default values for the fixture + ServerData data; + data.host = "127.0.0.1"; + data.port = "12110"; + data.auth_base64 = "cm9vdDphZG1pbg=="; // Base64 encoded authorization string + data.data_store = "test_ds"; + return data; +} diff --git a/cdsp/knowledge-layer/tests/common_fixtures/server_data_fixture.h b/cdsp/knowledge-layer/tests/common_fixtures/server_data_fixture.h new file mode 100644 index 0000000..7818e0d --- /dev/null +++ b/cdsp/knowledge-layer/tests/common_fixtures/server_data_fixture.h @@ -0,0 +1,11 @@ +#ifndef SERVER_DATA_FIXTURE_H +#define SERVER_DATA_FIXTURE_H + +#include "data_types.h" +class ServerDataFixture { + public: + static ServerData getValidWebsocketServerData(); + static ServerData getValidRDFoxServerData(); +}; + +#endif // SERVER_DATA_FIXTURE_H \ No newline at end of file diff --git a/cdsp/knowledge-layer/tests/utils/random_utils.cpp b/cdsp/knowledge-layer/tests/utils/random_utils.cpp new file mode 100644 index 0000000..194f92f --- /dev/null +++ b/cdsp/knowledge-layer/tests/utils/random_utils.cpp @@ -0,0 +1,31 @@ +#include "random_utils.h" + +#include + +float RandomUtils::generateRandomFloat(float min, float max) { + std::random_device rd; + std::mt19937 gen(rd()); + std::uniform_real_distribution dis(min, max); + return dis(gen); +} + +int RandomUtils::generateRandomInt(int min, int max) { + std::random_device rd; + std::mt19937 gen(rd()); + std::uniform_int_distribution<> dis(min, max); + return dis(gen); +} + +std::string RandomUtils::generateRandomString(size_t length) { + const char charset[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + std::random_device rd; + std::mt19937 gen(rd()); + std::uniform_int_distribution<> dis(0, sizeof(charset) - 2); + + std::string result; + result.reserve(length); + for (size_t i = 0; i < length; ++i) { + result += charset[dis(gen)]; + } + return result; +} \ No newline at end of file diff --git a/cdsp/knowledge-layer/tests/utils/random_utils.h b/cdsp/knowledge-layer/tests/utils/random_utils.h new file mode 100644 index 0000000..87b9064 --- /dev/null +++ b/cdsp/knowledge-layer/tests/utils/random_utils.h @@ -0,0 +1,16 @@ +#ifndef RANDOM_UTILS_H +#define RANDOM_UTILS_H + +#include + +/** + * @brief Provides utility functions to generate random values. + */ +class RandomUtils { + public: + static float generateRandomFloat(float min, float max); + static int generateRandomInt(int min, int max); + static std::string generateRandomString(size_t length); +}; + +#endif // RANDOM_UTILS_H \ No newline at end of file diff --git a/cdsp/knowledge-layer/tests/utils/utc_date_utils.cpp b/cdsp/knowledge-layer/tests/utils/utc_date_utils.cpp new file mode 100644 index 0000000..612b247 --- /dev/null +++ b/cdsp/knowledge-layer/tests/utils/utc_date_utils.cpp @@ -0,0 +1,48 @@ +#include "utc_date_utils.h" + +#include +#include + +/** + * @brief Generates a random UTC date as an ISO 8601 string. + * + * @param start_year The earliest possible year for the random date. + * @param end_year The latest possible year for the random date. + * @return A random UTC date in ISO 8601 format. + */ +std::string UtcDateUtils::generateRandomUtcDate(int start_year, int end_year) { + // Random number generator + static std::random_device rd; + static std::mt19937 gen(rd()); + + // Generate random year, month, day, hour, minute, second + std::uniform_int_distribution<> year_dis(start_year, end_year); + std::uniform_int_distribution<> month_dis(1, 12); + std::uniform_int_distribution<> day_dis(1, 28); // To simplify, avoid invalid dates + std::uniform_int_distribution<> hour_dis(0, 23); + std::uniform_int_distribution<> minute_dis(0, 59); + std::uniform_int_distribution<> second_dis(0, 59); + + // Populate tm structure + std::tm time_struct{}; + time_struct.tm_year = year_dis(gen) - 1900; // tm_year is years since 1900 + time_struct.tm_mon = month_dis(gen) - 1; // tm_mon is 0-based + time_struct.tm_mday = day_dis(gen); + time_struct.tm_hour = hour_dis(gen); + time_struct.tm_min = minute_dis(gen); + time_struct.tm_sec = second_dis(gen); + + return formatAsIso8601(time_struct); +} + +/** + * @brief Helper function to format a tm structure as an ISO 8601 string. + * + * @param time_struct The tm structure to format. + * @return The formatted date-time string in ISO 8601 format. + */ +std::string UtcDateUtils::formatAsIso8601(const std::tm& time_struct) { + std::ostringstream oss; + oss << std::put_time(&time_struct, "%Y-%m-%dT%H:%M:%S") << "Z"; + return oss.str(); +} \ No newline at end of file diff --git a/cdsp/knowledge-layer/tests/utils/utc_date_utils.h b/cdsp/knowledge-layer/tests/utils/utc_date_utils.h new file mode 100644 index 0000000..5b63092 --- /dev/null +++ b/cdsp/knowledge-layer/tests/utils/utc_date_utils.h @@ -0,0 +1,16 @@ +#ifndef UTC_DATE_UTILS_H +#define UTC_DATE_UTILS_H + +#include +#include +#include + +class UtcDateUtils { + public: + static std::string generateRandomUtcDate(int start_year = 2000, int end_year = 2030); + + private: + static std::string formatAsIso8601(const std::tm& time_struct); +}; + +#endif // UTC_DATE_UTILS_H \ No newline at end of file diff --git a/cdsp/knowledge-layer/tests/utils/vin_utils.cpp b/cdsp/knowledge-layer/tests/utils/vin_utils.cpp new file mode 100644 index 0000000..b207505 --- /dev/null +++ b/cdsp/knowledge-layer/tests/utils/vin_utils.cpp @@ -0,0 +1,38 @@ +#include "vin_utils.h" + +#include + +/** + * @brief Returns a random VIN string from the predefined list. + * + * This function selects a random VIN string using a uniform distribution. + * + * @return A random VIN string. + */ +std::string VinUtils::getRandomVinString() { + const auto& vin_list = getVinList(); + static std::mt19937 rng(std::random_device{}()); + std::uniform_int_distribution dist(0, vin_list.size() - 1); + return vin_list[dist(rng)]; +} + +/** + * @brief Returns the predefined list of VINs. + * + * This function provides a static list of predefined VIN strings. + * + * @return A reference to the list of VINs. + */ +const std::vector& VinUtils::getVinList() { + static const std::vector vin_list = { + "3VWRA7AU7FM024850", "1HGCM82633A004352", "JH4KA8260RC003748", "2G1FP32P0S2203762", + "1FTWW33P96ED15457", "4S4BRDLC0B2387119", "1FAFP40461F150129", "5UXWX9C50D0A14563", + "JN8AZ2KR5AT250004", "1G1ZT51886F276869", "WDCGG8JBXBF765243", "3MZBN1W35JM211567", + "1FTEX1E82FFA51428", "4T1BF1FK3GU523119", "5J8TB4H38GL002345", "1N4AA6AP3HC429087", + "WAUVT68E55A136789", "19XFC2F59JE013547", "5YJ3E1EA7JF012345", "1D7RV1CT8AS121098", + "1C6RR7JT2GS104567", "1J4PN2GK1BW543890", "5XYPG4A55HG567890", "1LNHL9FTXDG131222", + "KM8SRDHF7DU150111", "2HKRM3H53EH345678", "3FADP4EJ9DM200567", "1C4RJFAG6FC898765", + "2C3CDXBG6EH199234", "WBA3B1C57FP676567", "1FTEX1EP8GKD912345", "JM3KE2CY3G0798765", + "5YFBURHE3FP222678", "3C6JR6AT8DG236789"}; + return vin_list; +} \ No newline at end of file diff --git a/cdsp/knowledge-layer/tests/utils/vin_utils.h b/cdsp/knowledge-layer/tests/utils/vin_utils.h new file mode 100644 index 0000000..c38e7fa --- /dev/null +++ b/cdsp/knowledge-layer/tests/utils/vin_utils.h @@ -0,0 +1,19 @@ +#ifndef VIN_UTILS_H +#define VIN_UTILS_H + +#include +#include +#include + +/** + * @brief Provides utility functions to generate VIN strings. + */ +class VinUtils { + public: + static std::string getRandomVinString(); + + private: + static const std::vector& getVinList(); +}; + +#endif // VIN_UTILS_H \ No newline at end of file From 21e519b9c43a869585e2ea6d5ab6e8a1104d5b86 Mon Sep 17 00:00:00 2001 From: Christian Muehlbauer Date: Mon, 2 Dec 2024 12:20:27 +0100 Subject: [PATCH 47/48] Add subscription status message after subscribe/unsubscribe when using IoTDB added tests send subscription status message after subscribe/unsubscribe Signed-off-by: Christian Muehlbauer --- .../handlers/src/HandlerBase.ts | 4 +- .../handlers/src/iotdb/src/IoTDBHandler.ts | 2 +- .../iotdb/src/SubscriptionSimulator.test.ts | 62 ++++++++++++++++++- .../src/iotdb/src/SubscriptionSimulator.ts | 17 ++++- .../src/realmdb/src/RealmDbHandler.ts | 4 +- 5 files changed, 81 insertions(+), 8 deletions(-) diff --git a/cdsp/information-layer/handlers/src/HandlerBase.ts b/cdsp/information-layer/handlers/src/HandlerBase.ts index 92d14cc..ead01b1 100644 --- a/cdsp/information-layer/handlers/src/HandlerBase.ts +++ b/cdsp/information-layer/handlers/src/HandlerBase.ts @@ -100,13 +100,13 @@ export abstract class HandlerBase { } /** - * Generic function to create or remove a subscription message. + * Generic function to create a subscription status message. * @param type - Type of subscription message. * @param message - The original message from client. * @param status - The status of the subscription. * @returns - The transformed message. */ - protected createSubscribeMessage( + protected createSubscribeStatusMessage( type: "subscribe" | "unsubscribe", message: Pick, status: string diff --git a/cdsp/information-layer/handlers/src/iotdb/src/IoTDBHandler.ts b/cdsp/information-layer/handlers/src/iotdb/src/IoTDBHandler.ts index 4f271e8..aaf3e4e 100644 --- a/cdsp/information-layer/handlers/src/iotdb/src/IoTDBHandler.ts +++ b/cdsp/information-layer/handlers/src/iotdb/src/IoTDBHandler.ts @@ -42,7 +42,7 @@ export class IoTDBHandler extends HandlerBase { throw new Error("Invalid database configuration."); } this.session = new Session(); - this.subscriptionSimulator = new SubscriptionSimulator(this.session, this.sendMessageToClient, this.createUpdateMessage); + this.subscriptionSimulator = new SubscriptionSimulator(this.session, this.sendMessageToClient, this.createUpdateMessage, this.createSubscribeStatusMessage); } async authenticateAndConnect( diff --git a/cdsp/information-layer/handlers/src/iotdb/src/SubscriptionSimulator.test.ts b/cdsp/information-layer/handlers/src/iotdb/src/SubscriptionSimulator.test.ts index 69a9b07..fe35f92 100644 --- a/cdsp/information-layer/handlers/src/iotdb/src/SubscriptionSimulator.test.ts +++ b/cdsp/information-layer/handlers/src/iotdb/src/SubscriptionSimulator.test.ts @@ -12,7 +12,7 @@ jest.mock("../config/database-params", () => ({ })); import { SubscriptionSimulator } from './SubscriptionSimulator'; -import { WebSocketWithId, Message } from '../../../utils/data-types'; +import { WebSocketWithId, Message, MessageBase } from '../../../utils/data-types'; import { Session } from './Session'; import { SessionDataSet } from "../utils/SessionDataSet"; import { transformSessionDataSet } from "../utils/database-helper"; @@ -35,8 +35,19 @@ describe('SubscriptionSimulator', () => { beforeEach(() => { mockSession = new Session(); + const createSubscribeStatusMessageMock = jest.fn< + MessageBase, + ["subscribe" | "unsubscribe", Pick, string] + >((type, message, status) => ({ + type, // Properly narrowed type + id: message.id, + tree: message.tree, + uuid: message.uuid, + status, + })); + sendMessageToClientMock = jest.fn(); - simulator = new SubscriptionSimulator(mockSession, sendMessageToClientMock, jest.fn()); + simulator = new SubscriptionSimulator(mockSession, sendMessageToClientMock, jest.fn(), createSubscribeStatusMessageMock); mockWebSocket = { id: 'ws1' } as WebSocketWithId; mockMessage = { id: 'vehicle123', tree: 'VSS' } as Message; @@ -56,6 +67,28 @@ describe('SubscriptionSimulator', () => { * subscribe */ + test('calls sendMessageToClient if subscription was successful', () => { + + // Act: Call subscribe with a new WebSocket and message key + simulator.subscribe(mockMessage, mockWebSocket); + + // Assert: Verify sendMessageToClient was called + expect(sendMessageToClientMock).toHaveBeenCalled(); + + // Capture the actual message passed to sendMessageToClient + const [webSocketArg, messageArg] = sendMessageToClientMock.mock.calls[0]; + + // Check the WebSocket argument + expect(webSocketArg).toBe(mockWebSocket); + + // Check the message content + expect(messageArg).toEqual( + expect.objectContaining({ + status: "succeed", + tree: "VSS", + }) + ); + }); test('calls sendMessageToClient if subscription with same WebSocket already exists', () => { // Arrange: Manually add a subscription to simulate the "already exists" condition @@ -116,6 +149,31 @@ describe('SubscriptionSimulator', () => { /* * unsubscribe */ + test('calls sendMessageToClient if unsubscribe was successful', () => { + + // Arrange: Add a subscription with same key and same websocket + simulator['subscriptions'].set(mockKey, [mockWebSocket]); + + // Act: Call subscribe with a new WebSocket and message key + simulator.unsubscribe(mockMessage, mockWebSocket); + + // Assert: Verify sendMessageToClient was called + expect(sendMessageToClientMock).toHaveBeenCalled(); + + // Capture the actual message passed to sendMessageToClient + const [webSocketArg, messageArg] = sendMessageToClientMock.mock.calls[0]; + + // Check the WebSocket argument + expect(webSocketArg).toBe(mockWebSocket); + + // Check the message content + expect(messageArg).toEqual( + expect.objectContaining({ + status: "succeed", + tree: "VSS", + }) + ); + }); test('remove websocket from existing subscription if websocket and subscription exist', () => { // Arrange: Add a subscription with same key and same websocket + 1 other websocket diff --git a/cdsp/information-layer/handlers/src/iotdb/src/SubscriptionSimulator.ts b/cdsp/information-layer/handlers/src/iotdb/src/SubscriptionSimulator.ts index deab037..d34f838 100644 --- a/cdsp/information-layer/handlers/src/iotdb/src/SubscriptionSimulator.ts +++ b/cdsp/information-layer/handlers/src/iotdb/src/SubscriptionSimulator.ts @@ -18,15 +18,18 @@ export class SubscriptionSimulator { private subscriptions: SubscriptionMap = new Map(); private sendMessageToClient: ( ws: WebSocketWithId, message: Message | MessageBase | ErrorMessage) => void; private createUpdateMessage: (id: string, tree: string, uuid: string, nodes: Array<{ name: string; value: any }>) => Message; + private createSubscribeStatusMessage: (type: "subscribe" | "unsubscribe", message: Pick, status: string) => MessageBase; constructor(session: Session, sendMessageToClient: (ws: WebSocketWithId, message: Message | MessageBase | ErrorMessage) => void, - createUpdateMessage: (id: string, tree: string, uuid: string, nodes: Array<{ name: string; value: any }>) => Message) + createUpdateMessage: (id: string, tree: string, uuid: string, nodes: Array<{ name: string; value: any }>) => Message, + createSubscribeStatusMessage: (type: "subscribe" | "unsubscribe", message: Pick, status: string) => MessageBase) { this.session = session; this.notifyDatabaseChanges = this.notifyDatabaseChanges.bind(this); this.sendMessageToClient = sendMessageToClient; this.createUpdateMessage = createUpdateMessage; + this.createSubscribeStatusMessage = createSubscribeStatusMessage; } /** @@ -66,6 +69,12 @@ export class SubscriptionSimulator { this.timeIntervalLowerLimit = Date.now(); logMessage("started timer"); } + + this.sendMessageToClient( + wsOfNewSubscription, + this.createSubscribeStatusMessage("subscribe", message, "succeed") + ); + logMessage("subscribed"); this.logSubscriptions(); } @@ -104,6 +113,12 @@ export class SubscriptionSimulator { } this.removeTimerIfNoSubscription(); + + this.sendMessageToClient( + wsOfSubscriptionToBeDeleted, + this.createSubscribeStatusMessage("unsubscribe", message, "succeed") + ); + logMessage("unsubscribed"); this.logSubscriptions(); } diff --git a/cdsp/information-layer/handlers/src/realmdb/src/RealmDbHandler.ts b/cdsp/information-layer/handlers/src/realmdb/src/RealmDbHandler.ts index 2d103f4..dd26126 100644 --- a/cdsp/information-layer/handlers/src/realmdb/src/RealmDbHandler.ts +++ b/cdsp/information-layer/handlers/src/realmdb/src/RealmDbHandler.ts @@ -203,7 +203,7 @@ export class RealmDBHandler extends HandlerBase { this.sendMessageToClient( ws, - this.createSubscribeMessage("subscribe", message, "succeed") + this.createSubscribeStatusMessage("subscribe", message, "succeed") ); logWithColor( @@ -275,7 +275,7 @@ export class RealmDBHandler extends HandlerBase { this.sendMessageToClient( ws, - this.createSubscribeMessage("unsubscribe", message, "succeed") + this.createSubscribeStatusMessage("unsubscribe", message, "succeed") ); } else { this.sendMessageToClient( From 43a1758aea945ad3f4339ef9b6eeaccd6a08a238 Mon Sep 17 00:00:00 2001 From: Christian Muehlbauer Date: Mon, 2 Dec 2024 15:52:05 +0100 Subject: [PATCH 48/48] Add session management to Information Layer Changes due to Review comments move authenticateAndConnect() to Session aligned test and small changes run only 1 instance of SubscriptionSimulator with a seperate client and session. open/close session on connect/disconnect per client removed function sendMessageToClients() 1. create a handler for each client, 2. only use WebSocketWithId, 3. log websocket id use HandlerCreator to create handler first extension of readme log timestamp with ms check if the received message is an update message count messages in queue synchronize sent and received messages 1. convert the signal data and 2. receive responses to prevent backpressure new cl argument for element id (e.g. a vehicle id) only open websocket once - have extra websocket thread and event loop first version: writes to websocket, but not correctly Signed-off-by: Christian Muehlbauer --- .../handlers/config/config.ts | 11 + .../handlers/src/HandlerBase.ts | 20 +- .../handlers/src/HandlerCreator.ts | 26 ++ cdsp/information-layer/handlers/src/README.md | 10 +- .../handlers/src/iotdb/src/IoTDBHandler.ts | 72 +---- .../handlers/src/iotdb/src/Session.ts | 93 ++++-- .../src/iotdb/src/SubscriptionSimulator.ts | 40 ++- .../SubscriptionSimulator.test.ts | 110 ++----- .../{utils => test}/database-helper.test.ts | 4 +- .../src/realmdb/src/RealmDbHandler.ts | 28 +- .../information-layer/router/config/config.ts | 13 - .../router/src/websocket-server.ts | 46 +-- cdsp/information-layer/utils/logger.ts | 9 +- examples/remotivelabs-feeder/README.md | 36 ++- examples/remotivelabs-feeder/rl-bridge.py | 274 ++++++++++++++++++ 15 files changed, 512 insertions(+), 280 deletions(-) create mode 100644 cdsp/information-layer/handlers/src/HandlerCreator.ts rename cdsp/information-layer/handlers/src/iotdb/{src => test}/SubscriptionSimulator.test.ts (77%) rename cdsp/information-layer/handlers/src/iotdb/{utils => test}/database-helper.test.ts (92%) delete mode 100644 cdsp/information-layer/router/config/config.ts create mode 100644 examples/remotivelabs-feeder/rl-bridge.py diff --git a/cdsp/information-layer/handlers/config/config.ts b/cdsp/information-layer/handlers/config/config.ts index 6cd2c9d..c4da662 100644 --- a/cdsp/information-layer/handlers/config/config.ts +++ b/cdsp/information-layer/handlers/config/config.ts @@ -11,6 +11,17 @@ dotenv.config(); */ const ENDPOINTS_FILE: string = "vss_data_points.yaml"; +// Define the type of the handler, which will be a lowercase string +export const getHandlerType = (): string => { + const handlerType = process.env.HANDLER_TYPE; + + if (!handlerType) { + throw new Error("HANDLER_TYPE must be specified as an ENV variable"); + } + + return handlerType.toLowerCase(); // Ensure it's returned as lowercase +}; + /** * Retrieves the value of an environment variable. * diff --git a/cdsp/information-layer/handlers/src/HandlerBase.ts b/cdsp/information-layer/handlers/src/HandlerBase.ts index ead01b1..3fc8c76 100644 --- a/cdsp/information-layer/handlers/src/HandlerBase.ts +++ b/cdsp/information-layer/handlers/src/HandlerBase.ts @@ -2,7 +2,6 @@ import fs from "fs"; import yaml from "js-yaml"; import { Message, - WebSocket, WebSocketWithId, DataPointSchema, MessageBase, @@ -12,37 +11,36 @@ import { getDataPointsPath } from "../config/config"; import { logMessage, MessageType } from "../../utils/logger"; import { transformDataPointsWithUnderscores } from "../utils/transformations"; - export abstract class HandlerBase { // Default implementations of required functions - authenticateAndConnect(sendMessageToClients: (message: any) => void): void { + authenticateAndConnect(): void { logMessage( "authenticateAndConnect() is not implemented", MessageType.WARNING ); } - protected read(message: Message, ws: WebSocket): void { + protected read(message: Message, ws: WebSocketWithId): void { logMessage("read() is not implemented", MessageType.WARNING); } - protected write(message: Message, ws: WebSocket): void { + protected write(message: Message, ws: WebSocketWithId): void { logMessage("write() is not implemented", MessageType.WARNING); } - protected subscribe(message: Message, ws: WebSocket): void { + protected subscribe(message: Message, ws: WebSocketWithId): void { logMessage("subscribe() is not implemented", MessageType.WARNING); } - protected unsubscribe(message: Message, ws: WebSocket): void { + protected unsubscribe(message: Message, ws: WebSocketWithId): void { logMessage("unsubscribe() is not implemented", MessageType.WARNING); } - unsubscribe_client(ws: WebSocket): void { + unsubscribe_client(ws: WebSocketWithId): void { logMessage("unsubscribe_client() is not implemented", MessageType.WARNING); } - handleMessage(message: Message, connectionId: string, ws: WebSocketWithId): void { + handleMessage(message: Message, ws: WebSocketWithId): void { try { switch (message.type) { case "read": @@ -70,10 +68,10 @@ export abstract class HandlerBase { * Sends a message to the client. */ protected sendMessageToClient( - ws: WebSocket, + ws: WebSocketWithId, message: Message | MessageBase | ErrorMessage ): void { - logMessage(JSON.stringify(message), MessageType.SENT); + logMessage(JSON.stringify(message), MessageType.SENT, ws.id); ws.send(JSON.stringify(message)); } diff --git a/cdsp/information-layer/handlers/src/HandlerCreator.ts b/cdsp/information-layer/handlers/src/HandlerCreator.ts new file mode 100644 index 0000000..c594c8d --- /dev/null +++ b/cdsp/information-layer/handlers/src/HandlerCreator.ts @@ -0,0 +1,26 @@ +import { getHandlerType } from "../config/config"; +import { HandlerBase } from "./HandlerBase"; +import { RealmDBHandler } from "./realmdb/src/RealmDbHandler"; +import { IoTDBHandler } from "./iotdb/src/IoTDBHandler"; +import { logWithColor, COLORS } from "../../utils/logger"; + +export function createHandler() : HandlerBase { + const handlerType: string = getHandlerType(); + logWithColor(`\n ** Handler: ${handlerType} ** \n`, COLORS.BOLD); + + let handler: HandlerBase; + + // Instantiate the correct handler based on the handler type + switch (handlerType) { + case "realmdb": + handler = new RealmDBHandler(); + break; + case "iotdb": + handler = new IoTDBHandler(); + break; + default: + throw new Error("Unsupported handler type"); + } + + return handler; + } diff --git a/cdsp/information-layer/handlers/src/README.md b/cdsp/information-layer/handlers/src/README.md index 56ad64a..930ba48 100644 --- a/cdsp/information-layer/handlers/src/README.md +++ b/cdsp/information-layer/handlers/src/README.md @@ -13,7 +13,7 @@ This project uses a handler interface to dynamically integrate new database back 2. **Implement the handler methods**: You must implement the following methods in your new handler: - - `authenticateAndConnect(sendMessageToClients)`: Establish a connection with the database and authenticate. + - `authenticateAndConnect()`: Establish a connection with the database and authenticate. - `read(message, ws)`: Retrieve data from the database based on the incoming WebSocket message. - `write(message, ws)`: Write data to the database. - `subscribe(message, ws)`: Subscribe to changes in the database, and automatically send updates over WebSocket. @@ -25,7 +25,7 @@ This project uses a handler interface to dynamically integrate new database back const Handler = require('../../handler'); class MyDBHandler extends Handler { -async authenticateAndConnect(sendMessageToClients) { +async authenticateAndConnect() { // Connect to your database here } @@ -78,7 +78,7 @@ OPTIONAL_CUSTOM_VARIABLES="value" > [!WARNING] > Do not commit this file to GitHub! -In order to work with your custom database handler, it is required to initialize it in the [websocket-server.ts](../../router/src/websocket-server.ts). +In order to work with your custom database handler, it is required to create it in the [HandlerCreator.ts](./HandlerCreator.ts). ```ts switch (handlerType) { @@ -102,7 +102,7 @@ Run the WebSocket server, and connect with your handler by sending WebSocket mes ### Existing Handlers You can check the following examples to understand how to structure your new handler: -- **RealmDB Handler**: [RealmHandler](./realmdb/src/realmdb-handler.ts) provides an example of how to interact with RealmDB. -- **IoTDB Handler**: A similar implementation can be followed for [IoTDBHandler](./iotdb/src/iotdb-handler.ts). +- **RealmDB Handler**: [RealmHandler](./realmdb/src/RealmDBHandler.ts) provides an example of how to interact with RealmDB. +- **IoTDB Handler**: A similar implementation can be followed for [IoTDBHandler](./iotdb/src/IoTDBHandler.ts). For additional logging, you can utilize the `logMessage` function from [logger.ts](../../utils/logger.ts). \ No newline at end of file diff --git a/cdsp/information-layer/handlers/src/iotdb/src/IoTDBHandler.ts b/cdsp/information-layer/handlers/src/iotdb/src/IoTDBHandler.ts index aaf3e4e..e30a087 100644 --- a/cdsp/information-layer/handlers/src/iotdb/src/IoTDBHandler.ts +++ b/cdsp/information-layer/handlers/src/iotdb/src/IoTDBHandler.ts @@ -1,8 +1,6 @@ -import thrift from "thrift"; import { Session } from "./Session"; -import { SubscriptionSimulator } from "./SubscriptionSimulator"; +import { getSubscriptionSimulator, SubscriptionSimulator } from "./SubscriptionSimulator"; import { SupportedMessageDataTypes } from "./../utils/iotdb-constants"; -const Client = require("../gen-nodejs/IClientRPCService"); const { TSInsertRecordReq, }: any = require("../gen-nodejs/client_types"); @@ -16,22 +14,16 @@ import { } from "../config/iotdb-config"; import { databaseParams, databaseConfig } from "../config/database-params"; import { - logMessage, - logError, logErrorStr, logWithColor, COLORS, } from "../../../../utils/logger"; import { createErrorMessage } from "../../../../utils/error-message-helper"; -import { WebSocket, Message, STATUS_ERRORS, WebSocketWithId } from "../../../utils/data-types"; +import { Message, STATUS_ERRORS, WebSocketWithId } from "../../../utils/data-types"; import { transformSessionDataSet } from "../utils/database-helper"; import { transformDataPointsWithUnderscores } from "../../../utils/transformations"; export class IoTDBHandler extends HandlerBase { - private client: any = null; - private sendMessageToClients: - | ((ws: WebSocket, message: Message) => void) - | null = null; private session: Session; private subscriptionSimulator: SubscriptionSimulator; private dataPointsSchema: SupportedDataPoints = {}; @@ -42,43 +34,14 @@ export class IoTDBHandler extends HandlerBase { throw new Error("Invalid database configuration."); } this.session = new Session(); - this.subscriptionSimulator = new SubscriptionSimulator(this.session, this.sendMessageToClient, this.createUpdateMessage, this.createSubscribeStatusMessage); + this.subscriptionSimulator = getSubscriptionSimulator(this.sendMessageToClient, this.createUpdateMessage, this.createSubscribeStatusMessage); } - async authenticateAndConnect( - sendMessageToClients: (ws: WebSocket, message: Message) => void - ): Promise { - try { - this.sendMessageToClients = sendMessageToClients; - - const connection = thrift.createConnection( - databaseConfig!.iotdbHost, - databaseConfig!.iotdbPort!, - { - transport: thrift.TFramedTransport, - protocol: thrift.TBinaryProtocol, - } - ); - - logMessage( - `Connect to IoTDB, host: ${databaseConfig!.iotdbHost} port: ${databaseConfig!.iotdbPort}` - ); - - this.client = thrift.createClient(Client, connection); - this.session.setClient(this.client); - - connection.on("error", (error: Error) => { - logError("thrift connection error", error); - }); - - const supportedDataPoint: SupportedDataPoints = - this.getSupportedDataPoints() as SupportedDataPoints; - this.dataPointsSchema = createDataPointsSchema(supportedDataPoint); - - logMessage("Successfully connected to IoTDB using thrift"); - } catch (error: unknown) { - logError("Failed to authenticate with IoTDB", error); - } + async authenticateAndConnect(): Promise { + this.session.authenticateAndConnect(); + const supportedDataPoint: SupportedDataPoints = + this.getSupportedDataPoints() as SupportedDataPoints; + this.dataPointsSchema = createDataPointsSchema(supportedDataPoint); } protected subscribe(message: Message, ws: WebSocketWithId): void { @@ -89,14 +52,14 @@ export class IoTDBHandler extends HandlerBase { this.subscriptionSimulator.unsubscribe(message, ws); } - unsubscribe_client(ws: WebSocketWithId): void { + async unsubscribe_client(ws: WebSocketWithId): Promise { this.subscriptionSimulator.unsubscribeClient(ws); + await this.session.closeSession(); } - protected async read(message: Message, ws: WebSocket): Promise { + protected async read(message: Message, ws: WebSocketWithId): Promise { if (this.areNodesValid(message, ws)) { try { - await this.session.openSession(); const responseNodes = await this.queryLastFields(message, ws); if (responseNodes.length > 0) { const responseMessage = this.createUpdateMessage( @@ -120,16 +83,13 @@ export class IoTDBHandler extends HandlerBase { ws, createErrorMessage("read", STATUS_ERRORS.NOT_FOUND, errMsg) ); - } finally { - await this.session.closeSession(); } } } - protected async write(message: Message, ws: WebSocket): Promise { + protected async write(message: Message, ws: WebSocketWithId): Promise { if (this.areNodesValid(message, ws)) { try { - await this.session.openSession(); const data = this.createObjectToInsert(message); let measurements: string[] = []; let dataTypes: string[] = []; @@ -189,8 +149,6 @@ export class IoTDBHandler extends HandlerBase { `Failed writing data. ${errMsg}` ) ); - } finally { - await this.session.closeSession(); } } } @@ -202,7 +160,7 @@ export class IoTDBHandler extends HandlerBase { * @param ws - The WebSocket object for communication. * @returns - Returns true if all nodes are valid against the schema, otherwise false. */ - private areNodesValid(message: Message, ws: WebSocket): boolean { + private areNodesValid(message: Message, ws: WebSocketWithId): boolean { const { type } = message; const errorData = this.validateNodesAgainstSchema( @@ -280,7 +238,7 @@ export class IoTDBHandler extends HandlerBase { isAligned: isAligned, }); - return await this.client.insertRecord(request); + return await this.session.getClient().insertRecord(request); } /** @@ -291,7 +249,7 @@ export class IoTDBHandler extends HandlerBase { */ private async queryLastFields( message: Message, - ws: WebSocket + ws: WebSocketWithId ): Promise> { const { id: objectId, tree } = message; diff --git a/cdsp/information-layer/handlers/src/iotdb/src/Session.ts b/cdsp/information-layer/handlers/src/iotdb/src/Session.ts index baff40f..3978db8 100644 --- a/cdsp/information-layer/handlers/src/iotdb/src/Session.ts +++ b/cdsp/information-layer/handlers/src/iotdb/src/Session.ts @@ -1,41 +1,71 @@ +import thrift from "thrift"; import { - TSOpenSessionReq, - TSCloseSessionReq, - TSProtocolVersion, - TSExecuteStatementReq, - } from "../gen-nodejs/client_types"; - import { logMessage, logError, logWithColor, COLORS } from "../../../../utils/logger"; - import { databaseConfig } from "../config/database-params"; - import { SessionDataSet } from "../utils/SessionDataSet"; + TSOpenSessionReq, + TSCloseSessionReq, + TSProtocolVersion, + TSExecuteStatementReq, +} from "../gen-nodejs/client_types"; +import { logMessage, logError, logWithColor, COLORS } from "../../../../utils/logger"; +import { databaseConfig } from "../config/database-params"; +import { SessionDataSet } from "../utils/SessionDataSet"; - const PROTOCOL_VERSION: number = TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V3; +const Client = require("../gen-nodejs/IClientRPCService"); - export class Session { - private client: any; - private sessionId: number | null = null; - private statementId: number | null = null; - private fetchSize: number; - - constructor() { - this.fetchSize = databaseConfig?.fetchSize ?? 1000; +const PROTOCOL_VERSION: number = TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V3; + +export class Session { + private client: any; + private sessionId: number | null = null; + private statementId: number | null = null; + private fetchSize: number; + + constructor() { + this.fetchSize = databaseConfig?.fetchSize ?? 1000; + } + + public getSessionId(): number | null { + return this.sessionId; + } + public getClient() { + return this.client; + } + + async authenticateAndConnect(): Promise { + try { + const connection = thrift.createConnection( + databaseConfig!.iotdbHost, + databaseConfig!.iotdbPort!, + { + transport: thrift.TFramedTransport, + protocol: thrift.TBinaryProtocol, + } + ); + + this.client = thrift.createClient(Client, connection); + await this.openSession(); + + connection.on("error", (error: Error) => { + logError("thrift connection error", error); + }); + + process.on('exit', () => { + if (connection) { + connection.destroy(); + } + }); + + logMessage(`Successfully connected to IoTDB using thrift, host: ${databaseConfig!.iotdbHost} port: ${databaseConfig!.iotdbPort}`); + } catch (error: unknown) { + logError("Failed to authenticate with IoTDB", error); } + } - public getSessionId(): number | null { - return this.sessionId; - } - public getStatementId(): number | null { - return this.statementId; - } - public setClient(client: any) { - this.client = client; - } - - /** + /** * Opens a session with the IoTDB server using the provided credentials and configuration. */ async openSession(): Promise { if (this.sessionId) { - logMessage("The session is already opened."); + logMessage("The session is already opened, session id: " + this.sessionId); return; } @@ -60,7 +90,8 @@ import { } this.sessionId = resp.sessionId; - + logMessage(`session #${this.sessionId} opened`); + if (!this.sessionId) { throw new Error("Session ID is undefined, cannot request statement ID."); } @@ -79,7 +110,6 @@ import { logMessage("Session is already closed."); return; } - const req = new TSCloseSessionReq({ sessionId: this.sessionId! }); try { @@ -90,6 +120,7 @@ import { error ); } finally { + logMessage(`session #${this.sessionId} closed`); this.sessionId = null; } } diff --git a/cdsp/information-layer/handlers/src/iotdb/src/SubscriptionSimulator.ts b/cdsp/information-layer/handlers/src/iotdb/src/SubscriptionSimulator.ts index d34f838..87bd4d4 100644 --- a/cdsp/information-layer/handlers/src/iotdb/src/SubscriptionSimulator.ts +++ b/cdsp/information-layer/handlers/src/iotdb/src/SubscriptionSimulator.ts @@ -11,6 +11,22 @@ type SubscriptionMap = Map; const RANDOM_STRING = ""; const TREE_VSS = "VSS"; +// Define the singleton instance at the module level +let subscriptionSimulatorInstance: SubscriptionSimulator | null = null; + +// Function to get or initialize the singleton instance +export function getSubscriptionSimulator( + sendMessageToClient: (ws: WebSocketWithId, message: Message | MessageBase | ErrorMessage) => void, + createUpdateMessage: (id: string, tree: string, uuid: string, nodes: Array<{ name: string; value: any }>) => Message, + createSubscribeStatusMessage: (type: "subscribe" | "unsubscribe", message: Pick, status: string) => MessageBase +): SubscriptionSimulator { + if (!subscriptionSimulatorInstance) { + subscriptionSimulatorInstance = new SubscriptionSimulator(sendMessageToClient, createUpdateMessage, createSubscribeStatusMessage); + logMessage("SubscriptionSimulator instance created."); + } + return subscriptionSimulatorInstance; +} + export class SubscriptionSimulator { private intervalId: NodeJS.Timeout | null = null; private session: Session; @@ -20,16 +36,29 @@ export class SubscriptionSimulator { private createUpdateMessage: (id: string, tree: string, uuid: string, nodes: Array<{ name: string; value: any }>) => Message; private createSubscribeStatusMessage: (type: "subscribe" | "unsubscribe", message: Pick, status: string) => MessageBase; - constructor(session: Session, + constructor( sendMessageToClient: (ws: WebSocketWithId, message: Message | MessageBase | ErrorMessage) => void, createUpdateMessage: (id: string, tree: string, uuid: string, nodes: Array<{ name: string; value: any }>) => Message, createSubscribeStatusMessage: (type: "subscribe" | "unsubscribe", message: Pick, status: string) => MessageBase) { - this.session = session; + this.session = new Session(); this.notifyDatabaseChanges = this.notifyDatabaseChanges.bind(this); this.sendMessageToClient = sendMessageToClient; this.createUpdateMessage = createUpdateMessage; this.createSubscribeStatusMessage = createSubscribeStatusMessage; + this.session.authenticateAndConnect(); + + // Register the cleanup function + process.on("exit", this.cleanup.bind(this)); // Called when the process exits normally + process.on("SIGINT", () => { + this.cleanup(); + process.exit(0); // Ensure the process exits + }); + } + + private async cleanup(): Promise { + logMessage("Cleaning up SubscriptionSimulator..."); + await this.session.closeSession(); // Replace with actual session close logic } /** @@ -45,7 +74,7 @@ export class SubscriptionSimulator { * @param wsOfNewSubscription websocket representing a client to be associated with the new subscription * @returns void */ - subscribe(message: Message, wsOfNewSubscription: WebSocketWithId): void { + async subscribe(message: Message, wsOfNewSubscription: WebSocketWithId): Promise { const key = `${message.id}-${message.tree}`; const websockets = this.subscriptions.get(key); @@ -67,6 +96,7 @@ export class SubscriptionSimulator { this.intervalId = setInterval(this.notifyDatabaseChanges, databaseConfig!.pollIntervalLenInSec * 1000); this.intervalId.unref(); // Ensure timer doesn't keep the process alive this.timeIntervalLowerLimit = Date.now(); + logMessage("started timer"); } @@ -141,7 +171,7 @@ export class SubscriptionSimulator { /** * Removes the timer if there is no subscription left. */ - private removeTimerIfNoSubscription() { + private async removeTimerIfNoSubscription() { if (this.intervalId !== null && this.subscriptions.size === 0) { clearInterval(this.intervalId); @@ -181,7 +211,6 @@ export class SubscriptionSimulator { } const timeIntervalUpperLimit = Date.now(); - await this.session.openSession(); for (const [key, websockets] of this.subscriptions.entries()) { const [id, tree] = key.split('-'); @@ -192,7 +221,6 @@ export class SubscriptionSimulator { ); } } - await this.session.closeSession(); this.timeIntervalLowerLimit = timeIntervalUpperLimit; } diff --git a/cdsp/information-layer/handlers/src/iotdb/src/SubscriptionSimulator.test.ts b/cdsp/information-layer/handlers/src/iotdb/test/SubscriptionSimulator.test.ts similarity index 77% rename from cdsp/information-layer/handlers/src/iotdb/src/SubscriptionSimulator.test.ts rename to cdsp/information-layer/handlers/src/iotdb/test/SubscriptionSimulator.test.ts index fe35f92..e0d026f 100644 --- a/cdsp/information-layer/handlers/src/iotdb/src/SubscriptionSimulator.test.ts +++ b/cdsp/information-layer/handlers/src/iotdb/test/SubscriptionSimulator.test.ts @@ -11,18 +11,28 @@ jest.mock("../config/database-params", () => ({ }, })); -import { SubscriptionSimulator } from './SubscriptionSimulator'; -import { WebSocketWithId, Message, MessageBase } from '../../../utils/data-types'; -import { Session } from './Session'; -import { SessionDataSet } from "../utils/SessionDataSet"; -import { transformSessionDataSet } from "../utils/database-helper"; -import { IoTDBDataType } from '../utils/iotdb-constants'; +jest.mock('thrift', () => ({ + createConnection: jest.fn(() => ({ + on: jest.fn(), + end: jest.fn(), + destroy: jest.fn(), + })), +})); + +// Mock the module where transformSessionDataSet is defined +jest.mock('../utils/database-helper', () => ({ + transformSessionDataSet: jest.fn(), // Ensure transformSessionDataSet is a mock function +})); // Mock the module where transformSessionDataSet is defined jest.mock('../utils/database-helper', () => ({ transformSessionDataSet: jest.fn(), // Ensure transformSessionDataSet is a mock function })); +import { SubscriptionSimulator } from '../src//SubscriptionSimulator'; +import { WebSocketWithId, Message, MessageBase } from '../../../utils/data-types'; +import { Session } from '../src//Session'; + describe('SubscriptionSimulator', () => { let simulator: SubscriptionSimulator; let mockSession: Session; @@ -30,7 +40,6 @@ describe('SubscriptionSimulator', () => { let mockMessage: Message; let mockKey: string; let sendMessageToClientMock: jest.Mock; - let mockSessionDataSet: jest.Mocked; beforeEach(() => { mockSession = new Session(); @@ -47,7 +56,7 @@ describe('SubscriptionSimulator', () => { })); sendMessageToClientMock = jest.fn(); - simulator = new SubscriptionSimulator(mockSession, sendMessageToClientMock, jest.fn(), createSubscribeStatusMessageMock); + simulator = new SubscriptionSimulator(sendMessageToClientMock, jest.fn(), jest.fn()); mockWebSocket = { id: 'ws1' } as WebSocketWithId; mockMessage = { id: 'vehicle123', tree: 'VSS' } as Message; @@ -61,35 +70,15 @@ describe('SubscriptionSimulator', () => { simulator["intervalId"] = null; // Reset intervalId } jest.clearAllTimers(); // Clear any remaining active timers + + process.removeAllListeners("exit"); + process.removeAllListeners("SIGINT"); }); /* * subscribe */ - test('calls sendMessageToClient if subscription was successful', () => { - - // Act: Call subscribe with a new WebSocket and message key - simulator.subscribe(mockMessage, mockWebSocket); - - // Assert: Verify sendMessageToClient was called - expect(sendMessageToClientMock).toHaveBeenCalled(); - - // Capture the actual message passed to sendMessageToClient - const [webSocketArg, messageArg] = sendMessageToClientMock.mock.calls[0]; - - // Check the WebSocket argument - expect(webSocketArg).toBe(mockWebSocket); - - // Check the message content - expect(messageArg).toEqual( - expect.objectContaining({ - status: "succeed", - tree: "VSS", - }) - ); - }); - test('calls sendMessageToClient if subscription with same WebSocket already exists', () => { // Arrange: Manually add a subscription to simulate the "already exists" condition simulator['subscriptions'].set(mockKey, [mockWebSocket]); @@ -149,31 +138,6 @@ describe('SubscriptionSimulator', () => { /* * unsubscribe */ - test('calls sendMessageToClient if unsubscribe was successful', () => { - - // Arrange: Add a subscription with same key and same websocket - simulator['subscriptions'].set(mockKey, [mockWebSocket]); - - // Act: Call subscribe with a new WebSocket and message key - simulator.unsubscribe(mockMessage, mockWebSocket); - - // Assert: Verify sendMessageToClient was called - expect(sendMessageToClientMock).toHaveBeenCalled(); - - // Capture the actual message passed to sendMessageToClient - const [webSocketArg, messageArg] = sendMessageToClientMock.mock.calls[0]; - - // Check the WebSocket argument - expect(webSocketArg).toBe(mockWebSocket); - - // Check the message content - expect(messageArg).toEqual( - expect.objectContaining({ - status: "succeed", - tree: "VSS", - }) - ); - }); test('remove websocket from existing subscription if websocket and subscription exist', () => { // Arrange: Add a subscription with same key and same websocket + 1 other websocket @@ -324,43 +288,22 @@ describe('SubscriptionSimulator', () => { test('calls sendMessageToClient if there is a matching subscription and update', async () => { simulator["timeIntervalLowerLimit"] = Date.now(); - + // Add a subscription that should match the `id` in the mocked session data simulator['subscriptions'].set('vehicle123-VSS', [mockWebSocket]); - - // Create a real `SessionDataSet` instance to pass the `instanceof` check - const mockSessionDataSet = new SessionDataSet( - ['root.Vehicles_Speed'], // columnNameList - [IoTDBDataType.FLOAT], // columnTypeList - { 'root.Vehicles_Speed': 0 }, // columnNameIndex - 1, // queryId - {}, // client - 1, // statementId - 1, // sessionId - {}, // queryDataSet - true // ignoreTimestamp - ); - - // Mock executeQueryStatement to return the mockSessionDataSet - jest.spyOn(mockSession, 'executeQueryStatement').mockResolvedValue(mockSessionDataSet); - - // Mock transformSessionDataSet to return non-empty array (indicating changes) - (transformSessionDataSet as jest.Mock).mockReturnValueOnce([ - { name: 'speed', value: 100 }, - ]); - - // Mock createUpdateMessage to return an update message - simulator["createUpdateMessage"] = jest.fn().mockReturnValue({ + + // Mock checkForChanges to return an update message + jest.spyOn(simulator as any, 'checkForChanges').mockResolvedValueOnce({ type: "update", id: 'vehicle123', tree: 'VSS', uuid: 'test-uuid', nodes: [{ name: 'speed', value: 100 }], } as Message); // Return type MessageWithNodes - + // Call notifyDatabaseChanges await (simulator as any).notifyDatabaseChanges(); - + // Assert that sendMessageToClient was called with the matching websocket and update message expect(sendMessageToClientMock).toHaveBeenCalledWith( { id: 'ws1' }, // WebSocket in the subscription @@ -371,4 +314,5 @@ describe('SubscriptionSimulator', () => { }) ); }); + }); diff --git a/cdsp/information-layer/handlers/src/iotdb/utils/database-helper.test.ts b/cdsp/information-layer/handlers/src/iotdb/test/database-helper.test.ts similarity index 92% rename from cdsp/information-layer/handlers/src/iotdb/utils/database-helper.test.ts rename to cdsp/information-layer/handlers/src/iotdb/test/database-helper.test.ts index 6522221..4b8a4c4 100644 --- a/cdsp/information-layer/handlers/src/iotdb/utils/database-helper.test.ts +++ b/cdsp/information-layer/handlers/src/iotdb/test/database-helper.test.ts @@ -1,5 +1,5 @@ -import { transformSessionDataSet } from './database-helper'; -import { SessionDataSet } from './SessionDataSet'; +import { transformSessionDataSet } from '../utils/database-helper'; +import { SessionDataSet } from '../utils/SessionDataSet'; describe('database-helper', () => { let mockSessionDataSet: jest.Mocked; diff --git a/cdsp/information-layer/handlers/src/realmdb/src/RealmDbHandler.ts b/cdsp/information-layer/handlers/src/realmdb/src/RealmDbHandler.ts index dd26126..a3ab213 100644 --- a/cdsp/information-layer/handlers/src/realmdb/src/RealmDbHandler.ts +++ b/cdsp/information-layer/handlers/src/realmdb/src/RealmDbHandler.ts @@ -12,7 +12,7 @@ import { logErrorStr, } from "../../../../utils/logger"; import { createErrorMessage } from "../../../../utils/error-message-helper"; -import { WebSocket, Message, STATUS_ERRORS } from "../../../utils/data-types"; +import { WebSocketWithId, Message, STATUS_ERRORS } from "../../../utils/data-types"; import { transformDataPointsWithDots, transformDataPointsWithUnderscores } from "../../../utils/transformations"; // Define a type for changes @@ -40,10 +40,7 @@ function parseOnMediaElementChangeResponse( export class RealmDBHandler extends HandlerBase { private realm: Realm | null; - private sendMessageToClients: - | ((ws: WebSocket, message: Message) => void) - | null; - private listeners: Map>; + private listeners: Map>; constructor() { super(); @@ -51,16 +48,11 @@ export class RealmDBHandler extends HandlerBase { throw new Error("Invalid database configuration."); } this.realm = null; - this.sendMessageToClients = null; this.listeners = new Map(); } - async authenticateAndConnect( - sendMessageToClients: (ws: WebSocket, message: Message) => void - ): Promise { + async authenticateAndConnect(): Promise { try { - this.sendMessageToClients = sendMessageToClients; - const app = new Realm.App({ id: databaseConfig!.realmAppId }); const credentials = Realm.Credentials.apiKey(databaseConfig!.realmApiKey); const user = await app.logIn(credentials); @@ -86,7 +78,7 @@ export class RealmDBHandler extends HandlerBase { } } - protected async read(message: Message, ws: WebSocket): Promise { + protected async read(message: Message, ws: WebSocketWithId): Promise { if (this.areNodesValid(message, ws)) { try { const updateMessage = await this.getMessageData(message); @@ -102,7 +94,7 @@ export class RealmDBHandler extends HandlerBase { } } - protected async write(message: Message, ws: WebSocket): Promise { + protected async write(message: Message, ws: WebSocketWithId): Promise { if (this.areNodesValid(message, ws)) { try { const mediaElement = await this.getMediaElement(message); @@ -155,7 +147,7 @@ export class RealmDBHandler extends HandlerBase { } } - protected async subscribe(message: Message, ws: WebSocket): Promise { + protected async subscribe(message: Message, ws: WebSocketWithId): Promise { try { const mediaElement = await this.getMediaElement(message); @@ -243,7 +235,7 @@ export class RealmDBHandler extends HandlerBase { } } - protected async unsubscribe(message: Message, ws: WebSocket): Promise { + protected async unsubscribe(message: Message, ws: WebSocketWithId): Promise { const { id, tree, uuid } = message; if (!id || !tree || !mediaElementsParams[tree]) { const errorMessage = @@ -303,7 +295,7 @@ export class RealmDBHandler extends HandlerBase { ); } - async unsubscribe_client(ws: WebSocket): Promise { + async unsubscribe_client(ws: WebSocketWithId): Promise { this.listeners.delete(ws); logWithColor( `All client subscriptions removed! Amount Clients: ${this.listeners.size}`, @@ -318,7 +310,7 @@ export class RealmDBHandler extends HandlerBase { * @param ws - The WebSocket object for communication. * @returns - Returns true if all nodes are valid against the schema, otherwise false. */ - private areNodesValid(message: Message, ws: WebSocket): boolean { + private areNodesValid(message: Message, ws: WebSocketWithId): boolean { const { type, tree } = message; if (!tree || !mediaElementsParams[tree]) { logErrorStr("Tree is undefined or does not exist in mediaElementsParams"); @@ -438,7 +430,7 @@ export class RealmDBHandler extends HandlerBase { mediaElement: any, changes: Changes, messageHeader: Pick, - ws: WebSocket + ws: WebSocketWithId ): void { logMessage( "Media element changed", diff --git a/cdsp/information-layer/router/config/config.ts b/cdsp/information-layer/router/config/config.ts deleted file mode 100644 index 33768ca..0000000 --- a/cdsp/information-layer/router/config/config.ts +++ /dev/null @@ -1,13 +0,0 @@ -import dotenv from "dotenv"; -dotenv.config(); - -// Define the type of the handler, which will be a lowercase string -export const getHandlerType = (): string => { - const handlerType = process.env.HANDLER_TYPE; - - if (!handlerType) { - throw new Error("HANDLER_TYPE must be specified as an ENV variable"); - } - - return handlerType.toLowerCase(); // Ensure it's returned as lowercase -}; diff --git a/cdsp/information-layer/router/src/websocket-server.ts b/cdsp/information-layer/router/src/websocket-server.ts index 38bc5e9..c9297fe 100644 --- a/cdsp/information-layer/router/src/websocket-server.ts +++ b/cdsp/information-layer/router/src/websocket-server.ts @@ -1,9 +1,6 @@ import { v4 as uuidv4 } from 'uuid'; import WebSocket, { RawData } from "ws"; -import { RealmDBHandler } from "../../handlers/src/realmdb/src/RealmDbHandler"; -import { IoTDBHandler } from "../../handlers/src/iotdb/src/IoTDBHandler"; -import { HandlerBase } from "../../handlers/src/HandlerBase"; -import { getHandlerType } from "../config/config"; +import { createHandler } from "../../handlers/src/HandlerCreator"; import { validateMessage } from "../utils/message-validator"; import { logMessage, @@ -14,25 +11,6 @@ import { } from "../../utils/logger"; import { Message, WebSocketWithId } from "../../handlers/utils/data-types"; -// Define the handler as the base class type -let handler: HandlerBase; - -const handlerType: string = getHandlerType(); - -logWithColor(`\n ** Handler: ${handlerType} ** \n`, COLORS.BOLD); - -// Instantiate the correct handler based on the handler type -switch (handlerType) { - case "realmdb": - handler = new RealmDBHandler(); - break; - case "iotdb": - handler = new IoTDBHandler(); - break; - default: - throw new Error("Unsupported handler type"); -} - // WebSocket server creation const server = new WebSocket.Server({ port: 8080 }); @@ -45,12 +23,14 @@ server.on("connection", (ws: WebSocket) => { const wsWithId = addIdToWebsocket(ws); const connectionId = wsWithId.id; clients.set(connectionId, ws); // Add client to the Map - logWithColor(`Client connected with id ${connectionId}`, COLORS.YELLOW); + const handler = createHandler(); + handler.authenticateAndConnect(); + logWithColor(`Client connected and authenticated with id ${connectionId}`, COLORS.YELLOW); // Handle messages from the client ws.on("message", (message: WebSocket.RawData) => { let messageString = rawDataToString(message); - logMessage(JSON.stringify(messageString), MessageType.RECEIVED); + logMessage(JSON.stringify(messageString), MessageType.RECEIVED, connectionId); const validatedMessage = validateMessage(messageString); if (validatedMessage instanceof Error) { @@ -60,30 +40,18 @@ server.on("connection", (ws: WebSocket) => { }); } else { // Pass the validated message to the handler - handler.handleMessage(validatedMessage, connectionId, wsWithId); + handler.handleMessage(validatedMessage, wsWithId); } }); // Handle client disconnection ws.on("close", () => { - handler.unsubscribe_client(ws); // Remove all client listeners + handler.unsubscribe_client(wsWithId); // Remove all client listeners clients.delete(connectionId); logWithColor(`Client disconnected with ID ${connectionId}`, COLORS.ORANGE); }); }); -// Function to broadcast messages to all connected clients -const sendMessageToClients = (message: Message) => { - logMessage(JSON.stringify(message), MessageType.SENT); - clients.forEach((client) => { - client.send(JSON.stringify(message)); - }); -}; - -// Initialize handler and authenticate -logMessage(`Starting authentication and connection ...`); -handler.authenticateAndConnect(sendMessageToClients); - // Log server start logWithColor(`Web-Socket server started on ws://localhost:8080\n`, COLORS.BOLD); diff --git a/cdsp/information-layer/utils/logger.ts b/cdsp/information-layer/utils/logger.ts index 1e34fb9..81ac2fe 100644 --- a/cdsp/information-layer/utils/logger.ts +++ b/cdsp/information-layer/utils/logger.ts @@ -36,7 +36,8 @@ const MessageTypeColors: Record = { * @param color - The color to apply to the message. Should be a value from the COLORS enum. */ export function logWithColor(message: string, color: COLORS): void { - console.log("\n", color, message, COLORS.RESET); + const dateTimeNow = new Date().toISOString(); + console.log(`\n${color}${dateTimeNow} ${message}${COLORS.RESET}`); } /** @@ -52,15 +53,15 @@ export function logMessage( label: string = "" ): void { let color: COLORS = MessageTypeColors[type]; - const dateTimeNow = new Date().toLocaleString(); + const dateTimeNow = new Date().toISOString(); let labelText: string; switch (type) { case MessageType.RECEIVED: - labelText = "\u2193 ".concat(label || "Client Received"); + labelText = "\u2193 ".concat("Client Received ws: ").concat(label); break; case MessageType.SENT: - labelText = "\u2191 ".concat(label || "Client Sent"); + labelText = "\u2191 ".concat("Client Sent ws: ").concat(label); break; case MessageType.ERROR: labelText = "\u2716 ".concat(label || "Internal Error"); diff --git a/examples/remotivelabs-feeder/README.md b/examples/remotivelabs-feeder/README.md index f1a52ee..843414c 100644 --- a/examples/remotivelabs-feeder/README.md +++ b/examples/remotivelabs-feeder/README.md @@ -1,10 +1,12 @@ # RemotiveLabs Bridge/Feeder This a simple example of using the [RemotiveLabs virtual signal platform](https://remotivelabs.com/) as a feeder of vehicle data into the playground [Apache IoTDB](https://covesa.github.io/cdsp/manuals/apache-iotdb/) data store. -It is implemented as a bridge between an RemotiveLabs Broker as the data source and the IoTDB server. You specify the signals you wish to subscribe too. The bridge waits for the subscribed signals to be sent from the -RemotiveLabs broker, formats them and then writes them to IoTDB using the specified IoTDB path. +It is implemented as a bridge between an RemotiveLabs Broker as the data source and the IoTDB server or the websocket server on the information-layer. You specify the signals you wish to subscribe too. The bridge waits for the subscribed signals to be sent from the +RemotiveLabs broker, formats them and then writes them +* to IoTDB using the specified IoTDB path or +* the websocket server on the information-layer. Depending on the websocket server configuration the data is written to IoTDB or RealmDB. -The code assumes the timeseries into which the data will be written already exists in IoTDB. See the setup section for an example. +For IoTDB the code assumes the timeseries into which the data will be written already exists in IoTDB. See the setup section for an example. ## Setup @@ -21,6 +23,9 @@ CREATE DATABASE root.test2 ``` CREATE ALIGNED TIMESERIES root.test2.dev1(`Vehicle.Speed` FLOAT, `Vehicle.Chassis.Accelerator.PedalPosition` INT32, `Vehicle.Powertrain.Transmission.CurrentGear` INT32, `Vehicle.Powertrain.TractionBattery.NominalVoltage` INT32, `Vehicle.Powertrain.TractionBattery.StateOfCharge.CurrentEnergy` FLOAT, `Vehicle.Chassis.SteeringWheel.Angle` INT32, `Vehicle.CurrentLocation.Longitude` DOUBLE, `Vehicle.CurrentLocation.Latitude` DOUBLE, `Vehicle.CurrentLocation.HorizontalAccuracy` DOUBLE) ``` +### RealmDB schema +Is to be clarified + ### Bridge install The bridge requires Python3. A list of required packages is provided that can be installed with the pip package manager. @@ -40,8 +45,8 @@ RemotiveLabs have both a Cloud Demo and a Free Tier with pre-recorded datasets t ### Configuration Passing the `-h` parameter to the bridge will display the command line options: ``` -python3 rl-iotdb-bridge.py -h -usage: rl-iotdb-bridge.py [-h] [-u URL] [-x X_API_KEY] [-t ACCESS_TOKEN] -s [SIGNALS [SIGNALS ...]] +python3 rl-bridge.py -h +usage: rl-bridge.py [-h] [-u URL] [-x X_API_KEY] [-t ACCESS_TOKEN] -s [SIGNALS [SIGNALS ...]] -o {iotdb,websocket} [-i ID] Provide address to RemotiveBroker @@ -54,6 +59,9 @@ optional arguments: Personal or service-account access token -s [SIGNALS [SIGNALS ...]], --signals [SIGNALS [SIGNALS ...]] Signal to subscribe to + -o {iotdb,websocket}, --output_mode {iotdb,websocket} + Output mode: 'iotdb' to write to IoTDB, 'websocket' to send data to WebSocket. + -i ID, --id ID Element ID to include in WebSocket data. Required when output_mode is 'websocket'. ``` Tip: To avoid displaying RemotiveLabs Broker secrets on the command line you can pass them using export variables, e.g: ``` @@ -88,22 +96,28 @@ For a standard build of the playground with an unchanged IoTDB server configurat More typically you would change `device_id_` if needed to reflect how you are organizing data in IoTDB. +For sending data to the information-layer the websocket server has to listen on `ws://localhost:8080`. + ### Signal subscription examples -#### Single signal +#### Single signal IoTDB Execute the bridge and subscribe to the signal `Vehicle.Speed` in the namespace `vss`: ``` -python3 rl-iotdb-bridge.py --url $RL_BROKER_URL --x_api_key $RL_API_KEY --signals vss:Vehicle.Speed +python3 rl-bridge.py --url $RL_BROKER_URL --x_api_key $RL_API_KEY -o iotdb --signals vss:Vehicle.Speed ``` -#### Multiple signals +#### Multiple signals IoTDB Execute the bridge and subscribe to all supported VSS signals in the RemotiveLabs dataset example `Night drive to Luftkastellet`: ``` -python3 rl-iotdb-bridge.py --url $RL_BROKER_URL --x_api_key $RL_API_KEY --signals vss:Vehicle.Speed vss:Vehicle.Chassis.Accelerator.PedalPosition vss:Vehicle.Powertrain.Transmission.CurrentGear vss:Vehicle.Powertrain.TractionBattery.NominalVoltage vss:Vehicle.Powertrain.TractionBattery.StateOfCharge.CurrentEnergy vss:Vehicle.Chassis.SteeringWheel.Angle vss:Vehicle.CurrentLocation.Longitude vss:Vehicle.CurrentLocation.Latitude +python3 rl-bridge.py --url $RL_BROKER_URL --x_api_key $RL_API_KEY -o iotdb --signals vss:Vehicle.Speed vss:Vehicle.Chassis.Accelerator.PedalPosition vss:Vehicle.Powertrain.Transmission.CurrentGear vss:Vehicle.Powertrain.TractionBattery.NominalVoltage vss:Vehicle.Powertrain.TractionBattery.StateOfCharge.CurrentEnergy vss:Vehicle.Chassis.SteeringWheel.Angle vss:Vehicle.CurrentLocation.Longitude vss:Vehicle.CurrentLocation.Latitude ``` + +#### Single signal websocket +python3 rl-bridge.py --url $RL_BROKER_URL --x_api_key $RL_API_KEY -o websocket --signals vss:Vehicle.Speed -i TEST_VEHICLE + #### Errors If the requested signal or namespace name is not available in the broker an error will be reported: ``` -python3 rl-iotdb-bridge.py --url $RL_BROKER_URL --x_api_key $RL_API_KEY --signals bad-namespace-name:bad-signal-name +python3 rl-bridge.py --url $RL_BROKER_URL --x_api_key $RL_API_KEY --signals bad-namespace-name:bad-signal-name signal not declared (namespace, signal): ('bad-namespace-name', 'bad-signal-name') ``` @@ -121,7 +135,7 @@ The following example takes you through the steps of playing the RemotiveLabs da 4. Execute the bridge for the signals you wish to subscribe too: ``` -python3 rl-iotdb-bridge.py --url $RL_BROKER_URL --x_api_key $RL_API_KEY --signals vss:Vehicle.Speed vss:Vehicle.Chassis.Accelerator.PedalPosition vss:Vehicle.Powertrain.Transmission.CurrentGear vss:Vehicle.Powertrain.TractionBattery.NominalVoltage vss:Vehicle.Powertrain.TractionBattery.StateOfCharge.CurrentEnergy vss:Vehicle.Chassis.SteeringWheel.Angle vss:Vehicle.CurrentLocation.Longitude vss:Vehicle.CurrentLocation.Latitude +python3 rl-bridge.py --url $RL_BROKER_URL --x_api_key $RL_API_KEY -iotdb --signals vss:Vehicle.Speed vss:Vehicle.Chassis.Accelerator.PedalPosition vss:Vehicle.Powertrain.Transmission.CurrentGear vss:Vehicle.Powertrain.TractionBattery.NominalVoltage vss:Vehicle.Powertrain.TractionBattery.StateOfCharge.CurrentEnergy vss:Vehicle.Chassis.SteeringWheel.Angle vss:Vehicle.CurrentLocation.Longitude vss:Vehicle.CurrentLocation.Latitude ``` 5. The bridge will report that it is waiting to receive signals: ``` diff --git a/examples/remotivelabs-feeder/rl-bridge.py b/examples/remotivelabs-feeder/rl-bridge.py new file mode 100644 index 0000000..98e8e57 --- /dev/null +++ b/examples/remotivelabs-feeder/rl-bridge.py @@ -0,0 +1,274 @@ +#!/usr/bin/env python3 + +import argparse +import time +import asyncio +import json +import sys +from typing import Optional +from remotivelabs.broker.sync import ( + Client, + SignalsInFrame, + BrokerException, + SignalIdentifier, +) +from iotdb.Session import Session +import websockets +from queue import Queue +from threading import Thread + +# IoTDB connection details +ip = "127.0.0.1" +port_ = "6667" +username_ = "root" +password_ = "root" +session = None +device_id_ = "root.test2.dev1" + +# WebSocket URL with the default value +websocket_url = "ws://localhost:8080" + +# Global variables +websocket_queue = Queue() +websocket_thread = None +websocket = None + + +def setup_iotdb(): + global session + session = Session(ip, port_, username_, password_, fetch_size=1024, zone_id="GMT+00:00") + session.open(False) + print("Connected to IoTDB.") + + +def close_iotdb(): + if session: + session.close() + print("Closed IoTDB connection.") + + +import json # Ensure JSON parsing is available + +async def websocket_handler(element_id: str): + global websocket + try: + websocket = await websockets.connect(websocket_url) + print("Connected to WebSocket.") + + message_count = 0 # Counter for sent messages + + while True: + # Wait for the next message in the queue + data = await asyncio.get_event_loop().run_in_executor(None, websocket_queue.get) + if data is None: # Use `None` to signal shutdown + break + + # Prepare WebSocket data format + websocket_data = { + "type": "write", + "tree": "VSS", + "id": element_id, + "uuid": "rl-bridge", + "node": { + "name": data["signal_name"], + "value": data["signal_value"] + } + } + + # Send the message + await websocket.send(json.dumps(websocket_data)) + print(f"Sent data to WebSocket: {websocket_data}") + + # Wait for the response from the server before continuing + response = await websocket.recv() + + # Check the response type + try: + response_data = json.loads(response) # Parse the response as JSON + if response_data.get("type") != "update": + print(f"Unexpected response from WebSocket server: {response}") + exit(1) # Exit immediately without cleanup + else: + print(f"Received valid update response: {response}") + except json.JSONDecodeError: + print(f"Failed to parse response from WebSocket server: {response}") + exit(1) # Exit immediately without cleanup + + # Increment message count and log queue size every 100 messages + message_count += 1 + if message_count % 100 == 0: + queue_size = websocket_queue.qsize() + print(f"Queue size after {message_count} messages: {queue_size}") + + finally: + if websocket: + await websocket.close() + print("Closed WebSocket connection.") + +def start_websocket_thread(element_id: str): + global websocket_thread + websocket_thread = Thread(target=run_websocket_loop, args=(element_id,), daemon=True) + websocket_thread.start() + + +def run_websocket_loop(element_id: str): + asyncio.run(websocket_handler(element_id)) + + +def stop_websocket_thread(): + websocket_queue.put(None) # Signal the WebSocket handler to exit + if websocket_thread: + websocket_thread.join() + + +def on_signals(signals_in_frame: SignalsInFrame, output_mode: str): + for signal in signals_in_frame: + # Convert RemotiveLabs timestamp in microseconds to milliseconds + ts_ = int(signal.timestamp_us() / 1000) + + # Prepare data for writing + vss_name_ = signal.name() + if ( + vss_name_ == 'Vehicle.Chassis.Accelerator.PedalPosition' or + vss_name_ == 'Vehicle.Powertrain.Transmission.CurrentGear' or + vss_name_ == 'Vehicle.Powertrain.TractionBattery.NominalVoltage' or + vss_name_ == 'Vehicle.Chassis.SteeringWheel.Angle' + ): + vss_value_ = [str(int(signal.value()))] + else: + vss_value_ = [str(signal.value())] + + # Log the received data + print(f"Received from RemotiveLabs: name={vss_name_}, value={vss_value_[0]}, timestamp={ts_}") + + # IoTDB writing mode + if output_mode == "iotdb": + iotdb_vss_name_ = ['`{}`'.format(vss_name_)] + session.insert_str_record(device_id_, ts_, iotdb_vss_name_, vss_value_) + print(f"Written to IoTDB: {signal.to_json()}") + + # WebSocket sending mode + elif output_mode == "websocket": + data = { + "timestamp": ts_, + "signal_name": vss_name_, + "signal_value": vss_value_[0] + } + websocket_queue.put(data) # Place data in the queue for WebSocket + + +stopped = False # Global flag to signal shutdown + +def run_subscribe_sample(url: str, signals: list[str], secret: Optional[str], output_mode: str, element_id: Optional[str]): + global stopped + + client = Client(client_id="Sample client") + client.connect(url=url, api_key=secret) + + if output_mode == "websocket" and not element_id: + raise ValueError("--id parameter is required when output_mode is 'websocket'.") + + if output_mode == "iotdb": + setup_iotdb() + elif output_mode == "websocket": + start_websocket_thread(element_id) + + client.on_signals = lambda signals_in_frame: on_signals(signals_in_frame, output_mode) + + try: + def to_signal_id(signal: str): + s = signal.split(":") + if len(s) != 2: + print("--signals must be in format namespace:signal_name") + exit(1) + return SignalIdentifier(s[1], s[0]) + + subscription = client.subscribe( + signals_to_subscribe_to=list(map(to_signal_id, signals)), + changed_values_only=False, + ) + except BrokerException as e: + print(e) + stop_websocket_thread() + close_iotdb() + sys.exit(1) # Ensure exit after cleanup + except Exception as e: + print(e) + stop_websocket_thread() + close_iotdb() + sys.exit(1) # Ensure exit after cleanup + + try: + print("Broker connection and subscription setup completed, waiting for signals...") + while not stopped: # Exit loop when stopped is set + time.sleep(1) + except KeyboardInterrupt: + print("Keyboard interrupt received, closing") + stop_websocket_thread() + close_iotdb() + sys.exit(0) + + +def main(): + parser = argparse.ArgumentParser(description="Provide address to RemotiveBroker") + + parser.add_argument( + "-u", + "--url", + help="URL of the RemotiveBroker", + type=str, + required=False, + default="http://127.0.0.1:50051", + ) + + parser.add_argument( + "-x", + "--x_api_key", + help="API key is required when accessing brokers running in the cloud", + type=str, + required=False, + default=None, + ) + + parser.add_argument( + "-t", + "--access_token", + help="Personal or service-account access token", + type=str, + required=False, + default=None, + ) + + parser.add_argument( + "-s", "--signals", help="Signal to subscribe to", required=True, nargs="*" + ) + + parser.add_argument( + "-o", "--output_mode", + help="Output mode: 'iotdb' to write to IoTDB, 'websocket' to send data to WebSocket", + choices=["iotdb", "websocket"], + required=True + ) + + parser.add_argument( + "-i", "--id", + help="Element ID to include in WebSocket data (required for WebSocket mode)", + type=str, + required=False + ) + + try: + args = parser.parse_args() + except Exception as e: + return print("Error specifying signals to use:", e) + + if len(args.signals) == 0: + print("You must subscribe to at least one signal with --signals namespace:somesignal") + exit(1) + + secret = args.x_api_key if args.x_api_key is not None else args.access_token + run_subscribe_sample(args.url, args.signals, secret, args.output_mode, args.id) + + +if __name__ == "__main__": + main()