Re: IGNITE-4713 : refactoring of GridFinishedFuture and GridFutureAdapter

2017-03-10 Thread Александр Меньшиков
I'm sorry I didn't notice pair "acquireShared" and "releaseShared". Okay, well, there are no races. But we still can use "getState()" in "assert" instead "resFlag", that will allow us use boolean type. But if you think it will not make code cleaner, then I will close issue. 2017-03-01 14:55 GMT+03

Re: IGNITE-4713 : refactoring of GridFinishedFuture and GridFutureAdapter

2017-03-01 Thread Александр Меньшиков
First of all I want to replace the "byte resFlag" on the "bool haveResult" only for aesthetic reasons. I think that use a byte as a boolean flag looks like C in 1983. And constructions like return haveResult ? (R)res : null; more readable unlike return resFlag == RES ? (R)res : null; because yo

Re: IGNITE-4713 : refactoring of GridFinishedFuture and GridFutureAdapter

2017-02-28 Thread Yakov Zhdanov
Alexander, Can you please clarify this? >I suppose "volatile" is not need here, because right now if >GridFutureAdapter#onDone() called in another thread than GridFutureAdapter#get0, it will produce AssertionError. 1) 99.999% of time GridFutureAdapter#onDone() is called in some other thread tha

Re: IGNITE-4713 : refactoring of GridFinishedFuture and GridFutureAdapter

2017-02-28 Thread Александр Меньшиков
Sorry, I mean I want to do fast work on this issue (not make code faster). Your code is strange. You can see my view in my local temp PR: https://github.com/SharplEr/ignite/pull/4/files This is what I'm meaning. I suppose "volatile" is not need here, because right now if GridFutureAdapter#onDone

Re: IGNITE-4713 : refactoring of GridFinishedFuture and GridFutureAdapter

2017-02-28 Thread Александр Меньшиков
Alexey, Vladislav, are you agree with me, or not? I want to do it faster and move on. 2017-02-17 17:36 GMT+03:00 Александр Меньшиков : > We can check "onDone" method was called with using getState() method. If > getState()!=0 then resFlag!=0. Just look at code. > > > 2017-02-17 17:12 GMT+03:00 А

Re: IGNITE-4713 : refactoring of GridFinishedFuture and GridFutureAdapter

2017-02-17 Thread Александр Меньшиков
We can check "onDone" method was called with using getState() method. If getState()!=0 then resFlag!=0. Just look at code. 2017-02-17 17:12 GMT+03:00 Александр Меньшиков : > Like I said, if "resFlag==0" (of course 0 came from initialization) means > "you still haven't called the method onDone()"

Re: IGNITE-4713 : refactoring of GridFinishedFuture and GridFutureAdapter

2017-02-17 Thread Александр Меньшиков
Like I said, if "resFlag==0" (of course 0 came from initialization) means "you still haven't called the method onDone()", better make it clear. 2017-02-17 14:48 GMT+03:00 Vladislav Pyatkov : > Alexander, > > I think, the resFlag will be initiated as 0 (new GridFutureAdapter()), but > 1 and 2 sta

Re: IGNITE-4713 : refactoring of GridFinishedFuture and GridFutureAdapter

2017-02-17 Thread Vladislav Pyatkov
Alexander, I think, the resFlag will be initiated as 0 (new GridFutureAdapter()), but 1 and 2 states will be acquired on live. On Fri, Feb 17, 2017 at 1:56 PM, Александр Меньшиков wrote: > Alexey, > > I see only one place where writes in resFlag: > > if (err != null) { >

Re: IGNITE-4713 : refactoring of GridFinishedFuture and GridFutureAdapter

2017-02-17 Thread Александр Меньшиков
Alexey, I see only one place where writes in resFlag: if (err != null) { resFlag = ERR; this.res = err; } else { resFlag = RES; this.res = res; } And th

Re: IGNITE-4713 : refactoring of GridFinishedFuture and GridFutureAdapter

2017-02-17 Thread Alexey Goncharuk
Alexander, This change is not applicable for GridFutureAdapter because resFlag can have 3 values there. 2017-02-16 19:58 GMT+03:00 Александр Меньшиков : > Hello. > > I propose to do refactoring of classes "GridFinishedFuture" and > "GridFutureAdapter". There is field "resFlag" which can equals "

IGNITE-4713 : refactoring of GridFinishedFuture and GridFutureAdapter

2017-02-16 Thread Александр Меньшиков
Hello. I propose to do refactoring of classes "GridFinishedFuture" and "GridFutureAdapter". There is field "resFlag" which can equals "ERR = 1" or "RES = 2". So I can replace it to one "bool haveResult" field. If there are no objections, I'm ready to proceed. If you find more such classes, please

[jira] [Created] (IGNITE-4713) refactoring of GridFinishedFuture and GridFutureAdapter

2017-02-16 Thread Alexander Menshikov (JIRA)
Alexander Menshikov created IGNITE-4713: --- Summary: refactoring of GridFinishedFuture and GridFutureAdapter Key: IGNITE-4713 URL: https://issues.apache.org/jira/browse/IGNITE-4713 Project: Ignite