use of org.apache.ignite.internal.processors.cache.persistence.wal.io.SimpleFileInput in project ignite by apache.
the class IgniteDataIntegrityTests method setUp.
/**
*/
@Before
public void setUp() throws Exception {
File file = File.createTempFile("integrity", "dat");
file.deleteOnExit();
expBuf = new ByteBufferExpander(1024, ByteOrder.BIG_ENDIAN);
FileIOFactory factory = new RandomAccessFileIOFactory();
fileInput = new SimpleFileInput(factory.create(file), expBuf);
ByteBuffer buf = ByteBuffer.allocate(1024);
ThreadLocalRandom curr = ThreadLocalRandom.current();
for (int i = 0; i < 1024; i += 16) {
buf.putInt(curr.nextInt());
buf.putInt(curr.nextInt());
buf.putInt(curr.nextInt());
buf.position(i);
buf.putInt(FastCrc.calcCrc(buf, 12));
}
buf.rewind();
fileInput.io().writeFully(buf);
fileInput.io().force();
}
Aggregations