-
Notifications
You must be signed in to change notification settings - Fork 3k
Core: Make metrics reporter serializable #7370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
fb3fc4a to
5830956
Compare
5830956 to
97aeb00
Compare
7ccb9d8 to
8276986
Compare
| String impl = implFromLocation(location); | ||
| FileIO io = ioInstances.get(impl); | ||
| if (io != null) { | ||
| if (io instanceof HadoopFileIO && ((HadoopFileIO) io).conf() == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this need to change IO classes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8e34d90 to
35c58f6
Compare
| import java.util.Set; | ||
| import org.apache.iceberg.relocated.com.google.common.collect.Sets; | ||
|
|
||
| public class SerializableSet<E> implements Set<E>, Serializable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the idea here is aligned with SerializableMap. We need SerializableSet in the CompositeMetricsReporter to be able to serialize it
15e0566 to
5c8199e
Compare
| } else { | ||
| assertThat(headers).containsAllEntriesOf(contextHeaders); | ||
| adaptor = | ||
| Mockito.spy( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is only wrapping the RESTCatalogAdapter in a Mockito.spy() call
5c8199e to
21a2402
Compare
| \ java.lang.String>, org.apache.iceberg.rest.RESTClient>===)" | ||
| new: "parameter void org.apache.iceberg.rest.RESTCatalog::<init>(===org.apache.iceberg.util.SerializableFunction<java.util.Map<java.lang.String,\ | ||
| \ java.lang.String>, org.apache.iceberg.rest.RESTClient>===)" | ||
| justification: "Switching to SerializableFunction" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we support both? I don't think we can make this change if it is a breaking one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we can support both because there's no place where we could just cast from Function to SerializableFunction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| this.encryption = table.encryption(); | ||
| this.locationProvider = table.locationProvider(); | ||
| this.refs = SerializableMap.copyOf(table.refs()); | ||
| this.metricsReporter = table.metricsReporter(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we expose this through BaseTable instead of the Table interface? I'm not sure that we want this in the Table interface and it would be best to avoid it.
21a2402 to
090604d
Compare
|
Closing this in favor of #8032 that doesn't require breaking changes. |

No description provided.