当前位置: 首页>>代码示例>>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;未经允许,请勿转载。