Hi Poshitha,
You can use following methods to get Carbon Home and etc directory.
CarbonUtils.getCarbonHome()
CarbonUtils.getEtcCarbonConfigDirPath()
Thanks,
Bhathiya
On Fri, Oct 10, 2014 at 9:29 AM, Prabath Abeysekara <
[email protected]> wrote:
> In
> components/hdfs/org.wso2.carbon.hdfs.datanode/src/main/java/org/wso2/carbon/hdfs/datanode/HDFSDataNode.java:
>
> > public HDFSDataNode() {
> > - log.info("HDFS: Entered Data Node ");
> > -
> > -
> > - Configuration configuration = new Configuration(false);
> > - String carbonHome =
> > System.getProperty(ServerConstants.CARBON_HOME);
> > - //String hadoopConf = carbonHome + File.separator + "repository" +
> > File.separator +
> > - // "conf" + File.separator + "etc" +
> > File.separator + "hadoop";
> > + configuration = new HdfsConfiguration(false);
> > + String carbonHome =
> > System.getProperty(ServerConstants.CARBON_HOME);
> > String hadoopCoreSiteConf = carbonHome + File.separator +
> > "repository" + File.separator +
> > "conf" + File.separator + "etc" + File.separator +
> > "hadoop" + File.separator + CORE_SITE_XML;
> > String hdfsCoreSiteConf = carbonHome + File.separator +
> > "repository" + File.separator +
> > "conf" + File.separator + "etc" + File.separator +
> > "hadoop" + File.separator + HDFS_SITE_XML;
>
> Remove the initialization of variables such as carbonHome,
> hadoopCoreSiteConf, etc out of the constructor and have them initalized as
> top level public static final variables.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/wso2-dev/carbon-storage-management/pull/50/files#r18687773>
> .
>
--
*Bhathiya Jayasekara*
*Software Engineer,*
*WSO2 inc., http://wso2.com <http://wso2.com>*
*Phone: +94715478185*
*LinkedIn: http://www.linkedin.com/in/bhathiyaj
<http://www.linkedin.com/in/bhathiyaj>*
*Twitter: https://twitter.com/bhathiyax <https://twitter.com/bhathiyax>*
*Blog: http://movingaheadblog.blogspot.com
<http://movingaheadblog.blogspot.com/>*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev