Package ua_parser
Class CachingParser
java.lang.Object
ua_parser.Parser
ua_parser.CachingParser
When doing webanalytics (with for example PIG) the main pattern is to process
weblogs in clickstreams. A basic fact about common clickstreams is that in
general the same browser will do multiple requests in sequence. This has the
effect that the same useragent will appear in the logfiles and we will see
the need to parse the same useragent over and over again.
This class introduces a very simple LRU cache to reduce the number of times
the parsing is actually done. The default cache size is 1000 and can be
configured as object creation.
Note: The object handles one cache per parsing method - be carefull when using big sizes.
- Author:
- Niels Basjes
-
Field Summary
Fields inherited from class ua_parser.Parser
CODE_POINT_LIMIT -
Constructor Summary
ConstructorsConstructorDescriptionCachingParser(int cacheSize) CachingParser(InputStream regexYaml) CachingParser(InputStream regexYaml, int cacheSize) -
Method Summary
Methods inherited from class ua_parser.Parser
getDefaultLoaderOptions
-
Constructor Details
-
CachingParser
public CachingParser() -
CachingParser
-
CachingParser
public CachingParser(int cacheSize) -
CachingParser
-
-
Method Details
-
parse
-
parseUserAgent
- Overrides:
parseUserAgentin classParser
-
parseDevice
- Overrides:
parseDevicein classParser
-
parseOS
-