/** * Sender or Root. */ @DefaultImplementation(BroadcastSender.class) interface Sender<T> extends GroupCommOperator { /** * Send element to all receivers. */ void send(T element) throws NetworkException, InterruptedException; }
/** * Senders or non-roots. */ @DefaultImplementation(GatherSender.class) interface Sender<T> extends GroupCommOperator { /** * Send the element to the root/receiver. */ void send(T element) throws InterruptedException, NetworkException; }
/** * NameClient interface. */ @DefaultImplementation(NameClient.class) public interface NameResolver extends Stage, Naming { }
/** * Interface to request containers from YARN using AMRMClient.ContainerRequest requests. */ @DefaultImplementation(YarnContainerRequestHandlerImpl.class) public interface YarnContainerRequestHandler { /** * Enqueue a set of container requests with YARN. * * @param containerRequests set of container requests */ void onContainerRequest(final AMRMClient.ContainerRequest... containerRequests); }
/** * Supplies the path to the executable for process (Driver, Evaluator) launches. */ @DefaultImplementation(UnixJVMPathProvider.class) public interface RuntimePathProvider { String getPath(); }
@DefaultImplementation(TimerImpl.class) public interface Timer { void sleep() throws InterruptedException; @NamedParameter(default_value = "10", doc = "Number of seconds to sleep", short_name = "sec") class Seconds implements Name<Integer> { } }
/** * Provides path to job submission directory. */ @DefaultImplementation(JobSubmissionDirectoryProviderImpl.class) public interface JobSubmissionDirectoryProvider { /** * Returns path to job submission directory. * * @return job submission directory */ Path getJobSubmissionDirectoryPath(String applicationId); }
/** * Implement this interface to set the tracking URL reported to YARN. */ @DefaultImplementation(HttpTrackingURLProvider.class) public interface TrackingURLProvider { String getTrackingUrl(); }
/** * The EventHandler that receives the GroupCommunicationMsg. * pertaining to a specific Communication Group */ @DefaultImplementation(value = CommGroupNetworkHandlerImpl.class) public interface CommGroupNetworkHandler extends EventHandler<GroupCommunicationMessage> { void register(Class<? extends Name<String>> operName, EventHandler<GroupCommunicationMessage> handler); void addTopologyElement(Class<? extends Name<String>> operName); GroupCommunicationMessage waitForTopologyUpdate(Class<? extends Name<String>> operName); byte[] waitForTopologyChanges(Class<? extends Name<String>> operName); }
/** * Interface for remote block stores (e.g., GlusterFS, ...). */ @DefaultImplementation(GlusterFileStore.class) public interface RemoteFileStore extends BlockStore { }
/** * Interface for remote block stores (e.g., GlusterFS, ...). */ @DefaultImplementation(GlusterFileStore.class) public interface RemoteFileStore extends BlockStore { }
/** * Receiver or non-roots. */ @DefaultImplementation(ScatterReceiver.class) interface Receiver<T> extends GroupCommOperator { /** * Receive the sub-list of elements targeted for the current receiver. * * @return list of elements targeted for the current receiver. */ List<T> receive() throws InterruptedException, NetworkException; } }
/** * Receivers or Non-roots. */ @DefaultImplementation(BroadcastReceiver.class) interface Receiver<T> extends GroupCommOperator { /** * Receiver the element broadcasted by sender. * * @return the element broadcasted by sender */ T receive() throws NetworkException, InterruptedException; } }
/** * An interface for optimizer, which manages the optimization over submitted IR DAGs through * {@link org.apache.nemo.compiler.optimizer.policy.Policy}s. */ @DefaultImplementation(NemoOptimizer.class) public interface Optimizer { /** * Optimize the submitted DAG. * * @param dag the input DAG to optimize. * @return optimized DAG, reshaped or tagged with execution properties. */ DAG<IRVertex, IREdge> optimizeDag(DAG<IRVertex, IREdge> dag); }
/** * Interface for backend components. * @param <Plan> the physical execution plan to compile the DAG into. */ @DefaultImplementation(NemoBackend.class) public interface Backend<Plan> { /** * Compiles a DAG to a physical execution plan. * * @param dag the DAG to compile. * @return the execution plan generated. * @throws Exception Exception on the way. */ Plan compile(DAG<IRVertex, IREdge> dag) throws Exception; }
/** * An interface for optimizer, which manages the optimization over submitted IR DAGs through * {@link org.apache.nemo.compiler.optimizer.policy.Policy}s. */ @DefaultImplementation(NemoOptimizer.class) public interface Optimizer { /** * Optimize the submitted DAG. * * @param dag the input DAG to optimize. * @return optimized DAG, reshaped or tagged with execution properties. */ DAG<IRVertex, IREdge> optimizeDag(DAG<IRVertex, IREdge> dag); }
/** * Interface for EvaluatorInfoSerializer. */ @DefaultImplementation(AvroEvaluatorInfoSerializer.class) public interface EvaluatorInfoSerializer { /** * Build AvroEvaluatorsInfo object from raw data. */ AvroEvaluatorsInfo toAvro( final List<String> ids, final Map<String, EvaluatorDescriptor> evaluators); /** * Convert AvroEvaluatorsInfo object to JSON string. */ String toString(final AvroEvaluatorsInfo avroEvaluatorsInfo); }
/** * Provides security token for setting up YARN container context. */ @DefaultImplementation(UserCredentialSecurityTokenProvider.class) public interface SecurityTokenProvider { /** * Returns a ByteBuffer containing security tokens. * @return a ByteBuffer */ byte[] getTokens(); /** * Add serialized tokens to the credentials. * @param tokens ByteBuffer containing tokens. */ void addTokens(final byte[] tokens); }
/** * Senders or non roots. */ @DefaultImplementation(ReduceSender.class) interface Sender<T> extends GroupCommOperator { /** * Send the element to the root. */ void send(T element) throws NetworkException, InterruptedException; /** * The {@link ReduceFunction} to be applied on the set of received values. * * @return {@link ReduceFunction} */ Reduce.ReduceFunction<T> getReduceFunction(); }