Finalizes the indices and sends the rest of the data to the output.
Afterwards the database connection will be closed.

@throws WikiApiException
if an error occurs
432658
public void close()
		throws WikiApiException
	{

		try {
			this.revisionIndex.finalizeIndex();
			this.chronoIndex.finalizeIndex();

			info.setEndRevisionCount(lastRev.getRevisionCounter());
			this.infoList.add(info);

			this.articleIndex.add(currentArticleID, startTime, endTime,
					infoList);
			this.articleIndex.finalizeIndex();

			send();

			this.indexWriter.finish();

			if (connection != null) {
				this.connection.close();
			}

		}
		catch (SQLException sql) {
			sql.printStackTrace();
			throw new WikiApiException(sql);
		}
		catch (IOException sql) {
			sql.printStackTrace();
			throw new WikiApiException(sql);
		}
	}
1079843
public function finish()
	{
		try {
			$this->_statement->closeCursor();
		} catch ( PDOException $e ) {
			throw new MW_DB_Exception( $e->getMessage(), $e->getCode(), $e->errorInfo );
		}
	}
709386
public void close() throws SQLException {
    if (!closed) {
      // flush any open output streams
      if (os != null) {
        try {
          // we can't call os.close() otherwise we go into an infinite loop!
          os.flush();
        } catch (IOException ioe) {
          throw new PSQLException("Exception flushing output stream", PSQLState.DATA_ERROR, ioe);
        } finally {
          os = null;
        }
      }

      // finally close
      FastpathArg[] args = new FastpathArg[1];
      args[0] = new FastpathArg(fd);
      fp.fastpath("lo_close", args); // true here as we dont care!!
      closed = true;
      if (this.commitOnClose) {
        this.conn.commit();
      }
    }
  }
1354297
@Override
  public void close()
  {
    super.close();
    facts.clear();
    indexAndOffsets.clear();

    if (selectors != null) {
      selectors.clear();
    }

    Closer c = Closer.create();
    aggBuffers.forEach(c::register);
    try {
      c.close();
    }
    catch (IOException e) {
      throw new RuntimeException(e);
    }
    aggBuffers.clear();
  }
1289393
@Override
  public void close() throws IOException {
    delegateFieldsProducer.close();
    for (Entry<String, IndexInput> entry : indexInputList.entrySet()) {
      entry.getValue().close();
    }
  }
894069
public void close() {
    if (lock != null) {
      lock.lock();
    }
    this.connected = false;
    try {
      /* If a streaming result set is open, close it.*/
      skip();
    } catch (Exception e) {
      /* eat exception */
    }

    SendClosePacket.send(writer);
    closeSocket(reader, writer, socket);
    cleanMemory();
    if (lock != null) {
      lock.unlock();
    }
  }
17799
public void close()
        throws IOException
    {
        try{
            _completing=true;
            if (_connection instanceof Socket && !(_connection instanceof SSLSocket))
                ((Socket)_connection).shutdownOutput();
            _outputStream.close();
            _inputStream.close();
        }
        finally
        {
            if (_handlingThread!=null && Thread.currentThread()!=_handlingThread)
                _handlingThread.interrupt();
        }
    }
1015148
void finishConnection() {
    NioSocketConnector conn = this.connector;
    if (conn != null) {
      this.connector = null;
      conn.dispose();
      for (ConnectionListener listener : this.connectionListeners) {
        listener.connectionEnded(this);
      }
    }
    ExecutorFilter execs = this.executors;
    if (execs != null) {
      this.executors = null;
      execs.destroy();

    }
  }
1180458
public void finish() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Finishing " + this);
        }
        // if there is a print writer, flush any content unless it is already
        // closed. We don't need to do this with streams.
        if (null != this.outWriter) {
            this.outWriter.checkError();
        }
    }
203185
public void finish() {
        if (mAccountAuthenticatorResponse != null) {
            // send the result bundle back if set, otherwise send an error.
            if (mResultBundle != null) {
                mAccountAuthenticatorResponse.onResult(mResultBundle);
            } else {
                mAccountAuthenticatorResponse.onError(AccountManager.ERROR_CODE_CANCELED,
                        "canceled");
            }
            mAccountAuthenticatorResponse = null;
        }
        super.finish();
    }
761354
private void closeDataReader() throws IOException {
    if (mCurrentChunk != null) {
      mCurrentChunk.release();
      mCurrentChunk = null;
    }
    if (mDataReader != null) {
      mDataReader.close();
    }
    mDataReader = null;
  }
1020167
public void close() {
    if (indexManager != null)
      indexManager.flush();
    if (schema != null)
      schema.close();
    if (security != null)
      security.close();
  }
1247684
public function finalize(): void
    {
        if ($this->currentAnnotation !== null) {
            if ($this->currentAnnotationContent === null) {
                $this->parsedAnnotations[] = $this->currentAnnotation;
            } else {
                throw new AnnotationParseException(
                    'An annotation content is not closed (you probably forget to close a parenthesis or a quote)'
                );
            }
        }
    }
1323209
private void finalizeCEs() {
        CollationDataBuilder newBuilder = new CollationDataBuilder();
        newBuilder.initForTailoring(baseData);
        CEFinalizer finalizer = new CEFinalizer(nodes.getBuffer());
        newBuilder.copyFrom(dataBuilder, finalizer);
        dataBuilder = newBuilder;
    }
1095235
@Override
    public void close() throws IOException {
        if (!closed) {
            closed = true;
            nodeCursor = null;
            _currToken = null;
        }
    }
629310
@Override
    public void close() {
        if (trainingArchive != null && trainingArchive != weightsArchive) {
            trainingArchive.close();
            trainingArchive = null;
        }
        if (weightsArchive != null) {
            weightsArchive.close();
            weightsArchive = null;
        }
    }
1204417
public void finish() throws IOException
    {
        ensureNotFinished();
        flushBufferedData();
        compressedBuffer[MAGIC_LENGTH] = (byte) (COMPRESSION_METHOD_RAW | compressionLevel);
        writeIntLE(0, compressedBuffer, MAGIC_LENGTH + 1);
        writeIntLE(0, compressedBuffer, MAGIC_LENGTH + 5);
        writeIntLE(0, compressedBuffer, MAGIC_LENGTH + 9);
        assert MAGIC_LENGTH + 13 == HEADER_LENGTH;
        out.write(compressedBuffer, 0, HEADER_LENGTH);
        finished = true;
        out.flush();
    }