On 21 Jun 2019, at 19:12, Lukasz Cwik <lc...@google.com> wrote: > This question was triggered by one issue in KinesisIO [1] where we did quite > expensive check that stream exists in Write.expand() (calling backend Kinesis > for that) and, according to issue reporter, it was called several times, > though I always believed that it should be called only once. So, that puzzled > me and I came to these questions. > > [1] https://issues.apache.org/jira/browse/BEAM-7357 > <https://issues.apache.org/jira/browse/BEAM-7357> > > Interesting, did you print a stack trace to figure out all the call site > locations? > It could be something simple where we are calling expand multiple times > needlessly and only using the result once.
No, since it was not me, who reported this, and I could not reproduce this on my side. Now I’m thinking that actual issue could be caused by two correlated things and it’s not exactly related to how many times “expand()” was called. Anyway, probably adding more details about expected “expand” behaviour into documentation would be helpful.