Class EmptyResourceStorageDao

    • Constructor Detail

      • EmptyResourceStorageDao

        public EmptyResourceStorageDao()
    • Method Detail

      • exists

        public boolean exists​(ResourcePath path,
                              int depth)
        Description copied from interface: ResourceStorageDao
        Verifies if a path contains one or more metrics at the given depth.

        For example, assume we are working with file-system paths, and we have the following file on disk /a/b/c/some.metric. The function should behave as follows:

        • exists('/a/b/c', 0) -> true
        • exists('/a/b', 1) -> true
        • exists('/a/b', 2) -> false
        Specified by:
        exists in interface ResourceStorageDao
        Parameters:
        path - resource path used as the root of the check
        depth - a non-negative integer
        Returns:
        true if one or more metrics exist, false otherwise
      • existsWithin

        public boolean existsWithin​(ResourcePath path,
                                    int depth)
        Description copied from interface: ResourceStorageDao
        Verifies if a path contains one or more metrics within the given depth.

        For example, assume we are working with file-system paths, and we have the following file on disk /a/b/c/some.metric. The function should behave as follows:

        • exists('/a/b/c', 0) -> true
        • exists('/a/b', 1) -> true
        • exists('/a/b', 2) -> true
        • exists('/a', 1) -> false
        Specified by:
        existsWithin in interface ResourceStorageDao
        Parameters:
        path - resource path used as the root of the check
        depth - a non-negative integer
        Returns:
        true if one or more metrics exist, false otherwise
      • children

        public Set<ResourcePath> children​(ResourcePath path,
                                          int depth)
        Description copied from interface: ResourceStorageDao
        Retrieves the set of child paths one level bellow the given path which contain one or more metrics at the given depth.

        For example, assume we are working with file-system paths, and we have the following file on disk /a/b/c/some.metric. The function should behave as follows:

        • children('/a/b', 1) -> {'/a/b/c'}
        • children('/a/b', 2) -> {}
        • children('/a', 2) -> {'b'}
        Specified by:
        children in interface ResourceStorageDao
        Parameters:
        path - resource path used as the root of the check
        depth - a positive integer
        Returns:
        the set of child paths containing metrics
      • updateMetricToResourceMappings

        public void updateMetricToResourceMappings​(ResourcePath path,
                                                   Map<String,​String> metricsNameToResourceNames)
        Description copied from interface: ResourceStorageDao
        Maps the given metric names to the their associated resources names. The resource names are relative to the given path. When persisting to .rrd of .jrb files with storeByGroup enabled, this is used to map the data sources names (metrics) to associated .rrd files (resource names). Other strategies that can infer this information at runtime may chose to ignore calls to this method.
        Specified by:
        updateMetricToResourceMappings in interface ResourceStorageDao
        Parameters:
        path - parent resource path
        metricsNameToResourceNames - metric to resource mappings