コード例 #1
0
  @Test
  public void shouldReportCurrentTail() {
    final int tailValue = 64;

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

    assertThat(termAppender.tailVolatile(), is(tailValue));
  }
コード例 #2
0
ファイル: TermAppender.java プロジェクト: ezrover/Aeron
 /**
  * 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());
 }
コード例 #3
0
ファイル: TermAppender.java プロジェクト: ezrover/Aeron
 /**
  * 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);
 }