You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownewIllegalStateException("Object builders can only be used once");
}
java.lang.IllegalStateException: Object builders can only be used once
Users can use external retry logic with query builder like above.
But we can't re-use the same query builder on open search so IllegalStateException exception thrown.
I think builder.copy() is usually supported on many other db-client library so it's okay to add it on openserach java client too. and I think many opensearch user need this feature.
I'm contributor on other opensource so I can make PR so PTAL 🙇
Thanks for bringing this up. It should be relatively easy to implement on the generated code. Some things to consider:
Would you expect this to be a surface-level copy or a clone/deep-copy? Lists & Maps would need to be properly copied as we append to them in builders. But what do we do with nested objects.
Which use-cases require the builder implementing copy versus just re-using the built object from the builder?
Is your feature request related to a problem?
opensearch-java/java-client/src/main/java/org/opensearch/client/util/ObjectBuilderBase.java
Lines 46 to 49 in dbd93c1
Users can use external retry logic with query builder like above.
But we can't re-use the same query builder on open search so
IllegalStateException
exception thrown.What solution would you like?
If we can use
queryBudiler.copy()
, it's really useful for several cases!The text was updated successfully, but these errors were encountered: