[ https://issues.apache.org/jira/browse/YARN-9269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16762946#comment-16762946
]
Peter Bacsko commented on YARN-9269:
------------------------------------
Thanks [~adam.antal] for the comments.
1. {{allowedFpgas}} is populated only once and never modified again. It's called from the
{{bootstrap()}} method when the NM starts up. So I add the elements to a local list then
wrap it in an immutable list.
2. Yeah but that technically cannot happen. Also, we no longer retrieve the device object
from a list - we have it already as a method argument. Anyway I'll have to double check that
this is still OK (I haven't tested any modifications on a cluster yet).
3. Unused stuff in FpgaDevice: yeah, there's a separate Jira for that: YARN-9268. We store
stuff which is unnecessary. Only aliasDevName, minor and major are important.
4. Ok, I will do the rename + remove the extra spaces.
> Minor cleanup in FpgaResourceAllocator
> --------------------------------------
>
> Key: YARN-9269
> URL: https://issues.apache.org/jira/browse/YARN-9269
> Project: Hadoop YARN
> Issue Type: Sub-task
> Reporter: Peter Bacsko
> Assignee: Peter Bacsko
> Priority: Major
> Attachments: YARN-9269-001.patch, YARN-9269-002.patch
>
>
> Some stuff that we observed:
> * {{addFpga()}} - we check for duplicate devices, but we don't print any error/warning
if there's any.
> * {{findMatchedFpga()}} should be called {{findMatchingFpga()}}. Also, is this method
even needed? We already receive an {{FpgaDevice}} instance in {{updateFpga()}} which I believe
is the same that we're looking up.
> * variable {{IPIDpreference}} is confusing
> * {{availableFpga}} / {{usedFpgaByRequestor}} are instances of {{LinkedHashMap}}. What's
the rationale behind this? Doesn't a simple {{HashMap}} suffice?
> * {{usedFpgaByRequestor}} should be renamed, naming is a bit unclear
> * {{allowedFpgas}} should be an immutable list
> * {{@VisibleForTesting}} methods should be package private
> * get rid of {{*}} imports
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-issues-help@hadoop.apache.org
|