Class RateLimitedDirectoryWrapper
A Directory wrapper that allows IndexOutput rate limiting using IO context (IOContext.UsageContext) specific rate limiters (RateLimiter).
Note
This API is experimental and might change in incompatible ways in the next release.
Implements
Inherited Members
Namespace: Lucene.Net.Store
Assembly: Lucene.Net.dll
Syntax
public sealed class RateLimitedDirectoryWrapper : FilterDirectory, IDisposable
Constructors
RateLimitedDirectoryWrapper(Directory)
A Directory wrapper that allows IndexOutput rate limiting using IO context (IOContext.UsageContext) specific rate limiters (RateLimiter).
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
public RateLimitedDirectoryWrapper(Directory wrapped)
Parameters
Type | Name | Description |
---|---|---|
Directory | wrapped |
See Also
Methods
Copy(Directory, string, string, IOContext)
Copies the file src
to Directoryto
under the new
file name dest
.
Directory to; // the directory to copy to
foreach (string file in dir.ListAll()) {
dir.Copy(to, file, newFile, IOContext.DEFAULT); // newFile can be either file, or a new name
}
NOTE: this method does not check whether dest
exist and will
overwrite it if it does.
Declaration
public override void Copy(Directory to, string src, string dest, IOContext context)
Parameters
Type | Name | Description |
---|---|---|
Directory | to | |
string | src | |
string | dest | |
IOContext | context |
Overrides
See Also
CreateOutput(string, IOContext)
Creates a new, empty file in the directory with the given name. Returns a stream writing this file.
Declaration
public override IndexOutput CreateOutput(string name, IOContext context)
Parameters
Type | Name | Description |
---|---|---|
string | name | |
IOContext | context |
Returns
Type | Description |
---|---|
IndexOutput |
Overrides
See Also
CreateSlicer(string, IOContext)
Creates an Directory.IndexInputSlicer for the given file name. Directory.IndexInputSlicer allows other Directory implementations to efficiently open one or more sliced IndexInput instances from a single file handle. The underlying file handle is kept open until the Directory.IndexInputSlicer is closed.
Throws FileNotFoundException if the file does not exist.Note
This API is for internal purposes only and might change in incompatible ways in the next release.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
public override Directory.IndexInputSlicer CreateSlicer(string name, IOContext context)
Parameters
Type | Name | Description |
---|---|---|
string | name | |
IOContext | context |
Returns
Type | Description |
---|---|
Directory.IndexInputSlicer |
Overrides
Exceptions
Type | Condition |
---|---|
IOException | if an IOException occurs |
See Also
GetMaxWriteMBPerSec(UsageContext)
See SetMaxWriteMBPerSec(double?, UsageContext).
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
public double GetMaxWriteMBPerSec(IOContext.UsageContext context)
Parameters
Type | Name | Description |
---|---|---|
IOContext.UsageContext | context |
Returns
Type | Description |
---|---|
double |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | if the Directory is already disposed |
See Also
SetMaxWriteMBPerSec(double?, 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
This API is experimental and might change in incompatible ways in the next release.
Declaration
public void SetMaxWriteMBPerSec(double? mbPerSec, IOContext.UsageContext context)
Parameters
Type | Name | Description |
---|---|---|
double? | mbPerSec | |
IOContext.UsageContext | context |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | if the Directory is already disposed |
See Also
SetRateLimiter(RateLimiter, 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.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
public void SetRateLimiter(RateLimiter mergeWriteRateLimiter, IOContext.UsageContext context)
Parameters
Type | Name | Description |
---|---|---|
RateLimiter | mergeWriteRateLimiter | |
IOContext.UsageContext | context |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | if the Directory is already disposed |