com.bigdata.btree
Class AsynchronousIndexWriteConfiguration

java.lang.Object
  extended by com.bigdata.btree.AsynchronousIndexWriteConfiguration
All Implemented Interfaces:
Externalizable, Serializable

public class AsynchronousIndexWriteConfiguration
extends Object
implements Externalizable

Configuration for the asynchronous index write API.

See Also:
IAsynchronousWriteBufferFactory, AbstractMasterTask, AbstractSubtask, Serialized Form
TODO:
rename since not specific to asynchronous index writes, even if normally used in that context.

Constructor Summary
AsynchronousIndexWriteConfiguration()
          De-serialization ctor
AsynchronousIndexWriteConfiguration(int masterQueueCapacity, int masterChunkSize, long masterChunkTimeoutNanos, long sinkIdleTimeoutNanos, long sinkPollTimeoutNanos, int sinkQueueCapacity, int sinkChunkSize, long sinkChunkTimeoutNanos)
           
 
Method Summary
 int getMasterChunkSize()
          The desired size of the chunks that the master will process.
 long getMasterChunkTimeoutNanos()
          The time in nanoseconds that the master will combine smaller chunks so that it can satisfy the desired masterChunkSize.
 int getMasterQueueCapacity()
          The capacity of the queue on which the application writes.
 int getSinkChunkSize()
          The desired size of the chunks written that will be written by the sink.
 long getSinkChunkTimeoutNanos()
          The maximum amount of time in nanoseconds that a sink will combine smaller chunks so that it can satisfy the desired sinkChunkSize.
 long getSinkIdleTimeoutNanos()
          The time in nanoseconds after which an idle sink will be closed.
 long getSinkPollTimeoutNanos()
          The time in nanoseconds that the sink will wait inside of the IAsynchronousIterator when it polls the iterator for a chunk.
 int getSinkQueueCapacity()
          The capacity of the internal queue for the per-sink output buffer.
 void readExternal(ObjectInput in)
           
 void setMasterChunkSize(int masterChunkSize)
           
 void setMasterChunkTimeoutNanos(long masterChunkTimeoutNanos)
           
 void setMasterQueueCapacity(int masterQueueCapacity)
           
 void setSinkChunkSize(int sinkChunkSize)
           
 void setSinkChunkTimeoutNanos(long sinkChunkTimeoutNanos)
           
 void setSinkIdleTimeoutNanos(long sinkIdleTimeoutNanos)
           
 void setSinkPollTimeoutNanos(long sinkPollTimeoutNanos)
           
 void setSinkQueueCapacity(int sinkQueueCapacity)
           
 String toString()
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AsynchronousIndexWriteConfiguration

public AsynchronousIndexWriteConfiguration()
De-serialization ctor


AsynchronousIndexWriteConfiguration

public AsynchronousIndexWriteConfiguration(int masterQueueCapacity,
                                           int masterChunkSize,
                                           long masterChunkTimeoutNanos,
                                           long sinkIdleTimeoutNanos,
                                           long sinkPollTimeoutNanos,
                                           int sinkQueueCapacity,
                                           int sinkChunkSize,
                                           long sinkChunkTimeoutNanos)
Parameters:
masterQueueCapacity - The capacity of the queue on which the application writes. Chunks are drained from this queue by the AbstractTaskMaster, broken into splits, and each split is written onto the AbstractSubtask sink handling writes for the associated index partition.
masterChunkSize - The desired size of the chunks that the master will process.
masterChunkTimeoutNanos - The time in nanoseconds that the master will combine smaller chunks so that it can satisfy the desired masterChunkSize.
sinkIdleTimeoutNanos - The time in nanoseconds after which an idle sink will be closed. Any buffered writes are flushed when the sink is closed. The idle timeout is reset (a) if a chunk is available to be drained by the sink; or (b) if a chunk is drained from the sink. If no chunks become available the the sink will eventually decide that it is idle, will flush any buffered writes, and will close itself.

