| 限定符和类型 | 字段和说明 |
|---|---|
static org.slf4j.Logger |
_Logger
日志记录器
|
protected static int |
BUSY_DELAY
正在执行延时刷写
|
protected static int |
BUSY_FAIL
正在执行失败重试刷写
|
protected static int |
BUSY_MASK_COUNT
标识数量的位
|
protected static int |
BUSY_MASK_STATE
标识忙的位
|
protected static int |
BUSY_PERIOD
正在执行周期刷写
|
protected static int |
BUSY_REINDEX
正在执行重索引
|
protected int |
m_Busy
是否正在刷写或处理中(只是作简单标识,操作非原子)
|
protected cn.weforward.common.util.SinglyLinked<Flushable> |
m_DelayList
延时刷写项链表
|
protected cn.weforward.common.util.SinglyLinked<Flushable> |
m_FailList
延时刷写出错项链表
|
protected int |
m_FlushInterval
每次后台刷写的最小间隔(毫秒)
|
protected cn.weforward.common.util.SinglyLinked.SinglyLinkedNode<Flushable> |
m_FlushPending
执行刷写中的表
|
protected int |
m_FlushPeriod
刷写周期(毫秒)
|
protected long |
m_LastDelayFlush
最后延时刷写时间戳
|
protected long |
m_LastPeriodFlush
最后周期刷写时间戳
|
protected ReentrantLock |
m_Lock
锁
|
protected int |
m_MaxSuspend
最多等待刷写的累积项数(0表示不控制)
|
protected String |
m_Name
名称
|
protected int |
m_State
状态 STATE_xxx
|
protected Thread |
m_ThreadFlush
刷写的后台工作线程
|
protected Condition |
m_WaitWriteTask
等待刷写任务条件
|
protected static int |
STATE_CLOSED
刷写器已关闭
|
protected static int |
STATE_FLUSH_CLOSED
刷写线程已关闭
|
protected static int |
STATE_FLUSH_STARTING
刷写线程启动中
|
protected static int |
STATE_PERIOD
执行周期刷写
|
protected static int |
STATE_REINDEX_CLOSED
重索引线程已关闭
|
protected static int |
STATE_STOP
停止刷写器任务
|
| 构造器和说明 |
|---|
DelayFlusher()
构造刷写器,5秒延时
|
DelayFlusher(int interval)
构造刷写器
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
关闭刷写器
|
void |
daemonFlushing()
执行刷写任务
|
void |
destroy() |
boolean |
destroySignal() |
protected void |
finalize() |
void |
flush()
立刻刷写所有待刷写的项
|
void |
flush(Flushable flushable)
刷写待刷写项
|
boolean |
flushing()
执行延时队列的刷写
|
cn.weforward.common.util.SinglyLinked.SinglyLinkedNode<Flushable> |
getFlushPending()
执行刷写中的表
|
int |
getMaxSuspend() |
String |
getName() |
void |
mark(Flushable flushing)
标记待刷写项
|
protected void |
markOnFail(Flushable flushing)
标记刷写出错项
|
void |
setMaxSuspend(int limit)
最多等待刷写的累积项数
|
void |
setName(String name) |
String |
toString() |
boolean |
tryFailFlushing()
重试刷写错误的项
|
public static final org.slf4j.Logger _Logger
protected static final int STATE_FLUSH_CLOSED
protected static final int STATE_REINDEX_CLOSED
protected static final int STATE_CLOSED
protected static final int STATE_STOP
protected static final int STATE_FLUSH_STARTING
protected static final int STATE_PERIOD
protected static final int BUSY_PERIOD
protected static final int BUSY_DELAY
protected static final int BUSY_REINDEX
protected static final int BUSY_FAIL
protected static final int BUSY_MASK_STATE
protected static final int BUSY_MASK_COUNT
protected String m_Name
protected final cn.weforward.common.util.SinglyLinked<Flushable> m_DelayList
protected final cn.weforward.common.util.SinglyLinked<Flushable> m_FailList
protected final ReentrantLock m_Lock
protected final Condition m_WaitWriteTask
protected final int m_FlushInterval
protected int m_MaxSuspend
protected volatile int m_State
protected volatile long m_LastDelayFlush
protected Thread m_ThreadFlush
protected volatile int m_Busy
protected cn.weforward.common.util.SinglyLinked.SinglyLinkedNode<Flushable> m_FlushPending
protected final int m_FlushPeriod
protected volatile long m_LastPeriodFlush
public DelayFlusher()
public DelayFlusher(int interval)
interval - 后台刷写的最小间隔(秒)public void setName(String name)
public String getName()
public void setMaxSuspend(int limit)
limit - 要控制的项数,0表示不控制public int getMaxSuspend()
protected void markOnFail(Flushable flushing)
flushing - 待刷写项public boolean destroySignal()
destroySignal 在接口中 cn.weforward.common.DestroyableExtpublic void destroy()
destroy 在接口中 cn.weforward.common.Destroyablepublic void close()
public boolean flushing()
public cn.weforward.common.util.SinglyLinked.SinglyLinkedNode<Flushable> getFlushPending()
public boolean tryFailFlushing()
public void daemonFlushing()
Copyright © 2021. All rights reserved.