public static CommitLogDescriptor fromHeader(File file, EncryptionContext encryptionContext) { try (RandomAccessFile raf = new RandomAccessFile(file, "r")) { assert raf.getFilePointer() == 0; return readHeader(raf, encryptionContext); } catch (EOFException e) { throw new RuntimeException(e); } catch (IOException e) { throw new FSReadError(e, file); } }
public static CommitLogDescriptor fromHeader(File file, EncryptionContext encryptionContext) { try (RandomAccessFile raf = new RandomAccessFile(file, "r")) { assert raf.getFilePointer() == 0; return readHeader(raf, encryptionContext); } catch (EOFException e) { throw new RuntimeException(e); } catch (IOException e) { throw new FSReadError(e, file); } }
public static CommitLogDescriptor fromHeader(File file, EncryptionContext encryptionContext) { try (RandomAccessFile raf = new RandomAccessFile(file, "r")) { assert raf.getFilePointer() == 0; return readHeader(raf, encryptionContext); } catch (EOFException e) { throw new RuntimeException(e); } catch (IOException e) { throw new FSReadError(e, file); } }
private static boolean shouldSkip(File file) throws IOException, ConfigurationException { CommitLogDescriptor desc = CommitLogDescriptor.fromFileName(file.getName()); if (desc.version < CommitLogDescriptor.VERSION_21) { return false; } try(RandomAccessReader reader = RandomAccessReader.open(file)) { CommitLogDescriptor.readHeader(reader, DatabaseDescriptor.getEncryptionContext()); int end = reader.readInt(); long filecrc = reader.readInt() & 0xffffffffL; return end == 0 && filecrc == 0; } }
private static boolean shouldSkip(File file) throws IOException, ConfigurationException { CommitLogDescriptor desc = CommitLogDescriptor.fromFileName(file.getName()); if (desc.version < CommitLogDescriptor.VERSION_21) { return false; } try(RandomAccessReader reader = RandomAccessReader.open(file)) { CommitLogDescriptor.readHeader(reader, DatabaseDescriptor.getEncryptionContext()); int end = reader.readInt(); long filecrc = reader.readInt() & 0xffffffffL; return end == 0 && filecrc == 0; } }
private static boolean shouldSkip(File file) throws IOException, ConfigurationException { CommitLogDescriptor desc = CommitLogDescriptor.fromFileName(file.getName()); if (desc.version < CommitLogDescriptor.VERSION_21) { return false; } try(RandomAccessReader reader = RandomAccessReader.open(file)) { CommitLogDescriptor.readHeader(reader, DatabaseDescriptor.getEncryptionContext()); int end = reader.readInt(); long filecrc = reader.readInt() & 0xffffffffL; return end == 0 && filecrc == 0; } }
desc = CommitLogDescriptor.readHeader(reader, DatabaseDescriptor.getEncryptionContext());
desc = CommitLogDescriptor.readHeader(reader, DatabaseDescriptor.getEncryptionContext());
desc = CommitLogDescriptor.readHeader(reader, DatabaseDescriptor.getEncryptionContext());