The Gluster Blog

Gluster blog stories provide high-level spotlights on our users all over the world

Customizing the Hadoop Configuration implementation (outside of the cluster)

Gluster
2013-06-30

Dev Code that uses that hadoop needs to be customized. 

If you have control over your dev tests, you can simply use

Configuration.addDefaultResource(“/path/to/core-site.xml”);

This will load the conf file after loading other default resources.

In general, you can expect it to work.

But you might find the need to ensure the right core-site.xml is used *without* writing any java code.

Here’s how to load hadoop Configurations into maven and/or eclipse (yeah, admittedly, this is really just a matter of making sure core-site.xml is on the classpath, so astute eclipse/maven users shouldn’t really need manual instructions here…).

Custom Configuration classes in the eclipse runtime:


Unit tests in eclipse add files to the classpath through the snazzy eclipse ui.

Add the folder containing your core-site.xml to the “source folders on build path”.

Build Path -> Source -> select folder containing core-site.xml.


Custom Configuration classes in your maven builds:

Copy your core-site.xml into the resources/ folder.  This will induce it to be included in tests.  For specifics on how the resources/ directory works, see: http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html.

BLOG

  • 06 Dec 2020
    Looking back at 2020 – with g...

    2020 has not been a year we would have been able to predict. With a worldwide pandemic and lives thrown out of gear, as we head into 2021, we are thankful that our community and project continued to receive new developers, users and make small gains. For that and a...

    Read more
  • 27 Apr 2020
    Update from the team

    It has been a while since we provided an update to the Gluster community. Across the world various nations, states and localities have put together sets of guidelines around shelter-in-place and quarantine. We request our community members to stay safe, to care for their loved ones, to continue to be...

    Read more
  • 03 Feb 2020
    Building a longer term focus for Gl...

    The initial rounds of conversation around the planning of content for release 8 has helped the project identify one key thing – the need to stagger out features and enhancements over multiple releases. Thus, while release 8 is unlikely to be feature heavy as previous releases, it will be the...

    Read more