XmlContainer::lookupStatistics

#include <DbXml.hpp>

XmlStatistics XmlContainer::lookupStatistics(const std::string &uri,
    const std::string &name, const std::string &index,
    const XmlValue &value = XmlValue())

XmlStatistics XmlContainer::lookupStatistics(XmlTransaction &txn,
    const std::string &uri, const std::string &name,
    const std::string &index, const XmlValue &value = XmlValue())

XmlStatistics XmlContainer::lookupStatistics(const std::string &uri,
    const std::string &name, const std::string &parent_uri,
    const std::string &parent_name, const std::string &index,
    const XmlValue &value = XmlValue())

XmlStatistics XmlContainer::lookupStatistics(XmlTransaction &txn,
    const std::string &uri, const std::string &name,
    const std::string &parent_uri, const std::string &parent_name,
    const std::string &index, const XmlValue &value = XmlValue())

Returns an XmlStatistics object for the identified index. This object identifies the number of keys (both total and unique) maintained for the identified index.

There are two forms of this method: one that you use with non-edge indexes, and one that you use with edge indexes.

Looking up non-edge indexes

#include <DbXml.hpp>

XmlStatistics XmlContainer::lookupStatistics(const std::string &uri,
    const std::string &name, const std::string &index,
    const XmlValue &value = XmlValue())

XmlStatistics XmlContainer::lookupStatistics(XmlTransaction &txn,
    const std::string &uri, const std::string &name,
    const std::string &index, const XmlValue &value = XmlValue()) 

Lookup statistics for the identified index. Note that this form of this method cannot be used to return statistics on edge indices.

Parameters are:

txn

If the operation is to be transaction-protected, this parameter is an XmlTransaction handle returned from XmlManager::createTransaction.

uri

The namespace of the node to which this index is applied.

name

The name of the node to which this index is applied.

index

Identifies the index for which you want statistics returned. The value supplied here must be a valid index. See XmlIndexSpecification::addIndex for a description of valid index specifications.

value

Provides the value to which equality indices must be equal. This parameter is required when returning documents on equality indices, and it is ignored for all other types of indices.

Looking up edge indexes

#include <DbXml.hpp>

XmlStatistics XmlContainer::lookupStatistics(const std::string &uri,
    const std::string &name, const std::string &parent_uri,
    const std::string &parent_name, const std::string &index,
    const XmlValue &value = XmlValue())

XmlStatistics XmlContainer::lookupStatistics(XmlTransaction &txn,
    const std::string &uri, const std::string &name,
    const std::string &parent_uri, const std::string &parent_name,
    const std::string &index, const XmlValue &value = XmlValue())

Lookup statistics for the identified index. Use this form of this method to return statistics on edge indices.

Edge indices are indices maintained for those locations in a document where two nodes (a parent node and a child node) meet. See the Berkeley DB XML Getting Started Guide for details.

Parameters are:

txn

If the operation is to be transaction-protected, this parameter is an XmlTransaction handle returned from XmlManager::createTransaction.

uri

The namespace of the node to which this index is applied.

name

The name of the node to which this index is applied.

parent_uri

The namespace of the parent node to which this edge index is applied.

parent_name

The name of the parent node to which this edge index is applied.

index

Identifies the index for which you want statistics returned. The value supplied here must be a valid index. See XmlIndexSpecification::addIndex for a description of valid index specifications.

value

Provides the value to which equality indices must be equal. This parameter is required when returning documents on equality indices, and it is ignored for all other types of indices.

Errors

The XmlContainer::lookupStatistics method may fail and throw XmlException , encapsulating one of the following non-zero errors:

UNKNOWN_INDEX

Unknown index specification.

Class

XmlContainer

See Also

XmlContainer Methods