-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Add HDFS operation jmx stats #17078
Add HDFS operation jmx stats #17078
Conversation
362946f
to
2f5419e
Compare
@@ -27,6 +28,7 @@ | |||
implements TrinoFileSystemFactory | |||
{ | |||
private final HdfsEnvironment environment; | |||
private static final TrinoHdfsFileSystemStats STATS = new TrinoHdfsFileSystemStats(); |
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 need to make this static. It's only static for S3 because Hadoop file systems are singletons. But for this, we can have separate stats per instance.
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.
Thanks for taking a look :) Do you mean separate stats per HdfsFileSystem
instance? In this case we don't have to make TrinoHdfsFileSystemStats
singleton?
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.
Sorry, I shouldn't have said per instance. We can make TrinoHdfsFileSystemStats
injected into HdfsFileSystemFactory
and bound as a singleton, rather than making it static. This means that if we have multiple connectors, each one will have separate stats.
Take a look at how NamenodeStats
is bound and used.
plugin/trino-hive/src/main/java/io/trino/plugin/hive/fs/HiveFileIterator.java
Outdated
Show resolved
Hide resolved
2f5419e
to
5746180
Compare
236deec
to
51a923f
Compare
Force-pushed to rebase. |
51a923f
to
f8afbf7
Compare
06a0b5c
to
1dbbb94
Compare
@raunaqmorarka Can you give a review on this PR? Also can I re-run this failing task? The error does not look related. Thanks.
|
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.
Please rebase and then I'll merge this
plugin/trino-hive-hadoop2/src/test/java/io/trino/plugin/hive/s3select/S3SelectTestHelper.java
Outdated
Show resolved
Hide resolved
@@ -30,6 +32,8 @@ | |||
public void configure(Binder binder) | |||
{ | |||
binder.bind(HdfsFileSystemFactory.class).in(SINGLETON); | |||
binder.bind(TrinoHdfsFileSystemStats.class).toInstance(HdfsFileSystemFactory.getFileSystemStats()); |
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.
We can do
binder.bind(TrinoHdfsFileSystemStats.class).in(SINGLETON);
@@ -27,6 +28,7 @@ | |||
implements TrinoFileSystemFactory | |||
{ | |||
private final HdfsEnvironment environment; | |||
private static final TrinoHdfsFileSystemStats STATS = new TrinoHdfsFileSystemStats(); |
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.
Sorry, I shouldn't have said per instance. We can make TrinoHdfsFileSystemStats
injected into HdfsFileSystemFactory
and bound as a singleton, rather than making it static. This means that if we have multiple connectors, each one will have separate stats.
Take a look at how NamenodeStats
is bound and used.
@@ -125,6 +123,10 @@ public void configure(Binder binder) | |||
newExporter(binder).export(TrinoFileSystemCacheStats.class) | |||
.as(generator -> generator.generatedNameOf(io.trino.plugin.hive.fs.TrinoFileSystemCache.class)); | |||
|
|||
binder.bind(HdfsNamenodeStats.class).toInstance(HdfsFileSystemFactory.getNamenodeStats()); |
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.
We can keep this bound as a singleton, like it was before
1dbbb94
to
446cbb4
Compare
a20d756
to
220b8a3
Compare
@electrum I've rebased and bound the stats to singleton. The test failure seems unrelated and it looks like we have an open issue on this #16315 . Please take a look. Thanks.
|
220b8a3
to
af1e759
Compare
Force pushed to squash commits |
Description
HdfsFileSystem
Additional context and related issues
Release notes
(x) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
( ) Release notes are required, with the following suggested text: