• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java AsyncTransaction类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction的典型用法代码示例。如果您正苦于以下问题:Java AsyncTransaction类的具体用法?Java AsyncTransaction怎么用?Java AsyncTransaction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AsyncTransaction类属于org.opendaylight.controller.md.sal.common.api.data包,在下文中一共展示了AsyncTransaction类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onTransactionChainFailed

import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction; //导入依赖的package包/类
@Override
public void onTransactionChainFailed(final TransactionChain<?, ?> chain,
        final AsyncTransaction<?, ?> transaction, final Throwable cause) {
    Preconditions.checkState(delegate.equals(chain),
            "Illegal state - listener for %s was invoked for incorrect chain %s.", delegate, chain);
    /*
     * Intentionally NOOP, callback for failure, since we
     * are also listening on each transaction future for failure,
     * in order to have reference to Binding Transaction (which was seen by client
     * of this transaction chain), instead of DOM transaction
     * which is known only to this chain, binding transaction implementation
     * and underlying transaction chain.
     *
     */
    LOG.debug("Transaction chain {} failed. Failed DOM Transaction {}",this,transaction,cause);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:17,代码来源:BindingDOMTransactionChainAdapter.java


示例2: testResetTransactionQueue

import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction; //导入依赖的package包/类
@Test
public void testResetTransactionQueue() throws Exception {
    doNothing().when(chain).close();
    when(db.createTransactionChain(any(TransactionInvokerImpl.class))).thenReturn(chain);

    failedTransactionQ.add(mock(AsyncTransaction.class));
    field(TransactionInvokerImpl.class, "pendingTransactions").set(transactionInvokerImpl, pendingTransactions);
    field(TransactionInvokerImpl.class, "transactionToCommand").set(transactionInvokerImpl, transactionToCommand);
    field(TransactionInvokerImpl.class, "failedTransactionQueue").set(transactionInvokerImpl, failedTransactionQ);
    field(TransactionInvokerImpl.class, "successfulTransactionQueue").set(transactionInvokerImpl, successfulTxQ);

    Whitebox.invokeMethod(transactionInvokerImpl, "resetTransactionQueue");
    assertNotNull(Whitebox.getInternalState(transactionInvokerImpl, "pendingTransactions"));
    assertNotNull(Whitebox.getInternalState(transactionInvokerImpl, "transactionToCommand"));
    BlockingQueue<AsyncTransaction<?, ?>> testFailedTransactionQueue = Whitebox
            .getInternalState(transactionInvokerImpl, "failedTransactionQueue");
    assertEquals(0, testFailedTransactionQueue.size());
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:19,代码来源:TransactionInvokerImplTest.java


示例3: extractResubmitCommands

import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction; //导入依赖的package包/类
private List<TransactionCommand> extractResubmitCommands() {
    AsyncTransaction<?, ?> transaction = failedTransactionQueue.poll();
    List<TransactionCommand> commands = new ArrayList<>();
    if (transaction != null) {
        int index = pendingTransactions.lastIndexOf(transaction);
        //This logic needs to be revisited. Is it ok to resubmit these things again ?
        //are these operations idempotent ?
        //Does the transaction chain execute n+1th if nth one threw error ?
        List<ReadWriteTransaction> transactions =
                pendingTransactions.subList(index, pendingTransactions.size() - 1);
        for (ReadWriteTransaction tx: transactions) {
            commands.add(transactionToCommand.get(tx));
        }
        resetTransactionQueue();
    }
    if (commandIterator != null) {
        while (commandIterator.hasNext()) {
            commands.add(commandIterator.next());
        }
    }
    return commands;
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:23,代码来源:TransactionInvokerImpl.java


示例4: onTransactionChainFailed

import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction; //导入依赖的package包/类
@Override
public void onTransactionChainFailed(final TransactionChain<?, ?> transactionChain,
                                     final org.opendaylight.mdsal.common.api.AsyncTransaction<?, ?> asyncTransaction,
                                     final Throwable throwable) {
    txChainListener.onTransactionChainFailed(
            this, transactionFromDelegate(asyncTransaction.getIdentifier()), throwable);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:8,代码来源:ShardedDOMDataBrokerDelegatingTransactionChain.java


示例5: onTransactionChainFailed

import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction; //导入依赖的package包/类
@Override
public void onTransactionChainFailed(final TransactionChain<?, ?> chain,
        final AsyncTransaction<?, ?> transaction, final Throwable cause) {
    // This is expected to happen frequently in isolation testing.
    LOG.debug("Transaction chain failed.", cause);
    // Do not return RPC here, rely on transaction failure to call runFailed.
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:8,代码来源:WriteTransactionsHandler.java


示例6: onTransactionChainFailed

import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction; //导入依赖的package包/类
@Override
public void onTransactionChainFailed(TransactionChain<?, ?> chain, AsyncTransaction<?, ?> transaction,
		Throwable cause) {
	// TODO Auto-generated method stub
	LOG.error("RibManager for {} failed in transaction {}", localRibRef.getInstanceIdentifier(),
			transaction != null ? transaction.getIdentifier() : null, cause);
}
 
开发者ID:onfsdn,项目名称:atrium-odl,代码行数:8,代码来源:RibManager.java


示例7: onTransactionChainFailed

import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction; //导入依赖的package包/类
@Override
public void onTransactionChainFailed(final TransactionChain<?, ?> pchain, final AsyncTransaction<?, ?> transaction,
        final Throwable cause) {
    // FIXME: flip internal state, so that the next attempt to update fails, triggering node reconnect
    LOG.error("Unexpected transaction failure in node {} transaction {}",
            this.nodeId, transaction.getIdentifier(), cause);
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:8,代码来源:TopologyNodeState.java


示例8: onTransactionChainFailed

import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction; //导入依赖的package包/类
@Override
public final synchronized void onTransactionChainFailed(final TransactionChain<?, ?> transactionChain,
        final AsyncTransaction<?, ?> transaction, final Throwable cause) {
    LOG.error("Topology builder for {} failed in transaction {}.", getInstanceIdentifier(),
            transaction != null ? transaction.getIdentifier() : null, cause);
    scheduleListenerRestart();
    restartTransactionChainOnDemand();
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:9,代码来源:AbstractTopologyBuilder.java


示例9: onTransactionChainFailed

import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction; //导入依赖的package包/类
@Override
public synchronized void onTransactionChainFailed(final TransactionChain<?, ?> chain, final AsyncTransaction<?, ?> transaction, final Throwable cause) {
    LOG.error("Broken chain in RIB {} transaction {}", getInstanceIdentifier(), transaction != null ? transaction.getIdentifier() : null, cause);
    if (this.txChainToLocRibWriter.containsKey(chain)) {
        final LocRibWriter locRibWriter = this.txChainToLocRibWriter.remove(chain);
        final DOMTransactionChain newChain = createPeerChain(this);
        locRibWriter.restart(newChain);
        this.txChainToLocRibWriter.put(newChain, locRibWriter);
    }
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:11,代码来源:RIBImpl.java


示例10: onTransactionChainFailed

import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction; //导入依赖的package包/类
@Override
public synchronized void onTransactionChainFailed(final TransactionChain<?, ?> chain,
        final AsyncTransaction<?, ?> transaction, final Throwable cause) {
    LOG.error("Transaction chain failed.", cause);
    this.chain.close();
    this.chain = this.rib.createPeerChain(this);
    this.ribWriter = AdjRibInWriter.create(this.rib.getYangRibId(), this.peerRole, this.simpleRoutingPolicy,
            this.chain);
    releaseConnection();
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:11,代码来源:BGPPeer.java


示例11: onTransactionChainFailed

import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction; //导入依赖的package包/类
@Override
public void onTransactionChainFailed(final TransactionChain<?, ?> chain, final AsyncTransaction<?, ?> transaction,
        final Throwable cause) {
    LOG.error("Broken chain {} in DatastoreBaAbstractWrite, transaction {}, cause {}", chain,
            transaction.getIdentifier(), cause);
    close();
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:8,代码来源:AppPeerBenchmark.java


示例12: extractResubmitCommands

import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction; //导入依赖的package包/类
private List<TransactionCommand> extractResubmitCommands() {
    AsyncTransaction<?, ?> transaction = failedTransactionQueue.poll();
    List<TransactionCommand> commands = new ArrayList<>();
    if (transaction != null) {
        int index = pendingTransactions.lastIndexOf(transaction);
        List<ReadWriteTransaction> transactions =
                pendingTransactions.subList(index, pendingTransactions.size() - 1);
        for (ReadWriteTransaction tx: transactions) {
            commands.add(transactionToCommand.get(tx));
        }
        resetTransactionQueue();
    }
    return commands;
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:15,代码来源:TransactionInvokerImpl.java


示例13: testOnTransactionChainFailed

import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction; //导入依赖的package包/类
@Test
public void testOnTransactionChainFailed() throws Exception {
    field(TransactionInvokerImpl.class, "failedTransactionQueue").set(transactionInvokerImpl,
            failedTransactionQ);
    AsyncTransaction<?, ?> transaction = mock(AsyncTransaction.class);
    Throwable cause = mock(Throwable.class);
    transactionInvokerImpl.onTransactionChainFailed(mock(TransactionChain.class), transaction, cause);
    BlockingQueue<AsyncTransaction<?, ?>> testFailedTransactionQueue = Whitebox
            .getInternalState(transactionInvokerImpl, "failedTransactionQueue");
    assertTrue(testFailedTransactionQueue.contains(transaction));
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:12,代码来源:TransactionInvokerImplTest.java


示例14: testExtractResubmitCommands

import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Test
public void testExtractResubmitCommands() throws Exception {
    AsyncTransaction<?, ?> transaction = mock(ReadWriteTransaction.class);
    failedTransactionQ.put(transaction);
    field(TransactionInvokerImpl.class, "failedTransactionQueue").set(transactionInvokerImpl,
            failedTransactionQ);

    AsyncTransaction tx1 = mock(ReadWriteTransaction.class);
    AsyncTransaction tx2 = mock(ReadWriteTransaction.class);
    pendingTransactions.add((ReadWriteTransaction) tx1);
    pendingTransactions.add((ReadWriteTransaction) transaction);
    pendingTransactions.add((ReadWriteTransaction) tx2);
    MemberModifier.field(TransactionInvokerImpl.class, "pendingTransactions").set(transactionInvokerImpl,
            pendingTransactions);

    List<ReadWriteTransaction> transactions = new ArrayList<>();
    transactions.add((ReadWriteTransaction) tx1);

    TransactionCommand txCommand = mock(TransactionCommand.class);
    transactionToCommand.put((ReadWriteTransaction) tx1, txCommand);
    transactionToCommand.put((ReadWriteTransaction) tx2, txCommand);
    transactionToCommand.put((ReadWriteTransaction) transaction, txCommand);
    MemberModifier.field(TransactionInvokerImpl.class, "transactionToCommand").set(transactionInvokerImpl,
            transactionToCommand);
    PowerMockito.suppress(MemberModifier.method(TransactionInvokerImpl.class, "resetTransactionQueue"));

    List<TransactionCommand> testCommands = new ArrayList<>();
    testCommands.add(txCommand);

    assertEquals(testCommands, Whitebox.invokeMethod(transactionInvokerImpl, "extractResubmitCommands"));
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:33,代码来源:TransactionInvokerImplTest.java


示例15: onTransactionChainFailed

import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction; //导入依赖的package包/类
@Override
public void onTransactionChainFailed(final TransactionChain<?, ?> chain,
        final AsyncTransaction<?, ?> transaction, final Throwable cause) {
    LOG.error("Broken chain {} in TxchainBaDelete, transaction {}, cause {}",
            chain, transaction.getIdentifier(), cause);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:7,代码来源:TxchainBaDelete.java


示例16: onTransactionChainFailed

import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction; //导入依赖的package包/类
@Override
public void onTransactionChainFailed(final TransactionChain<?, ?> chain,
        final AsyncTransaction<?, ?> transaction, final Throwable cause) {
    LOG.error("Broken chain {} in TxchainDomDelete, transaction {}, cause {}",
            chain, transaction.getIdentifier(), cause);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:7,代码来源:TxchainDomDelete.java


示例17: onTransactionChainFailed

import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction; //导入依赖的package包/类
@Override
public void onTransactionChainFailed(final TransactionChain<?, ?> chain,
        final AsyncTransaction<?, ?> transaction, final Throwable cause) {
    LOG.error("Broken chain {} in TxchainDomWrite, transaction {}, cause {}",
            chain, transaction.getIdentifier(), cause);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:7,代码来源:TxchainDomWrite.java


示例18: onTransactionChainFailed

import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction; //导入依赖的package包/类
@Override
public void onTransactionChainFailed(final TransactionChain<?, ?> chain,
        final AsyncTransaction<?, ?> transaction, final Throwable cause) {
    LOG.error("Broken chain {} in DatastoreBaAbstractWrite, transaction {}, cause {}",
            chain, transaction.getIdentifier(), cause);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:7,代码来源:TxchainBaWrite.java


示例19: onTransactionChainFailed

import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction; //导入依赖的package包/类
@Override
public void onTransactionChainFailed(final TransactionChain<?, ?> chain,
                                     final AsyncTransaction<?, ?> transaction, final Throwable cause) {
    LOG.error("Broken chain {} in TxchainDomDelete, transaction {}, cause {}",
            chain, transaction.getIdentifier(), cause);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:7,代码来源:TxchainDomRead.java


示例20: onTransactionChainFailed

import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction; //导入依赖的package包/类
@Override
public void onTransactionChainFailed(final TransactionChain<?, ?> chain,
                                     final AsyncTransaction<?, ?> transaction, final Throwable cause) {
    LOG.error("Broken chain {} in TxchainBaDelete, transaction {}, cause {}",
            chain, transaction.getIdentifier(), cause);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:7,代码来源:TxchainBaRead.java



注:本文中的org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BeanToPropertyValueTransformer类代码示例发布时间:2022-05-22
下一篇:
Java FileContents类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap