Hi Maxim, FileWriteAheadLogManager & FsyncModeFileWriteAheadLogManager were intentionally copy-pasted in hope we will soon delete FsyncManager.
But it is still shows this tool works good. Probably we could integrate this tool to our processes. Sincerely, Dmitriy Pavlov вт, 15 мая 2018 г. в 20:06, Maxim Muzafarov <maxmu...@gmail.com>: > +1 also for something like "resource manager". > > Recently, I've found for myself sonarcloud.io tool for code analisys. It's > free for open source project and I've made Ignite project initial run [1]. > > I've prepeared analisys for mysefl and found a lot of duplicated code > blocks [1]. Of course it's not the ideal tool but gave us direction of > thoughts. E.g. these classes [3]: > 1) FileWriteAheadLogManager.java > 2) FsyncModeFileWriteAheadLogManager.java > > > [1] https://sonarcloud.io/dashboard?id=org.apache.ignite%3Aapache-ignite > [2] > > https://sonarcloud.io/component_measures?id=org.apache.ignite%3Aapache-ignite&metric=duplicated_blocks > [3] > > https://sonarcloud.io/component_measures?id=org.apache.ignite%3Aapache-ignite&metric=duplicated_blocks&selected=org.apache.ignite%3Aignite-core%3Asrc%2Fmain%2Fjava%2Forg%2Fapache%2Fignite%2Finternal%2Fprocessors%2Fcache%2Fpersistence%2Fwal%2FFsyncModeFileWriteAheadLogManager.java > > вт, 15 мая 2018 г. в 19:26, Pavel Kovalenko <jokse...@gmail.com>: > > > +1 to this approach, > > > > It can be also very helpful in failover scenarios when something wrong > > happened with disk. In this case we're reducing the number of points of > > failure. > > > > 2018-05-15 18:37 GMT+03:00 Dmitriy Govorukhin < > > dmitriy.govoruk...@gmail.com> > > : > > > > > Hi Ignite, > > > > > > Do we have a general approach to work with a file and directories? > > > I see many duplication logic for write through .tmp file. > > > > > > For example, > > > > > > GridCacheDatabaseSharedManager.writeCheckpointEntry(); > > > GridCacheDatabaseSharedManage.nodeStart(); > > > FileWriteAheadLogManager.FileArchiver.archiveSegment(); > > > > > > All of these methods implement the same logic, write to tmp file and > > rename > > > to normal name. > > > > > > I guess, will be better if we stopping write duplication logic code and > > > start to consolidate all in one place. > > > > > > Also, I think that current approach to creating files is not quite > right > > > faithful. Each internal component > > > create/delete files inside himself, and nobody knows where which files > > > located. > > > > > > I suggest refactoring code and create something (maybe new manager) > that > > > will know about all files inside the node. All internal components must > > > create files only through this one. > > > > > > It makes help to write tests for persistence easier and reduce > > duplication > > > code in working with files. > > > > > >