Interface NamingConvention

  • All Superinterfaces:
    java.io.Serializable
    All Known Implementing Classes:
    DefaultNamingConvention

    @Internal
    public interface NamingConvention
    extends java.io.Serializable
    Interface wrapping generic convention for naming files.
    • Method Detail

      • defaultConvention

        static NamingConvention defaultConvention​(java.time.Duration rollTimePeriod,
                                                  java.lang.String prefix,
                                                  java.lang.String suffix)
        Return default NamingConvention that is used with BinaryBlobFormat FileFormat.
        Parameters:
        rollTimePeriod - time rolling interval in milliseconds.
        prefix - prefix of all names generated
        suffix - suffix of filenames
        Returns:
        default naming convention with given settings
      • prefixed

        static NamingConvention prefixed​(java.lang.String prefix,
                                         NamingConvention parent)
        Create a NamingConvention that adds prefix to each generated name of parent convention.
        Parameters:
        prefix - prefix to be added to generated names
        parent - the parent convention that generates names
        Returns:
        prefixed NamingConvention
      • nameOf

        java.lang.String nameOf​(long ts)
        Convert given timestamp to string representing atomic time range of this naming convention.
        Parameters:
        ts - timestamp to create name for
        Returns:
        String representation of (prefixable) name representing time range
      • prefixesOf

        java.util.Collection<java.lang.String> prefixesOf​(long minTs,
                                                          long maxTs)
        Convert given time range to prefixes, at least one of which must all Paths in given time range have.
        Parameters:
        minTs - minimal timestamp (inclusive)
        maxTs - maximal timestamp (exclusive)
        Returns:
        String representation of name prefix
      • isInRange

        boolean isInRange​(java.lang.String name,
                          long minTs,
                          long maxTs)
        Validate that the given name belongs to given time range.
        Parameters:
        name - name of the Path
        minTs - minimal timestamp (inclusive)
        maxTs - maximal timestamp (exclusive)
        Returns:
        true if the name belongs to given time range false otherwise
      • parseMinMaxTimestamp

        Pair<java.lang.Long,​java.lang.Long> parseMinMaxTimestamp​(java.lang.String name)
        Parse min and max timestamp from given string.
        Parameters:
        name - name generated by this convention
        Returns:
        Pair of min and max timestamps