@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); }
@DefaultImplementation(YarnContainerRequestHandlerImpl.class) public interface YarnContainerRequestHandler { /** * Enqueue a set of container requests with YARN. * * @param containerRequests */ void onContainerRequest(final AMRMClient.ContainerRequest... containerRequests); }
/** * Implement this interface to set the tracking URL reported to YARN. */ @DefaultImplementation(DefaultTrackingURLProvider.class) public interface TrackingURLProvider { public String getTrackingUrl(); }
/** * Interface for DriverInfoSerializer */ @DefaultImplementation(AvroDriverInfoSerializer.class) public interface DriverInfoSerializer { /** * Build AvroDriverInfo object from raw data * * @param id * @param startTime * @return AvroDriverInfo object */ public AvroDriverInfo toAvro(final String id, final String startTime, final List<AvroReefServiceInfo> services); /** * Convert AvroDriverInfo object to JSon string * * @param avroDriverInfo * @return */ public String toString(final AvroDriverInfo avroDriverInfo); }
/** * interface for EvaluatorListSerializer */ @DefaultImplementation(AvroEvaluatorListSerializer.class) public interface EvaluatorListSerializer { /** * Build AvroEvaluatorList object * * @param evaluatorMap * @param totalEvaluators * @param startTime * @return */ public AvroEvaluatorList toAvro(final Map<String, EvaluatorDescriptor> evaluatorMap, final int totalEvaluators, final String startTime); /** * Convert AvroEvaluatorList to JSon string * * @param avroEvaluatorList * @return */ public String toString(final AvroEvaluatorList avroEvaluatorList); }
/** * (De-)serializes exceptions. */ @DefaultImplementation(DefaultExceptionCodec.class) public interface ExceptionCodec { /** * Deserializes a Throwable that has been serialized using toBytes(). * * @param bytes * @return the Throable or Optional.empty() if the deserialization fails. */ public Optional<Throwable> fromBytes(final byte[] bytes); /** * @param bytes * @return fromBytes(bytes.get()) or Optional.empty() */ public Optional<Throwable> fromBytes(final Optional<byte[]> bytes); /** * @param throwable * @return the serialized form of the given Throwable. */ public byte[] toBytes(final Throwable throwable); }
@DefaultImplementation(HttpServerImpl.class) public interface HttpServer {
@DefaultImplementation(WorkingDirectoryTempFileCreator.class) public interface TempFileCreator {
/** * Manages the RunningJobs a client knows about */ @Private @ClientSide @DefaultImplementation(RunningJobsImpl.class) interface RunningJobs { /** * Closes all registered jobs forcefully. */ public void closeAllJobs(); /** * Processes a status message from a Job. If the Job is already known, the message will be passed on. If it is a * first message, a new RunningJob instance will be created for it. * * @param message */ public void onJobStatusMessage(final RemoteMessage<ReefServiceProtos.JobStatusProto> message); /** * Processes a error message from the resource manager. * * @param runtimeFailure */ public void onRuntimeErrorMessage(final RemoteMessage<ReefServiceProtos.RuntimeErrorProto> runtimeFailure); }
@DefaultImplementation(REEFImplementation.class) public interface REEF extends AutoCloseable {
@ClientSide @Provided @DefaultImplementation(RunningJobImpl.class) public interface RunningJob extends Identifiable, AutoCloseable {