162163164165166167168169170171172
writeBuffer.put(renameBuffer.toByteBuffer().array(), 0, renameBuffer.writerIndex()); writeBuffer.rewind(); controlFile.writeDirect(writeBuffer, true); return controlFile; } finally {
130131132133134135136137138139140
start = System.currentTimeMillis(); } bb1.rewind(); file.writeDirect(bb1, true); } long end = System.currentTimeMillis(); double rate = 1000 * (double)its / (end - start);
279280281282283284285286287288289
{ for (int i = 0; i < its; i++) { bb1.rewind(); file.writeDirect(bb1, true, task); // try // { // file.writeDirect(bb1, true); // } // catch (Exception e)
542543544545546547548549550551552
if (!channel1.isOpen()) { channel1.open(1, false); } channel1.writeDirect(ByteBuffer.wrap(data), true); } /** * Reserves files (with the given fileID) in the specified journal, and places a * {@link FileWrapperJournal} in place to store messages while synchronization is going on.
536537538539540541542543544545546
541542543544545546547548549550551
109110111112113114115116117118119
for (int i = 0; i < 200; i++) { buffer.put(i, (byte)1); } file.writeDirect(buffer, true); buffer = ByteBuffer.allocate(400); for (int i = 0; i < 400; i++) { buffer.put(i, (byte)2);
117118119120121122123124125126127
for (int i = 0; i < 400; i++) { buffer.put(i, (byte)2); } file.writeDirect(buffer, true); buffer = ByteBuffer.allocate(600); file.position(0);
604605606607608609610611612613614
buffer.rewind(); // Changing the check bufferSize, so reload will ignore this record file.position(100); file.writeDirect(buffer, true); file.close(); setupAndLoadJournal(JOURNAL_SIZE, 100);