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

Java TransactionCommitFailedException类代码示例

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

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



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

示例1: submit

import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; //导入依赖的package包/类
@Override
public CheckedFuture<Void, TransactionCommitFailedException> submit(
        final DOMDataWriteTransaction transaction, final Collection<DOMStoreThreePhaseCommitCohort> cohorts) {
    checkNotFailed();
    checkNotClosed();

    final CheckedFuture<Void, TransactionCommitFailedException> ret = broker.submit(transaction, cohorts);

    COUNTER_UPDATER.incrementAndGet(this);
    Futures.addCallback(ret, new FutureCallback<Void>() {
        @Override
        public void onSuccess(final Void result) {
            transactionCompleted();
        }

        @Override
        public void onFailure(final Throwable t) {
            transactionFailed(transaction, t);
        }
    });

    return ret;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:24,代码来源:DOMDataBrokerTransactionChainImpl.java


示例2: listenForFailure

import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; //导入依赖的package包/类
private CheckedFuture<Void, TransactionCommitFailedException> listenForFailure(
        final WriteTransaction tx, final CheckedFuture<Void, TransactionCommitFailedException> future) {
    Futures.addCallback(future, new FutureCallback<Void>() {
        @Override
        public void onFailure(final Throwable t) {
            failTransactionChain(tx,t);
        }

        @Override
        public void onSuccess(final Void result) {
            // Intentionally NOOP
        }
    });

    return future;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:17,代码来源:BindingDOMTransactionChainAdapter.java


示例3: setTestOperData

import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; //导入依赖的package包/类
private void setTestOperData(final ExecStatus sts, final long tstCompl) {
    TestStatus status = new TestStatusBuilder()
            .setExecStatus(sts)
            .setTestsCompleted(tstCompl)
            .build();

    WriteTransaction tx = simpleTxDataBroker.newWriteOnlyTransaction();
    tx.put(LogicalDatastoreType.OPERATIONAL, TEST_STATUS_IID, status);

    try {
        tx.submit().checkedGet();
    } catch (final TransactionCommitFailedException e) {
        throw new IllegalStateException(e);
    }

    LOG.debug("DataStore test oper status populated: {}", status);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:18,代码来源:DsbenchmarkProvider.java


示例4: submit

import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; //导入依赖的package包/类
@Override
public synchronized CheckedFuture<Void, TransactionCommitFailedException> submit() {
    Preconditions.checkState(!closed, "Transaction %s is already closed", identifier);

    final Set<DOMStoreWriteTransaction> txns = ImmutableSet.copyOf(idToTransaction.values());
    final List<DOMStoreThreePhaseCommitCohort> cohorts = new ArrayList<>(txns.size());
    for (DOMStoreWriteTransaction tx : txns) {
        cohorts.add(tx.ready());
    }

    try {
        return Futures.immediateCheckedFuture(new CommitCoordinationTask(this, cohorts, null).call());
    } catch (TransactionCommitFailedException e) {
        return Futures.immediateFailedCheckedFuture(e);
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:17,代码来源:ShardedDOMDataWriteTransaction.java


示例5: submit

import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; //导入依赖的package包/类
@Override
public CheckedFuture<Void, TransactionCommitFailedException> submit() {
    final AbstractDOMForwardedTransactionFactory<?> impl = IMPL_UPDATER.getAndSet(this, null);
    checkRunning(impl);

    final Collection<T> txns = getSubtransactions();
    final Collection<DOMStoreThreePhaseCommitCohort> cohorts = new ArrayList<>(txns.size());

    // FIXME: deal with errors thrown by backed (ready and submit can fail in theory)
    for (DOMStoreWriteTransaction txn : txns) {
        cohorts.add(txn.ready());
    }

    final CheckedFuture<Void, TransactionCommitFailedException> ret = impl.submit(this, cohorts);
    FUTURE_UPDATER.lazySet(this, ret);
    return ret;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:18,代码来源:DOMForwardedWriteTransaction.java


示例6: submit

import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; //导入依赖的package包/类
@Override
protected CheckedFuture<Void,TransactionCommitFailedException> submit(final DOMDataWriteTransaction transaction,
        final Collection<DOMStoreThreePhaseCommitCohort> cohorts) {
    Preconditions.checkArgument(transaction != null, "Transaction must not be null.");
    Preconditions.checkArgument(cohorts != null, "Cohorts must not be null.");
    LOG.debug("Tx: {} is submitted for execution.", transaction.getIdentifier());

    ListenableFuture<Void> commitFuture = null;
    try {
        commitFuture = executor.submit(new CommitCoordinationTask(transaction, cohorts,
                commitStatsTracker));
    } catch(RejectedExecutionException e) {
        LOG.error("The commit executor's queue is full - submit task was rejected. \n" +
                  executor, e);
        return Futures.immediateFailedCheckedFuture(
                new TransactionCommitFailedException(
                    "Could not submit the commit task - the commit queue capacity has been exceeded.", e));
    }

    return MappingCheckedFuture.create(commitFuture,
            TransactionCommitFailedExceptionMapper.COMMIT_ERROR_MAPPER);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:23,代码来源:SerializedDOMDataBroker.java


示例7: testRejectedCommit

import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; //导入依赖的package包/类
@Test(expected=TransactionCommitFailedException.class)
public void testRejectedCommit() throws Exception {

    commitExecutor.delegate = Mockito.mock( ExecutorService.class );
    Mockito.doThrow( new RejectedExecutionException( "mock" ) )
        .when( commitExecutor.delegate ).execute( Mockito.any( Runnable.class ) );
    Mockito.doNothing().when( commitExecutor.delegate ).shutdown();
    Mockito.doReturn( Collections.emptyList() ).when( commitExecutor.delegate ).shutdownNow();
    Mockito.doReturn( "" ).when( commitExecutor.delegate ).toString();
    Mockito.doReturn( true ).when( commitExecutor.delegate )
        .awaitTermination( Mockito.anyLong(), Mockito.any( TimeUnit.class ) );

    DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
    writeTx.put( OPERATIONAL, TestModel.TEST_PATH, ImmutableNodes.containerNode(TestModel.TEST_QNAME) );

    writeTx.submit().checkedGet( 5, TimeUnit.SECONDS );
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:18,代码来源:DOMBrokerTest.java


示例8: submit

import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; //导入依赖的package包/类
@Override
public CheckedFuture<Void, TransactionCommitFailedException> submit() {
    final AbstractDOMTransactionFactory<?> impl = IMPL_UPDATER.getAndSet(this, null);
    checkRunning(impl);

    final Collection<T> txns = getSubtransactions();
    final Collection<DOMStoreThreePhaseCommitCohort> cohorts = new ArrayList<>(txns.size());

    // FIXME: deal with errors thrown by backed (ready and submit can fail in theory)
    for (final T txn : txns) {
        cohorts.add(txn.ready());
    }

    final CheckedFuture<Void, TransactionCommitFailedException> ret = impl.submit(this, cohorts);
    FUTURE_UPDATER.lazySet(this, ret);
    return ret;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:18,代码来源:AbstractDOMBrokerWriteTransaction.java


示例9: submit

import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; //导入依赖的package包/类
@Override
public CheckedFuture<Void, TransactionCommitFailedException> submit(
        final DOMDataWriteTransaction transaction, final Collection<DOMStoreThreePhaseCommitCohort> cohorts) {
    checkNotFailed();
    checkNotClosed();

    final CheckedFuture<Void, TransactionCommitFailedException> ret = broker.submit(transaction, cohorts);

    COUNTER_UPDATER.incrementAndGet(this);
    Futures.addCallback(ret, new FutureCallback<Void>() {
        @Override
        public void onSuccess(final Void result) {
            transactionCompleted();
        }

        @Override
        public void onFailure(final Throwable failure) {
            transactionFailed(transaction, failure);
        }
    }, MoreExecutors.directExecutor());

    return ret;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:24,代码来源:DOMBrokerTransactionChain.java


示例10: submit

import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; //导入依赖的package包/类
@Override
protected CheckedFuture<Void, TransactionCommitFailedException> submit(final DOMDataWriteTransaction transaction,
        final Collection<DOMStoreThreePhaseCommitCohort> cohorts) {

    Preconditions.checkArgument(transaction != null, "Transaction must not be null.");
    Preconditions.checkArgument(cohorts != null, "Cohorts must not be null.");
    LOG.debug("Tx: {} is submitted for execution.", transaction.getIdentifier());

    if (cohorts.isEmpty()) {
        return Futures.immediateCheckedFuture(null);
    }

    final AsyncNotifyingSettableFuture clientSubmitFuture =
            new AsyncNotifyingSettableFuture(clientFutureCallbackExecutor);

    doCanCommit(clientSubmitFuture, transaction, cohorts);

    return MappingCheckedFuture.create(clientSubmitFuture, COMMIT_ERROR_MAPPER);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:20,代码来源:ConcurrentDOMDataBroker.java


示例11: testSubmitWithNegativeCanCommitResponse

import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; //导入依赖的package包/类
@Test
public void testSubmitWithNegativeCanCommitResponse() throws Exception {
    doReturn(Futures.immediateFuture(true)).when(mockCohort1).canCommit();
    doReturn(Futures.immediateFuture(null)).when(mockCohort1).abort();

    doReturn(Futures.immediateFuture(false)).when(mockCohort2).canCommit();
    doReturn(Futures.immediateFuture(null)).when(mockCohort2).abort();

    DOMStoreThreePhaseCommitCohort mockCohort3 = mock(DOMStoreThreePhaseCommitCohort.class);
    doReturn(Futures.immediateFuture(false)).when(mockCohort3).canCommit();
    doReturn(Futures.immediateFuture(null)).when(mockCohort3).abort();

    CheckedFuture<Void, TransactionCommitFailedException> future = coordinator.submit(
            transaction, Arrays.asList(mockCohort1, mockCohort2, mockCohort3));

    assertFailure(future, null, mockCohort1, mockCohort2, mockCohort3);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:18,代码来源:ConcurrentDOMDataBrokerTest.java


示例12: testSubmitWithPreCommitException

import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; //导入依赖的package包/类
@Test
public void testSubmitWithPreCommitException() throws Exception {
    doReturn(Futures.immediateFuture(true)).when(mockCohort1).canCommit();
    doReturn(Futures.immediateFuture(null)).when(mockCohort1).preCommit();
    doReturn(Futures.immediateFuture(null)).when(mockCohort1).abort();

    doReturn(Futures.immediateFuture(true)).when(mockCohort2).canCommit();
    IllegalStateException cause = new IllegalStateException("mock");
    doReturn(Futures.immediateFailedFuture(cause)).when(mockCohort2).preCommit();
    doReturn(Futures.immediateFuture(null)).when(mockCohort2).abort();

    DOMStoreThreePhaseCommitCohort mockCohort3 = mock(DOMStoreThreePhaseCommitCohort.class);
    doReturn(Futures.immediateFuture(true)).when(mockCohort3).canCommit();
    doReturn(Futures.immediateFailedFuture(new IllegalStateException("mock2")))
            .when(mockCohort3).preCommit();
    doReturn(Futures.immediateFuture(null)).when(mockCohort3).abort();

    CheckedFuture<Void, TransactionCommitFailedException> future = coordinator.submit(
            transaction, Arrays.asList(mockCohort1, mockCohort2, mockCohort3));

    assertFailure(future, cause, mockCohort1, mockCohort2, mockCohort3);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:23,代码来源:ConcurrentDOMDataBrokerTest.java


示例13: testSubmitWithCommitException

import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; //导入依赖的package包/类
@Test
public void testSubmitWithCommitException() throws Exception {
    doReturn(Futures.immediateFuture(true)).when(mockCohort1).canCommit();
    doReturn(Futures.immediateFuture(null)).when(mockCohort1).preCommit();
    doReturn(Futures.immediateFuture(null)).when(mockCohort1).commit();
    doReturn(Futures.immediateFuture(null)).when(mockCohort1).abort();

    doReturn(Futures.immediateFuture(true)).when(mockCohort2).canCommit();
    doReturn(Futures.immediateFuture(null)).when(mockCohort2).preCommit();
    IllegalStateException cause = new IllegalStateException("mock");
    doReturn(Futures.immediateFailedFuture(cause)).when(mockCohort2).commit();
    doReturn(Futures.immediateFuture(null)).when(mockCohort2).abort();

    DOMStoreThreePhaseCommitCohort mockCohort3 = mock(DOMStoreThreePhaseCommitCohort.class);
    doReturn(Futures.immediateFuture(true)).when(mockCohort3).canCommit();
    doReturn(Futures.immediateFuture(null)).when(mockCohort3).preCommit();
    doReturn(Futures.immediateFailedFuture(new IllegalStateException("mock2")))
            .when(mockCohort3).commit();
    doReturn(Futures.immediateFuture(null)).when(mockCohort3).abort();

    CheckedFuture<Void, TransactionCommitFailedException> future = coordinator.submit(
            transaction, Arrays.asList(mockCohort1, mockCohort2, mockCohort3));

    assertFailure(future, cause, mockCohort1, mockCohort2, mockCohort3);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:26,代码来源:ConcurrentDOMDataBrokerTest.java


示例14: testEmptyTransactionSubmitSucceeds

import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; //导入依赖的package包/类
@Test
public void testEmptyTransactionSubmitSucceeds() throws ExecutionException, InterruptedException {
    DOMStore domStore = mock(DOMStore.class);
    try (ConcurrentDOMDataBroker dataBroker = new ConcurrentDOMDataBroker(ImmutableMap.of(
            LogicalDatastoreType.OPERATIONAL, domStore, LogicalDatastoreType.CONFIGURATION, domStore),
            futureExecutor)) {

        CheckedFuture<Void, TransactionCommitFailedException> submit1 =
                dataBroker.newWriteOnlyTransaction().submit();

        assertNotNull(submit1);

        submit1.get();

        CheckedFuture<Void, TransactionCommitFailedException> submit2 =
                dataBroker.newReadWriteTransaction().submit();

        assertNotNull(submit2);

        submit2.get();
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:23,代码来源:ConcurrentDOMDataBrokerTest.java


示例15: testBasicProducer

import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; //导入依赖的package包/类
/**
 * A simple unbound producer. It write some basic things into the data store based on the
 * test model.
 * @throws DOMDataTreeProducerException
 * @throws TransactionCommitFailedException
 */
@Test
public final void testBasicProducer() throws DOMDataTreeProducerException, TransactionCommitFailedException {
    // Create a producer. It is an AutoCloseable resource, hence the try-with pattern
    try (final DOMDataTreeProducer prod = service().createProducer(Collections.singleton(UNORDERED_CONTAINER_TREE))) {
        assertNotNull(prod);

        final DOMDataWriteTransaction tx = prod.createTransaction(true);
        assertNotNull(tx);

        tx.put(LogicalDatastoreType.OPERATIONAL, UNORDERED_CONTAINER_IID, ImmutableContainerNodeBuilder.create().build());

        final CheckedFuture<Void, TransactionCommitFailedException> f = tx.submit();
        assertNotNull(f);

        f.checkedGet();
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:24,代码来源:AbstractDOMDataTreeServiceTestSuite.java


示例16: prepareInterfaceWithIcmpAcl

import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; //导入依赖的package包/类
protected void prepareInterfaceWithIcmpAcl() throws TransactionCommitFailedException {
    // Given
    Matches matches = newMatch(AclConstants.SOURCE_LOWER_PORT_UNSPECIFIED,
            AclConstants.SOURCE_UPPER_PORT_UNSPECIFIED, AclConstants.DEST_LOWER_PORT_2,
            AclConstants.DEST_UPPER_PORT_3, AclConstants.SOURCE_REMOTE_IP_PREFIX_UNSPECIFIED,
            AclConstants.DEST_REMOTE_IP_PREFIX_SPECIFIED, (short) NwConstants.IP_PROT_ICMP);
    dataBrokerUtil.put(new IdentifiedAceBuilder().sgUuid(SG_UUID_1).newRuleName(SR_UUID_1_1)
            .newMatches(matches).newDirection(DirectionEgress.class).newRemoteGroupId(new Uuid(SG_UUID_1)).build());

    matches = newMatch(AclConstants.SOURCE_LOWER_PORT_UNSPECIFIED, AclConstants.SOURCE_UPPER_PORT_UNSPECIFIED,
            AclConstants.DEST_LOWER_PORT_2, AclConstants.DEST_UPPER_PORT_3,
            AclConstants.SOURCE_REMOTE_IP_PREFIX_SPECIFIED, AclConstants.DEST_REMOTE_IP_PREFIX_UNSPECIFIED,
            (short) NwConstants.IP_PROT_ICMP);
    dataBrokerUtil.put(new IdentifiedAceBuilder().sgUuid(SG_UUID_1).newRuleName(SR_UUID_1_2)
            .newMatches(matches).newDirection(DirectionIngress.class).build());
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:17,代码来源:AclServiceTestBase.java


示例17: scheduleCentralizedSwitch

import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; //导入依赖的package包/类
@Override
public boolean scheduleCentralizedSwitch(Routers router) {
    BigInteger nextSwitchId = getSwitchWithLowestWeight();
    String routerName = router.getRouterName();
    RouterToNaptSwitchBuilder routerToNaptSwitchBuilder =
            new RouterToNaptSwitchBuilder().setRouterName(routerName);
    RouterToNaptSwitch id = routerToNaptSwitchBuilder.setPrimarySwitchId(nextSwitchId).build();
    addToDpnMaps(routerName, router.getSubnetIds(), nextSwitchId);
    try {
        SingleTransactionDataBroker.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION,
                getNaptSwitchesIdentifier(routerName), id);
        switchWeightsMap.put(nextSwitchId,switchWeightsMap.get(nextSwitchId) + 1);

    } catch (TransactionCommitFailedException e) {
        LOG.error("ScheduleCentralizedSwitch failed for {}", routerName);
    }
    return true;

}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:20,代码来源:WeightedCentralizedSwitchScheduler.java


示例18: addPrefixToInterface

import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; //导入依赖的package包/类
static void addPrefixToInterface(DataBroker broker, long vpnId, String interfaceName, String ipPrefix,
                                 BigInteger dpId, Uuid subnetId, Prefixes.PrefixCue prefixCue) {
    InstanceIdentifier<Prefixes> prefixId = InstanceIdentifier.builder(PrefixToInterface.class)
            .child(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.prefix.to._interface
                    .VpnIds.class, new org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.prefix
                    .to._interface.VpnIdsKey(vpnId))
            .child(Prefixes.class, new PrefixesKey(ipPrefix)).build();
    PrefixesBuilder prefixBuilder = new PrefixesBuilder().setDpnId(dpId).setIpAddress(ipPrefix);
    prefixBuilder.setVpnInterfaceName(interfaceName).setSubnetId(subnetId).setPrefixCue(prefixCue);
    try {
        SingleTransactionDataBroker.syncWrite(broker, LogicalDatastoreType.OPERATIONAL, prefixId,
                prefixBuilder.build());
    } catch (TransactionCommitFailedException e) {
        LOG.error("addPrefixToInterface : Failed to write prefxi-to-interface for {} vpn-id {} DPN {}",
                ipPrefix, vpnId, dpId, e);
    }
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:18,代码来源:NatUtil.java


示例19: removeMipAdjacency

import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; //导入依赖的package包/类
private void removeMipAdjacency(String fixedip, String vpnName, String interfaceName) {
    synchronized (interfaceName.intern()) {
        InstanceIdentifier<VpnInterface> vpnIfId = VpnUtil.getVpnInterfaceIdentifier(interfaceName);
        InstanceIdentifier<Adjacencies> path = vpnIfId.augmentation(Adjacencies.class);
        Optional<Adjacencies> adjacencies = VpnUtil.read(dataBroker, LogicalDatastoreType.CONFIGURATION, path);
        if (adjacencies.isPresent()) {
            InstanceIdentifier<Adjacency> adid = vpnIfId.augmentation(Adjacencies.class).child(Adjacency.class,
                new AdjacencyKey(ipToPrefix(fixedip)));
            try {
                SingleTransactionDataBroker.syncDelete(dataBroker, LogicalDatastoreType.CONFIGURATION, adid);
            } catch (TransactionCommitFailedException e) {
                LOG.error("Failed to delete the learned-ip-adjacency for vpn {} interface {} prefix {}",
                        vpnName, interfaceName, ipToPrefix(fixedip), e);
                return;
            }
            LOG.info("Successfully deleted the learned-ip-adjacency prefix {} on vpn {} for interface {}",
                    ipToPrefix(fixedip), vpnName, interfaceName);
        }
    }
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:21,代码来源:ArpMonitorStopTask.java


示例20: removeDpnFromSubnet

import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; //导入依赖的package包/类
private void removeDpnFromSubnet(Uuid subnetId, BigInteger dpnId) {
    try {
        InstanceIdentifier<SubnetOpDataEntry> subOpIdentifier =
            InstanceIdentifier.builder(SubnetOpData.class).child(SubnetOpDataEntry.class,
                new SubnetOpDataEntryKey(subnetId)).build();
        InstanceIdentifier<SubnetToDpn> dpnOpId =
            subOpIdentifier.child(SubnetToDpn.class, new SubnetToDpnKey(dpnId));
        Optional<SubnetToDpn> optionalSubDpn = VpnUtil.read(broker, LogicalDatastoreType.OPERATIONAL, dpnOpId);
        if (!optionalSubDpn.isPresent()) {
            LOG.warn("removeDpnFromSubnet: Cannot delete, SubnetToDpn for subnet {} DPN {} not available"
                    + " in datastore", subnetId.getValue(), dpnId);
            return;
        }
        LOG.trace("removeDpnFromSubnet: Deleting SubnetToDpn entry for subnet {} with DPNId {}",
                subnetId.getValue(), dpnId);
        SingleTransactionDataBroker.syncDelete(broker, LogicalDatastoreType.OPERATIONAL, dpnOpId);
    } catch (TransactionCommitFailedException ex) {
        LOG.error("removeDpnFromSubnet: Deletion of SubnetToDpn for subnet {} with DPN {} failed",
                subnetId.getValue(), dpnId, ex);
    }
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:22,代码来源:SubnetOpDpnManager.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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