Code Monkey home page Code Monkey logo

financialinstuments's Introduction

The app reads the input file in a separate thread and puts the lines read into
the queue. On the other end of the queue there're several threads pulling the lines from it, parse 'em and make
necessary calculations.
The problem which was difficult for me to solve is how to arrange the database support, i.e. how to access the data,
since accessing db on each line is very time-consuming.
On the other hand, I tried to cache the db data using Guava Cache, but it's is not 100% correct. This cache updates
on timer, hence this approach can and will leave some db updates unattended.
I also investigated how the cache can be updated by db trigger, but this approach is tied to the exact database technology
(like h2, it has the Java API, unlike many other db's), so I decided to put it aside.
I believe there're several ways to solve this problem (like using JMS for instance), but I didn't want to make it very
sophisticated, so by default my app queries database each time (though I haven't delete the cacheable solution,
you can try it by using -DuseCachedMultiplierProvider=true)

usage examples:
- run app with specified input file:
    mvn clean integration-test -PcustomFile -DinputFile=<path to the input file>
- run app with specified input file and with multipliers cache:
    mvn clean integration-test -PcustomFile -DinputFile=<path to the input file> -DuseCachedMultiplierProvider=true

financialinstuments's People

Contributors

tvolkov avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.