Hi Paul,
wouldn't it a better and may easier solution to have an arraylist for
all values of keys and just add the values to the arraylist.
Than we can have a getProperty method that return the first value in
the list and a getProperties that return an array? This could be very
similar to the ContentProperties mechanism.
I think using an array list is may easier than using properties that
are hosted in properties.
Stefan
Am 21.12.2005 um 01:36 schrieb Paul Baclace:
Stefan Groschupf wrote:
> My suggestion is that we change NutchConf is following way:
>
> resourceNames.add(resourceNames.size()-1, name); // add second to
last
> loadResource(properties, name, false);
This would make property settings in the new resource (name, in the
above)
override explicitly set() properties and the final site settings
could be overridden by a lower priority config file.
In TestNDFS, I relied on explicitly set() properties to make the
test *independent* of the conf files (even to the point of overriding
nutch-site.xml).
I recommend filing a bug and I will then submit a patch.
Details:
The problem here is that NutchConf puts all the attribute-value pairs
in a single Properties instance. It should use the existing mechanism
of Properties which can chain together as an implicit linked list
of defaults.
In the most straightforward approach, each resource should get an
instance of Properties and a separate, highest priority, Properties
instance should be used to hold explicitly set value.
In Java:
Properties props, deep, deeper, deepest;
props = new Properties(deep = new Properties(deeper = new
Properties(deepest = new Properties())));
and
NutchConf.set(a,v) would simply use props.setProperty(a,v)
loadResource(deep, "nutch-site.xml", false);
loadResource(deeper, name, false);
loadResource(deepest, "nutch-default.xml", false);
The actual implementation would need to deal with a variable number of
Properties, not just 3.
Paul
---------------------------------------------------------------
company: http://www.media-style.com
forum: http://www.text-mining.org
blog: http://www.find23.net