Package cz.o2.proxima.direct.io.bulkfs
Class AbstractBulkFileSystemAttributeWriter
- java.lang.Object
-
- cz.o2.proxima.core.storage.AbstractStorage
-
- cz.o2.proxima.direct.core.AbstractAttributeWriter
-
- cz.o2.proxima.direct.core.AbstractBulkAttributeWriter
-
- cz.o2.proxima.direct.io.bulkfs.AbstractBulkFileSystemAttributeWriter
-
- All Implemented Interfaces:
AttributeWriterBase
,BulkAttributeWriter
,java.lang.AutoCloseable
- Direct Known Subclasses:
HadoopBulkAttributeWriter
public abstract class AbstractBulkFileSystemAttributeWriter extends AbstractBulkAttributeWriter
An abstract parent class forBulkAttributeWriter
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
AbstractBulkFileSystemAttributeWriter.Bulk
-
Nested classes/interfaces inherited from class cz.o2.proxima.core.storage.AbstractStorage
AbstractStorage.SerializableAbstractStorage
-
Nested classes/interfaces inherited from interface cz.o2.proxima.direct.core.AttributeWriterBase
AttributeWriterBase.Factory<W extends AttributeWriterBase>, AttributeWriterBase.Type
-
Nested classes/interfaces inherited from interface cz.o2.proxima.direct.core.BulkAttributeWriter
BulkAttributeWriter.Factory<T extends BulkAttributeWriter>
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractBulkFileSystemAttributeWriter(EntityDescriptor entity, java.net.URI uri, FileSystem fs, NamingConvention namingConvention, FileFormat format, Context context, long rollPeriodMs, long allowedLatenessMs)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
close()
Close allocated resources of this writer.protected abstract void
flush(AbstractBulkFileSystemAttributeWriter.Bulk bulk)
Flush givenAbstractBulkFileSystemAttributeWriter.Bulk
to final output.protected void
handleLateData(StreamElement data, long watermark, CommitCallback statusCallback)
Handle data after watermark.void
rollback()
Rollback the writer to last committed position.void
updateWatermark(long watermark)
Update watermark when no input data arrives.void
write(StreamElement data, long watermark, CommitCallback statusCallback)
Write given serialized attribute value to given entity.-
Methods inherited from class cz.o2.proxima.core.storage.AbstractStorage
equals, hashCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface cz.o2.proxima.direct.core.AttributeWriterBase
bulk, getUri, online
-
Methods inherited from interface cz.o2.proxima.direct.core.BulkAttributeWriter
asFactory, getType
-
-
-
-
Constructor Detail
-
AbstractBulkFileSystemAttributeWriter
protected AbstractBulkFileSystemAttributeWriter(EntityDescriptor entity, java.net.URI uri, FileSystem fs, NamingConvention namingConvention, FileFormat format, Context context, long rollPeriodMs, long allowedLatenessMs)
-
-
Method Detail
-
write
public void write(StreamElement data, long watermark, CommitCallback statusCallback)
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).- Parameters:
data
- the data to writerwatermark
- watermark of data being writtenstatusCallback
- callback to commit the data
-
handleLateData
protected void handleLateData(StreamElement data, long watermark, CommitCallback statusCallback)
Handle data after watermark.- Parameters:
data
- the late datawatermark
- current watermarkstatusCallback
- callback for commit
-
updateWatermark
public void updateWatermark(long watermark)
Description copied from interface:BulkAttributeWriter
Update watermark when no input data arrives.- Parameters:
watermark
- timestamp of the new watermark
-
rollback
public void rollback()
Description copied from interface:AttributeWriterBase
Rollback the writer to last committed position.
-
close
public void close()
Description copied from interface:AttributeWriterBase
Close allocated resources of this writer. This is supposed to be idempotent.
-
flush
protected abstract void flush(AbstractBulkFileSystemAttributeWriter.Bulk bulk)
Flush givenAbstractBulkFileSystemAttributeWriter.Bulk
to final output.- Parameters:
bulk
- the bulk to flush
-
-