@Override public void write(FileChannel fileChannel) throws IOException { byteBuffer().position(0); byteBuffer().putShort(magic); byteBuffer().putLong(this.firstRecordId); byteBuffer().flip(); fileChannel.position(0); fileChannel.write(byteBuffer()); fileChannel.force(true); } }
public long getNextRecordId() { return fileHeader.getFirstRecordId() + fileLength; }
public int getHeaderLength() { return fileHeader.getLength(); }
this.storeConfig = storeConfig; this.entryBuffer = ByteBuffer.allocate(storeConfig.getMaxxLogEntryLength() + 1 + 4); this.fileHeader = new StoreTxLogFileHeader(); fileLength = fileHeader.getLength(); fileHeader.setFirstRecordId(firstRecordId); fileHeader.write(fileChannel); } else { fileHeader.read(fileChannel); fileLength = fileChannel.size(); lastCheckPointLength = fileLength;
this.storeConfig = storeConfig; this.entryBuffer = ByteBuffer.allocate(storeConfig.getMaxxLogEntryLength() + 1 + 4); this.fileHeader = new StoreTxLogFileHeader(); fileLength = fileHeader.getLength(); fileHeader.setFirstRecordId(firstRecordId); fileHeader.write(fileChannel); } else { fileHeader.read(fileChannel); fileLength = fileChannel.size(); lastCheckPointLength = fileLength;
this.storeConfig = storeConfig; this.entryBuffer = ByteBuffer.allocate(storeConfig.getMaxxLogEntryLength() + 1 + 4); this.fileHeader = new StoreTxLogFileHeader(); fileLength = fileHeader.getLength(); fileHeader.setFirstRecordId(firstRecordId); fileHeader.write(fileChannel); } else { fileHeader.read(fileChannel); fileLength = fileChannel.size(); lastCheckPointLength = fileLength;
@Override public void write(FileChannel fileChannel) throws IOException { byteBuffer().position(0); byteBuffer().putShort(magic); byteBuffer().putLong(this.firstRecordId); byteBuffer().flip(); fileChannel.position(0); fileChannel.write(byteBuffer()); fileChannel.force(true); } }
public long getFirstRecordId() { return fileHeader.getFirstRecordId(); }
public int getHeaderLength() { return fileHeader.getLength(); }
@Override public void read(FileChannel fileChannel) throws IOException { if (fileChannel.size() == 0) { return; } fileChannel.position(0); fileChannel.read(byteBuffer()); byteBuffer().position(0); short readMagic = byteBuffer().getShort(); if (readMagic != magic) { throw new IOException("Invalid file type magic number 0x" + Integer.toHexString(readMagic & 0xFFFF)); } this.firstRecordId = byteBuffer().getLong(); }
public long getFirstRecordId() { return fileHeader.getFirstRecordId(); }
public int getHeaderLength() { return fileHeader.getLength(); }
@Override public void read(FileChannel fileChannel) throws IOException { if (fileChannel.size() == 0) { return; } fileChannel.position(0); fileChannel.read(byteBuffer()); byteBuffer().position(0); short readMagic = byteBuffer().getShort(); if (readMagic != magic) { throw new IOException("Invalid file type magic number 0x" + Integer.toHexString(readMagic & 0xFFFF)); } this.firstRecordId = byteBuffer().getLong(); }
public long getNextRecordId() { return fileHeader.getFirstRecordId() + fileLength; }
@Override public void write(FileChannel fileChannel) throws IOException { byteBuffer().position(0); byteBuffer().putShort(magic); byteBuffer().putLong(this.firstRecordId); byteBuffer().flip(); fileChannel.position(0); fileChannel.write(byteBuffer()); fileChannel.force(true); } }
public long getNextRecordId() { return fileHeader.getFirstRecordId() + fileLength; }
@Override public void read(FileChannel fileChannel) throws IOException { if (fileChannel.size() == 0) { return; } fileChannel.position(0); fileChannel.read(byteBuffer()); byteBuffer().position(0); short readMagic = byteBuffer().getShort(); if (readMagic != magic) { throw new IOException("Invalid file type magic number 0x" + Integer.toHexString(readMagic & 0xFFFF)); } this.firstRecordId = byteBuffer().getLong(); }
public long getFirstRecordId() { return fileHeader.getFirstRecordId(); }