Package com.marklogic.mapreduce
Class LargeBinaryDocument
- java.lang.Object
-
- com.marklogic.mapreduce.ForestDocument
-
- com.marklogic.mapreduce.BinaryDocument
-
- com.marklogic.mapreduce.LargeBinaryDocument
-
- All Implemented Interfaces:
MarkLogicDocument,org.apache.hadoop.io.Writable
public class LargeBinaryDocument extends BinaryDocument
ABinaryDocumentrepresenting a large binary document extracted from a forest using Direct Access.A large binary is stored outside of a MarkLogic fragment. A binary document categorized as "large" when it exceeds the large size threshold configured for a database. For more details, see "Working With Binary Documents" in the MarkLogic Server Application Developer's Guide.
- See Also:
ForestInputFormat
-
-
Constructor Summary
Constructors Constructor Description LargeBinaryDocument()LargeBinaryDocument(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path forestDir, ExpandedTree tree)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetBinaryOrigLen()byte[]getContentAsByteArray()Return content as byte array.byte[]getContentAsByteArray(int offset, int len)InputStreamgetContentAsByteStream()Return content as byte stream.MarkLogicNodegetContentAsMarkLogicNode()Return content as MarkLogicNode.StringgetContentAsString()Return content as String.org.apache.hadoop.io.TextgetContentAsText()Return content as Text.longgetContentSize()Return byte length of the content.ContentTypegetContentType()Return content type of the document.longgetOffset()org.apache.hadoop.fs.PathgetPath()booleanisStreamable()Whether the content can be streamed.voidreadFields(DataInput in)voidwrite(DataOutput out)-
Methods inherited from class com.marklogic.mapreduce.BinaryDocument
createContent
-
Methods inherited from class com.marklogic.mapreduce.ForestDocument
createDocument, getCollections, getFragmentOrdinal, getMetadata, getQuality, setContentOptions, setQuality
-
-
-
-
Constructor Detail
-
LargeBinaryDocument
public LargeBinaryDocument()
-
LargeBinaryDocument
public LargeBinaryDocument(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path forestDir, ExpandedTree tree)
-
-
Method Detail
-
getPath
public org.apache.hadoop.fs.Path getPath()
-
getOffset
public long getOffset()
-
getBinaryOrigLen
public long getBinaryOrigLen()
-
readFields
public void readFields(DataInput in) throws IOException
- Specified by:
readFieldsin interfaceMarkLogicDocument- Specified by:
readFieldsin interfaceorg.apache.hadoop.io.Writable- Overrides:
readFieldsin classForestDocument- Throws:
IOException
-
write
public void write(DataOutput out) throws IOException
- Specified by:
writein interfaceMarkLogicDocument- Specified by:
writein interfaceorg.apache.hadoop.io.Writable- Overrides:
writein classForestDocument- Throws:
IOException
-
getContentAsByteArray
public byte[] getContentAsByteArray()
Description copied from interface:MarkLogicDocumentReturn content as byte array.- Returns:
- content.
-
getContentAsByteArray
public byte[] getContentAsByteArray(int offset, int len)
-
getContentAsMarkLogicNode
public MarkLogicNode getContentAsMarkLogicNode()
Description copied from interface:MarkLogicDocumentReturn content as MarkLogicNode.- Returns:
- content.
-
getContentAsText
public org.apache.hadoop.io.Text getContentAsText()
Description copied from interface:MarkLogicDocumentReturn content as Text.- Returns:
- content.
-
getContentType
public ContentType getContentType()
Description copied from interface:MarkLogicDocumentReturn content type of the document.- Returns:
- content type of the document.
-
getContentAsString
public String getContentAsString() throws UnsupportedEncodingException
Description copied from interface:MarkLogicDocumentReturn content as String.- Returns:
- content.
- Throws:
UnsupportedEncodingException
-
getContentAsByteStream
public InputStream getContentAsByteStream()
Description copied from interface:MarkLogicDocumentReturn content as byte stream.- Specified by:
getContentAsByteStreamin interfaceMarkLogicDocument- Overrides:
getContentAsByteStreamin classForestDocument- Returns:
- content.
-
getContentSize
public long getContentSize()
Description copied from interface:MarkLogicDocumentReturn byte length of the content.- Specified by:
getContentSizein interfaceMarkLogicDocument- Overrides:
getContentSizein classForestDocument- Returns:
- byte length of the content.
-
isStreamable
public boolean isStreamable()
Description copied from interface:MarkLogicDocumentWhether the content can be streamed.- Specified by:
isStreamablein interfaceMarkLogicDocument- Overrides:
isStreamablein classForestDocument- Returns:
- true for LargeBinaryDocument, false for the rest.
-
-