congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
RollCycle.defaultIndexSpacing
Code IndexAdd Tabnine to your IDE (free)

How to use
defaultIndexSpacing
method
in
net.openhft.chronicle.queue.RollCycle

Best Java code snippets using net.openhft.chronicle.queue.RollCycle.defaultIndexSpacing (Showing top 11 results out of 315)

origin: OpenHFT/Chronicle-Queue

@Override
public int defaultIndexSpacing() {
  return delegate.defaultIndexSpacing();
}
origin: OpenHFT/Chronicle-Queue

public int indexSpacing() {
  return indexSpacing == null || indexSpacing <= 0 ? rollCycle().defaultIndexSpacing() :
      indexSpacing;
}
origin: OpenHFT/Chronicle-Queue

/**
 * @param rollCycle    the current rollCycle
 * @param wireType     the wire type that is being used
 * @param mappedBytes  used to mapped the data store file
 * @param indexCount   the number of entries in each index.
 * @param indexSpacing the spacing between indexed entries.
 */
public SingleChronicleQueueStore(@NotNull RollCycle rollCycle,
                 @NotNull final WireType wireType,
                 @NotNull MappedBytes mappedBytes,
                 int indexCount,
                 int indexSpacing) {
  this.mappedBytes = mappedBytes;
  this.mappedFile = mappedBytes.mappedFile();
  this.refCount = ReferenceCounter.onReleased(this::onCleanup);
  indexCount = Maths.nextPower2(indexCount, 8);
  indexSpacing = Maths.nextPower2(indexSpacing, 1);
  this.indexing = new SCQIndexing(wireType, indexCount, indexSpacing);
  this.indexing.writePosition = this.writePosition = wireType.newTwoLongReference().get();
  this.indexing.sequence = this.sequence = new RollCycleEncodeSequence(writePosition,
      rollCycle.defaultIndexCount(),
      rollCycle.defaultIndexSpacing());
}
origin: OpenHFT/Chronicle-Queue

long lastIndex = -1;
do {
  int defaultIndexSpacing = this.queue.rollCycle().defaultIndexSpacing();
  Wire wire = wire();
  int writeCount = Math.min(128 << 10,
origin: OpenHFT/Chronicle-Queue

@Test
public void testForwardFollowedBackBackwardTailer() {
  try (ChronicleQueue chronicle = builder(getTmpDir(), this.wireType)
      .rollCycle(TEST2_DAILY)
      .build()) {
    ExcerptAppender appender = chronicle.acquireAppender();
    int entries = chronicle.rollCycle().defaultIndexSpacing() + 2;
    for (int i = 0; i < entries; i++) {
      int finalI = i;
      appender.writeDocument(w -> w.writeEventName("hello").text("world" + finalI));
    }
    for (int i = 0; i < 3; i++) {
      readForward(chronicle, entries);
      readBackward(chronicle, entries);
    }
  }
}
origin: OpenHFT/Chronicle-Queue

long lastIndex = -1;
do {
  int defaultIndexSpacing = q.rollCycle().defaultIndexSpacing();
  Wire wire = appender.wire();
  int writeCount = (int) (defaultIndexSpacing - (lastIndex & (defaultIndexSpacing - 1)) - 1);
origin: OpenHFT/Chronicle-Queue

@Test
public void testToEndBeforeWrite() {
  try (ChronicleQueue chronicle = builder(getTmpDir(), wireType)
      .rollCycle(TEST2_DAILY)
      .build()) {
    ExcerptAppender appender = chronicle.acquireAppender();
    ExcerptTailer tailer = chronicle.createTailer();
    int entries = chronicle.rollCycle().defaultIndexSpacing() * 2 + 2;
    for (int i = 0; i < entries; i++) {
      tailer.toEnd();
      int finalI = i;
      appender.writeDocument(w -> w.writeEventName("hello").text("world" + finalI));
      tailer.readDocument(w -> w.read().text("world" + finalI, Assert::assertEquals));
    }
  }
}
origin: OpenHFT/Chronicle-Queue

@Test
public void testSomeMessages() {
  try (ChronicleQueue chronicle = builder(getTmpDir(), wireType)
      .rollCycle(TEST2_DAILY)
      .build()) {
    ExcerptAppender appender = chronicle.acquireAppender();
    ExcerptTailer tailer = chronicle.createTailer();
    int entries = chronicle.rollCycle().defaultIndexSpacing() * 2 + 2;
    for (long i = 0; i < entries; i++) {
      long finalI = i;
      appender.writeDocument(w -> w.writeEventName("hello").int64(finalI));
      long seq = chronicle.rollCycle().toSequenceNumber(appender.lastIndexAppended());
      assertEquals(i, seq);
      //      System.out.println(chronicle.dump());
      tailer.readDocument(w -> w.read().int64(finalI, (a, b) -> Assert.assertEquals((long) a, b)));
    }
  }
}
origin: net.openhft/chronicle-queue

public int indexSpacing() {
  return indexSpacing == null || indexSpacing <= 0 ? rollCycle().defaultIndexSpacing() :
      indexSpacing;
}
origin: net.openhft/chronicle-queue

/**
 * @param rollCycle    the current rollCycle
 * @param wireType     the wire type that is being used
 * @param mappedBytes  used to mapped the data store file
 * @param indexCount   the number of entries in each index.
 * @param indexSpacing the spacing between indexed entries.
 */
public SingleChronicleQueueStore(@NotNull RollCycle rollCycle,
                 @NotNull final WireType wireType,
                 @NotNull MappedBytes mappedBytes,
                 int indexCount,
                 int indexSpacing) {
  this.mappedBytes = mappedBytes;
  this.mappedFile = mappedBytes.mappedFile();
  this.refCount = ReferenceCounter.onReleased(this::onCleanup);
  indexCount = Maths.nextPower2(indexCount, 8);
  indexSpacing = Maths.nextPower2(indexSpacing, 1);
  this.indexing = new SCQIndexing(wireType, indexCount, indexSpacing);
  this.indexing.writePosition = this.writePosition = wireType.newTwoLongReference().get();
  this.indexing.sequence = this.sequence = new RollCycleEncodeSequence(writePosition,
      rollCycle.defaultIndexCount(),
      rollCycle.defaultIndexSpacing());
}
origin: net.openhft/chronicle-queue

long lastIndex = -1;
do {
  int defaultIndexSpacing = this.queue.rollCycle().defaultIndexSpacing();
  Wire wire = wire();
  int writeCount = Math.min(128 << 10,
net.openhft.chronicle.queueRollCycledefaultIndexSpacing

Popular methods of RollCycle

  • current
  • length
  • toCycle
  • toIndex
  • defaultIndexCount
  • toSequenceNumber
  • format

Popular in Java

  • Updating database using SQL prepared statement
  • compareTo (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSupportFragmentManager (FragmentActivity)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now