/// <summary>
        /// Record the fact that a node has voted in a current election for a candidate so it can survive a restart.
        /// </summary>
        /// <param name="candidateTermId"> to record that a vote has taken place. </param>
        /// <param name="fileSyncLevel"> as defined by cluster file sync level.</param>
        public void CandidateTermId(long candidateTermId, int fileSyncLevel)
        {
            buffer.PutLongVolatile(MarkFileHeaderEncoder.CandidateTermIdEncodingOffset(), candidateTermId);

            if (fileSyncLevel > 0)
            {
                markFile.MappedByteBuffer().Flush();
            }
        }
Beispiel #2
0
 /// <summary>
 /// Record the fact that a node has voted in a current election for a candidate so it can survive a restart.
 /// </summary>
 /// <param name="candidateTermId"> to record that a vote has taken place. </param>
 public void CandidateTermId(long candidateTermId)
 {
     buffer.PutLongVolatile(MarkFileHeaderEncoder.CandidateTermIdEncodingOffset(), candidateTermId);
     //markFile.MappedByteBuffer().Force(); How to do this?
 }
Beispiel #3
0
 /// <summary>
 /// Record the fact that a node has voted in a current election for a candidate so it can survive a restart.
 /// </summary>
 /// <param name="candidateTermId"> to record that a vote has taken place. </param>
 public void CandidateTermId(long candidateTermId)
 {
     buffer.PutLongVolatile(MarkFileHeaderEncoder.CandidateTermIdEncodingOffset(), candidateTermId);
     markFile.MappedByteBuffer().Flush();
 }