@@ -64,6 +64,7 @@ export class InternalTopicClient extends AuthenticatedService<Ydb.Topic.V1.Topic
6464 // @ts -ignore
6565 public destroy ( ) ;
6666 public /*async*/ destroy ( ctx : Context ) {
67+ this . logger . trace ( '%s: InternalTopicClient.destroy()' , ctx ) ;
6768 let destroyPromise ;
6869 if ( this . allStreams . length > 0 ) {
6970 destroyPromise = new Promise ( ( resolve ) => {
@@ -78,13 +79,15 @@ export class InternalTopicClient extends AuthenticatedService<Ydb.Topic.V1.Topic
7879 }
7980
8081 public async openWriteStreamWithEvents ( ctx : Context , args : InternalWriteStreamInitArgs & Pick < Ydb . Topic . StreamWriteMessage . IInitRequest , 'messageGroupId' > ) {
82+ this . logger . trace ( '%s: InternalTopicClient.openWriteStreamWithEvents()' , ctx ) ;
8183 if ( args . producerId === undefined || args . producerId === null ) {
8284 const newGUID = uuid_v4 ( ) ;
8385 args = { ...args , producerId : newGUID , messageGroupId : newGUID }
8486 } else if ( args . messageGroupId === undefined || args . messageGroupId === null ) {
8587 args = { ...args , messageGroupId : args . producerId } ;
8688 }
87- const writerStream = new InternalTopicWriteStream ( ctx , args , this , this . logger ) ;
89+ const writerStream = new InternalTopicWriteStream ( ctx , this , this . logger ) ;
90+ await writerStream . init ( ctx , args ) ;
8891 writerStream . events . once ( 'end' , ( ) => {
8992 const index = this . allStreams . findIndex ( v => v === writerStream )
9093 if ( index >= 0 ) this . allStreams . splice ( index , 1 ) ;
@@ -95,7 +98,9 @@ export class InternalTopicClient extends AuthenticatedService<Ydb.Topic.V1.Topic
9598 }
9699
97100 public async openReadStreamWithEvents ( ctx : Context , args : InternalReadStreamInitArgs ) {
98- const readStream = new InternalTopicReadStream ( ctx , args , this , this . logger ) ;
101+ this . logger . trace ( '%s: InternalTopicClient.openReadStreamWithEvents()' , ctx ) ;
102+ const readStream = new InternalTopicReadStream ( ctx , this , this . logger ) ;
103+ await readStream . init ( ctx , args ) ;
99104 readStream . events . once ( 'end' , ( ) => {
100105 const index = this . allStreams . findIndex ( v => v === readStream )
101106 if ( index >= 0 ) this . allStreams . splice ( index , 1 ) ;
@@ -105,31 +110,38 @@ export class InternalTopicClient extends AuthenticatedService<Ydb.Topic.V1.Topic
105110 return readStream ;
106111 }
107112
108- public async commitOffset ( _ctx : Context , request : InternalCommitOffsetArgs ) {
113+ public async commitOffset ( ctx : Context , request : InternalCommitOffsetArgs ) {
114+ this . logger . trace ( '%s: InternalTopicClient.commitOffset()' , ctx ) ;
109115 return ( await this . api . commitOffset ( request ) ) as InternalCommitOffsetResult ;
110116 }
111117
112- public async updateOffsetsInTransaction ( _ctx : Context , request : InternalUpdateOffsetsInTransactionArgs ) {
118+ public async updateOffsetsInTransaction ( ctx : Context , request : InternalUpdateOffsetsInTransactionArgs ) {
119+ this . logger . trace ( '%s: InternalTopicClient.updateOffsetsInTransaction()' , ctx ) ;
113120 return ( await this . api . updateOffsetsInTransaction ( request ) ) as InternalUpdateOffsetsInTransactionResult ;
114121 }
115122
116- public async createTopic ( _ctx : Context , request : InternalCreateTopicArgs ) {
123+ public async createTopic ( ctx : Context , request : InternalCreateTopicArgs ) {
124+ this . logger . trace ( '%s: InternalTopicClient.createTopic()' , ctx ) ;
117125 return ( await this . api . createTopic ( request ) ) as InternalCreateTopicResult ;
118126 }
119127
120- public async describeTopic ( _ctx : Context , request : InternalDescribeTopicArgs ) {
128+ public async describeTopic ( ctx : Context , request : InternalDescribeTopicArgs ) {
129+ this . logger . trace ( '%s: InternalTopicClient.describeTopic()' , ctx ) ;
121130 return ( await this . api . describeTopic ( request ) ) as InternalDescribeTopicResult ;
122131 }
123132
124- public async describeConsumer ( _ctx : Context , request : InternalDescribeConsumerArgs ) {
133+ public async describeConsumer ( ctx : Context , request : InternalDescribeConsumerArgs ) {
134+ this . logger . trace ( '%s: InternalTopicClient.describeConsumer()' , ctx ) ;
125135 return ( await this . api . describeConsumer ( request ) ) as InternalDescribeConsumerResult ;
126136 }
127137
128- public async alterTopic ( _ctx : Context , request : InternalAlterTopicArgs ) {
138+ public async alterTopic ( ctx : Context , request : InternalAlterTopicArgs ) {
139+ this . logger . trace ( '%s: InternalTopicClient.alterTopic()' , ctx ) ;
129140 return ( await this . api . alterTopic ( request ) ) as InternalAlterTopicResult ;
130141 }
131142
132- public async dropTopic ( _ctx : Context , request : InternalDropTopicArgs ) {
143+ public async dropTopic ( ctx : Context , request : InternalDropTopicArgs ) {
144+ this . logger . trace ( '%s: InternalTopicClient.dropTopic()' , ctx ) ;
133145 return ( await this . api . dropTopic ( request ) ) as InternalDropTopicResult ;
134146 }
135147}
0 commit comments