If the idle timeout is LT the getSinkChunkTimeoutNanos() then a sink will remain open as long as new chunks appear and are combined within idle timeout, otherwise the sink will decide that it is idle and will flush its last chunk and close itself. If this is Long.MAX_VALUE then the sink will identify itself as idle and will only be closed if the master is closed or the sink has received a StaleLocatorException for the index partition on which the sink is writing.

sinkPollTimeoutNanos - The time in nanoseconds that the sink will wait inside of the IAsynchronousIterator when it polls the iterator for a chunk. This value should be relatively small so that the sink remains responsible rather than blocking inside of the IAsynchronousIterator for long periods of time.
sinkQueueCapacity - The capacity of the internal queue for the per-sink output buffer.
sinkChunkSize - The desired size of the chunks written that will be written by the sink.
sinkChunkTimeoutNanos - The maximum amount of time in nanoseconds that a sink will combine smaller chunks so that it can satisify the desired sinkChunkSize.
Method Detail

getMasterQueueCapacity

public int getMasterQueueCapacity()
The capacity of the queue on which the application writes. Chunks are drained from this queue by the AbstractTaskMaster, broken into splits, and each split is written onto the AbstractSubtask sink handling writes for the associated index partition.


setMasterQueueCapacity

public void setMasterQueueCapacity(int masterQueueCapacity)

getMasterChunkSize

public int getMasterChunkSize()
The desired size of the chunks that the master will process.


setMasterChunkSize

public void setMasterChunkSize(int masterChunkSize)

getMasterChunkTimeoutNanos

public long getMasterChunkTimeoutNanos()
The time in nanoseconds that the master will combine smaller chunks so that it can satisfy the desired masterChunkSize.


setMasterChunkTimeoutNanos

public void setMasterChunkTimeoutNanos(long masterChunkTimeoutNanos)

getSinkIdleTimeoutNanos

public long getSinkIdleTimeoutNanos()
The time in nanoseconds after which an idle sink will be closed. Any buffered writes are flushed when the sink is closed. The idle timeout is reset (a) if a chunk is available to be drained by the sink; or (b) if a chunk is drained from the sink. If no chunks become available the the sink will eventually decide that it is idle, will flush any buffered writes, and will close itself.

If the idle timeout is LT the getSinkChunkTimeoutNanos() then a sink will remain open as long as new chunks appear and are combined within idle timeout, otherwise the sink will decide that it is idle and will flush its last chunk and close itself. If the idle timeout is Long.MAX_VALUE then the sink will identify itself as idle and will only be closed if the master is closed or the sink has received a StaleLocatorException for the index partition on which the sink is writing.


setSinkIdleTimeoutNanos

public void setSinkIdleTimeoutNanos(long sinkIdleTimeoutNanos)

getSinkPollTimeoutNanos

public long getSinkPollTimeoutNanos()
The time in nanoseconds that the sink will wait inside of the IAsynchronousIterator when it polls the iterator for a chunk. This value should be relatively small so that the sink remains responsible rather than blocking inside of the IAsynchronousIterator for long periods of time.


setSinkPollTimeoutNanos

public void setSinkPollTimeoutNanos(long sinkPollTimeoutNanos)

getSinkQueueCapacity

public int getSinkQueueCapacity()
The capacity of the internal queue for the per-sink output buffer.


setSinkQueueCapacity

public void setSinkQueueCapacity(int sinkQueueCapacity)

getSinkChunkSize

public int getSinkChunkSize()
The desired size of the chunks written that will be written by the sink.


setSinkChunkSize

public void setSinkChunkSize(int sinkChunkSize)

getSinkChunkTimeoutNanos

public long getSinkChunkTimeoutNanos()
The maximum amount of time in nanoseconds that a sink will combine smaller chunks so that it can satisfy the desired sinkChunkSize.


setSinkChunkTimeoutNanos

public void setSinkChunkTimeoutNanos(long sinkChunkTimeoutNanos)

toString

public String toString()
Overrides:
toString in class Object

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException


Copyright © 2006-2011 SYSTAP, LLC. All Rights Reserved.