private Location checkpointSubscriptionCommand(KahaSubscriptionCommand subscription) throws IOException { ByteSequence sequence = toByteSequence(subscription); Location location = journal.write(sequence, nullCompletionCallback) ; try { location.getLatch().await(); } catch (InterruptedException e) { throw new InterruptedIOException(e.toString()); } return location; }
private Location checkpointAckMessageFileMap() throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oout = new ObjectOutputStream(baos); oout.writeObject(metadata.ackMessageFileMap); oout.flush(); oout.close(); // using completion callback allows a disk sync to be avoided when enableJournalDiskSyncs = false Location location = store(new KahaAckMessageFileMapCommand().setAckMessageFileMap(new Buffer(baos.toByteArray())), nullCompletionCallback); try { location.getLatch().await(); } catch (InterruptedException e) { throw new InterruptedIOException(e.toString()); } return location; }
private Location checkpointProducerAudit() throws IOException { if (metadata.producerSequenceIdTracker == null || metadata.producerSequenceIdTracker.modified()) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oout = new ObjectOutputStream(baos); oout.writeObject(metadata.producerSequenceIdTracker); oout.flush(); oout.close(); // using completion callback allows a disk sync to be avoided when enableJournalDiskSyncs = false Location location = store(new KahaProducerAuditCommand().setAudit(new Buffer(baos.toByteArray())), nullCompletionCallback); try { location.getLatch().await(); if (location.getException().get() != null) { throw location.getException().get(); } } catch (InterruptedException e) { throw new InterruptedIOException(e.toString()); } return location; } return metadata.producerSequenceIdTrackerLocation; }
private Location checkpointSubscriptionCommand(KahaSubscriptionCommand subscription) throws IOException { ByteSequence sequence = toByteSequence(subscription); Location location = journal.write(sequence, nullCompletionCallback) ; try { location.getLatch().await(); } catch (InterruptedException e) { throw new InterruptedIOException(e.toString()); } return location; }
private Location checkpointSubscriptionCommand(KahaSubscriptionCommand subscription) throws IOException { ByteSequence sequence = toByteSequence(subscription); Location location = journal.write(sequence, nullCompletionCallback) ; try { location.getLatch().await(); } catch (InterruptedException e) { throw new InterruptedIOException(e.toString()); } return location; }
private Location checkpointSubscriptionCommand(KahaSubscriptionCommand subscription) throws IOException { ByteSequence sequence = toByteSequence(subscription); Location location = journal.write(sequence, nullCompletionCallback) ; try { location.getLatch().await(); } catch (InterruptedException e) { throw new InterruptedIOException(e.toString()); } return location; }
private Location checkpointAckMessageFileMap() throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oout = new ObjectOutputStream(baos); oout.writeObject(metadata.ackMessageFileMap); oout.flush(); oout.close(); // using completion callback allows a disk sync to be avoided when enableJournalDiskSyncs = false Location location = store(new KahaAckMessageFileMapCommand().setAckMessageFileMap(new Buffer(baos.toByteArray())), nullCompletionCallback); try { location.getLatch().await(); } catch (InterruptedException e) { throw new InterruptedIOException(e.toString()); } return location; }
private Location checkpointAckMessageFileMap() throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oout = new ObjectOutputStream(baos); oout.writeObject(metadata.ackMessageFileMap); oout.flush(); oout.close(); // using completion callback allows a disk sync to be avoided when enableJournalDiskSyncs = false Location location = store(new KahaAckMessageFileMapCommand().setAckMessageFileMap(new Buffer(baos.toByteArray())), nullCompletionCallback); try { location.getLatch().await(); } catch (InterruptedException e) { throw new InterruptedIOException(e.toString()); } return location; }
private Location checkpointAckMessageFileMap() throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oout = new ObjectOutputStream(baos); oout.writeObject(metadata.ackMessageFileMap); oout.flush(); oout.close(); // using completion callback allows a disk sync to be avoided when enableJournalDiskSyncs = false Location location = store(new KahaAckMessageFileMapCommand().setAckMessageFileMap(new Buffer(baos.toByteArray())), nullCompletionCallback); try { location.getLatch().await(); } catch (InterruptedException e) { throw new InterruptedIOException(e.toString()); } return location; }
private Location checkpointProducerAudit() throws IOException { if (metadata.producerSequenceIdTracker == null || metadata.producerSequenceIdTracker.modified()) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oout = new ObjectOutputStream(baos); oout.writeObject(metadata.producerSequenceIdTracker); oout.flush(); oout.close(); // using completion callback allows a disk sync to be avoided when enableJournalDiskSyncs = false Location location = store(new KahaProducerAuditCommand().setAudit(new Buffer(baos.toByteArray())), nullCompletionCallback); try { location.getLatch().await(); if (location.getException().get() != null) { throw location.getException().get(); } } catch (InterruptedException e) { throw new InterruptedIOException(e.toString()); } return location; } return metadata.producerSequenceIdTrackerLocation; }
private Location checkpointProducerAudit() throws IOException { if (metadata.producerSequenceIdTracker == null || metadata.producerSequenceIdTracker.modified()) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oout = new ObjectOutputStream(baos); oout.writeObject(metadata.producerSequenceIdTracker); oout.flush(); oout.close(); // using completion callback allows a disk sync to be avoided when enableJournalDiskSyncs = false Location location = store(new KahaProducerAuditCommand().setAudit(new Buffer(baos.toByteArray())), nullCompletionCallback); try { location.getLatch().await(); if (location.getException().get() != null) { throw location.getException().get(); } } catch (InterruptedException e) { throw new InterruptedIOException(e.toString()); } return location; } return metadata.producerSequenceIdTrackerLocation; }
private Location checkpointProducerAudit() throws IOException { if (metadata.producerSequenceIdTracker == null || metadata.producerSequenceIdTracker.modified()) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oout = new ObjectOutputStream(baos); oout.writeObject(metadata.producerSequenceIdTracker); oout.flush(); oout.close(); // using completion callback allows a disk sync to be avoided when enableJournalDiskSyncs = false Location location = store(new KahaProducerAuditCommand().setAudit(new Buffer(baos.toByteArray())), nullCompletionCallback); try { location.getLatch().await(); if (location.getException().get() != null) { throw location.getException().get(); } } catch (InterruptedException e) { throw new InterruptedIOException(e.toString()); } return location; } return metadata.producerSequenceIdTrackerLocation; }