public ChronicleStream(String name, int messageSizeHint) throws IOException { this(name, messageSizeHint, ChronicleQueueBuilder.indexed(PersistentQueueSpec.DEFAULT_BASE_PATH, name).build() ); }
/** * Create an {@link ChronicleQueuePersistor} based on the given base path. * * @param basePath Directory in which to create the Chronicle. * @throws IOException */ public ChronicleQueuePersistor(@Nonnull String basePath) throws IOException { this(basePath, new JavaSerializationCodec<T>(), false, false, ChronicleQueueBuilder.vanilla(basePath)); }
this.deleteOnExit = deleteOnExit; data = config.build(); lastId.set(data.lastWrittenIndex()); if (clearOnStart) {
/** * Makes IndexedChronicleQueueBuilder cloneable. * * @return a cloned copy of this IndexedChronicleQueueBuilder instance */ @NotNull @SuppressWarnings("CloneDoesntDeclareCloneNotSupportedException") @Override public IndexedChronicleQueueBuilder clone() { try { return (IndexedChronicleQueueBuilder) super.clone(); } catch (CloneNotSupportedException e) { throw new AssertionError(e); } } }
/** * Makes ReplicaChronicleQueueBuilder cloneable. * * @return a cloned copy of this ReplicaChronicleQueueBuilder instance */ @NotNull @SuppressWarnings("CloneDoesntDeclareCloneNotSupportedException") @Override public ReplicaChronicleQueueBuilder clone() { try { return (ReplicaChronicleQueueBuilder) super.clone(); } catch (CloneNotSupportedException e) { throw new AssertionError(e); } } }
/** * Create a chronicle dispatcher * * @param name The name of the dispatcher. */ public ChronicleReaderStream(String name) throws IOException { this(name, ChronicleQueueBuilder.indexed(PersistentQueueSpec.DEFAULT_BASE_PATH, name).build() ); }
@Override public PersistentQueue<T> get() { try { return new PersistentQueue<T>(new ChronicleQueuePersistor<T>(basePath, codec, clearOnStart, deleteOnExit, ChronicleQueueBuilder.vanilla(basePath) .indexBlockSize(indexBlockSize) .synchronous(sync) .dataBlockSize(dataBlockSize))); } catch (IOException e) { throw new IllegalStateException(e.getMessage(), e); } }
@Override public Chronicle build() throws IOException { if (this.builder != null) { this.chronicle = this.builder.build(); } return doBuild(); }
/** * Makes VanillaChronicleQueueBuilder cloneable. * * @return a cloned copy of this VanillaChronicleQueueBuilder instance */ @NotNull @SuppressWarnings("CloneDoesntDeclareCloneNotSupportedException") @Override public VanillaChronicleQueueBuilder clone() { try { return (VanillaChronicleQueueBuilder) super.clone(); } catch (CloneNotSupportedException e) { throw new AssertionError(e); } } }
public static IndexedChronicleQueueBuilder indexed(File parent, String child) { return indexed(new File(parent, child)); }
public static VanillaChronicleQueueBuilder vanilla(File parent, String child) { return vanilla(new File(parent, child)); }
public static IndexedChronicleQueueBuilder indexed(String path) { return indexed(new File(path)); }
public static VanillaChronicleQueueBuilder vanilla(String path) { return vanilla(new File(path)); }
public static IndexedChronicleQueueBuilder indexed(String parent, String child) { return indexed(new File(parent, child)); }
public static VanillaChronicleQueueBuilder vanilla(String parent, String child) { return vanilla(new File(parent, child)); }
public ChronicleStream(String name, int messageSizeHint) throws IOException { this(name, messageSizeHint, ChronicleQueueBuilder.indexed(PersistentQueueSpec.DEFAULT_BASE_PATH, name).build() ); }
this.chronicle = ChronicleQueueBuilder.vanilla(pathToChronicle).cycleLength((int)this.queueRollingInterval).cycleFormat(this.cycleFormat).build(); this.queueConsumer = new DefaultStreamingMessageQueueConsumer(this.getId(), this.chronicle.createTailer(), this.queueWaitStrategy); this.queueProducer = new DefaultStreamingMessageQueueProducer(this.getId(), this.chronicle.createAppender(), this.queueWaitStrategy);
/** * Create a chronicle dispatcher * * @param name The name of the dispatcher. */ public ChronicleReaderStream(String name) throws IOException { this(name, ChronicleQueueBuilder.indexed(PersistentQueueSpec.DEFAULT_BASE_PATH, name).build() ); }
Chronicle ic = ChronicleQueueBuilder.indexed(basePath).build(); ExcerptTailer excerpt = ic.createTailer();
@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); } }