private void createTxChain(final DataBroker dataBroker) { txChainFactory = dataBroker.createTransactionChain(TransactionChainManager.this); }
OperationProcessor(final DataBroker dataBroker) { this.dataBroker = Preconditions.checkNotNull(dataBroker); this.queue = new LinkedBlockingQueue<HostTrackerOperation>(QUEUE_DEPTH); this.transactionChain = dataBroker.createTransactionChain(this); }
/** * Reset a transaction chain by closing the current chain and starting a new one */ private synchronized void initTransactionChain() { LOG.debug("Initializing transaction chain for topology {}", this); Preconditions.checkState(this.chain == null, "Transaction chain has to be closed before being initialized"); this.chain = this.dataProvider.createTransactionChain(this); }
public TransactionInvokerImpl(DataBroker db) { this.db = db; this.chain = db.createTransactionChain(this); ThreadFactory threadFact = new ThreadFactoryBuilder().setNameFormat("transaction-invoker-impl-%d").build(); executor = Executors.newSingleThreadExecutor(threadFact); executor.submit(this); }
public OperationProcessor(final DataBroker dataBroker) { this.dataBroker = Preconditions.checkNotNull(dataBroker); transactionChain = this.dataBroker.createTransactionChain(this); thread = new Thread(this); thread.setDaemon(true); thread.setName("FlowCapableTopologyExporter-" + FlowCapableTopologyProvider.TOPOLOGY_ID); }
public StatisticsManagerImpl (final DataBroker dataBroker, final StatisticsManagerConfig statManagerconfig) { statManagerConfig = Preconditions.checkNotNull(statManagerconfig); this.dataBroker = Preconditions.checkNotNull(dataBroker, "DataBroker can not be null!"); ThreadFactory threadFact; threadFact = new ThreadFactoryBuilder().setNameFormat("odl-stat-rpc-oper-thread-%d").build(); statRpcMsgManagerExecutor = Executors.newSingleThreadExecutor(threadFact); threadFact = new ThreadFactoryBuilder().setNameFormat("odl-stat-ds-oper-thread-%d").build(); statDataStoreOperationServ = Executors.newSingleThreadExecutor(threadFact); txChain = dataBroker.createTransactionChain(this); }
public StatisticsManagerImpl (final DataBroker dataBroker, final StatisticsManagerConfig statManagerconfig) { statManagerConfig = Preconditions.checkNotNull(statManagerconfig); this.dataBroker = Preconditions.checkNotNull(dataBroker, "DataBroker can not be null!"); ThreadFactory threadFact; threadFact = new ThreadFactoryBuilder().setNameFormat("odl-stat-rpc-oper-thread-%d").build(); statRpcMsgManagerExecutor = Executors.newSingleThreadExecutor(threadFact); threadFact = new ThreadFactoryBuilder().setNameFormat("odl-stat-ds-oper-thread-%d").build(); statDataStoreOperationServ = Executors.newSingleThreadExecutor(threadFact); txChain = dataBroker.createTransactionChain(this); }
@Override public BindingTransactionChain createTransactionChain(TransactionChainListener listener) { return delegate().createTransactionChain(listener); }
/** * Recreate transaction chain if error occurred and decrement allowed error rate counter */ private void reinitializeChain() { closed.decrementAndGet(); bindingTransactionChain.close(); bindingTransactionChain = dataBroker.createTransactionChain(chainListener); }
private void resetTransactionQueue() { chain.close(); chain = db.createTransactionChain(this); pendingTransactions = new ArrayList<>(); transactionToCommand = new HashMap<>(); failedTransactionQueue.clear(); successfulTransactionQueue.clear(); }
void start() { final NodeChangeCommiter changeCommiter = new NodeChangeCommiter(FlowCapableInventoryProvider.this); this.listenerRegistration = this.notificationService.registerNotificationListener(changeCommiter); this.txChain = (dataBroker.createTransactionChain(this)); thread = new Thread(this); thread.setDaemon(true); thread.setName("FlowCapableInventoryProvider"); thread.start(); LOG.info("Flow Capable Inventory Provider started."); }
static synchronized void initTransactionChain() { try { if (fibTransact != null) { fibTransact.close(); LOG.error("*** TxChain Close, *** Attempts: {}", txChainAttempts); fibTransact = null; } } catch (Exception ignore) { } BgpUtil.fibTransact = dataBroker.createTransactionChain(new BgpUtilTransactionChainListener()); txChainAttempts++; }
private void resetTransactionChainForAdapaters() { txChain = Preconditions.checkNotNull(dataBroker).createTransactionChain(transactionChainListener); datastoreAdapter.setTxChain(txChain); topologyDatastoreAdapter.setTxChain(txChain); logger.trace("{}: Resetting TransactionChain {}", id, txChain); }
public TopologyNodeState(final DataBroker broker, final InstanceIdentifier<Topology> topology, final NodeId id, final long holdStateNanos) { Preconditions.checkArgument(holdStateNanos >= 0); this.nodeId = topology.child(Node.class, new NodeKey(id)); this.holdStateNanos = holdStateNanos; this.chain = broker.createTransactionChain(this); }
@Override public void onTransactionChainFailed(TransactionChain<?, ?> chain, AsyncTransaction<?, ?> transaction, Throwable cause) { LOG.warn("Failed to export Topology manager operations, Transaction {} failed: {}", transaction.getIdentifier(), cause.getMessage()); LOG.debug("Failed to export Topology manager operations.. ", cause); transactionChain.close(); transactionChain = dataBroker.createTransactionChain(this); cleanDataStoreOperQueue(); }
@Override public void onSessionInitiated(final BindingAwareBroker.ProviderContext session) { logger.debug("{}: Session with sal established {}", id, session); this.dataBroker = session.getSALService(DataBroker.class); txChain = Preconditions.checkNotNull(dataBroker).createTransactionChain(transactionChainListener); datastoreAdapter = new NetconfDeviceDatastoreAdapter(id, txChain); topologyDatastoreAdapter = new NetconfDeviceTopologyAdapter(id, txChain); }
private void chainFailure() { try { transactionChain.close(); transactionChain = dataBroker.createTransactionChain(this); clearQueue(); } catch (IllegalStateException e) { LOG.warn(e.getLocalizedMessage()); } }
public TopologyDataChangeCounter(final DataBroker dataBroker, final String counterId) { this.dataBroker = dataBroker; this.chain = this.dataBroker.createTransactionChain(this); this.counterId = counterId; this.counterInstanceId = InstanceIdentifier.builder(DataChangeCounter.class) .child(Counter.class, new CounterKey(this.counterId)).build(); this.count = new AtomicLong(0); putCount(this.count.get()); LOG.debug("Data change counter {} initiated", this.counterId); }
private void submitTransaction(ReadWriteTransaction tx) { try { tx.submit().checkedGet(); } catch (final TransactionCommitFailedException e) { LOG.warn("Stat DataStoreOperation unexpected State!", e); transactionChain.close(); transactionChain = dataBroker.createTransactionChain(this); cleanDataStoreOperQueue(); } }
public BGPConfigModuleMapperProvider(final DataBroker dataBroker, final BGPConfigStateStore configStateHolders) { Preconditions.checkNotNull(configStateHolders); this.txChain = Preconditions.checkNotNull(dataBroker).createTransactionChain(this); configMapperRegistry.registerOpenConfigMapper(new BGPGlobalProviderImpl(txChain, configStateHolders)); configMapperRegistry.registerOpenConfigMapper(new BGPNeighborProviderImpl(txChain, configStateHolders)); configMapperRegistry.registerOpenConfigMapper(new BGPAppNeighborProviderImpl(txChain, configStateHolders)); }