當前位置: 首頁>>代碼示例>>Java>>正文


Java TransactionStore.close方法代碼示例

本文整理匯總了Java中com.alibaba.rocketmq.broker.transaction.TransactionStore.close方法的典型用法代碼示例。如果您正苦於以下問題:Java TransactionStore.close方法的具體用法?Java TransactionStore.close怎麽用?Java TransactionStore.close使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.alibaba.rocketmq.broker.transaction.TransactionStore的用法示例。


在下文中一共展示了TransactionStore.close方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: test_mysql_put

import com.alibaba.rocketmq.broker.transaction.TransactionStore; //導入方法依賴的package包/類
public void test_mysql_put() {
    JDBCTransactionStoreConfig config = new JDBCTransactionStoreConfig();

    TransactionStore store = new JDBCTransactionStore(config);

    boolean open = store.open();
    System.out.println(open);
    Assert.assertTrue(open);

    long begin = System.currentTimeMillis();
    List<TransactionRecord> trs = new ArrayList<TransactionRecord>();
    for (int i = 0; i < 20; i++) {
        TransactionRecord tr = new TransactionRecord();
        tr.setOffset(i);
        tr.setProducerGroup("PG_" + i);
        trs.add(tr);
    }

    boolean write = store.put(trs);

    System.out.println("TIME=" + (System.currentTimeMillis() - begin));

    Assert.assertTrue(write);

    store.close();
}
 
開發者ID:y123456yz,項目名稱:reading-and-annotate-rocketmq-3.4.6,代碼行數:27,代碼來源:JDBCTransactionStoreTest.java

示例2: test_mysql_remove

import com.alibaba.rocketmq.broker.transaction.TransactionStore; //導入方法依賴的package包/類
public void test_mysql_remove() {
    JDBCTransactionStoreConfig config = new JDBCTransactionStoreConfig();

    TransactionStore store = new JDBCTransactionStore(config);

    boolean open = store.open();
    System.out.println(open);
    Assert.assertTrue(open);

    List<Long> pks = new ArrayList<Long>();
    pks.add(2L);
    pks.add(4L);
    pks.add(6L);
    pks.add(8L);
    pks.add(11L);

    store.remove(pks);

    store.close();
}
 
開發者ID:y123456yz,項目名稱:reading-and-annotate-rocketmq-3.4.6,代碼行數:21,代碼來源:JDBCTransactionStoreTest.java

示例3: test_derby_open

import com.alibaba.rocketmq.broker.transaction.TransactionStore; //導入方法依賴的package包/類
@Test
public void test_derby_open() {
    JDBCTransactionStoreConfig config = new JDBCTransactionStoreConfig();
    config.setJdbcDriverClass("org.apache.derby.jdbc.EmbeddedDriver");
    config.setJdbcURL("jdbc:derby:xxx;create=true");
    config.setJdbcUser("xxx");
    config.setJdbcPassword("xxx");
    TransactionStore store = new JDBCTransactionStore(config);

    boolean open = store.open();
    System.out.println(open);
    Assert.assertTrue(open);
    store.close();
}
 
開發者ID:y123456yz,項目名稱:reading-and-annotate-rocketmq-3.4.6,代碼行數:15,代碼來源:JDBCTransactionStoreTest.java

示例4: test_mysql_open

import com.alibaba.rocketmq.broker.transaction.TransactionStore; //導入方法依賴的package包/類
public void test_mysql_open() {
    JDBCTransactionStoreConfig config = new JDBCTransactionStoreConfig();

    TransactionStore store = new JDBCTransactionStore(config);

    boolean open = store.open();
    System.out.println(open);
    Assert.assertTrue(open);
    store.close();
}
 
開發者ID:y123456yz,項目名稱:reading-and-annotate-rocketmq-3.4.6,代碼行數:11,代碼來源:JDBCTransactionStoreTest.java


注:本文中的com.alibaba.rocketmq.broker.transaction.TransactionStore.close方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。