Documentation ¶
Overview ¶
*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
Index ¶
- Constants
- type Conn
- type DialOption
- type FuncOption
- type Session
- func (s *Session) CheckTimeseriesExists(path string) bool
- func (s *Session) Close()
- func (s *Session) CreateMultiTimeseries(paths []string, dataTypes []int32, encodings []int32, compressors []int32)
- func (s *Session) CreateTimeseries(path string, dataType int32, encoding int32, compressor int32)
- func (s *Session) DeleteData(paths []string, startTime int64, endTime int64)
- func (s *Session) DeleteStorageGroup(storageGroupId string)
- func (s *Session) DeleteStorageGroups(storageGroupIds []string)
- func (s *Session) DeleteTimeseries(paths []string)
- func (s *Session) ExecuteBatchStatement(inserts []string)
- func (s *Session) ExecuteQueryStatement(sql string) *utils.SessionDataSet
- func (s *Session) ExecuteRawDataQuery(paths []string, startTime int64, endTime int64) *utils.SessionDataSet
- func (s *Session) ExecuteStatement(sql string) *utils.SessionDataSet
- func (s *Session) ExecuteUpdateStatement(sql string) *utils.SessionDataSet
- func (s *Session) GetTimeZone() string
- func (s *Session) InsertRecord(deviceId string, measurements []string, dataTypes []int32, ...)
- func (s *Session) InsertRecords(deviceIds []string, measurements [][]string, dataTypes [][]int32, ...)
- func (s *Session) InsertStringRecord(deviceId string, measurements []string, values []string, timestamp int64)
- func (s *Session) InsertStringRecords(deviceIds []string, measurements [][]string, values [][]string, ...)
- func (s *Session) InsertTablet(tablet utils.Tablet)
- func (s *Session) InsertTablets(tablets []utils.Tablet)
- func (s *Session) Open(enableRPCCompression bool, connectionTimeoutInMs int)
- func (s *Session) SetStorageGroup(storageGroupId string)
- func (s *Session) SetTimeZone(timeZone string)
- func (s *Session) TestInsertRecord(deviceId string, measurements []string, dataTypes []int32, ...)
- func (s *Session) TestInsertRecords(deviceIds []string, measurements [][]string, dataTypes [][]int32, ...)
- func (s *Session) TestInsertStringRecord(deviceId string, measurements []string, values []string, timestamp int64)
- func (s *Session) TestInsertStringRecords(deviceIds []string, measurements [][]string, values [][]string, ...)
- func (s *Session) TestInsertTablet(tablet utils.Tablet)
- func (s *Session) TestInsertTablets(tablets []utils.Tablet)
Constants ¶
const ( DefaultUser = "root" DefaultPasswd = "root" DefaultZoneId = "Asia/Shanghai" DefaultFetchSize int32 = 10000 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DialOption ¶
type DialOption interface {
// contains filtered or unexported methods
}
type FuncOption ¶
type FuncOption struct {
// contains filtered or unexported fields
}
type Session ¶
type Session struct { Host string Port string User string Passwd string FetchSize int32 ZoneId string // contains filtered or unexported fields }
func NewSession ¶
func NewSession(host string, port string, opts ...DialOption) Session
func (*Session) CheckTimeseriesExists ¶
func (*Session) CreateMultiTimeseries ¶
func (s *Session) CreateMultiTimeseries(paths []string, dataTypes []int32, encodings []int32, compressors []int32)
*create multiple time series * *params *paths: []string, complete time series paths (starts from root) *dataTypes: []int32, data types for time series *encodings: []int32, encodings for time series *compressors: []int32, compressing types for time series *
func (*Session) CreateTimeseries ¶
*create single time series * *params *path: string, complete time series path (starts from root) *dataType: int32, data type for this time series *encoding: int32, data type for this time series *compressor: int32, compressing type for this time series *
func (*Session) DeleteData ¶
*delete all startTime <= data <= endTime in multiple time series * *params *paths: []string, time series array that the data in *startTime: int64, start time of deletion range *endTime: int64, end time of deletion range *
func (*Session) DeleteStorageGroup ¶
*delete one storage group * *param *storageGroupId: string, storage group name (starts from root) *
func (*Session) DeleteStorageGroups ¶
*delete multiple storage group * *param *storageGroupIds: []string, paths of the target storage groups *
func (*Session) DeleteTimeseries ¶
*delete multiple time series, including data and schema * *params *paths: []string, time series paths, which should be complete (starts from root) *
func (*Session) ExecuteBatchStatement ¶
func (*Session) ExecuteQueryStatement ¶
func (s *Session) ExecuteQueryStatement(sql string) *utils.SessionDataSet
func (*Session) ExecuteRawDataQuery ¶
func (*Session) ExecuteStatement ¶
func (s *Session) ExecuteStatement(sql string) *utils.SessionDataSet
func (*Session) ExecuteUpdateStatement ¶
func (s *Session) ExecuteUpdateStatement(sql string) *utils.SessionDataSet
func (*Session) GetTimeZone ¶
func (*Session) InsertRecord ¶
func (s *Session) InsertRecord(deviceId string, measurements []string, dataTypes []int32, values []interface{}, timestamp int64)
*insert one row of record into database, if you want improve your performance, please use insertTablet method * *params *deviceId: string, time series path for device *measurements: []string, sensor names *dataTypes: []int32, list of dataType, indicate the data type for each sensor *values: []interface{}, values to be inserted, for each sensor *timestamp: int64, indicate the timestamp of the row of data *
func (*Session) InsertRecords ¶
func (s *Session) InsertRecords(deviceIds []string, measurements [][]string, dataTypes [][]int32, values [][]interface{}, timestamps []int64)
*insert multiple rows of data, records are independent to each other, in other words, there's no relationship *between those records * *params *deviceIds: []string, time series paths for device *measurements: [][]string, each element of outer list indicates measurements of a device *dataTypes: [][]int32, each element of outer list indicates sensor data types of a device *values: [][]interface{}, values to be inserted, for each device *timestamps: []int64, timestamps for records *
func (*Session) InsertStringRecord ¶
func (s *Session) InsertStringRecord(deviceId string, measurements []string, values []string, timestamp int64)
*special case for inserting one row of String (TEXT) value * *params *deviceId: string, time series path for device *measurements: []string, sensor names *values: []string, values to be inserted, for each sensor *timestamp: int64, indicate the timestamp of the row of data *
func (*Session) InsertStringRecords ¶
func (s *Session) InsertStringRecords(deviceIds []string, measurements [][]string, values [][]string, timestamps []int64)
*special case for inserting multiple rows of String (TEXT) value * *params *deviceIds: []string, time series paths for device *measurements: [][]string, each element of outer list indicates measurements of a device *values: [][]interface{}, values to be inserted, for each device *timestamps: []int64, timestamps for records *
func (*Session) InsertTablet ¶
*insert one tablet, in a tablet, for each timestamp, the number of measurements is same * *params *tablet: utils.Tablet, a tablet specified above *
func (*Session) InsertTablets ¶
*insert multiple tablets, tablets are independent to each other * *params *tablets: []utils.Tablet, list of tablets *
func (*Session) SetStorageGroup ¶
*set one storage group * *param *storageGroupId: string, storage group name (starts from root) *