io.continual.flowcontrol.controlapi.ConfigTransferService Maven / Gradle / Ivy
package io.continual.flowcontrol.controlapi;
import java.io.InputStream;
import java.util.Map;
import io.continual.flowcontrol.jobapi.FlowControlJob;
/**
* A config transfer service prepares a job's configuration for transfer onto the working
* compute nodes. The service is expected to be used in conjunction with node setup code
* that understands the key/value map returned by the deploy call and can use it to retrieve
* the job configuration later. For example, using a k8s controller, the working pods may
* have an init container that pulls configuration using key/values pushed to the environment.
*/
public interface ConfigTransferService
{
class ServiceException extends Exception
{
public ServiceException ( String msg ) { super(msg); }
public ServiceException ( Throwable t ) { super(t); }
public ServiceException ( String msg, Throwable t ) { super(msg,t); }
private static final long serialVersionUID = 1L;
}
/**
* Prepare a configuration to be pulled into a running deployment and return a fetch key
* @param job
* @return a key to fetch the config
*/
Map deployConfiguration ( FlowControlJob job ) throws ServiceException;
/**
* Fetch a configuration based on a key generated by the deployConfiguration call
* @param byKey
* @return an input stream, or null if not found/invalid
*/
InputStream fetch ( String byKey ) throws ServiceException;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy