org.apache.storm.scheduler.utils

## Class ArtifactoryConfigLoader

- java.lang.Object
- - org.apache.storm.scheduler.utils.ArtifactoryConfigLoader

- All Implemented Interfaces:
    IConfigLoader

      public class ArtifactoryConfigLoader
      extends Object
      implements IConfigLoader

  A dynamic loader that can load scheduler configurations for user resource guarantees from Artifactory (an artifact repository manager). This is not thread-safe.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static String` | `LOCAL_ARTIFACT_DIR`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ArtifactoryConfigLoader(Map<String,Object> conf)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected String` | `doGet(String api, String artifact, String host, Integer port)` Protected so we can override this in unit tests.
    `Map<String,Object>` | `load(String configKey)` Load the configs associated with the configKey from the targetURI.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### LOCAL_ARTIFACT_DIR

          protected static final String LOCAL_ARTIFACT_DIR

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ArtifactoryConfigLoader

          public ArtifactoryConfigLoader(Map<String,Object> conf)

  - ### Method Detail

    - #### load

          public Map<String,Object> load(String configKey)

      Load the configs associated with the configKey from the targetURI.

      Specified by:
        `load` in interface `IConfigLoader`
      Parameters:
        `configKey` - The key from which we want to get the scheduler config.
      Returns:
        The scheduler configuration if exists; null otherwise.

    - #### doGet

          protected String doGet(String api,
                                 String artifact,
                                 String host,
                                 Integer port)

      Protected so we can override this in unit tests.

      Parameters:
        `api` - null if we are trying to download artifact, otherwise a string to call REST api, e.g. “/api/storage”
        `artifact` - location of artifact
        `host` - Artifactory hostname
        `port` - Artifactory port
      Returns:
        null on failure or the response string if return code is in 200 range

Copyright © 2021 The Apache Software Foundation. All rights reserved.