|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.io.ObjectWritable org.apache.nutch.metadata.MetaWrapper
public class MetaWrapper
This is a simple decorator that adds metadata to any Object-s that can be serialized by ObjectWritable. 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,
Object object,
Configuration conf)
|
|
MetaWrapper(Object object,
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)
Reads the fields of this object from in . |
void |
setMeta(String name,
String value)
Set metadata. |
void |
write(DataOutput out)
Writes the fields of this object to out . |
Methods inherited from class org.apache.hadoop.io.ObjectWritable |
---|
get, getConf, getDeclaredClass, readObject, readObject, set, setConf, writeObject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MetaWrapper()
public MetaWrapper(Object object, Configuration conf)
public MetaWrapper(Metadata metadata, Object object, 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
Writable
in
. For efficiency,
implementations should attempt to re-use storage in the existing object
where possible.
readFields
in interface Writable
readFields
in class ObjectWritable
IOException
public void write(DataOutput out) throws IOException
Writable
out
.
write
in interface Writable
write
in class ObjectWritable
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |