@InterfaceAudience.Private @InterfaceStability.Evolving public class SpillableMemoryChannel extends FileChannel
SpillableMemoryChannel will use main memory for buffering events until it has reached capacity. Thereafter file channel will be used as overflow.
| Modifier and Type | Class and Description | 
|---|---|
| static class  | SpillableMemoryChannel.DrainOrderQueue | 
| Modifier and Type | Field and Description | 
|---|---|
| static String | AVG_EVENT_SIZEEstimated average size of events expected to be in the channel | 
| static String | BYTE_CAPACITYmax number of bytes used for all events in the queue. | 
| static String | BYTE_CAPACITY_BUFFER_PERCENTAGEpercent of buffer between byteCapacity and the estimated event size. | 
| static String | CAPACITYfile channel capacity overridden by Spillable Channel | 
| protected ChannelCounter | channelCounter | 
| static int | defaultMemoryCapacity | 
| static int | defaultOverflowCapacity | 
| static int | defaultOverflowDeactivationThreshold | 
| static int | defaultOverflowTimeout | 
| SpillableMemoryChannel.DrainOrderQueue | drainOrder | 
| static String | KEEP_ALIVEfile channel setting that is overriden by Spillable Channel | 
| static String | MEMORY_CAPACITYMax number of events to be stored in memory | 
| ArrayDeque<Event> | memQueue | 
| static String | OVERFLOW_CAPACITYmax number of events in overflow. | 
| static String | OVERFLOW_DEACTIVATION_THRESHOLDInternal use only. | 
| static String | OVERFLOW_TIMEOUTSeconds to wait before enabling disk overflow when memory fills up | 
transactionCapacity| Constructor and Description | 
|---|
| SpillableMemoryChannel() | 
| Modifier and Type | Method and Description | 
|---|---|
| void | configure(Context context)Read parameters from context
 memoryCapacity = total number of events allowed at one time in the memory queue. | 
| protected BasicTransactionSemantics | createTransaction()
 Called to create new  Transactionobjects, which must
 extendBasicTransactionSemantics. | 
| int | getMaxMemQueueSize() | 
| int | getMemoryCapacity() | 
| protected Integer | getOverflowCapacity() | 
| int | getOverflowTimeout() | 
| protected int | getTotalStored() | 
| protected boolean | isOverflowDisabled() | 
| int | queueSize() | 
| void | start()
 Starts a service or component. | 
| void | stop()
 Stops a service or component. | 
getDepth, isOpen, setName, toStringgetTransaction, initialize, put, takegetLifecycleState, getNamepublic static final String MEMORY_CAPACITY
public static final String OVERFLOW_TIMEOUT
public static final String OVERFLOW_DEACTIVATION_THRESHOLD
public static final String BYTE_CAPACITY_BUFFER_PERCENTAGE
public static final String BYTE_CAPACITY
public static final String OVERFLOW_CAPACITY
public static final String KEEP_ALIVE
public static final String CAPACITY
public static final String AVG_EVENT_SIZE
public static final int defaultMemoryCapacity
public static final int defaultOverflowCapacity
public static final int defaultOverflowTimeout
public static final int defaultOverflowDeactivationThreshold
public ArrayDeque<Event> memQueue
protected ChannelCounter channelCounter
public final SpillableMemoryChannel.DrainOrderQueue drainOrder
protected int getTotalStored()
public int getMemoryCapacity()
public int getOverflowTimeout()
public int getMaxMemQueueSize()
protected Integer getOverflowCapacity()
protected boolean isOverflowDisabled()
public int queueSize()
public void configure(Context context)
configure in interface Configurableconfigure in class FileChannelpublic void start()
LifecycleAwareStarts a service or component.
 Implementations should determine the result of any start logic and effect
 the return value of LifecycleAware.getLifecycleState() accordingly.
 
start in interface LifecycleAwarestart in class FileChannelpublic void stop()
LifecycleAwareStops a service or component.
 Implementations should determine the result of any stop logic and effect
 the return value of LifecycleAware.getLifecycleState() accordingly.
 
stop in interface LifecycleAwarestop in class FileChannelprotected BasicTransactionSemantics createTransaction()
BasicChannelSemantics
 Called to create new Transaction objects, which must
 extend BasicTransactionSemantics.  Each object is used
 for only one transaction, but is stored in a thread-local and
 retrieved by getTransaction for the duration of that
 transaction.
 
createTransaction in class FileChannelCopyright © 2009-2017 Apache Software Foundation. All Rights Reserved.