@Override protected void doStart() { ChronicleTools.warmup(); this.basePath = (this.basePath.endsWith("/") ? this.basePath + getName() : this.basePath + "/" + getName()); try { chronicle = ChronicleQueueBuilder.indexed(basePath).synchronous(true).build(); appender = chronicle.createAppender(); } catch (Throwable t) { addError(t.getMessage(), t); } }
@Override protected void doStart() { ChronicleTools.warmup(); this.basePath = (this.basePath.endsWith("/") ? this.basePath + getName() : this.basePath + "/" + getName()); try { chronicle = ChronicleQueueBuilder.indexed(basePath).synchronous(true).build(); appender = chronicle.createAppender(); } catch (Throwable t) { addError(t.getMessage(), t); } }
public void startExcerpt(long capacity) { checkNotClosed(); // in case there is more than one appender :P if (index != size()) { super.toEndForAppend0(); } if (capacity >= IndexedChronicle.this.builder.dataBlockSize()) { throw new IllegalArgumentException( "Capacity too large " + capacity + " >= " + IndexedChronicle.this.builder.dataBlockSize()); } // if the capacity is to large, roll the previous entry, and there was one if (positionAddr + capacity > dataStartAddr + dataBlockSize) { // check we are the start of a block. checkNewIndexLine(); writePaddedEntry(); try { loadNextDataBuffer(); } catch (IOException e) { throw new IllegalStateException(e); } } // check we are the start of a block. checkNewIndexLine(); // update the soft limitAddr startAddr = positionAddr; limitAddr = positionAddr + capacity; finished = false; nextSynchronous = IndexedChronicle.this.builder.synchronous(); }
@Override public void finish() { super.finish(); if (IndexedChronicle.this.builder.synchronous()) { if (dataBuffer != null) { dataBuffer.force(); } if (indexBuffer != null) { indexBuffer.force(); } } }