Commits a no-op entry to the log, ensuring any entries from a previous term are committed.
350460
private CompletableFuture<Void> commitInitialEntries() {
    // The Raft protocol dictates that leaders cannot commit entries from previous terms until
    // at least one entry from their current term has been stored on a majority of servers. Thus,
    // we force entries to be appended up to the leader's no-op entry. The LeaderAppender will ensure
    // that the commitIndex is not increased until the no-op entry (appender.index()) is committed.
    CompletableFuture<Void> future = new CompletableFuture<>();
    appender.appendEntries(appender.index()).whenComplete((resultIndex, error) -> {
      context.checkThread();
      if (isOpen()) {
        if (error == null) {
          context.getStateMachine().apply(resultIndex);
          future.complete(null);
        } else {
          context.setLeader(0);
          context.transition(CopycatServer.State.FOLLOWER);
        }
      }
    });
    return future;
  }
906806
CommitLogSegment allocatingFrom()
    {
        CommitLogSegment r = allocatingFrom;
        if (r == null)
        {
            advanceAllocatingFrom(null);
            r = allocatingFrom;
        }
        return r;
    }
1173552
protected function _commit()
    {
        $this->_connect();
        $this->_connection->commit();
        $this->_connection->autocommit(true);
    }
806345
def commit(self, cont = False):
        

        self.journal.close()
        self.journal = None
        os.remove(self.j_file)

        for itm in os.listdir(self.tmp_dir): os.remove(cpjoin(self.tmp_dir, itm))

        if cont is True: self.begin()
676039
public Optional<CommitLog> commitAndGetLogs() throws InvalidKBException {
        if (isClosed()) {
            return Optional.empty();
        }
        try {
            return commitWithLogs();
        } finally {
            String closeMessage = ErrorMessage.TX_CLOSED_ON_ACTION.getMessage("committed", keyspace());
            closeTransaction(closeMessage);
        }
    }
892200
public void commit() {
        Log.info("Committing");
        try {
            indexWriter.commit();
        } catch (IOException e) {
            Log.error(e, "Error while committing");
            throw new RuntimeException(e);
        }
    }
215922
private void commitAndRun(Substream winningSubstream) {
    Runnable postCommitTask = commit(winningSubstream);

    if (postCommitTask != null) {
      postCommitTask.run();
    }
  }
303257
def commit(self):
        
        while len(self.__buffer) > 0:
            self.__run(self.__buffer.pop(0))
764036
private CommitResult commitTransaction(TransactionScope<K> transactionScope) {
    TransactionLog<MapUpdate<K, byte[]>> transactionLog = transactionScope.transactionLog();
    boolean retainTombstones = !activeTransactions.isEmpty();

    List<AtomicMapEvent<K, byte[]>> eventsToPublish = Lists.newArrayList();
    for (MapUpdate<K, byte[]> record : transactionLog.records()) {
      if (record.type() == MapUpdate.Type.VERSION_MATCH) {
        continue;
      }

      K key = record.key();
      checkState(preparedKeys.remove(key), "key is not prepared");

      if (record.type() == MapUpdate.Type.LOCK) {
        continue;
      }

      MapEntryValue previousValue = entries().remove(key);

      // Cancel the previous timer if set.
      cancelTtl(previousValue);

      MapEntryValue newValue = null;

      // If the record is not a delete, create a transactional commit.
      if (record.type() != MapUpdate.Type.REMOVE_IF_VERSION_MATCH) {
        newValue = new MapEntryValue(MapEntryValue.Type.VALUE, currentVersion, record.value(), 0, 0);
      } else if (retainTombstones) {
        // For deletes, if tombstones need to be retained then create and store a tombstone commit.
        newValue = new MapEntryValue(MapEntryValue.Type.TOMBSTONE, currentVersion, null, 0, 0);
      }

      AtomicMapEvent<K, byte[]> event;
      if (newValue != null) {
        entries().put(key, newValue);
        if (!valueIsNull(newValue)) {
          if (!valueIsNull(previousValue)) {
            event = new AtomicMapEvent<>(
                AtomicMapEvent.Type.UPDATE,
                key,
                toVersioned(newValue),
                toVersioned(previousValue));
          } else {
            event = new AtomicMapEvent<>(
                AtomicMapEvent.Type.INSERT,
                key,
                toVersioned(newValue),
                null);
          }
        } else {
          event = new AtomicMapEvent<>(
              AtomicMapEvent.Type.REMOVE,
              key,
              null,
              toVersioned(previousValue));
        }
      } else {
        event = new AtomicMapEvent<>(
            AtomicMapEvent.Type.REMOVE,
            key,
            null,
            toVersioned(previousValue));
      }
      eventsToPublish.add(event);
    }
    publish(eventsToPublish);
    return CommitResult.OK;
  }
