public boolean isUnusedPreallocated(DataFile dataFile) throws IOException { if (preallocationScope == PreallocationScope.ENTIRE_JOURNAL_ASYNC) { DataFileAccessor reader = accessorPool.openDataFileAccessor(dataFile); try { byte[] firstFewBytes = new byte[BATCH_CONTROL_RECORD_HEADER.length]; reader.readFully(0, firstFewBytes); ByteSequence bs = new ByteSequence(firstFewBytes); return bs.startsWith(EOF_RECORD); } catch (Exception ignored) { } finally { accessorPool.closeDataFileAccessor(reader); } } return false; }
private int checkBatchRecord(ByteSequence bs, RandomAccessFile reader) throws IOException { ensureAvailable(bs, reader, EOF_RECORD.length); if (bs.startsWith(EOF_RECORD)) { return 0; // eof
public boolean isUnusedPreallocated(DataFile dataFile) throws IOException { if (preallocationScope == PreallocationScope.ENTIRE_JOURNAL_ASYNC) { DataFileAccessor reader = accessorPool.openDataFileAccessor(dataFile); try { byte[] firstFewBytes = new byte[BATCH_CONTROL_RECORD_HEADER.length]; reader.readFully(0, firstFewBytes); ByteSequence bs = new ByteSequence(firstFewBytes); return bs.startsWith(EOF_RECORD); } catch (Exception ignored) { } finally { accessorPool.closeDataFileAccessor(reader); } } return false; }
public boolean isUnusedPreallocated(DataFile dataFile) throws IOException { if (preallocationScope == PreallocationScope.ENTIRE_JOURNAL_ASYNC) { DataFileAccessor reader = accessorPool.openDataFileAccessor(dataFile); try { byte[] firstFewBytes = new byte[BATCH_CONTROL_RECORD_HEADER.length]; reader.readFully(0, firstFewBytes); ByteSequence bs = new ByteSequence(firstFewBytes); return bs.startsWith(EOF_RECORD); } catch (Exception ignored) { } finally { accessorPool.closeDataFileAccessor(reader); } } return false; }
public boolean isUnusedPreallocated(DataFile dataFile) throws IOException { if (preallocationScope == PreallocationScope.ENTIRE_JOURNAL_ASYNC) { DataFileAccessor reader = accessorPool.openDataFileAccessor(dataFile); try { byte[] firstFewBytes = new byte[BATCH_CONTROL_RECORD_HEADER.length]; reader.readFully(0, firstFewBytes); ByteSequence bs = new ByteSequence(firstFewBytes); return bs.startsWith(EOF_RECORD); } catch (Exception ignored) { } finally { accessorPool.closeDataFileAccessor(reader); } } return false; }
private int checkBatchRecord(ByteSequence bs, RandomAccessFile reader) throws IOException { ensureAvailable(bs, reader, EOF_RECORD.length); if (bs.startsWith(EOF_RECORD)) { return 0; // eof
private int checkBatchRecord(ByteSequence bs, RandomAccessFile reader) throws IOException { ensureAvailable(bs, reader, EOF_RECORD.length); if (bs.startsWith(EOF_RECORD)) { return 0; // eof
private int checkBatchRecord(ByteSequence bs, RandomAccessFile reader) throws IOException { ensureAvailable(bs, reader, EOF_RECORD.length); if (bs.startsWith(EOF_RECORD)) { return 0; // eof