reef-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Weimer <>
Subject Re: REEF Services
Date Tue, 02 Feb 2016 18:06:17 GMT
Sorry for being late to the thread!

On 2016-02-01 16:25, Andrew Chung wrote:
> I have come across a few potential issues and questions with regards
>  to REEF Services:

:) One of the least documented parts of the REEF design indeed. You are
in good company.

> 1. What is the scope of a REEF Service? Are they tied to a Context? 
> According to the way the code is currently structured (see 
>, I believe this is the case.

Yes. The idea of a REEF Service is to expand the API surface of REEF
with plug-ins. We really should have called them that, plug-ins. They
come in two flavors:

(1) Driver side Services: These are basically event handlers bound *in
addition to* the event handlers bound by the user. The name service is
one of these, so is the group communications. Further, the Driver side
Services provide injectable objects for the application Driver to use,
e.g. `GroupCommunicationsDriver`. Frequently, those objects provide
facilities to configure the Evaluator side of the same service.

(2) Evaluator side Services: These services predominantly provide
additional injectable objects for the Task to use. Services live in
Contexts, and receive events based on that: `ContextStart`,
`ContextStop`, ... . Further, they receive Task level events `TaskStart`
and `TaskStop`. The reason for putting Services into Contexts is to
provide a life-cycle for the Services that is independent both of the
Evaluator and the Task life-cycle: A Context (and therefore Services)
can span one Task, some Tasks or the entire life of an Evaluator.

> 2. Currently, the Java code does not use the variable `services` from
> `serviceInjector.GetInstance`. I believe it is possible for certain
> implementations of JVM JIT compilers to optimize away services, so
> users may end up not having the Services created at all.

Which file is this in? It might be a bug we need to resolve?

> If a REEF Service is tied to a Context and is only visible by it and
>  its children Contexts, I believe we should do the following: 1. 
> Create a `Service` interface that extends `AutoCloseable` and expose 
> the method `Start()`.

Why not use events for start and stop?

> Note that this may require modifications to the
> `ServiceConfiguration` API we expose now.

Given that Services aren't implemented in .NET right now, that should be
fine :)


View raw message