Exemplo n.º 1
0
  @Test
  public void shouldReportCurrentTail() {
    final int tailValue = 64;

    when(metaDataBuffer.getIntVolatile(TERM_TAIL_COUNTER_OFFSET)).thenReturn(tailValue);

    assertThat(termAppender.tailVolatile(), is(tailValue));
  }
Exemplo n.º 2
0
 /**
  * Get the current tail value in a volatile memory ordering fashion. If raw tail is greater than
  * term capacity then capacity will be returned.
  *
  * @return the current tail value.
  */
 public int tailVolatile() {
   return Math.min(metaDataBuffer.getIntVolatile(TERM_TAIL_COUNTER_OFFSET), termBuffer.capacity());
 }
Exemplo n.º 3
0
 /**
  * Get the raw value current tail value in a volatile memory ordering fashion.
  *
  * @return the current tail value.
  */
 public int rawTailVolatile() {
   return metaDataBuffer.getIntVolatile(TERM_TAIL_COUNTER_OFFSET);
 }