Package org.apache.lucene.tests.util
Class ThrottledIndexOutput
- java.lang.Object
-
- org.apache.lucene.store.DataOutput
-
- org.apache.lucene.store.IndexOutput
-
- org.apache.lucene.tests.util.ThrottledIndexOutput
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class ThrottledIndexOutput extends IndexOutput
Intentionally slow IndexOutput for testing.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_MIN_WRITTEN_BYTES
-
Constructor Summary
Constructors Constructor Description ThrottledIndexOutput(int bytesPerSecond, long delays, int minBytesWritten, IndexOutput delegate)ThrottledIndexOutput(int bytesPerSecond, long flushDelayMillis, long closeDelayMillis, long seekDelayMillis, long minBytesWritten, IndexOutput delegate)ThrottledIndexOutput(int bytesPerSecond, long delayInMillis, IndexOutput delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidcopyBytes(DataInput input, long numBytes)longgetChecksum()protected longgetDelay(boolean closing)longgetFilePointer()static intmBitsToBytes(int mbits)ThrottledIndexOutputnewFromDelegate(IndexOutput output)voidwriteByte(byte b)voidwriteBytes(byte[] b, int offset, int length)-
Methods inherited from class org.apache.lucene.store.IndexOutput
alignFilePointer, alignOffset, getName, toString
-
Methods inherited from class org.apache.lucene.store.DataOutput
writeBytes, writeInt, writeLong, writeMapOfStrings, writeSetOfStrings, writeShort, writeString, writeVInt, writeVLong, writeZInt, writeZLong
-
-
-
-
Field Detail
-
DEFAULT_MIN_WRITTEN_BYTES
public static final int DEFAULT_MIN_WRITTEN_BYTES
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ThrottledIndexOutput
public ThrottledIndexOutput(int bytesPerSecond, long delayInMillis, IndexOutput delegate)
-
ThrottledIndexOutput
public ThrottledIndexOutput(int bytesPerSecond, long delays, int minBytesWritten, IndexOutput delegate)
-
ThrottledIndexOutput
public ThrottledIndexOutput(int bytesPerSecond, long flushDelayMillis, long closeDelayMillis, long seekDelayMillis, long minBytesWritten, IndexOutput delegate)
-
-
Method Detail
-
newFromDelegate
public ThrottledIndexOutput newFromDelegate(IndexOutput output)
-
mBitsToBytes
public static final int mBitsToBytes(int mbits)
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classIndexOutput- Throws:
IOException
-
getFilePointer
public long getFilePointer()
- Specified by:
getFilePointerin classIndexOutput
-
writeByte
public void writeByte(byte b) throws IOException- Specified by:
writeBytein classDataOutput- Throws:
IOException
-
writeBytes
public void writeBytes(byte[] b, int offset, int length) throws IOException- Specified by:
writeBytesin classDataOutput- Throws:
IOException
-
getDelay
protected long getDelay(boolean closing)
-
copyBytes
public void copyBytes(DataInput input, long numBytes) throws IOException
- Overrides:
copyBytesin classDataOutput- Throws:
IOException
-
getChecksum
public long getChecksum() throws IOException- Specified by:
getChecksumin classIndexOutput- Throws:
IOException
-
-