Class RateLimitedDirectoryWrapper
A Directory wrapper that allows IndexOutput rate limiting using IO context (IOContext.UsageContext) specific rate limiters (RateLimiter).
Implements
Inherited Members
Namespace: Lucene.Net.Store
Assembly: Lucene.Net.dll
Syntax
public sealed class RateLimitedDirectoryWrapper : FilterDirectory, IDisposable
Constructors
| Improve this Doc View SourceRateLimitedDirectoryWrapper(Directory)
Declaration
public RateLimitedDirectoryWrapper(Directory wrapped)
Parameters
Type | Name | Description |
---|---|---|
Directory | wrapped |
Methods
| Improve this Doc View SourceCopy(Directory, String, String, IOContext)
Declaration
public override void Copy(Directory to, string src, string dest, IOContext context)
Parameters
Type | Name | Description |
---|---|---|
Directory | to | |
System.String | src | |
System.String | dest | |
IOContext | context |
Overrides
| Improve this Doc View SourceCreateOutput(String, IOContext)
Declaration
public override IndexOutput CreateOutput(string name, IOContext context)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | |
IOContext | context |
Returns
Type | Description |
---|---|
IndexOutput |
Overrides
| Improve this Doc View SourceCreateSlicer(String, IOContext)
Declaration
public override Directory.IndexInputSlicer CreateSlicer(string name, IOContext context)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | |
IOContext | context |
Returns
Type | Description |
---|---|
Directory.IndexInputSlicer |
Overrides
| Improve this Doc View SourceGetMaxWriteMBPerSec(IOContext.UsageContext)
See SetMaxWriteMBPerSec(Nullable<Double>, IOContext.UsageContext).
Declaration
public double GetMaxWriteMBPerSec(IOContext.UsageContext context)
Parameters
Type | Name | Description |
---|---|---|
IOContext.UsageContext | context |
Returns
Type | Description |
---|---|
System.Double |
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | if the Directory is already disposed |
SetMaxWriteMBPerSec(Nullable<Double>, IOContext.UsageContext)
Sets the maximum (approx) MB/sec allowed by all write IO performed by
IndexOutput created with the given IOContext.UsageContext. Pass
null
for mbPerSec
to have no limit.
NOTE: For already created IndexOutput instances there is no guarantee this new rate will apply to them; it will only be guaranteed to apply for new created IndexOutput instances.
NOTE: this is an optional operation and might not be respected by all Directory implementations. Currently only buffered (FSDirectory) Directory implementations use rate-limiting.
Declaration
public void SetMaxWriteMBPerSec(double? mbPerSec, IOContext.UsageContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.Double> | mbPerSec | |
IOContext.UsageContext | context |
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | if the Directory is already disposed |
SetRateLimiter(RateLimiter, IOContext.UsageContext)
Sets the rate limiter to be used to limit (approx) MB/sec allowed by all IO
performed with the given context (IOContext.UsageContext). Pass null
to
have no limit.
Passing an instance of rate limiter compared to setting it using SetMaxWriteMBPerSec(Nullable<Double>, IOContext.UsageContext) allows to use the same limiter instance across several directories globally limiting IO across them.
Declaration
public void SetRateLimiter(RateLimiter mergeWriteRateLimiter, IOContext.UsageContext context)
Parameters
Type | Name | Description |
---|---|---|
RateLimiter | mergeWriteRateLimiter | |
IOContext.UsageContext | context |
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | if the Directory is already disposed |