Package cz.o2.proxima.direct.core
Interface OnlineAttributeWriter
-
- All Superinterfaces:
AttributeWriterBase
,java.lang.AutoCloseable
- All Known Subinterfaces:
CachedView
- All Known Implementing Classes:
AbstractOnlineAttributeWriter
,HttpWriter
,JdbcOnlineAttributeWriter
,KafkaWriter
,LocalCachedPartitionedView
,OpenTsdbWriter
,TransactionalCachedView
,TransactionalOnlineAttributeWriter
@Stable public interface OnlineAttributeWriter extends AttributeWriterBase
Writer for attribute values. This is online version, where each element is committed one after another.The ingest process works as follows:
- incoming request is written into
CommitLog
, which is instance of this interface - the message is confirmed to the client, because commit log is persistent, durable and distributed
- next, the message is asynchronously consumed by all writes from the commit log and written to the storages
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
OnlineAttributeWriter.Factory<T extends OnlineAttributeWriter>
Serializable
factory forOnlineAttributeWriter
.-
Nested classes/interfaces inherited from interface cz.o2.proxima.direct.core.AttributeWriterBase
AttributeWriterBase.Type
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description OnlineAttributeWriter.Factory<? extends OnlineAttributeWriter>
asFactory()
Convert instance of this writer toAttributeWriterBase.Factory
suitable for serialization.default AttributeWriterBase.Type
getType()
Retrieve type of the writer.default boolean
isTransactional()
default void
rollback()
Rollback the writer to last committed position.default TransactionalOnlineAttributeWriter
transactional()
void
write(StreamElement data, CommitCallback statusCallback)
Write given serialized attribute value to given entity.-
Methods inherited from interface cz.o2.proxima.direct.core.AttributeWriterBase
bulk, close, getUri, online
-
-
-
-
Method Detail
-
getType
default AttributeWriterBase.Type getType()
Description copied from interface:AttributeWriterBase
Retrieve type of the writer.- Specified by:
getType
in interfaceAttributeWriterBase
- Returns:
AttributeWriterBase.Type
of the writer
-
rollback
default void rollback()
Description copied from interface:AttributeWriterBase
Rollback the writer to last committed position.- Specified by:
rollback
in interfaceAttributeWriterBase
-
write
void write(StreamElement data, CommitCallback statusCallback)
Write given serialized attribute value to given entity.- Parameters:
data
- the data to writestatusCallback
- callback used to commit data processing
-
asFactory
OnlineAttributeWriter.Factory<? extends OnlineAttributeWriter> asFactory()
Description copied from interface:AttributeWriterBase
Convert instance of this writer toAttributeWriterBase.Factory
suitable for serialization.- Specified by:
asFactory
in interfaceAttributeWriterBase
- Returns:
- the
AttributeWriterBase.Factory
representing this reader
-
isTransactional
default boolean isTransactional()
- Returns:
true
is this is aTransactionalOnlineAttributeWriter
.TransactionalOnlineAttributeWriter
is used when writing attribute that supportsTransactionMode
different fromTransactionMode.NONE
.
-
transactional
default TransactionalOnlineAttributeWriter transactional()
- Returns:
this
ifisTransactional()
returns true.- Throws:
java.lang.UnsupportedOperationException
- ifisTransactional()
returnsfalse
-
-