Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BACKPORT] Add ConfigRecognizer API #17093

Merged
merged 1 commit into from Jun 19, 2020

Commits on Jun 17, 2020

  1. Add ConfigRecognizer API

    This commit introduces the ConfigRecognition API that is meant to
    recognize if a provided declarative configuration is recognized by the
    rules defined in a given implementation. The main use case for this
    implementation is to recognize member, client and failover client XML
    and YAML configurations just by looking into the content of the
    configuration, without building any actual configuration.
    
    Along with the API the following three implementations are added:
    - MemberConfigRecognizer for recognizing member XML and YAML
    configurations
    - ClientConfigRecognizer for recognizing client XML and YAML
    configurations
    - ClientFailoverConfigRecognizer for recognizing failover client XML and
    YAML configurations
    
    All the three are extensible with custom recognizers so that even those
    configurations can be recognized that would otherwise remain
    unrecognized with the built-in set of recognizers that recognizes XML
    and YAML configurations by checking the root node in the provided
    configuration.
    
    The API recognizes configuration provided in InputStreams only, while
    the ConfigBuilder implementations can be built from files defined by
    their location and URLs too. The reason for lacking the support for
    these two options is that both are easy to convert to InputStreams and
    that handling errors caused by non-existing resources, missing
    privileges etc should be handled outside of this API with potentially
    having more contextual information.
    
    The built-in implementations honour parse errors with unrecognized
    configuration. The reason is that the provided InputStream can be tested
    both for XML and YAML configuration and at least one is expected to
    lead to parse errors.
    
    Implements hazelcast#16866
    
    (cherry picked from commit 9457ddc)
    blazember committed Jun 17, 2020
    Configuration menu
    Copy the full SHA
    a546a34 View commit details
    Browse the repository at this point in the history