io.continual.flowcontrol.controlapi.ConfigTransferService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of continualFlowControl Show documentation
Show all versions of continualFlowControl Show documentation
Continual's flow control system for event processing.
The newest version!
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;
}