reef-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julia Wang (QIUHE)" <Qiuhe.W...@microsoft.com>
Subject RE: REEF Services
Date Tue, 02 Feb 2016 18:02:21 GMT
> I haven't seen a case where a Service is not tied to a Context yet.
> But the term "Service" is a bit confusing though since it can be 
> interpreted in a few ways.
> When we say Slider can be a service in REEF, the service does not mean 
> a REEF Service component.
>

This is a good point. It really depends on what services. Examples are Naming Service, Network
Service. If we need one service per context, then it should be tight to context. If we only
need singleton in entire evaluator, it should be tight to evaluator. If any service is at
task level, then it should be tight to task I guess. 

Thanks,
Julia

-----Original Message-----
From: Andrew Chung [mailto:afchung90@gmail.com] 
Sent: Tuesday, February 2, 2016 9:43 AM
To: dev@reef.apache.org
Subject: Re: REEF Services

Thanks for the comments Gon! Replies inline.

On Tue, Feb 2, 2016 at 2:13 AM, Byung-Gon Chun <bgchun@gmail.com> wrote:
> Thanks, Andrew!
>
> On Tue, Feb 2, 2016 at 9:25 AM, Andrew Chung <afchung90@gmail.com> wrote:
>
>> Hi All,
>>
>> Recently, I have been going over the .NET Evaluator code to implement 
>> various missing features and have been cross comparing the code with 
>> Java code.
>>
>> I have come across a few potential issues and questions with regards 
>> to REEF Services:
>> 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 
>> https://na01.safelinks.protection.outlook.com/?url=ContextRuntime.java&data=01%7c01%7cQiuhe.Wang%40microsoft.com%7c034bee95cec24eb3304208d32bf86dc9%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=AnXjkvcWKBGkF7%2bT6U0TAoEDLYfO8tdnEOqPd0d6U90%3d),
I believe this is the case.
>>
>
> I haven't seen a case where a Service is not tied to a Context yet.
> But the term "Service" is a bit confusing though since it can be 
> interpreted in a few ways.
> When we say Slider can be a service in REEF, the service does not mean 
> a REEF Service component.
>

I agree, though changing the term at this point may require significant effort... Seeing how
`ServiceConfiguration` submission is tied to submission on top of an `ActiveContext`, I think
we are safe to make the assumption that a REEF Service is tied to a Context.

>
>> 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.
>>
>
> Should we be concerned about item 2?
>

I believe so. Local variable Object construction without using the Object and expecting it
to be created or stick around is never good. A solution is to tie services as a private variable
to `ContextRuntime`, if Services are indeed tied to Contexts.
See: https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fstackoverflow.com%2fquestions%2f15205016%2fcan-unused-private-variables-be-gced-before-their-holding-instance&data=01%7c01%7cQiuhe.Wang%40microsoft.com%7c034bee95cec24eb3304208d32bf86dc9%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=UvglLSts8Y36RsJcSQFa7D8KrcxpAMimUBYrJHeL%2fs0%3d

>
>>
>> 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()`.
>> 2. Make `ContextRuntime` implement `AutoCloseable`.
>> 3. Close `Service` only when `ContextRuntime` is closed.
>>
>> How does this sound? Note that this may require modifications to the 
>> `ServiceConfiguration` API we expose now.
>>
>> Thanks,
>> Andrew
>>
>
>
>
> --
> Byung-Gon Chun
Mime
View raw message