On Fri, May 26, 2017 at 11:29 AM, Denis Magda <dma...@apache.org> wrote:

> > Can we just fix the exception
> > message to clearly state that client mode requires all explicit
> > configuration for such and such functionality?
>
> I don’t like this. It will require me as a user:
>
> * have a separate configuration for clients ALL the times.
> * initialize the memory bean explicitly which looks like a hack and
> workaround
>
> <property name="memoryConfiguration">
>    <bean class="org.apache.ignite.configuration.MemoryConfiguration">
>    </bean>
> </property>
>
>
Denis,

Why would you even have a use case for a persistence configuration on the
client side? What happened in your case was a mistake and you should have
received a proper exception. I am simply suggesting that in the odd case
that someone does need it, we provide proper error message explaining
exactly what needs to be done. Why not?


> > On May 26, 2017, at 11:02 AM, Dmitriy Setrakyan <dsetrak...@apache.org>
> wrote:
> >
> > I don't like ignoring any configuration, but I do agree that enabling
> > persistence on the client side seems odd. Can we just fix the exception
> > message to clearly state that client mode requires all explicit
> > configuration for such and such functionality?
> >
> > D.
> >
> > On Fri, May 26, 2017 at 10:34 AM, Sergey Chugunov <
> sergey.chugu...@gmail.com
> >> wrote:
> >
> >> Denis,
> >>
> >> Thanks for quick reply,
> >>
> >> I made a change and tested it with your example, everything looks fine.
> >>
> >> Pull request is open and available at [1]
> >>
> >> [1] https://github.com/apache/ignite/pull/2016
> >>
> >> On Fri, May 26, 2017 at 8:25 PM, Denis Magda <dma...@apache.org> wrote:
> >>
> >>>> I would suggest on the first iteration to simply ignore persistence
> >>>> configuration on client nodes.
> >>>> If client node finds persistence configuration on startup it will
> >>> printout
> >>>> warning message to log and proceed without persistence.
> >>>
> >>> +1 for this. Otherwise, it looks like a dirty hack when I need to add
> an
> >>> empty MemoryConfiguration to a client config file. Plus, it requires us
> >> to
> >>> create different configuration files for servers and clients which has
> to
> >>> be optional by default.
> >>>
> >>> —
> >>> Denis
> >>>
> >>>> On May 26, 2017, at 9:50 AM, Sergey Chugunov <
> >> sergey.chugu...@gmail.com>
> >>> wrote:
> >>>>
> >>>> Moreover, enabling persistence on client node is very risky and may
> >> lead
> >>> to
> >>>> many tricky cases.
> >>>>
> >>>> I would suggest on the first iteration to simply ignore persistence
> >>>> configuration on client nodes.
> >>>> If client node finds persistence configuration on startup it will
> >>> printout
> >>>> warning message to log and proceed without persistence.
> >>>>
> >>>> Supporting persistence on client nodes definitely requires more
> >>> thoughtful
> >>>> discussion and may be added in the future.
> >>>>
> >>>> Thanks,
> >>>> Sergey.
> >>>>
> >>>> On Fri, May 26, 2017 at 7:28 PM, Sergey Chugunov <
> >>> sergey.chugu...@gmail.com>
> >>>> wrote:
> >>>>
> >>>>> Denis,
> >>>>>
> >>>>> I see from example that you're trying to start a client node with
> >>>>> persistence configuration specified and you're saying that Ignite
> must
> >>>>> provide default MemoryConfiguration.
> >>>>>
> >>>>> But that contradicts with decision we all agreed on in the
> >>> discussion[1]:
> >>>>> if user wants to do something unusual on client nodes like storing
> >> cache
> >>>>> partitions (or in this case persisting stuff) he/she *must *provide
> >> all
> >>>>> necessary configuration explicitly.
> >>>>>
> >>>>> Server node with the same persistence configuration (and without
> >>> explicit
> >>>>> memory configuration) starts just fine.
> >>>>>
> >>>>> [1] http://apache-ignite-developers.2346864.n4.nabble.
> >>>>> com/Question-local-cache-on-client-nodes-tt15950.html
> >>>>>
> >>>>> Thanks,
> >>>>> Sergey.
> >>>>>
> >>>>> On Fri, May 26, 2017 at 7:03 PM, Denis Magda <dma...@apache.org>
> >> wrote:
> >>>>>
> >>>>>> Sergey,
> >>>>>>
> >>>>>> The issue vanishes as soon as I add the following to the
> >> configuration:
> >>>>>>
> >>>>>> <property name="memoryConfiguration">
> >>>>>>   <bean class="org.apache.ignite.configuration.
> >> MemoryConfiguration">
> >>>>>>   </bean>
> >>>>>> </property>
> >>>>>>
> >>>>>> My point is that we just need to create a MemoryConfiguration
> >>> implicitly
> >>>>>> if it’s not defined (no any warnings or extra messages). It’s a
> >>>>>> responsibility of our platform to generate a default configuration
> if
> >>> it’s
> >>>>>> not set explicitly.
> >>>>>>
> >>>>>> —
> >>>>>> Denis
> >>>>>>
> >>>>>>> On May 26, 2017, at 8:46 AM, Sergey Chugunov <
> >>> sergey.chugu...@gmail.com>
> >>>>>> wrote:
> >>>>>>>
> >>>>>>> Hi Denis,
> >>>>>>>
> >>>>>>> What is the expected behavior in that case? Bug doesn't suggest
> any.
> >>>>>>>
> >>>>>>> From my point of view it would be better to throw an exception on
> >>>>>> startup
> >>>>>>> with meaningful message than to silently create a default
> >>>>>>> MemoryConfiguration under the cover.
> >>>>>>>
> >>>>>>> Thanks,
> >>>>>>> Sergey.
> >>>>>>>
> >>>>>>> On Fri, May 26, 2017 at 4:00 AM, Denis Magda <dma...@apache.org>
> >>> wrote:
> >>>>>>>
> >>>>>>>> Igniters,
> >>>>>>>>
> >>>>>>>> I’ve just added the first Persistent Store example to the branch
> >> that
> >>>>>>>> fosters the donation:
> >>>>>>>> https://github.com/apache/ignite/tree/ignite-5267/
> >>>>>>>> examples/src/main/java/org/apache/ignite/examples/persistentstore
> >>>>>>>>
> >>>>>>>> However, the example fails with an NPE if a MemoryConfiguration is
> >>> not
> >>>>>>>> defined explicitly:
> >>>>>>>> https://issues.apache.org/jira/browse/IGNITE-5295
> >>>>>>>>
> >>>>>>>> Please those who are involved in the store development fix the
> >> issue
> >>> by
> >>>>>>>> the end of tomorrow. I want to complete with the technical
> >>>>>> documentation
> >>>>>>>> referring to a workable example.
> >>>>>>>>
> >>>>>>>> —
> >>>>>>>> Denis
> >>>>>>
> >>>>>>
> >>>>>
> >>>
> >>>
> >>
>
>

Reply via email to