Package org.apache.lucene.tests.store
Class MockIndexOutputWrapper
- java.lang.Object
-
- org.apache.lucene.store.DataOutput
-
- org.apache.lucene.store.IndexOutput
-
- org.apache.lucene.store.FilterIndexOutput
-
- org.apache.lucene.tests.store.MockIndexOutputWrapper
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class MockIndexOutputWrapper extends FilterIndexOutput
Used to create an output stream that will throw an IOException on fake disk full, track max disk space actually used, and maybe throw random IOExceptions.
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.store.FilterIndexOutput
out
-
-
Constructor Summary
Constructors Constructor Description MockIndexOutputWrapper(MockDirectoryWrapper dir, IndexOutput out, String name)
Construct an empty output buffer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
copyBytes(DataInput input, long numBytes)
void
writeByte(byte b)
void
writeBytes(byte[] b, int len)
void
writeBytes(byte[] b, int offset, int len)
-
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
writeGroupVInts, writeInt, writeLong, writeMapOfStrings, writeSetOfStrings, writeShort, writeString, writeVInt, writeVLong, writeZInt, writeZLong
-
-
-
-
Constructor Detail
-
MockIndexOutputWrapper
public MockIndexOutputWrapper(MockDirectoryWrapper dir, IndexOutput out, String name)
Construct an empty output buffer.
-
-
Method Detail
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterIndexOutput
- Throws:
IOException
-
writeByte
public void writeByte(byte b) throws IOException
- Overrides:
writeByte
in classFilterIndexOutput
- Throws:
IOException
-
writeBytes
public void writeBytes(byte[] b, int offset, int len) throws IOException
- Overrides:
writeBytes
in classFilterIndexOutput
- Throws:
IOException
-
writeBytes
public void writeBytes(byte[] b, int len) throws IOException
- Overrides:
writeBytes
in classDataOutput
- Throws:
IOException
-
copyBytes
public void copyBytes(DataInput input, long numBytes) throws IOException
- Overrides:
copyBytes
in classDataOutput
- Throws:
IOException
-
-