com.alibaba.rocketmq.store.index
类 IndexFile

java.lang.Object
  继承者 com.alibaba.rocketmq.store.index.IndexFile

public class IndexFile
extends Object

存储具体消息索引信息的文件

从以下版本开始:
2013-7-21
作者:
shijia.wxr

构造方法摘要
IndexFile(String fileName, int hashSlotNum, int indexNum, long endPhyOffset, long endTimestamp)
           
 
方法摘要
 boolean destroy(long intervalForcibly)
           
 void flush()
           
 long getBeginTimestamp()
           
 long getEndPhyOffset()
           
 long getEndTimestamp()
           
 String getFileName()
           
 int indexKeyHashMethod(String key)
           
 boolean isTimeMatched(long begin, long end)
          时间区间是否匹配
 boolean isWriteFull()
          当前索引文件是否写满
 void load()
           
 boolean putKey(String key, long phyOffset, long storeTimestamp)
          如果返回false,表示需要创建新的索引文件
 void selectPhyOffset(List<Long> phyOffsets, String key, int maxNum, long begin, long end, boolean lock)
          前提:入参时间区间在调用前已经匹配了当前索引文件的起始结束时间
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

IndexFile

public IndexFile(String fileName,
                 int hashSlotNum,
                 int indexNum,
                 long endPhyOffset,
                 long endTimestamp)
          throws IOException
抛出:
IOException
方法详细信息

getFileName

public String getFileName()

load

public void load()

flush

public void flush()

isWriteFull

public boolean isWriteFull()
当前索引文件是否写满


destroy

public boolean destroy(long intervalForcibly)

putKey

public boolean putKey(String key,
                      long phyOffset,
                      long storeTimestamp)
如果返回false,表示需要创建新的索引文件


getBeginTimestamp

public long getBeginTimestamp()

getEndTimestamp

public long getEndTimestamp()

getEndPhyOffset

public long getEndPhyOffset()

isTimeMatched

public boolean isTimeMatched(long begin,
                             long end)
时间区间是否匹配


indexKeyHashMethod

public int indexKeyHashMethod(String key)

selectPhyOffset

public void selectPhyOffset(List<Long> phyOffsets,
                            String key,
                            int maxNum,
                            long begin,
                            long end,
                            boolean lock)
前提:入参时间区间在调用前已经匹配了当前索引文件的起始结束时间



Copyright © 2012–2015. All rights reserved.