8866
def add_log_entry(self, entry):
        
        event_log = self.job_record.event_log
        if len(event_log) > job.MAX_NUMBER_OF_EVENTS:
            del event_log[-1]
        event_log.insert(0, entry)
965068
private function commit()
    {
        //====================================================================//
        // Safety Checks
        if (empty($this->new)) {
            return true;
        }
        //====================================================================//
        // Create Field List
        if (empty($this->fields)) {
            $this->fields = array();
        }
        //====================================================================//
        // Validate New Field
        if (!$this->verify()) {
            $this->new = null;

            return false;
        }
        //====================================================================//
        // Insert Field List
        $this->fields[] = $this->new;
        $this->new = null;

        return true;
    }
642135
def commit(self):
        

        if not self._parent._is_active:
            raise exc.InvalidRequestError("This transaction is inactive")
        yield from self._do_commit()
        self._is_active = False
233513
@SuppressWarnings("unchecked")
    private void performCommit(Subscriber<? super T> subscriber, State state) {
        getConnection(state);
        query.context().endTransactionObserve();
        if (subscriber.isUnsubscribed())
            return;

        debug("committing");
        Conditions.checkTrue(!Util.isAutoCommit(state.con));
        Util.commit(state.con);
        // must close before onNext so that connection is released and is
        // available to a query that might process the onNext
        close(state);

        if (subscriber.isUnsubscribed())
            return;

        subscriber.onNext((T) Integer.valueOf(1));
        debug("committed");
        complete(subscriber);
    }
89529
def addLogEntry(self, entry, save=True):
        """"""
        # create log directory if it doesn't exist
        # error will be thrown if this is not possible
        _busy = Purr.BusyIndicator()
        self._initIndexDir()
        # discard temporary watchers -- these are only used to keep track of
        # deleted files
        self.temp_watchers = {}
        # ignored entries are only there to carry info on ignored data products
        # All we do is save them, and update DP policies based on them
        if entry.ignore:
            entry.save(self.logdir)
        # proper entries are added to list
        else:
            self.entries.append(entry)
            Purr.progressMessage("Saving new log entry")
            # find previous entry -- skip over "ignore" entries
            for prev in self.entries[-2::-1]:
                if not prev.ignore:
                    break
            else:
                prev = None
            entry.setLogDirectory(self.logdir)
            entry.setPrevUpNextLinks(prev=prev, up=os.path.join("..", Purr.RenderIndex.INDEX))
            entry.save()
            self.timestamp = self.last_scan_timestamp
            # regenerate links of previous entry
            prev and prev.generateIndex()
            # and our log may need to be regenerated
            if save:
                self.save()
        self.updatePoliciesFromEntry(entry, new=True)
359433
public function commit()
    {
        if ($this->_hasChanges) {
            $this->_getIndexWriter()->commit();

            $this->_updateDocCount();

            $this->_hasChanges = false;
        }
    }
1060756
public void localCommit()
    {
        if (log.isDebugEnabled()) log.debug("commit was called");
        if (!this.isInLocalTransaction)
        {
            throw new TransactionNotInProgressException("Not in transaction, call begin() before commit()");
        }
        try
        {
            if(!broker.isManaged())
            {
                if (batchCon != null)
                {
                    batchCon.commit();
                }
                else if (con != null)
                {
                    con.commit();
                }
            }
            else
            {
                if(log.isDebugEnabled()) log.debug(
                        "Found managed environment setting in PB, will skip Connection.commit() call");
            }
        }
        catch (SQLException e)
        {
            log.error("Commit on underlying connection failed, try to rollback connection", e);
            this.localRollback();
            throw new TransactionAbortedException("Commit on connection failed", e);
        }
        finally
        {
            this.isInLocalTransaction = false;
            restoreAutoCommitState();
            this.releaseConnection();
        }
    }
669851
public final void commit() {
        ensureNotYetCreated();
        ensureHasChanges();
        alreadyCreated = true;
        area.replaceMulti(Collections.unmodifiableList(list));
    }