Skip to content
Debmalya Jash edited this page Oct 25, 2018 · 6 revisions

Welcome to the SFM wiki!

Functionality

Used MapDB to store ( HTreeMap<String,long[]> ) words with their timestamp. Key is the word from log file. Value is an array of long values. Here word count is 5, so last six occurence time is stored. While checking the string is valid or not, these 6 values are checked. If any of them is within last 24 hours false is returned, true otherwise.

How does it operate ?

  • Suppose "NullPointerException" occurs in log files.
  • NullPointerException is key and value stored as [0, 0, 0, 0, 0, 1540449668000] - at this state, validity of string "NullPointerException" is true. "NullPointerException" occurs only once at this stage.
  • is [0, 0, 0, 0, 1540449668000,1540450982000] - at this state, validity of string "is" is true as it occurs twice only.
  • is [0, 0, 0, 1540449668000,1540450982000,1540451727000] - at this state, validity of string "is" is true
  • is [0, 0, 1540449668000, 1540449668000, 1540450982000, 1540451727000] - at this state, validity of string "is" is true
  • is [0, 1540449668000, 1540450982000, 1540451727000, 1540451921000, 1540451944000] - at this state, validity of string "is" is true
  • is [1540449668000, 1540450982000, 1540451727000, 1540451921000, 1540451944000, 1540452229000] - at this state, validity of string "is" is false
  • is [1540449668000, 1540449668000, 1540450982000, 1540451727000, 1540451921000, 1540451944000] - at this state, validity of string "is" is false
  • is [1540450982000, 1540451727000, 1540451921000, 1540451944000, 1540452229000, 1540452265000] - at this state, validity of string "is" is false In last three cases string "is" was appeared more than 5 times in log file within last 24 hours.

Files

  1. org.deb.SFM.api.SFMRestController.java
  2. org.deb.SFM.config.ConfigurationComponent.java
  3. org.deb.SFM.repository.WordRegister24Hours.java
  4. org.deb.SFM.service.SFMService.java
  5. org.deb.SFM.service.SFMServiceImpl.java
  6. org.deb.SFM.watcher.directory.FolderWatcher.java

Test Files

  1. org.deb.SFM.SfmApplicationTests.java

Technologies Used

  • Spring Boot
  • Quartz Scheduler
  • MapDB
  • REST API
Clone this wiki locally