Package com.marklogic.mapreduce
Interface MarkLogicDocument
-
- All Superinterfaces:
org.apache.hadoop.io.Writable
- All Known Implementing Classes:
BinaryDocument,DatabaseDocument,DatabaseDocumentWithMeta,DOMDocument,ForestDocument,JSONDocument,LargeBinaryDocument,RegularBinaryDocument
public interface MarkLogicDocument extends org.apache.hadoop.io.WritableAn abstraction of a document stored in a MarkLogic database.This interface represents any type of MarkLogic document, regardless of content type or whether it is actively managed by MarkLogic server.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]getContentAsByteArray()Return content as byte array.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.booleanisStreamable()Whether the content can be streamed.voidreadFields(DataInput in)voidwrite(DataOutput out)
-
-
-
Method Detail
-
getContentType
ContentType getContentType()
Return content type of the document.- Returns:
- content type of the document.
-
getContentAsText
org.apache.hadoop.io.Text getContentAsText()
Return content as Text.- Returns:
- content.
- Throws:
UnsupportedOperationException- for binary documents.
-
getContentAsByteArray
byte[] getContentAsByteArray()
Return content as byte array.- Returns:
- content.
-
getContentAsByteStream
InputStream getContentAsByteStream()
Return content as byte stream.- Returns:
- content.
-
getContentAsMarkLogicNode
MarkLogicNode getContentAsMarkLogicNode()
Return content as MarkLogicNode.- Returns:
- content.
- Throws:
UnsupportedOperationException- for binary documents.
-
getContentAsString
String getContentAsString() throws UnsupportedEncodingException
Return content as String.- Returns:
- content.
- Throws:
UnsupportedEncodingExceptionUnsupportedOperationException- for binary documents.
-
getContentSize
long getContentSize()
Return byte length of the content.- Returns:
- byte length of the content.
-
isStreamable
boolean isStreamable()
Whether the content can be streamed.- Returns:
- true for LargeBinaryDocument, false for the rest.
-
readFields
void readFields(DataInput in) throws IOException
- Specified by:
readFieldsin interfaceorg.apache.hadoop.io.Writable- Throws:
IOException
-
write
void write(DataOutput out) throws IOException
- Specified by:
writein interfaceorg.apache.hadoop.io.Writable- Throws:
IOException
-
-