Skip to content

Commit c5d243b

Browse files
committed
refactor(odps/tunnel/record_pack_stream_writer): Make Reset Function Public
1 parent 1b15f45 commit c5d243b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

odps/tunnel/record_pack_stream_writer.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func newRecordStreamHttpWriter(session *StreamUploadSession) RecordPackStreamWri
4949

5050
func (rsw *RecordPackStreamWriter) Append(record data.Record) error {
5151
if rsw.flushing {
52-
rsw.appendErr = errors.New("There's an unsuccessful flush called, you should call flush to retry or call reset to drop the data")
52+
rsw.appendErr = errors.New("There's an unsuccessful flush called, you should call flush to retry or call Reset to drop the data")
5353
return rsw.appendErr
5454
}
5555
if !rsw.session.allowSchemaMismatch {
@@ -88,7 +88,7 @@ func checkIfRecordSchemaMatchSessionSchema(record *data.Record, schema []tablesc
8888
// `recordCount` and `recordBytes` is the count and bytes count of the records uploaded
8989
func (rsw *RecordPackStreamWriter) Flush(timeout_ ...time.Duration) (string, int64, int64, error) {
9090
if rsw.appendErr != nil {
91-
return "", 0, 0, errors.New("There's an unsuccessful append called before, you should call reset to drop the data and re-append the data.")
91+
return "", 0, 0, errors.New("There's an unsuccessful append called before, you should call Reset to drop the data and re-append the data.")
9292
}
9393

9494
timeout := time.Duration(0)
@@ -117,7 +117,7 @@ func (rsw *RecordPackStreamWriter) Flush(timeout_ ...time.Duration) (string, int
117117

118118
recordCount := rsw.recordCount
119119
rsw.flushing = false
120-
rsw.reset()
120+
rsw.Reset()
121121

122122
return reqId, recordCount, int64(bytesSend), nil
123123
}
@@ -132,7 +132,7 @@ func (rsw *RecordPackStreamWriter) DataSize() int64 {
132132
return int64(rsw.buffer.Len())
133133
}
134134

135-
func (rsw *RecordPackStreamWriter) reset() {
135+
func (rsw *RecordPackStreamWriter) Reset() {
136136
rsw.buffer.Reset()
137137
rsw.protocWriter = newRecordProtocWriter(&bufWriter{rsw.buffer}, rsw.session.schema.Columns, false)
138138
rsw.recordCount = 0

0 commit comments

Comments
 (0)