|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.io.GenericWritable org.apache.nutch.util.GenericWritableConfigurable org.apache.nutch.crawl.NutchWritable org.apache.nutch.metadata.MetaWrapper
public class MetaWrapper
This is a simple decorator that adds metadata to any Writable-s that can be serialized by NutchWritable. This is useful when data needs to be temporarily enriched during processing, but this temporary metadata doesn't need to be permanently stored after the job is done.
Constructor Summary | |
---|---|
MetaWrapper()
|
|
MetaWrapper(Metadata metadata,
Writable instance,
Configuration conf)
|
|
MetaWrapper(Writable instance,
Configuration conf)
|
Method Summary | |
---|---|
void |
addMeta(String name,
String value)
Add metadata. |
String |
getMeta(String name)
Get metadata. |
Metadata |
getMetadata()
Get all metadata. |
String[] |
getMetaValues(String name)
Get multiple metadata. |
void |
readFields(DataInput in)
|
void |
setMeta(String name,
String value)
Set metadata. |
void |
write(DataOutput out)
|
Methods inherited from class org.apache.nutch.crawl.NutchWritable |
---|
getTypes |
Methods inherited from class org.apache.nutch.util.GenericWritableConfigurable |
---|
getConf, setConf |
Methods inherited from class org.apache.hadoop.io.GenericWritable |
---|
get, set, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MetaWrapper()
public MetaWrapper(Writable instance, Configuration conf)
public MetaWrapper(Metadata metadata, Writable instance, Configuration conf)
Method Detail |
---|
public Metadata getMetadata()
public void addMeta(String name, String value)
Metadata.add(String, String)
for more information.
name
- metadata namevalue
- metadata valuepublic void setMeta(String name, String value)
Metadata.set(String, String)
for more information.
name
- value
- public String getMeta(String name)
Metadata.get(String)
for more information.
name
-
public String[] getMetaValues(String name)
Metadata.getValues(String)
for more information.
name
-
public void readFields(DataInput in) throws IOException
readFields
in interface Writable
readFields
in class GenericWritableConfigurable
IOException
public void write(DataOutput out) throws IOException
write
in interface Writable
write
in class GenericWritable
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |