Package com.yahoo.document.serialization
Class VespaDocumentSerializer6
- java.lang.Object
-
- com.yahoo.vespa.objects.BufferSerializer
-
- com.yahoo.document.serialization.VespaDocumentSerializer6
-
- All Implemented Interfaces:
AnnotationWriter
,DocumentSerializer
,DocumentUpdateWriter
,DocumentWriter
,FieldWriter
,SpanNodeWriter
,SpanTreeWriter
,com.yahoo.vespa.objects.Deserializer
,com.yahoo.vespa.objects.Serializer
- Direct Known Subclasses:
VespaDocumentSerializerHead
public class VespaDocumentSerializer6 extends com.yahoo.vespa.objects.BufferSerializer implements DocumentSerializer
Class used for serializing documents on the Vespa 6.x document format.- Author:
- baldersheim
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static long
getSerializedSize(Document doc)
Returns the serialized size of the givenDocument
.void
write(AlternateSpanList altSpanList)
void
write(Annotation annotation)
void
write(Span span)
void
write(SpanList spanList)
void
write(SpanNode spanNode)
void
write(SpanTree tree)
void
write(Document doc)
write out a documentvoid
write(DocumentId id)
void
write(DocumentType type)
void
write(DocumentUpdate update)
void
write(AddFieldPathUpdate update)
void
write(AssignFieldPathUpdate update)
void
write(FieldPathUpdate update)
void
write(AddValueUpdate update, DataType superType)
void
write(ArithmeticValueUpdate update)
void
write(AssignValueUpdate update, DataType superType)
void
write(ClearValueUpdate clearValueUpdate, DataType superType)
void
write(FieldUpdate update)
void
write(MapValueUpdate update, DataType superType)
void
write(RemoveValueUpdate update, DataType superType)
void
write(TensorAddUpdate update)
void
write(TensorModifyUpdate update)
void
write(TensorRemoveUpdate update)
void
write(com.yahoo.vespa.objects.FieldBase field, AnnotationReference value)
Write out the value of annotation data.<T extends FieldValue>
voidwrite(com.yahoo.vespa.objects.FieldBase field, Array<T> array)
Write out the value of array fieldvoid
write(com.yahoo.vespa.objects.FieldBase field, BoolFieldValue value)
Write out the value of byte fieldvoid
write(com.yahoo.vespa.objects.FieldBase field, ByteFieldValue value)
Write out the value of byte field<T extends FieldValue>
voidwrite(com.yahoo.vespa.objects.FieldBase field, CollectionFieldValue<T> value)
Write out the value of collection fieldvoid
write(com.yahoo.vespa.objects.FieldBase field, DoubleFieldValue value)
Write out the value of double fieldvoid
write(com.yahoo.vespa.objects.FieldBase field, FieldValue value)
Write out the value of fieldvoid
write(com.yahoo.vespa.objects.FieldBase field, FloatFieldValue value)
Write out the value of float fieldvoid
write(com.yahoo.vespa.objects.FieldBase field, IntegerFieldValue value)
Write out the value of integer fieldvoid
write(com.yahoo.vespa.objects.FieldBase field, LongFieldValue value)
Write out the value of long field<K extends FieldValue,V extends FieldValue>
voidwrite(com.yahoo.vespa.objects.FieldBase field, MapFieldValue<K,V> map)
Write the value of a map fieldvoid
write(com.yahoo.vespa.objects.FieldBase field, PredicateFieldValue value)
Write out the value of predicate fieldvoid
write(com.yahoo.vespa.objects.FieldBase field, Raw value)
Write out the value of raw fieldvoid
write(com.yahoo.vespa.objects.FieldBase field, ReferenceFieldValue value)
Write out the value of the given reference field value.void
write(com.yahoo.vespa.objects.FieldBase field, StringFieldValue value)
Write out the value of string fieldvoid
write(com.yahoo.vespa.objects.FieldBase field, Struct s)
Write out the value of struct fieldvoid
write(com.yahoo.vespa.objects.FieldBase field, StructuredFieldValue value)
Write out the value of structured fieldvoid
write(com.yahoo.vespa.objects.FieldBase field, TensorFieldValue value)
Write out the value of the given tensor field value.<T extends FieldValue>
voidwrite(com.yahoo.vespa.objects.FieldBase field, WeightedSet<T> ws)
Write out the value of weighted set fieldvoid
write(com.yahoo.vespa.objects.FieldBase field, Document doc)
Write out the value of field-
Methods inherited from class com.yahoo.vespa.objects.BufferSerializer
createUTF8CharArray, flip, getBuf, getByte, getBytes, getDouble, getFloat, getInt, getInt1_2_4Bytes, getInt1_4Bytes, getInt2_4_8Bytes, getLong, getShort, getString, order, order, position, position, put, put, put, putByte, putDouble, putFloat, putInt, putInt1_4Bytes, putInt2_4_8Bytes, putLong, putShort, remaining, setBuf, wrap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.yahoo.document.serialization.DocumentSerializer
getBuf
-
-
-
-
Method Detail
-
write
public void write(Document doc)
Description copied from interface:DocumentWriter
write out a document- Specified by:
write
in interfaceDocumentWriter
- Parameters:
doc
- document to be written
-
write
public void write(com.yahoo.vespa.objects.FieldBase field, Document doc)
Description copied from interface:FieldWriter
Write out the value of field- Specified by:
write
in interfaceFieldWriter
- Parameters:
field
- field description (name and data type)doc
- field value
-
write
public void write(com.yahoo.vespa.objects.FieldBase field, FieldValue value)
Write out the value of field- Specified by:
write
in interfaceFieldWriter
- Parameters:
field
- - field description (name and data type)value
- - field value
-
write
public <T extends FieldValue> void write(com.yahoo.vespa.objects.FieldBase field, Array<T> array)
Write out the value of array field- Specified by:
write
in interfaceFieldWriter
- Parameters:
field
- - field description (name and data type)array
- - field value
-
write
public <K extends FieldValue,V extends FieldValue> void write(com.yahoo.vespa.objects.FieldBase field, MapFieldValue<K,V> map)
Description copied from interface:FieldWriter
Write the value of a map field- Specified by:
write
in interfaceFieldWriter
-
write
public void write(com.yahoo.vespa.objects.FieldBase field, ByteFieldValue value)
Write out the value of byte field- Specified by:
write
in interfaceFieldWriter
- Parameters:
field
- - field description (name and data type)value
- - field value
-
write
public void write(com.yahoo.vespa.objects.FieldBase field, BoolFieldValue value)
Description copied from interface:FieldWriter
Write out the value of byte field- Specified by:
write
in interfaceFieldWriter
- Parameters:
field
- field description (name and data type)value
- field value
-
write
public <T extends FieldValue> void write(com.yahoo.vespa.objects.FieldBase field, CollectionFieldValue<T> value)
Write out the value of collection field- Specified by:
write
in interfaceFieldWriter
- Parameters:
field
- - field description (name and data type)value
- - field value
-
write
public void write(com.yahoo.vespa.objects.FieldBase field, DoubleFieldValue value)
Write out the value of double field- Specified by:
write
in interfaceFieldWriter
- Parameters:
field
- - field description (name and data type)value
- - field value
-
write
public void write(com.yahoo.vespa.objects.FieldBase field, FloatFieldValue value)
Write out the value of float field- Specified by:
write
in interfaceFieldWriter
- Parameters:
field
- - field description (name and data type)value
- - field value
-
write
public void write(com.yahoo.vespa.objects.FieldBase field, IntegerFieldValue value)
Write out the value of integer field- Specified by:
write
in interfaceFieldWriter
- Parameters:
field
- - field description (name and data type)value
- - field value
-
write
public void write(com.yahoo.vespa.objects.FieldBase field, LongFieldValue value)
Write out the value of long field- Specified by:
write
in interfaceFieldWriter
- Parameters:
field
- - field description (name and data type)value
- - field value
-
write
public void write(com.yahoo.vespa.objects.FieldBase field, Raw value)
Write out the value of raw field- Specified by:
write
in interfaceFieldWriter
- Parameters:
field
- - field description (name and data type)value
- - field value
-
write
public void write(com.yahoo.vespa.objects.FieldBase field, PredicateFieldValue value)
Description copied from interface:FieldWriter
Write out the value of predicate field- Specified by:
write
in interfaceFieldWriter
- Parameters:
field
- field description (name and data type)value
- field value
-
write
public void write(com.yahoo.vespa.objects.FieldBase field, StringFieldValue value)
Write out the value of string field- Specified by:
write
in interfaceFieldWriter
- Parameters:
field
- - field description (name and data type)value
- - field value
-
write
public void write(com.yahoo.vespa.objects.FieldBase field, TensorFieldValue value)
Description copied from interface:FieldWriter
Write out the value of the given tensor field value.- Specified by:
write
in interfaceFieldWriter
- Parameters:
field
- field description (name and data type)value
- tensor field value
-
write
public void write(com.yahoo.vespa.objects.FieldBase field, ReferenceFieldValue value)
Description copied from interface:FieldWriter
Write out the value of the given reference field value.- Specified by:
write
in interfaceFieldWriter
- Parameters:
field
- field description (name and data type)value
- reference field value
-
write
public void write(com.yahoo.vespa.objects.FieldBase field, Struct s)
Write out the value of struct field- Specified by:
write
in interfaceFieldWriter
- Parameters:
field
- - field description (name and data type)s
- - field value
-
write
public void write(com.yahoo.vespa.objects.FieldBase field, StructuredFieldValue value)
Write out the value of structured field- Specified by:
write
in interfaceFieldWriter
- Parameters:
field
- - field description (name and data type)value
- - field value
-
write
public <T extends FieldValue> void write(com.yahoo.vespa.objects.FieldBase field, WeightedSet<T> ws)
Write out the value of weighted set field- Specified by:
write
in interfaceFieldWriter
- Parameters:
field
- - field description (name and data type)ws
- - field value
-
write
public void write(com.yahoo.vespa.objects.FieldBase field, AnnotationReference value)
Description copied from interface:FieldWriter
Write out the value of annotation data.- Specified by:
write
in interfaceFieldWriter
- Parameters:
field
- field description (name and data type)value
- field value
-
write
public void write(DocumentId id)
- Specified by:
write
in interfaceDocumentWriter
-
write
public void write(DocumentType type)
- Specified by:
write
in interfaceDocumentWriter
-
write
public void write(Annotation annotation)
- Specified by:
write
in interfaceAnnotationWriter
-
write
public void write(SpanTree tree)
- Specified by:
write
in interfaceSpanTreeWriter
-
write
public void write(SpanNode spanNode)
- Specified by:
write
in interfaceSpanNodeWriter
-
write
public void write(Span span)
- Specified by:
write
in interfaceSpanNodeWriter
-
write
public void write(SpanList spanList)
- Specified by:
write
in interfaceSpanNodeWriter
-
write
public void write(AlternateSpanList altSpanList)
- Specified by:
write
in interfaceSpanNodeWriter
-
write
public void write(DocumentUpdate update)
- Specified by:
write
in interfaceDocumentUpdateWriter
-
write
public void write(FieldPathUpdate update)
-
write
public void write(AssignFieldPathUpdate update)
-
write
public void write(AddFieldPathUpdate update)
-
write
public void write(FieldUpdate update)
- Specified by:
write
in interfaceDocumentUpdateWriter
-
write
public void write(AddValueUpdate update, DataType superType)
- Specified by:
write
in interfaceDocumentUpdateWriter
-
write
public void write(MapValueUpdate update, DataType superType)
- Specified by:
write
in interfaceDocumentUpdateWriter
-
write
public void write(ArithmeticValueUpdate update)
- Specified by:
write
in interfaceDocumentUpdateWriter
-
write
public void write(AssignValueUpdate update, DataType superType)
- Specified by:
write
in interfaceDocumentUpdateWriter
-
write
public void write(RemoveValueUpdate update, DataType superType)
- Specified by:
write
in interfaceDocumentUpdateWriter
-
write
public void write(ClearValueUpdate clearValueUpdate, DataType superType)
- Specified by:
write
in interfaceDocumentUpdateWriter
-
write
public void write(TensorModifyUpdate update)
- Specified by:
write
in interfaceDocumentUpdateWriter
-
write
public void write(TensorAddUpdate update)
- Specified by:
write
in interfaceDocumentUpdateWriter
-
write
public void write(TensorRemoveUpdate update)
- Specified by:
write
in interfaceDocumentUpdateWriter
-
getSerializedSize
public static long getSerializedSize(Document doc)
Returns the serialized size of the givenDocument
. Please note that this method performs actual serialization of the document, but simply return the size of the finalGrowableByteBuffer
. If you need the buffer itself, do NOT use this method.- Parameters:
doc
- The Document whose size to calculate.- Returns:
- The size in bytes.
-
-