Lean
$LEAN_TAG$
|
A local disk implementation of IObjectStore. More...
Public Member Functions | |
virtual void | Initialize (int userId, int projectId, string userToken, Controls controls) |
Initializes the object store More... | |
void | Clear () |
Will clear the object store state cache. This is useful when the object store is used concurrently by nodes which want to share information More... | |
bool | ContainsKey (string path) |
Determines whether the store contains data for the specified path More... | |
byte[] | ReadBytes (string path) |
Returns the object data for the specified path More... | |
bool | SaveBytes (string path, byte[] contents) |
Saves the object data for the specified path More... | |
bool | Delete (string path) |
Deletes the object data for the specified path More... | |
virtual string | GetFilePath (string path) |
Returns the file path for the specified path More... | |
virtual void | Dispose () |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More... | |
IEnumerator< KeyValuePair< string, byte[]> > | GetEnumerator () |
Returns an enumerator that iterates through the collection. More... | |
Protected Member Functions | |
virtual string | StorageRoot () |
Storage root path More... | |
bool | InternalSaveBytes (string path, byte[] contents) |
Won't trigger persist nor will check storage write permissions, useful on initialization since it allows read only permissions to load the object store More... | |
virtual bool | IsWithinStorageLimit (string path, byte[] contents, bool takePersistLock) |
Validates storage limits are respected on a new save operation More... | |
string | PathForKey (string path) |
Get's a file path for a given path. Internal use only because it does not guarantee the existence of the file. More... | |
virtual bool | PersistData () |
Overridable persistence function More... | |
virtual void | OnErrorRaised (Exception error) |
Event invocator for the ErrorRaised event More... | |
Static Protected Attributes | |
const string | NoReadPermissionsError |
No read permissions error message More... | |
const string | NoWritePermissionsError |
No write permissions error message More... | |
Properties | |
static string | DefaultObjectStore = Path.GetFullPath(Config.Get("object-store-root", "./storage")) [get, set] |
Gets the default object store location More... | |
Controls | Controls [get] |
Provides access to the controls governing behavior of this instance, such as the persistence interval More... | |
string | AlgorithmStorageRoot [get] |
The root storage folder for the algorithm More... | |
FileHandler | FileHandler = new () [get, set] |
The file handler instance to use More... | |
ICollection< string > | Keys [get] |
Returns the file paths present in the object store. This is specially useful not to load the object store into memory More... | |
![]() | |
ICollection< string > | Keys [get] |
Returns the file paths present in the object store. This is specially useful not to load the object store into memory More... | |
Events | |
EventHandler< ObjectStoreErrorRaisedEventArgs > | ErrorRaised |
Event raised each time there's an error More... | |
![]() | |
EventHandler< ObjectStoreErrorRaisedEventArgs > | ErrorRaised |
Event raised each time there's an error More... | |
A local disk implementation of IObjectStore.
Definition at line 35 of file LocalObjectStore.cs.
|
virtual |
Initializes the object store
userId | The user id |
projectId | The project id |
userToken | The user token |
controls | The job controls instance |
Implements QuantConnect.Interfaces.IObjectStore.
Definition at line 91 of file LocalObjectStore.cs.
|
protectedvirtual |
Storage root path
Definition at line 114 of file LocalObjectStore.cs.
void QuantConnect.Lean.Engine.Storage.LocalObjectStore.Clear | ( | ) |
Will clear the object store state cache. This is useful when the object store is used concurrently by nodes which want to share information
Implements QuantConnect.Interfaces.IObjectStore.
Definition at line 181 of file LocalObjectStore.cs.
bool QuantConnect.Lean.Engine.Storage.LocalObjectStore.ContainsKey | ( | string | path | ) |
Determines whether the store contains data for the specified path
path | The object path |
Implements QuantConnect.Interfaces.IObjectStore.
Definition at line 194 of file LocalObjectStore.cs.
byte [] QuantConnect.Lean.Engine.Storage.LocalObjectStore.ReadBytes | ( | string | path | ) |
Returns the object data for the specified path
path | The object path |
Implements QuantConnect.Interfaces.IObjectStore.
Definition at line 226 of file LocalObjectStore.cs.
bool QuantConnect.Lean.Engine.Storage.LocalObjectStore.SaveBytes | ( | string | path, |
byte[] | contents | ||
) |
Saves the object data for the specified path
path | The object path |
contents | The object data |
Implements QuantConnect.Interfaces.IObjectStore.
Definition at line 255 of file LocalObjectStore.cs.
|
protected |
Won't trigger persist nor will check storage write permissions, useful on initialization since it allows read only permissions to load the object store
Definition at line 297 of file LocalObjectStore.cs.
|
protectedvirtual |
Validates storage limits are respected on a new save operation
Definition at line 313 of file LocalObjectStore.cs.
bool QuantConnect.Lean.Engine.Storage.LocalObjectStore.Delete | ( | string | path | ) |
Deletes the object data for the specified path
path | The object path |
Implements QuantConnect.Interfaces.IObjectStore.
Definition at line 367 of file LocalObjectStore.cs.
|
virtual |
Returns the file path for the specified path
If the key is not already inserted it will just return a path associated with it and add the key with null value
path | The object path |
Implements QuantConnect.Interfaces.IObjectStore.
Definition at line 406 of file LocalObjectStore.cs.
|
virtual |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Definition at line 439 of file LocalObjectStore.cs.
IEnumerator<KeyValuePair<string, byte[]> > QuantConnect.Lean.Engine.Storage.LocalObjectStore.GetEnumerator | ( | ) |
Returns an enumerator that iterates through the collection.
<filterpriority>1</filterpriority>
Definition at line 461 of file LocalObjectStore.cs.
|
protected |
Get's a file path for a given path. Internal use only because it does not guarantee the existence of the file.
Definition at line 478 of file LocalObjectStore.cs.
|
protectedvirtual |
Overridable persistence function
Definition at line 531 of file LocalObjectStore.cs.
|
protectedvirtual |
Event invocator for the ErrorRaised event
Definition at line 582 of file LocalObjectStore.cs.
|
staticprotected |
No read permissions error message
Definition at line 40 of file LocalObjectStore.cs.
|
staticprotected |
No write permissions error message
Definition at line 46 of file LocalObjectStore.cs.
|
staticgetset |
Gets the default object store location
Definition at line 57 of file LocalObjectStore.cs.
|
getprotected |
Provides access to the controls governing behavior of this instance, such as the persistence interval
Definition at line 72 of file LocalObjectStore.cs.
|
getprotected |
The root storage folder for the algorithm
Definition at line 77 of file LocalObjectStore.cs.
|
getsetprotected |
The file handler instance to use
Definition at line 82 of file LocalObjectStore.cs.
|
get |
Returns the file paths present in the object store. This is specially useful not to load the object store into memory
Definition at line 171 of file LocalObjectStore.cs.
EventHandler<ObjectStoreErrorRaisedEventArgs> QuantConnect.Lean.Engine.Storage.LocalObjectStore.ErrorRaised |
Event raised each time there's an error
Definition at line 52 of file LocalObjectStore.cs.