[
https://issues.apache.org/jira/browse/BIGTOP-952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13934033#comment-13934033
]
Konstantin Boudnik commented on BIGTOP-952:
-------------------------------------------
Ok, almost there!
- declare things like {{OOZIE_SHARE="/user/oozie/share/lib/";}} as {{def final
....}}. It is script, but why not to make the code reading an easier exercise?
;)
- still unused imports in
{noformat}
import java.io.FileReader;
...
import org.apache.hadoop.fs.permission.FsPermission;
...
import org.apache.commons.logging.Log;
{noformat}
- {{if(user != null && user.equals("HCFS_SUPER_USER"))}} can be shortened to
{{if (user?.equals("HCFS_SUPER_USER"))}}
- and I would suggest to change the iteration over the dirs to
{noformat}
def final dir = new Path(name);
if (mode == null) {
fs.mkdirs(dir);
} else {
fs.mkdirs(dir, new FsPermission((short) mode));
}
if (user != null) {
fs.setOwner(dir, user, group);
} else {
LOG.warn("No owner specified for " + name);
}
{noformat}
as you can see I am using a constant for dir instead of calling the constructor
each time (I think this was your initial intention too?) and added a pair of
'{' '}' to the else branch of the last {{if}}
- you can add {{final}} qualifier in the line 152 as well
- there's an extra empty line at 139 and 161
The rest is great! Thanks!
> init-hdfs.sh is dog slow. Let's replace it with a single VM call and better
> layout management
> ---------------------------------------------------------------------------------------------
>
> Key: BIGTOP-952
> URL: https://issues.apache.org/jira/browse/BIGTOP-952
> Project: Bigtop
> Issue Type: Improvement
> Components: Deployment
> Affects Versions: 0.5.0
> Reporter: Konstantin Boudnik
> Assignee: jay vyas
> Priority: Blocker
> Fix For: 0.8.0
>
> Attachments: BIGTOP-952-tested-refined.patch,
> BIGTOP-952-tested.patch, BIGTOP-952.8.patch, BIGTOP-952.patch,
> provision2.groovy, untar.groovy
>
>
> As has been proposed in [this
> patch|https://issues.apache.org/jira/secure/attachment/12575644/untarHdfs.groovy]
> by [~rvs] there's a very efficient way of creating layout in HDFS using a
> tarfile and Groovy script with direct call into DFS APIs.
> Let's making it happen.
--
This message was sent by Atlassian JIRA
(v6.2#6252)