Class ThrottledIndexOutput
Intentionally slow Lucene.Net.Store.IndexOutput for testing.
Implements
Inherited Members
Namespace: Lucene.Net.Util
Assembly: Lucene.Net.TestFramework.dll
Syntax
public class ThrottledIndexOutput : IndexOutput, IDisposable
Constructors
ThrottledIndexOutput(int, long, IndexOutput)
Intentionally slow Lucene.Net.Store.IndexOutput for testing.
Declaration
public ThrottledIndexOutput(int bytesPerSecond, long delayInMillis, IndexOutput @delegate)
Parameters
Type | Name | Description |
---|---|---|
int | bytesPerSecond | |
long | delayInMillis | |
IndexOutput | delegate |
ThrottledIndexOutput(int, long, int, IndexOutput)
Intentionally slow Lucene.Net.Store.IndexOutput for testing.
Declaration
public ThrottledIndexOutput(int bytesPerSecond, long delays, int minBytesWritten, IndexOutput @delegate)
Parameters
Type | Name | Description |
---|---|---|
int | bytesPerSecond | |
long | delays | |
int | minBytesWritten | |
IndexOutput | delegate |
ThrottledIndexOutput(int, long, long, long, long, IndexOutput)
Intentionally slow Lucene.Net.Store.IndexOutput for testing.
Declaration
public ThrottledIndexOutput(int bytesPerSecond, long flushDelayMillis, long closeDelayMillis, long seekDelayMillis, long minBytesWritten, IndexOutput @delegate)
Parameters
Type | Name | Description |
---|---|---|
int | bytesPerSecond | |
long | flushDelayMillis | |
long | closeDelayMillis | |
long | seekDelayMillis | |
long | minBytesWritten | |
IndexOutput | delegate |
Fields
DEFAULT_MIN_WRITTEN_BYTES
Intentionally slow Lucene.Net.Store.IndexOutput for testing.
Declaration
public const int DEFAULT_MIN_WRITTEN_BYTES = 1024
Field Value
Type | Description |
---|---|
int |
Properties
Checksum
Returns the current checksum of bytes written so far
Declaration
public override long Checksum { get; }
Property Value
Type | Description |
---|---|
long |
Overrides
Length
Gets or Sets the file length. By default, this property's setter does nothing (it's optional for a Lucene.Net.Store.Directory to implement it). But, certain Lucene.Net.Store.Directory implementations (for example Lucene.Net.Store.FSDirectory) can use this to inform the underlying IO system to pre-allocate the file to the specified size. If the length is longer than the current file length, the bytes added to the file are undefined. Otherwise the file is truncated.
Declaration
public override long Length { get; set; }
Property Value
Type | Description |
---|---|
long |
Overrides
Position
Returns the current position in this file, where the next write will occur.
This was getFilePointer() in Lucene.Declaration
public override long Position { get; }
Property Value
Type | Description |
---|---|
long |
Overrides
See Also
Methods
CopyBytes(DataInput, long)
Copy numBytes bytes from input to ourself.
Declaration
public override void CopyBytes(DataInput input, long numBytes)
Parameters
Type | Name | Description |
---|---|---|
DataInput | input | |
long | numBytes |
Overrides
Dispose(bool)
Closes this stream to further operations.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing |
Overrides
Flush()
Forces any buffered output to be written.
Declaration
public override void Flush()
Overrides
GetDelay(bool)
Intentionally slow Lucene.Net.Store.IndexOutput for testing.
Declaration
protected virtual long GetDelay(bool closing)
Parameters
Type | Name | Description |
---|---|---|
bool | closing |
Returns
Type | Description |
---|---|
long |
MBitsToBytes(int)
Intentionally slow Lucene.Net.Store.IndexOutput for testing.
Declaration
public static int MBitsToBytes(int mbits)
Parameters
Type | Name | Description |
---|---|---|
int | mbits |
Returns
Type | Description |
---|---|
int |
NewFromDelegate(IndexOutput)
Intentionally slow Lucene.Net.Store.IndexOutput for testing.
Declaration
public virtual ThrottledIndexOutput NewFromDelegate(IndexOutput output)
Parameters
Type | Name | Description |
---|---|---|
IndexOutput | output |
Returns
Type | Description |
---|---|
ThrottledIndexOutput |
Seek(long)
Sets current position in this file, where the next write will occur.
Declaration
[Obsolete("(4.1) this method will be removed in Lucene 5.0")]
public override void Seek(long pos)
Parameters
Type | Name | Description |
---|---|---|
long | pos |
Overrides
See Also
WriteByte(byte)
Writes a single byte.
The most primitive data type is an eight-bit byte. Files are accessed as sequences of bytes. All other data types are defined as sequences of bytes, so file formats are byte-order independent.Declaration
public override void WriteByte(byte b)
Parameters
Type | Name | Description |
---|---|---|
byte | b |
Overrides
See Also
WriteBytes(byte[], int, int)
Writes an array of bytes.
Declaration
public override void WriteBytes(byte[] b, int offset, int length)
Parameters
Type | Name | Description |
---|---|---|
byte[] | b | the bytes to write |
int | offset | the offset in the byte array |
int | length | the number of bytes to write |