com.taobao.metamorphosis.server.transaction.store
类 JournalStore

java.lang.Object
  继承者 com.taobao.metamorphosis.server.transaction.store.JournalStore
所有已实现的接口:
Closeable

public class JournalStore
extends Object
implements Closeable

事务存储引擎

作者:
boyan(boyan@taobao.com)

构造方法摘要
JournalStore(String path, MessageStoreManager storeManager, JournalTransactionStore transactionStore, int maxCheckpoints, int flushTxLogAtCommit)
           
 
方法摘要
 void checkpoint()
          设置一个checkpoint,下次回放将从最近设置的checkpoint开始
 void close()
           
 JournalLocation getRecentCheckpoint()
          返回最近的checkpoint
protected  com.taobao.metamorphosis.server.transaction.store.DataFile newDataFile()
          生成一个新的数据文件
 JournalLocation write(TransactionCommands.TxCommand msg, ByteBuffer attachment, JournalLocation location, boolean committedOrRollback)
          写入命令到事务日志
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

JournalStore

public JournalStore(String path,
                    MessageStoreManager storeManager,
                    JournalTransactionStore transactionStore,
                    int maxCheckpoints,
                    int flushTxLogAtCommit)
             throws Exception
抛出:
Exception
方法详细信息

write

public JournalLocation write(TransactionCommands.TxCommand msg,
                             ByteBuffer attachment,
                             JournalLocation location,
                             boolean committedOrRollback)
                      throws IOException
写入命令到事务日志

参数:
msg - 事务命令
attachment - 事务命令的附加数据
location - 写入的位置
committedOrRollback - 是否是提交或者回滚命令
返回:
抛出:
IOException

close

public void close()
           throws IOException
指定者:
接口 Closeable 中的 close
抛出:
IOException

getRecentCheckpoint

public JournalLocation getRecentCheckpoint()
返回最近的checkpoint

返回:

checkpoint

public void checkpoint()
                throws Exception
设置一个checkpoint,下次回放将从最近设置的checkpoint开始

抛出:
Exception

newDataFile

protected com.taobao.metamorphosis.server.transaction.store.DataFile newDataFile()
                                                                          throws IOException
生成一个新的数据文件

抛出:
FileNotFoundException
IOException


Copyright © 2010–2013. All rights reserved.