private TransactionSnapshot readSnapshotFile(InputStream is) throws IOException { return codecProvider.decode(is); }
/** * Retrieve a persisted snapshot taken in the past. * @return the decoded transaction manager snapshot */ private TransactionSnapshot retrieveSnapshot() { try { System.out.println("Retrieving snapshot from file " + existingFilename); File snapshotFile = new File(existingFilename); try (FileInputStream fis = new FileInputStream(snapshotFile)) { TransactionSnapshot snapshot = codecProvider.decode(fis); System.out.println("Snapshot retrieved, timestamp is " + snapshot.getTimestamp() + " ms."); return snapshot; } } catch (IOException e) { System.out.println("File " + existingFilename + " could not be read."); e.printStackTrace(); return null; } }
/** * Retrieve a persisted snapshot taken in the past. * @return the decoded transaction manager snapshot */ private TransactionSnapshot retrieveSnapshot() { try { System.out.println("Retrieving snapshot from file " + existingFilename); File snapshotFile = new File(existingFilename); try (FileInputStream fis = new FileInputStream(snapshotFile)) { TransactionSnapshot snapshot = codecProvider.decode(fis); System.out.println("Snapshot retrieved, timestamp is " + snapshot.getTimestamp() + " ms."); return snapshot; } } catch (IOException e) { System.out.println("File " + existingFilename + " could not be read."); e.printStackTrace(); return null; } }
private TransactionSnapshot readSnapshotInputStream(InputStream in) throws IOException { CountingInputStream countingIn = new CountingInputStream(in); TransactionSnapshot snapshot = codecProvider.decode(countingIn); LOG.info("Read encoded transaction snapshot of {} bytes", countingIn.getCount()); return snapshot; }
snapshot = codecProvider.decode(input);
snapshot = codecProvider.decode(input);