Class ElasticsearchWriter
- java.lang.Object
-
- cz.o2.proxima.direct.io.elasticsearch.ElasticsearchWriter
-
- All Implemented Interfaces:
AttributeWriterBase
,BulkAttributeWriter
,java.lang.AutoCloseable
public class ElasticsearchWriter extends java.lang.Object implements BulkAttributeWriter
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface cz.o2.proxima.direct.core.AttributeWriterBase
AttributeWriterBase.Type
-
Nested classes/interfaces inherited from interface cz.o2.proxima.direct.core.BulkAttributeWriter
BulkAttributeWriter.Factory<T extends BulkAttributeWriter>
-
-
Constructor Summary
Constructors Constructor Description ElasticsearchWriter(ElasticsearchAccessor accessor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BulkAttributeWriter.Factory<? extends BulkAttributeWriter>
asFactory()
Convert instance of this writer toAttributeWriterBase.Factory
suitable for serialization.void
close()
Close allocated resources of this writer.java.net.URI
getUri()
Retrieve URI of this writer.void
rollback()
Rollback the writer to last committed position.void
write(StreamElement element, long watermark, CommitCallback commitCallback)
Write given serialized attribute value to given entity.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface cz.o2.proxima.direct.core.AttributeWriterBase
bulk, online
-
Methods inherited from interface cz.o2.proxima.direct.core.BulkAttributeWriter
getType, updateWatermark
-
-
-
-
Constructor Detail
-
ElasticsearchWriter
public ElasticsearchWriter(ElasticsearchAccessor accessor)
-
-
Method Detail
-
getUri
public java.net.URI getUri()
Description copied from interface:AttributeWriterBase
Retrieve URI of this writer.- Specified by:
getUri
in interfaceAttributeWriterBase
- Returns:
- URI of this writer
-
rollback
public void rollback()
Description copied from interface:AttributeWriterBase
Rollback the writer to last committed position.- Specified by:
rollback
in interfaceAttributeWriterBase
-
write
public void write(StreamElement element, long watermark, CommitCallback commitCallback)
Description copied from interface:BulkAttributeWriter
Write given serialized attribute value to given entity. Use the statusCallback to commit the whole bulk (of not yet committed elements).- Specified by:
write
in interfaceBulkAttributeWriter
- Parameters:
element
- the data to writerwatermark
- watermark of data being writtencommitCallback
- callback to commit the data
-
close
public void close()
Description copied from interface:AttributeWriterBase
Close allocated resources of this writer. This is supposed to be idempotent.- Specified by:
close
in interfaceAttributeWriterBase
- Specified by:
close
in interfacejava.lang.AutoCloseable
-
asFactory
public BulkAttributeWriter.Factory<? extends BulkAttributeWriter> asFactory()
Description copied from interface:AttributeWriterBase
Convert instance of this writer toAttributeWriterBase.Factory
suitable for serialization.- Specified by:
asFactory
in interfaceAttributeWriterBase
- Specified by:
asFactory
in interfaceBulkAttributeWriter
- Returns:
- the
AttributeWriterBase.Factory
representing this reader
-
-