You are viewing a plain text version of this content. The canonical link for it is here.
Posted to submarine-dev@hadoop.apache.org by "Peter Bacsko (JIRA)" <ji...@apache.org> on 2019/05/15 14:30:00 UTC

[jira] [Comment Edited] (SUBMARINE-67) Add tests to Localizer class

    [ https://issues.apache.org/jira/browse/SUBMARINE-67?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16840466#comment-16840466 ] 

Peter Bacsko edited comment on SUBMARINE-67 at 5/15/19 2:29 PM:
----------------------------------------------------------------

[~snemeth] some minor comments:
 # Variable name: {{for (Localization loc : localizations)}} --> I'd rename "loc" to "localization"
 # Similarly, {{locState}} --> {{localizationState}}
 # {{determineSourceFile(LocalizationState locState)}}: {{locState}} --> {{localizationState}}
 # {{srcFileStr}} --> {{sourceFile}}
 # Simplification #1:
{code:java}
private boolean determineNeedHdfs(boolean remote) {
   return remote ? needHdfs(remoteUri) : false;
}{code}
# Simplification #2:
{code:java}
private LocalizationType determineLocalizationType(boolean directory, boolean remote) {
  if (directory) {
    return remote ? LocalizationType.REMOTE_DIRECTORY : LocalizationType.LOCAL_DIRECTORY;
  } else {
    return remote ? LocalizationType.REMOTE_FILE : LocalizationType.LOCAL_FILE;
  }
}
{code}


was (Author: pbacsko):
[~snemeth] some minor comments:
 # Variable name: {{for (Localization loc : localizations)}} --> I'd rename "loc" to "localization"
 # Similarly, {{locState}} --> {{localizationState}}
 # {{determineSourceFile(LocalizationState locState)}}: {{locState}} --> {{localizationState}}
 # {{srcFileStr}} --> {{sourceFile}}
 # Simplification #1:

{code:java}
private boolean determineNeedHdfs(boolean remote) {
   return remote ? needHdfs(remoteUri) : false;
}{code}

 # Simplification #2:

{code:java}
private LocalizationType determineLocalizationType(boolean directory, boolean remote) {
  if (directory) {
    return remote ? LocalizationType.REMOTE_DIRECTORY : LocalizationType.LOCAL_DIRECTORY;
  } else {
    return remote ? LocalizationType.REMOTE_FILE : LocalizationType.LOCAL_FILE;
  }
}{code}

> Add tests to Localizer class
> ----------------------------
>
>                 Key: SUBMARINE-67
>                 URL: https://issues.apache.org/jira/browse/SUBMARINE-67
>             Project: Hadoop Submarine
>          Issue Type: Improvement
>            Reporter: Szilard Nemeth
>            Assignee: Szilard Nemeth
>            Priority: Minor
>         Attachments: SUBMARINE-67.001.patch
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)