Package com.marklogic.mapreduce
Class ForestDocument
- java.lang.Object
-
- com.marklogic.mapreduce.ForestDocument
-
- All Implemented Interfaces:
MarkLogicDocument,org.apache.hadoop.io.Writable
- Direct Known Subclasses:
BinaryDocument,DOMDocument,JSONDocument
public abstract class ForestDocument extends Object implements MarkLogicDocument
AMarkLogicDocumentretrieved from a MarkLogic forest through Direct Access.- See Also:
ForestInputFormat
-
-
Field Summary
Fields Modifier and Type Field Description static org.apache.commons.logging.LogLOG
-
Constructor Summary
Constructors Constructor Description ForestDocument()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract com.marklogic.xcc.ContentcreateContent(String uri, com.marklogic.xcc.ContentCreateOptions options, boolean copyCollections, boolean copyMetadata, boolean copyQuality)static ForestDocumentcreateDocument(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path forestDir, ExpandedTree tree, String uri)String[]getCollections()InputStreamgetContentAsByteStream()Return content as byte stream.longgetContentSize()Return byte length of the content.longgetFragmentOrdinal()Map<String,String>getMetadata()intgetQuality()booleanisStreamable()Whether the content can be streamed.voidreadFields(DataInput in)protected voidsetContentOptions(com.marklogic.xcc.ContentCreateOptions options, boolean copyCollections, boolean copyMetadata, boolean copyQuality)voidsetQuality(int quality)voidwrite(DataOutput out)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.marklogic.mapreduce.MarkLogicDocument
getContentAsByteArray, getContentAsMarkLogicNode, getContentAsString, getContentAsText, getContentType
-
-
-
-
Method Detail
-
createDocument
public static ForestDocument createDocument(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path forestDir, ExpandedTree tree, String uri)
-
getFragmentOrdinal
public long getFragmentOrdinal()
-
getCollections
public String[] getCollections()
-
readFields
public void readFields(DataInput in) throws IOException
- Specified by:
readFieldsin interfaceMarkLogicDocument- Specified by:
readFieldsin interfaceorg.apache.hadoop.io.Writable- Throws:
IOException
-
getQuality
public int getQuality()
-
setQuality
public void setQuality(int quality)
-
write
public void write(DataOutput out) throws IOException
- Specified by:
writein interfaceMarkLogicDocument- Specified by:
writein interfaceorg.apache.hadoop.io.Writable- Throws:
IOException
-
getContentAsByteStream
public InputStream getContentAsByteStream()
Description copied from interface:MarkLogicDocumentReturn content as byte stream.- Specified by:
getContentAsByteStreamin interfaceMarkLogicDocument- Returns:
- content.
-
getContentSize
public long getContentSize()
Description copied from interface:MarkLogicDocumentReturn byte length of the content.- Specified by:
getContentSizein interfaceMarkLogicDocument- Returns:
- byte length of the content.
-
isStreamable
public boolean isStreamable()
Description copied from interface:MarkLogicDocumentWhether the content can be streamed.- Specified by:
isStreamablein interfaceMarkLogicDocument- Returns:
- true for LargeBinaryDocument, false for the rest.
-
createContent
public abstract com.marklogic.xcc.Content createContent(String uri, com.marklogic.xcc.ContentCreateOptions options, boolean copyCollections, boolean copyMetadata, boolean copyQuality) throws IOException
- Throws:
IOException
-
setContentOptions
protected void setContentOptions(com.marklogic.xcc.ContentCreateOptions options, boolean copyCollections, boolean copyMetadata, boolean copyQuality)
-
-