Commit Graph

16 Commits

Author SHA1 Message Date
Martin Molinero 82da3b5521 Fix dispose race condition at ZipDataCacheProvider 2019-07-04 13:30:42 -03:00
Martin Molinero 1581801f9b Address reviews 2019-06-11 12:01:57 -03:00
Martin Molinero ec1d410907 Performance improvements
- `SecurityIdentifier` will calculate `StrikePrice` just once. Replacing
`!=` for a direct call to `Equals()` preventing unnecessary checks.
- Slightly improving Linq queries at `OptionFilterUniverse`
- Replace `OpenReader().CopyTo` for `Extract(stream)` avoids copying the
data twice.
- Replace `DateTime.Now` for `DateTime.UtcNow`
2019-06-10 22:40:19 -03:00
Martin Molinero d360ec36ac Address reviews 2019-05-31 18:26:18 -03:00
Martin-Molinero 2a69b3279a Add IDataCacheProvider.IsDataEphemeral (#3160)
* Add IDataCacheProvider.IsDataEphemeral
2019-05-01 19:33:35 -07:00
Martin Molinero 2ca715f582 Improve performance of fecthing zipped data 2018-06-25 12:26:14 -03:00
Stefano Raggi a32e298d21 Fix stream dispose in ZipDataCacheProvider
This bug was causing all zip files to remain open, even when removing them from the cache and calling Dispose on ZipFile objects.

The issue is that ZipFile.Dispose closes the underlying FileStream only if created by the ZipFile instance, which is not the case here because we fetch a Stream object containing the zip file from the data provider. In fact calling ZipFile.Read(stream) returns a ZipFile instance which does not "own" the stream, it is the caller's responsibility to dispose of it.
2018-02-13 20:40:20 +01:00
Ben Sauerwine 0d6ba9e0ae Fixes issue whereby ZipDataCacheProvider is not able to load data files larger than Int32.MaxValue bytes. 2018-01-26 15:23:58 -06:00
Stefano Raggi d509ff61c5 Add synchronization to ZipFile instances in ZipDataCacheProvider 2017-05-10 00:40:14 +02:00
Stefano Raggi 38bfc96e59 Remove Lazy<T> usage from ZipDataCacheProvider 2017-05-09 23:24:11 +02:00
Stefano Raggi 7a6f8a7278 Remove unnecessary file openings in ZipDataCacheProvider
When reading multi-entry zip files (such as futures and options), ZipDataCacheProvider was unnecessarily calling DataProvider.Fetch for files already cached.
2017-05-09 21:26:06 +02:00
Stefano Raggi f9706b5a8b Improve ZipDataCacheProvider exception handling and logging 2017-05-06 09:44:37 +02:00
Stefano Raggi 46bf66705c Handle corrupt zip files in data cache providers
Instead of leaving zip exceptions to the data feed enumerator stack, we now log file names of corrupt zip files, return null and continue.

The file system data feed should now handle corrupt files like missing files.
2017-04-26 01:27:30 +02:00
Andrew b62bc6ba22 Options and Futures are not seeded with a price when the security is created 2017-02-17 14:32:47 -05:00
Andrew 672e134939 Removed ApiDataProvider
Refactored IHistoryProvider interface order of parameters
2017-02-16 15:47:06 -05:00
Andrew b6171cc9d5 Renamed IDataFileProvider to IDataProvider using resharper
Refactored IDataProvider interface to return stream. The IDataProvider
Fetch method now only takes a key.  The IDataProvider
has been reshuffled to be at the bottom of the LeanDataStack.  It provides
data to the rest of the Lean stack. The default implementation of IDataProvider reads
data from disc.

All IDataCacheProviders now have constructors which take IDataProviders
and use them to find data on disc.

Renamed DataCacheProvider to ZipDataCacheProvider

Added comments to IDataProvider and it's implementations

Added comments to IDataCacheProvider and it's implementations
2017-02-15 12:16:50 -05:00