Uh oh!
There was an error while loading. Please reload this page.
Configurable metrics reporter by catalog properties - #6410
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
nastra
commented
Dec 20, 2022
kmozaid
commented
Dec 21, 2022
nastra
left a comment
There was a problem hiding this comment.
For testing the custom metrics reporter it would be good to add the following test to TestJdbcCatalog:
+ @Test
+ public void testCatalogWithCustomMetricsReporter() throws IOException {
+ catalog =
+ initCatalog(
+ "test_jdbc_catalog_with_custom_reporter",
+ ImmutableMap.of(
+ CatalogProperties.METRICS_REPORTER_IMPL, CustomMetricsReporter.class.getName()));
+
+ catalog.buildTable(TABLE, SCHEMA).create();
+ Table table = catalog.loadTable(TABLE);
+ table
+ .newFastAppend()
+ .appendFile(
+ DataFiles.builder(PartitionSpec.unpartitioned())
+ .withPath("/path/to/data-a.parquet")
+ .withFileSizeInBytes(10)
+ .withRecordCount(2)
+ .build())
+ .commit();
+
+ try (CloseableIterable<FileScanTask> tasks = table.newScan().planFiles()) {
+ assertThat(tasks.iterator()).hasNext();
+ }
+
+ // counter of custom metrics reporter should have been increased
+ // 1x for commit metrics / 1x for scan metrics
+ assertThat(CustomMetricsReporter.COUNTER.get()).isEqualTo(2);
+ }
+
+ public static class CustomMetricsReporter implements MetricsReporter {
+ static final AtomicInteger COUNTER = new AtomicInteger(0);
+
+ @Override
+ public void report(MetricsReport report) {
+ COUNTER.incrementAndGet();
+ }
+ }
Uh oh!
There was an error while loading. Please reload this page.
nastra
commented
Dec 21, 2022
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
kmozaid
commented
Dec 23, 2022
Can I please get another review for merge to get enabled? |
kmozaid
commented
Jan 4, 2023
@gaborkaszab Can you please get this merged? |
gaborkaszab
commented
Jan 4, 2023
The patch LGTM, however, I won't be able to merge as I'm not a committer. cc @rdblue |
Uh oh!
There was an error while loading. Please reload this page.
szehon-ho
commented
Jan 20, 2023
I think its fine with me if we can fix the failures |
kmozaid
commented
Feb 3, 2023
@gaborkaszab@szehon-ho Could you please trigger workflows? |
nastra
commented
Feb 5, 2023
@kmozaid could you rebase the PR please? |
kmozaid
commented
Feb 6, 2023
@nastra I have rebased PR. |
| } | ||
| @Override | ||
| protected Map<String, String> properties() { |
There was a problem hiding this comment.
I'm confused, because the changes in this file should be gone after a rebase
There was a problem hiding this comment.
sorry, I didn't build locally.
thanks, I agree it should be gone. Fixed it.
commented
Feb 9, 2023
Merged, thanks @kmozaid , also @nastra , @gaborkaszab , @PraveenNanda124 for reviews |
No description provided.