Save This Page
Home » activemq-parent-5.3.1-source-release » org.apache » activemq » kaha » impl » async » [javadoc | source]
class: DataFileAppender [javadoc | source]

Direct Known Subclasses:

An optimized writer to do batch appends to a data file. This object is thread safe and gains throughput as you increase the number of concurrent writes it does.
Nested Class Summary:
public static class  DataFileAppender.WriteKey   
public class  DataFileAppender.WriteBatch   
public static class  DataFileAppender.WriteCommand   
Field Summary
protected static final  byte[] RESERVED_SPACE     
protected static final  int DEFAULT_MAX_BATCH_SIZE     
protected final  AsyncDataManager dataManager     
protected final  Map<WriteKey, WriteCommand> inflightWrites     
protected final  Object enqueueMutex     
protected  WriteBatch nextWriteBatch     
protected  boolean shutdown     
protected  IOException firstAsyncException     
protected final  CountDownLatch shutdownDone     
protected  int maxWriteBatchSize     
protected  boolean running     
 public DataFileAppender(AsyncDataManager dataManager) 
    Construct a Store writer
    fileId -
Method from org.apache.activemq.kaha.impl.async.DataFileAppender Summary:
close,   processQueue,   storeItem,   storeItem
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.activemq.kaha.impl.async.DataFileAppender Detail:
 public  void close() throws IOException 
 protected  void processQueue() 
    The async processing loop that writes to the data files and does the force calls. Since the file sync() call is the slowest of all the operations, this algorithm tries to 'batch' or group together several file sync() requests into a single file sync() call. The batching is accomplished attaching the same CountDownLatch instance to every force request in a group.
 public Location storeItem(ByteSequence data,
    byte type,
    boolean sync) throws IOException 
 public Location storeItem(ByteSequence data,
    byte type,
    Runnable onComplete) throws IOException