Hi Talat,
On Sun, Nov 3, 2013 at 5:13 PM, <dev-digest-h...@nutch.apache.org> wrote: > > Why is createWebStore not generic ? > 24736 by: Talat UYARER > > Hi All, > > I need create a table in plugins I don't understand this/I am not familiar with this. You mean you are building a table based on the plugins you use? Can you please elaborate. > But I dont create that because of this code: > > if (WebPage.class.equals(persistentClass)) { > schema = conf.get("storage.schema.webpage", "webpage"); > } else if (Host.class.equals(persistentClass)) { > schema = conf.get("storage.schema.host", "host"); > } else { > throw new UnsupportedOperationException("Unable to create store for > class " + persistentClass); > } > The code you've posted reflects the fact that Nutch 2.x can currently build a Web table and Host table. THIS IS ALL. Depending on which Nutch tools you use e.g. inject, updatedb, readdb or hostinject, updatehostdb and readhostdb and subsequently which persistent class WebPage [0] or Host [1] will be used respectively determines which persistent class is passed as a parameter to them method @runtime. This way, the correct table can be created within the backend datastore. > > Other methods are generic in StorageUtils.java What is the reasons of > support other store creation ? > > You would need to write the avro schema (data model) for *another* persistent class and store if you wished to use anything other than WebDB and HostDB. Currently there is nothing stopping you Talat. Hope this makes sense. Thanks Lewis [0] https://svn.apache.org/repos/asf/nutch/branches/2.x/src/java/org/apache/nutch/storage/Host.java [1] https://svn.apache.org/repos/asf/nutch/branches/2.x/src/java/org/apache/nutch/storage/WebPage.java [2] [3]