This is an automated email from the ASF dual-hosted git repository.

haonan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iotdb-client-go.git


The following commit(s) were added to refs/heads/main by this push:
     new a05323c  [IOTDB-5001] updated TSStatusCode, fix Go client CI fail (#63)
a05323c is described below

commit a05323c73a3d615efde25d4d3287fcee32ec1292
Author: 橘子 <[email protected]>
AuthorDate: Sun Nov 20 20:54:06 2022 -0800

    [IOTDB-5001] updated TSStatusCode, fix Go client CI fail (#63)
---
 client/protocol.go   | 191 +++++++++++++++++++++++++++++++++------------------
 client/utils.go      |   4 +-
 client/utils_test.go |  12 ++--
 3 files changed, 134 insertions(+), 73 deletions(-)

diff --git a/client/protocol.go b/client/protocol.go
index 4588c1e..9781e8b 100644
--- a/client/protocol.go
+++ b/client/protocol.go
@@ -60,69 +60,130 @@ const (
 
 //TSStatusCode
 const (
-       SuccessStatus        int32 = 200
-       StillExecutingStatus int32 = 201
-       InvalidHandleStatus  int32 = 202
-       IncompatibleVersion  int32 = 203
-
-       NodeDeleteFailedError                  int32 = 298
-       AliasAlreadyExistError                 int32 = 299
-       PathAlreadyExistError                  int32 = 300
-       PathNotExistError                      int32 = 301
-       UnsupportedFetchMetadataOperationError int32 = 302
-       MetadataError                          int32 = 303
-       TimeseriesNotExist                     int32 = 304
-       OutOfTTLError                          int32 = 305
-       ConfigAdjuster                         int32 = 306
-       MergeError                             int32 = 307
-       SystemCheckError                       int32 = 308
-       SyncDeviceOwnerConflictError           int32 = 309
-       SyncConnectionException                int32 = 310
-       StorageGroupProcessorError             int32 = 311
-       StorageGroupError                      int32 = 312
-       StorageEngineError                     int32 = 313
-       TsfileProcessorError                   int32 = 314
-       PathIllegal                            int32 = 315
-       LoadFileError                          int32 = 316
-       StorageGroupNotReady                   int32 = 317
-
-       ExecuteStatementError    int32 = 400
-       SQLParseError            int32 = 401
-       GenerateTimeZoneError    int32 = 402
-       SetTimeZoneError         int32 = 403
-       NotStorageGroupError     int32 = 404
-       QueryNotAllowed          int32 = 405
-       AstFormatError           int32 = 406
-       LogicalOperatorError     int32 = 407
-       LogicalOptimizeError     int32 = 408
-       UnsupportedFillTypeError int32 = 409
-       PathErroRint32           int32 = 410
-       QueryProcessError        int32 = 411
-       WriteProcessError        int32 = 412
-       WriteProcessReject       int32 = 413
-
-       UnsupportedIndexFuncError int32 = 421
-       UnsupportedIndexTypeError int32 = 422
-
-       InternalServerError        int32 = 500
-       CloseOperationError        int32 = 501
-       ReadOnlySystemError        int32 = 502
-       DiskSpaceInsufficientError int32 = 503
-       StartUpError               int32 = 504
-       ShutDownError              int32 = 505
-       MultipleError              int32 = 506
-
-       WrongLoginPasswordError int32 = 600
-       NotLoginError           int32 = 601
-       NoPermissionError       int32 = 602
-       UninitializedAuthError  int32 = 603
-
-       PartitionNotReady    int32 = 700
-       TimeOut              int32 = 701
-       NoLeader             int32 = 702
-       UnsupportedOperation int32 = 703
-       NodeReadOnly         int32 = 704
-       ConsistencyFailure   int32 = 705
-       NoConnection         int32 = 706
-       NeedRedirection      int32 = 707
+       SuccessStatus       int32 = 200
+       IncompatibleVersion int32 = 201
+       ConfigurationError  int32 = 202
+       StartUpError        int32 = 203
+       ShutDownError       int32 = 204
+
+       UnsupportedOperation    int32 = 300
+       ExecuteStatementError   int32 = 301
+       MultipleError           int32 = 302
+       IllegalParameter        int32 = 303
+       OverlapWithExistingTask int32 = 304
+       InternalServerError     int32 = 305
+
+       RedirectionRecommend int32 = 400
+
+       DatabaseNotExist        int32 = 500
+       DatabaseAlreadyExists   int32 = 501
+       SeriesOverflow          int32 = 502
+       TimeseriesAlreadyExist  int32 = 503
+       TimeseriesInBlackList   int32 = 504
+       AliasAlreadyExist       int32 = 505
+       PathAlreadyExist        int32 = 506
+       MetadataError           int32 = 507
+       PathNotExist            int32 = 508
+       IllegalPath             int32 = 509
+       CreateTemplateError     int32 = 510
+       DuplicatedTemplate      int32 = 511
+       UndefinedTemplate       int32 = 512
+       TemplateNotSet          int32 = 513
+       DifferentTemplate       int32 = 514
+       TemplateIsInUse         int32 = 515
+       TemplateIncompatible    int32 = 516
+       SegmentNotFound         int32 = 517
+       PageOutOfSpace          int32 = 518
+       RecordDuplicated        int32 = 519
+       SegmentOutOfSpace       int32 = 520
+       SchemaFileNotExists     int32 = 521
+       OversizeRecord          int32 = 522
+       SchemaFileRedoLogBroken int32 = 523
+       TemplateNotActivated    int32 = 524
+
+       SystemReadOnly         int32 = 600
+       StorageEngineError     int32 = 601
+       StorageEngineNotReady  int32 = 602
+       DataregionProcessError int32 = 603
+       TsfileProcessorError   int32 = 604
+       WriteProcessError      int32 = 605
+       WriteProcessReject     int32 = 606
+       OutOfTtl               int32 = 607
+       CompactionError        int32 = 608
+       AlignedTimeseriesError int32 = 609
+       WalError               int32 = 610
+       DiskSpaceInsufficient  int32 = 611
+
+       SqlParseError             int32 = 700
+       SemanticError             int32 = 701
+       GenerateTimeZoneError     int32 = 702
+       SetTimeZoneError          int32 = 703
+       QueryNotAllowed           int32 = 704
+       LogicalOperatorError      int32 = 705
+       LogicalOptimizeError      int32 = 706
+       UnsupportedFillType       int32 = 707
+       QueryProcessError         int32 = 708
+       MppMemoryNotEnough        int32 = 709
+       CloseOperationError       int32 = 710
+       TsblockSerializeError     int32 = 711
+       InternalRequestTimeOut    int32 = 712
+       InternalRequestRetryError int32 = 713
+
+       AuthenticationError       int32 = 800
+       WrongLoginPassword        int32 = 801
+       NotLogin                  int32 = 802
+       NoPermission              int32 = 803
+       UninitializedAuthError    int32 = 804
+       UserNotExist              int32 = 805
+       RoleNotExist              int32 = 806
+       ClearPermissionCacheError int32 = 807
+
+       MigrateRegionError        int32 = 900
+       CreateRegionError         int32 = 901
+       DeleteRegionError         int32 = 902
+       PartitionCacheUpdateError int32 = 903
+       ConsensusNotInitialized   int32 = 904
+       RegionLeaderChangeError   int32 = 905
+       NoAvailableRegionGroup    int32 = 906
+
+       DatanodeAlreadyRegistered int32 = 1000
+       NoEnoughDatanode          int32 = 1001
+       AddConfignodeError        int32 = 1002
+       RemoveConfignodeError     int32 = 1003
+       DatanodeNotExist          int32 = 1004
+       DatanodeStopError         int32 = 1005
+       RemoveDatanodeError       int32 = 1006
+       RegisterRemovedDatanode   int32 = 1007
+       CanNotConnectDatanode     int32 = 1008
+
+       LoadFileError                 int32 = 1100
+       LoadPieceOfTsfileError        int32 = 1101
+       DeserializePieceOfTsfileError int32 = 1102
+       SyncConnectionError           int32 = 1103
+       SyncFileRedirectionError      int32 = 1104
+       SyncFileError                 int32 = 1105
+       CreatePipeSinkError           int32 = 1106
+       PipeError                     int32 = 1107
+       PipeserverError               int32 = 1108
+       VerifyMetadataError           int32 = 1109
+
+       UdfLoadClassError        int32 = 1200
+       UdfDownloadError         int32 = 1201
+       CreateUdfOnDatanodeError int32 = 1202
+       DropUdfOnDatanodeError   int32 = 1203
+
+       CreateTriggerError         int32 = 1300
+       DropTriggerError           int32 = 1301
+       TriggerFireError           int32 = 1302
+       TriggerLoadClassError      int32 = 1303
+       TriggerDownloadError       int32 = 1304
+       CreateTriggerInstanceError int32 = 1305
+       ActiveTriggerInstanceError int32 = 1306
+       DropTriggerInstanceError   int32 = 1307
+       UpdateTriggerLocationError int32 = 1308
+
+       NoSuchCq                  int32 = 1400
+       CqAlreadyActive           int32 = 1401
+       CqAlreadyExist            int32 = 1402
+       CqUpdateLastExecTimeError int32 = 1403
 )
diff --git a/client/utils.go b/client/utils.go
index 24367cf..15354e1 100644
--- a/client/utils.go
+++ b/client/utils.go
@@ -73,7 +73,7 @@ func bytesToInt64(bys []byte) int64 {
 func verifySuccesses(statuses []*rpc.TSStatus) error {
        buff := bytes.Buffer{}
        for _, status := range statuses {
-               if status.Code != SuccessStatus && status.Code != 
NeedRedirection {
+               if status.Code != SuccessStatus && status.Code != 
RedirectionRecommend {
                        buff.WriteString(*status.Message + ";")
                }
        }
@@ -85,7 +85,7 @@ func verifySuccesses(statuses []*rpc.TSStatus) error {
 }
 
 func VerifySuccess(status *rpc.TSStatus) error {
-       if status.Code == NeedRedirection {
+       if status.Code == RedirectionRecommend {
                return nil
        }
 
diff --git a/client/utils_test.go b/client/utils_test.go
index 9727ac5..3554b8d 100644
--- a/client/utils_test.go
+++ b/client/utils_test.go
@@ -192,10 +192,10 @@ func Test_verifySuccess(t *testing.T) {
                wantErr bool
        }{
                {
-                       name: "NeedRedirection",
+                       name: "RedirectionRecommend",
                        args: args{
                                status: &rpc.TSStatus{
-                                       Code:      NeedRedirection,
+                                       Code:      RedirectionRecommend,
                                        Message:   &errMsg,
                                        SubStatus: []*rpc.TSStatus{},
                                },
@@ -253,7 +253,7 @@ func Test_verifySuccesses(t *testing.T) {
        }
        var internalServerError string = "InternalServerError"
        var success string = "Success"
-       var needRedirection string = "NeedRedirection"
+       var redirectionRecommend string = "RedirectionRecommend"
        tests := []struct {
                name    string
                args    args
@@ -285,12 +285,12 @@ func Test_verifySuccesses(t *testing.T) {
                        wantErr: false,
                },
                {
-                       name: "NeedRedirection",
+                       name: "RedirectionRecommend",
                        args: args{
                                statuses: []*rpc.TSStatus{
                                        &rpc.TSStatus{
-                                               Code:      NeedRedirection,
-                                               Message:   &needRedirection,
+                                               Code:      RedirectionRecommend,
+                                               Message:   
&redirectionRecommend,
                                                SubStatus: []*rpc.TSStatus{},
                                        },
                                },

Reply via email to