[
https://issues.apache.org/jira/browse/YARN-9477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16830272#comment-16830272
]
Szilard Nemeth commented on YARN-9477:
--------------------------------------
Hi [~pbacsko]!
Some comments:
1. In UdevUtil#getSysPath: the variable sysPath is redundant, you can return it
immediately without declaring it.
2. Similarly in VEDeviceDiscoverer#getDevicesFromPath, you can return the value
at the end of the method immediately.
3. After the closing curly bracket of UdevUtil.LibUdev#init, there's an
additional semicolon, please remove it!
4. In VEDeviceDiscoverer#getDeviceState: Please use a more descriptive and
detailed error message rather than "Unknown <some_number>".
5. In VEDeviceDiscoverer: You use the String "ONLINE" both in the DEVICE_STATE
array and on its own in toDevice method. Please define a static final String
constant for this one, at least. I think the rest of the string values in
DEVICE_STATE can remain intact.
6. Could you please add some testcases for VEDeviceDiscoverer? I think you
should use a temporary directory for test files and you should test if the
devices are parsed correctly (toDevice method).
I can take another look once you fixed these above.
Thanks!
> Implement VE discovery using libudev
> ------------------------------------
>
> Key: YARN-9477
> URL: https://issues.apache.org/jira/browse/YARN-9477
> Project: Hadoop YARN
> Issue Type: Sub-task
> Reporter: Peter Bacsko
> Assignee: Peter Bacsko
> Priority: Major
> Attachments: YARN-9477-POC.patch, YARN-9477-POC2.patch
>
>
> Right now we have a Python script which is able to discover VE cards using
> pyudev: https://pyudev.readthedocs.io/en/latest/
> Java does not officially support libudev. There are some projects on Github
> (example: https://github.com/Zubnix/udev-java-bindings) but they're not
> available as Maven artifacts.
> However it's not that difficult to create a minimal layer around libudev
> using JNA. We don't have to wrap every function, we need to call 4-5 methods.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]