Package org.apache.lucene.tests.util
Class ThrottledIndexOutput
java.lang.Object
org.apache.lucene.store.DataOutput
org.apache.lucene.store.IndexOutput
org.apache.lucene.store.FilterIndexOutput
org.apache.lucene.tests.util.ThrottledIndexOutput
- All Implemented Interfaces:
Closeable
,AutoCloseable
Intentionally slow IndexOutput for testing.
-
Field Summary
FieldsFields inherited from class org.apache.lucene.store.FilterIndexOutput
out
-
Constructor Summary
ConstructorsConstructorDescriptionThrottledIndexOutput
(int bytesPerSecond, long delays, int minBytesWritten, IndexOutput out) ThrottledIndexOutput
(int bytesPerSecond, long flushDelayMillis, long closeDelayMillis, long seekDelayMillis, long minBytesWritten, IndexOutput out) ThrottledIndexOutput
(int bytesPerSecond, long delayInMillis, IndexOutput out) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected long
getDelay
(boolean closing) static final int
mBitsToBytes
(int mbits) void
writeByte
(byte b) void
writeBytes
(byte[] b, int offset, int length) Methods inherited from class org.apache.lucene.store.FilterIndexOutput
getChecksum, getDelegate, getFilePointer, unwrap
Methods inherited from class org.apache.lucene.store.IndexOutput
alignFilePointer, alignOffset, getName, toString
Methods inherited from class org.apache.lucene.store.DataOutput
copyBytes, writeBytes, writeInt, writeLong, writeMapOfStrings, writeSetOfStrings, writeShort, writeString, writeVInt, writeVLong, writeZInt, writeZLong
-
Field Details
-
DEFAULT_MIN_WRITTEN_BYTES
public static final int DEFAULT_MIN_WRITTEN_BYTES- See Also:
-
-
Constructor Details
-
ThrottledIndexOutput
-
ThrottledIndexOutput
-
ThrottledIndexOutput
public ThrottledIndexOutput(int bytesPerSecond, long flushDelayMillis, long closeDelayMillis, long seekDelayMillis, long minBytesWritten, IndexOutput out)
-
-
Method Details
-
newFromDelegate
-
mBitsToBytes
public static final int mBitsToBytes(int mbits) -
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterIndexOutput
- Throws:
IOException
-
writeByte
- Overrides:
writeByte
in classFilterIndexOutput
- Throws:
IOException
-
writeBytes
- Overrides:
writeBytes
in classFilterIndexOutput
- Throws:
IOException
-
getDelay
protected long getDelay(boolean closing)
-