|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectcom.alibaba.rocketmq.store.MapedFileQueue
public class MapedFileQueue
存储队列,数据定时删除,无限增长
队列是由多个文件组成
| 构造方法摘要 | |
|---|---|
MapedFileQueue(String storePath,
int mapedFileSize,
AllocateMapedFileService allocateMapedFileService)
|
|
| 方法摘要 | |
|---|---|
boolean |
commit(int flushLeastPages)
返回值表示是否全部刷盘完成 |
int |
deleteExpiredFileByOffset(long offset,
int unitSize)
根据物理队列最小Offset来删除逻辑队列 |
int |
deleteExpiredFileByTime(long expiredTime,
int deleteFilesInterval,
long intervalForcibly,
boolean cleanImmediately)
根据文件过期时间来删除物理队列文件 |
void |
deleteLastMapedFile()
恢复时调用 |
void |
destroy()
销毁队列,队列数据被删除,此函数有可能不成功 |
MapedFile |
findMapedFileByOffset(long offset)
|
MapedFile |
findMapedFileByOffset(long offset,
boolean returnFirstOnNotFound)
|
long |
getCommittedWhere()
|
MapedFile |
getFirstMapedFileOnLock()
|
MapedFile |
getLastMapedFile()
|
MapedFile |
getLastMapedFile(long startOffset)
获取最后一个MapedFile对象,如果一个都没有,则新创建一个,如果最后一个写满了,则新创建一个 |
MapedFile |
getLastMapedFile2()
|
MapedFile |
getMapedFileByTime(long timestamp)
|
List<MapedFile> |
getMapedFiles()
|
int |
getMapedFileSize()
|
long |
getMapedMemorySize()
|
long |
getMaxOffset()
|
long |
getMinOffset()
获取队列的最小Offset,如果队列为空,则返回-1 |
long |
getStoreTimestamp()
|
long |
howMuchFallBehind()
刷盘进度落后了多少 |
boolean |
load()
|
boolean |
retryDeleteFirstFile(long intervalForcibly)
|
void |
setCommittedWhere(long committedWhere)
|
void |
shutdown(long intervalForcibly)
关闭队列,队列数据还在,但是不能访问 |
void |
truncateDirtyFiles(long offset)
recover时调用,不需要加锁 |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
public MapedFileQueue(String storePath,
int mapedFileSize,
AllocateMapedFileService allocateMapedFileService)
| 方法详细信息 |
|---|
public MapedFile getMapedFileByTime(long timestamp)
public void truncateDirtyFiles(long offset)
public boolean load()
public long howMuchFallBehind()
public MapedFile getLastMapedFile()
public MapedFile getLastMapedFile(long startOffset)
startOffset - 如果创建新的文件,起始offset
public long getMinOffset()
public long getMaxOffset()
public void deleteLastMapedFile()
public int deleteExpiredFileByTime(long expiredTime,
int deleteFilesInterval,
long intervalForcibly,
boolean cleanImmediately)
public int deleteExpiredFileByOffset(long offset,
int unitSize)
offset - 物理队列最小offsetpublic boolean commit(int flushLeastPages)
public MapedFile findMapedFileByOffset(long offset,
boolean returnFirstOnNotFound)
public MapedFile getLastMapedFile2()
public MapedFile findMapedFileByOffset(long offset)
public long getMapedMemorySize()
public boolean retryDeleteFirstFile(long intervalForcibly)
public MapedFile getFirstMapedFileOnLock()
public void shutdown(long intervalForcibly)
public void destroy()
public long getCommittedWhere()
public void setCommittedWhere(long committedWhere)
public long getStoreTimestamp()
public List<MapedFile> getMapedFiles()
public int getMapedFileSize()
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||