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

java.lang.Object
  继承者 com.taobao.metamorphosis.server.transaction.store.JournalTransactionStore
所有已实现的接口:
Service, JournalTransactionStoreMBean, TransactionStore

public class JournalTransactionStore
extends Object
implements TransactionStore, JournalTransactionStoreMBean

事务存储引擎

作者:
boyan(boyan@taobao.com)

嵌套类摘要
static class JournalTransactionStore.AddMsgLocation
          添加消息到store的位置和checksum
static class JournalTransactionStore.AddMsgOperation
           
static class JournalTransactionStore.Tx
          事务内存对象,保存操作轨迹
static interface JournalTransactionStore.TxOperation
          事务操作接口
 
构造方法摘要
JournalTransactionStore(String dataPath, MessageStoreManager storeManager, MetaConfig metaConfig)
           
 
方法摘要
 void addMessage(MessageStore store, long msgId, PutCommand putCmd, JournalLocation location)
          添加消息,为了保证添加顺序,这里不得不加锁
 JournalLocation checkpoint()
           
 void commit(TransactionId txid, boolean wasPrepared)
           
 void dispose()
           
 int getActiveTransactionCount()
          返回当前活跃事务数
 JournalTransactionStore.Tx getInflyTx(Object txid)
           
 JournalStore getJournalStore()
           
 JournalTransactionStore.Tx getTx(Object txid, JournalLocation location)
           
 void init()
           
 boolean isDoingRecover()
           
 void makeCheckpoint()
          执行checkpoint
 void prepare(TransactionId txid)
           
 void recover(TransactionRecoveryListener listener)
           
 JournalTransactionStore.Tx replayCommit(TransactionId txid, boolean wasPrepared)
           
 void replayPrepare(TransactionId txid)
           
 void replayRollback(TransactionId txid)
           
 void rollback(TransactionId txid)
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

JournalTransactionStore

public JournalTransactionStore(String dataPath,
                               MessageStoreManager storeManager,
                               MetaConfig metaConfig)
                        throws Exception
抛出:
Exception
方法详细信息

prepare

public void prepare(TransactionId txid)
             throws IOException
指定者:
接口 TransactionStore 中的 prepare
抛出:
IOException

getJournalStore

public JournalStore getJournalStore()

replayPrepare

public void replayPrepare(TransactionId txid)
                   throws IOException
抛出:
IOException

getInflyTx

public JournalTransactionStore.Tx getInflyTx(Object txid)

getActiveTransactionCount

public int getActiveTransactionCount()
从接口 JournalTransactionStoreMBean 复制的描述
返回当前活跃事务数

指定者:
接口 JournalTransactionStoreMBean 中的 getActiveTransactionCount
返回:

getTx

public JournalTransactionStore.Tx getTx(Object txid,
                                        JournalLocation location)

commit

public void commit(TransactionId txid,
                   boolean wasPrepared)
            throws IOException
指定者:
接口 TransactionStore 中的 commit
抛出:
IOException

replayCommit

public JournalTransactionStore.Tx replayCommit(TransactionId txid,
                                               boolean wasPrepared)
                                        throws IOException
抛出:
IOException

rollback

public void rollback(TransactionId txid)
              throws IOException
指定者:
接口 TransactionStore 中的 rollback
抛出:
IOException

replayRollback

public void replayRollback(TransactionId txid)
                    throws IOException
抛出:
IOException

init

public void init()
指定者:
接口 Service 中的 init

dispose

public void dispose()
指定者:
接口 Service 中的 dispose

recover

public void recover(TransactionRecoveryListener listener)
             throws IOException
指定者:
接口 TransactionStore 中的 recover
抛出:
IOException

addMessage

public void addMessage(MessageStore store,
                       long msgId,
                       PutCommand putCmd,
                       JournalLocation location)
                throws IOException
添加消息,为了保证添加顺序,这里不得不加锁

指定者:
接口 TransactionStore 中的 addMessage
抛出:
IOException

makeCheckpoint

public void makeCheckpoint()
                    throws Exception
从接口 JournalTransactionStoreMBean 复制的描述
执行checkpoint

指定者:
接口 JournalTransactionStoreMBean 中的 makeCheckpoint
抛出:
Exception

checkpoint

public JournalLocation checkpoint()
                           throws IOException
抛出:
IOException

isDoingRecover

public boolean isDoingRecover()


Copyright © 2010–2013. All rights reserved.