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.Factorysuitable for serialization.voidclose()Close allocated resources of this writer.java.net.URIgetUri()Retrieve URI of this writer.voidrollback()Rollback the writer to last committed position.voidwrite(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:AttributeWriterBaseRetrieve URI of this writer.- Specified by:
getUriin interfaceAttributeWriterBase- Returns:
- URI of this writer
-
rollback
public void rollback()
Description copied from interface:AttributeWriterBaseRollback the writer to last committed position.- Specified by:
rollbackin interfaceAttributeWriterBase
-
write
public void write(StreamElement element, long watermark, CommitCallback commitCallback)
Description copied from interface:BulkAttributeWriterWrite given serialized attribute value to given entity. Use the statusCallback to commit the whole bulk (of not yet committed elements).- Specified by:
writein 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:AttributeWriterBaseClose allocated resources of this writer. This is supposed to be idempotent.- Specified by:
closein interfaceAttributeWriterBase- Specified by:
closein interfacejava.lang.AutoCloseable
-
asFactory
public BulkAttributeWriter.Factory<? extends BulkAttributeWriter> asFactory()
Description copied from interface:AttributeWriterBaseConvert instance of this writer toAttributeWriterBase.Factorysuitable for serialization.- Specified by:
asFactoryin interfaceAttributeWriterBase- Specified by:
asFactoryin interfaceBulkAttributeWriter- Returns:
- the
AttributeWriterBase.Factoryrepresenting this reader
-
-