sql - Avoiding lots of counters in Java -


in java project, need read file 1.6 million lines.

each line represents 1 action users have done in 1 day. there 83 different possible actions if i'm not wrong.

i need analyze file follows , store found statistics in csv files: generally: count how 1 action has occurred (numbers go high half million)

but there should separate files:

  • how has 1 action occurred per hour? (24 rows in csv file)

  • how has 1 action occurred per user? (about 20 different users - file each one)

  • how has 1 action occurred per user per hour? (separate file per user, 24 rows in it)

and on top, there 3 different channels (html, mobile, telephone) things can occur (also saved in log-file), need create 1 folder every channel , things mentioned above each one.

the question:

how can store/count efficiently? run-time not of problem (it shouldn't run day it's no problem it takes half hour) how count it?

i can't create many counters (amount huge), , int[] aren't convenient in opinion here have remember action has index etc.

is there better solution?

i thought using local database , sql scripts, program needs run on every pc , has executable command-line (and not in ide). using intellij 14 development.

an embedded database h2.

any packing mean have yourself.

you have count fields on several levels, maybe separate tables, speed. timestamp checking.

the advantage reports can done flexibly. backups made easily.

a custom refactoring can done later when functions.


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -