client

package module
v0.0.0-...-bbd73f3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

README

To use go client, add "import github.com/yanhongwangg/incubator-iotdb/client-go"

Requirement

  • GoLang 1.14+

Getting started

*Create project eg:session

*Enter project directory eg:cd session

*Download dependency : go get github.com/yanhongwangg/incubator-iotdb@client-go

*eg:https://github.com/yanhongwangg/incubator-iotdb/blob/client-go/client-go/src/main/client/example/session_example.go

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

View Source
const (
	DefaultUser            = "root"
	DefaultPasswd          = "root"
	DefaultZoneId          = "Asia/Shanghai"
	DefaultFetchSize int32 = 10000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

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 (s *Session) CheckTimeseriesExists(path string) bool

func (*Session) Close

func (s *Session) Close()

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

func (s *Session) CreateTimeseries(path string, dataType int32, encoding int32, compressor int32)

*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

func (s *Session) DeleteData(paths []string, startTime int64, endTime int64)

*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

func (s *Session) DeleteStorageGroup(storageGroupId string)

*delete one storage group * *param *storageGroupId: string, storage group name (starts from root) *

func (*Session) DeleteStorageGroups

func (s *Session) DeleteStorageGroups(storageGroupIds []string)

*delete multiple storage group * *param *storageGroupIds: []string, paths of the target storage groups *

func (*Session) DeleteTimeseries

func (s *Session) DeleteTimeseries(paths []string)

*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 (s *Session) ExecuteBatchStatement(inserts []string)

func (*Session) ExecuteQueryStatement

func (s *Session) ExecuteQueryStatement(sql string) *utils.SessionDataSet

func (*Session) ExecuteRawDataQuery

func (s *Session) ExecuteRawDataQuery(paths []string, startTime int64, endTime int64) *utils.SessionDataSet

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 (s *Session) GetTimeZone() string

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

func (s *Session) InsertTablet(tablet utils.Tablet)

*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

func (s *Session) InsertTablets(tablets []utils.Tablet)

*insert multiple tablets, tablets are independent to each other * *params *tablets: []utils.Tablet, list of tablets *

func (*Session) Open

func (s *Session) Open(enableRPCCompression bool, connectionTimeoutInMs int)

func (*Session) SetStorageGroup

func (s *Session) SetStorageGroup(storageGroupId string)

*set one storage group * *param *storageGroupId: string, storage group name (starts from root) *

func (*Session) SetTimeZone

func (s *Session) SetTimeZone(timeZone string)

func (*Session) TestInsertRecord

func (s *Session) TestInsertRecord(deviceId string, measurements []string, dataTypes []int32, values []interface{},
	timestamp int64)

func (*Session) TestInsertRecords

func (s *Session) TestInsertRecords(deviceIds []string, measurements [][]string, dataTypes [][]int32, values [][]interface{},
	timestamps []int64)

func (*Session) TestInsertStringRecord

func (s *Session) TestInsertStringRecord(deviceId string, measurements []string, values []string, timestamp int64)

func (*Session) TestInsertStringRecords

func (s *Session) TestInsertStringRecords(deviceIds []string, measurements [][]string, values [][]string,
	timestamps []int64)

func (*Session) TestInsertTablet

func (s *Session) TestInsertTablet(tablet utils.Tablet)

func (*Session) TestInsertTablets

func (s *Session) TestInsertTablets(tablets []utils.Tablet)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL