Skip to content

Commit

Permalink
Port to 1.8.2-196-gd0e9417c2
Browse files Browse the repository at this point in the history
  • Loading branch information
JPWatson committed Apr 23, 2018
1 parent b1c7e98 commit bd0341a
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 63 deletions.
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#### Port
Aeron.NET has been ported against Java version:
- Agrona: 0.9.12-30-gec52107
- Aeron: 1.8.2-166-gcd044137f
- Aeron: 1.8.2-196-gd0e9417c2
Binary file modified driver/media-driver.jar
Binary file not shown.
6 changes: 3 additions & 3 deletions driver/version.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Driver built from source
Agrona: 0.9.15-19-g492ed0c
SBE: 1.7.9-30-g720f5c7f
Aeron: 1.8.2-166-gcd044137f
Agrona: 0.9.15-35-g9e6c532
SBE: 1.7.9-33-gc3884639
Aeron: 1.8.2-196-gd0e9417c2
2 changes: 1 addition & 1 deletion scripts/build-prerelease-nuget-packages.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@echo off
pushd %~dp0..
SET suffix=pre7
SET suffix=pre8
SET nuget_source=https://www.myget.org/F/aeron/api/v2/package

del nupkgs\*.nupkg
Expand Down
70 changes: 35 additions & 35 deletions src/Adaptive.Cluster/Codecs/RequestVoteDecoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,27 +88,27 @@ public void Limit(int limit)
this._limit = limit;
}

public static int CandidateTermIdId()
public static int LastBaseLogPositionId()
{
return 1;
}

public static int CandidateTermIdSinceVersion()
public static int LastBaseLogPositionSinceVersion()
{
return 0;
}

public static int CandidateTermIdEncodingOffset()
public static int LastBaseLogPositionEncodingOffset()
{
return 0;
}

public static int CandidateTermIdEncodingLength()
public static int LastBaseLogPositionEncodingLength()
{
return 8;
}

public static string CandidateTermIdMetaAttribute(MetaAttribute metaAttribute)
public static string LastBaseLogPositionMetaAttribute(MetaAttribute metaAttribute)
{
switch (metaAttribute)
{
Expand All @@ -121,48 +121,48 @@ public static string CandidateTermIdMetaAttribute(MetaAttribute metaAttribute)
return "";
}

public static long CandidateTermIdNullValue()
public static long LastBaseLogPositionNullValue()
{
return -9223372036854775808L;
}

public static long CandidateTermIdMinValue()
public static long LastBaseLogPositionMinValue()
{
return -9223372036854775807L;
}

public static long CandidateTermIdMaxValue()
public static long LastBaseLogPositionMaxValue()
{
return 9223372036854775807L;
}

public long CandidateTermId()
public long LastBaseLogPosition()
{
return _buffer.GetLong(_offset + 0, ByteOrder.LittleEndian);
}


public static int LastBaseLogPositionId()
public static int LastTermPositionId()
{
return 2;
}

public static int LastBaseLogPositionSinceVersion()
public static int LastTermPositionSinceVersion()
{
return 0;
}

public static int LastBaseLogPositionEncodingOffset()
public static int LastTermPositionEncodingOffset()
{
return 8;
}

public static int LastBaseLogPositionEncodingLength()
public static int LastTermPositionEncodingLength()
{
return 8;
}

public static string LastBaseLogPositionMetaAttribute(MetaAttribute metaAttribute)
public static string LastTermPositionMetaAttribute(MetaAttribute metaAttribute)
{
switch (metaAttribute)
{
Expand All @@ -175,48 +175,48 @@ public static string LastBaseLogPositionMetaAttribute(MetaAttribute metaAttribut
return "";
}

public static long LastBaseLogPositionNullValue()
public static long LastTermPositionNullValue()
{
return -9223372036854775808L;
}

public static long LastBaseLogPositionMinValue()
public static long LastTermPositionMinValue()
{
return -9223372036854775807L;
}

public static long LastBaseLogPositionMaxValue()
public static long LastTermPositionMaxValue()
{
return 9223372036854775807L;
}

public long LastBaseLogPosition()
public long LastTermPosition()
{
return _buffer.GetLong(_offset + 8, ByteOrder.LittleEndian);
}


public static int LastTermPositionId()
public static int CandidateTermIdId()
{
return 3;
}

public static int LastTermPositionSinceVersion()
public static int CandidateTermIdSinceVersion()
{
return 0;
}

public static int LastTermPositionEncodingOffset()
public static int CandidateTermIdEncodingOffset()
{
return 16;
}

public static int LastTermPositionEncodingLength()
public static int CandidateTermIdEncodingLength()
{
return 8;
}

public static string LastTermPositionMetaAttribute(MetaAttribute metaAttribute)
public static string CandidateTermIdMetaAttribute(MetaAttribute metaAttribute)
{
switch (metaAttribute)
{
Expand All @@ -229,22 +229,22 @@ public static string LastTermPositionMetaAttribute(MetaAttribute metaAttribute)
return "";
}

public static long LastTermPositionNullValue()
public static long CandidateTermIdNullValue()
{
return -9223372036854775808L;
}

public static long LastTermPositionMinValue()
public static long CandidateTermIdMinValue()
{
return -9223372036854775807L;
}

public static long LastTermPositionMaxValue()
public static long CandidateTermIdMaxValue()
{
return 9223372036854775807L;
}

public long LastTermPosition()
public long CandidateTermId()
{
return _buffer.GetLong(_offset + 16, ByteOrder.LittleEndian);
}
Expand Down Expand Up @@ -333,21 +333,21 @@ public StringBuilder AppendTo(StringBuilder builder)
}
builder.Append(BLOCK_LENGTH);
builder.Append("):");
//Token{signal=BEGIN_FIELD, name='candidateTermId', referencedName='null', description='null', id=1, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}}
//Token{signal=BEGIN_FIELD, name='lastBaseLogPosition', referencedName='null', description='null', id=1, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}}
//Token{signal=ENCODING, name='int64', referencedName='null', description='null', id=-1, version=0, deprecated=0, encodedLength=8, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}}
builder.Append("CandidateTermId=");
builder.Append(CandidateTermId());
builder.Append('|');
//Token{signal=BEGIN_FIELD, name='lastBaseLogPosition', referencedName='null', description='null', id=2, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}}
//Token{signal=ENCODING, name='int64', referencedName='null', description='null', id=-1, version=0, deprecated=0, encodedLength=8, offset=8, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}}
builder.Append("LastBaseLogPosition=");
builder.Append(LastBaseLogPosition());
builder.Append('|');
//Token{signal=BEGIN_FIELD, name='lastTermPosition', referencedName='null', description='null', id=3, version=0, deprecated=0, encodedLength=0, offset=16, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}}
//Token{signal=ENCODING, name='int64', referencedName='null', description='null', id=-1, version=0, deprecated=0, encodedLength=8, offset=16, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}}
//Token{signal=BEGIN_FIELD, name='lastTermPosition', referencedName='null', description='null', id=2, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}}
//Token{signal=ENCODING, name='int64', referencedName='null', description='null', id=-1, version=0, deprecated=0, encodedLength=8, offset=8, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}}
builder.Append("LastTermPosition=");
builder.Append(LastTermPosition());
builder.Append('|');
//Token{signal=BEGIN_FIELD, name='candidateTermId', referencedName='null', description='null', id=3, version=0, deprecated=0, encodedLength=0, offset=16, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}}
//Token{signal=ENCODING, name='int64', referencedName='null', description='null', id=-1, version=0, deprecated=0, encodedLength=8, offset=16, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}}
builder.Append("CandidateTermId=");
builder.Append(CandidateTermId());
builder.Append('|');
//Token{signal=BEGIN_FIELD, name='candidateMemberId', referencedName='null', description='null', id=4, version=0, deprecated=0, encodedLength=0, offset=24, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}}
//Token{signal=ENCODING, name='int32', referencedName='null', description='null', id=-1, version=0, deprecated=0, encodedLength=4, offset=24, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}}
builder.Append("CandidateMemberId=");
Expand Down
36 changes: 18 additions & 18 deletions src/Adaptive.Cluster/Codecs/RequestVoteEncoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,96 +96,96 @@ public void Limit(int limit)
this._limit = limit;
}

public static int CandidateTermIdEncodingOffset()
public static int LastBaseLogPositionEncodingOffset()
{
return 0;
}

public static int CandidateTermIdEncodingLength()
public static int LastBaseLogPositionEncodingLength()
{
return 8;
}

public static long CandidateTermIdNullValue()
public static long LastBaseLogPositionNullValue()
{
return -9223372036854775808L;
}

public static long CandidateTermIdMinValue()
public static long LastBaseLogPositionMinValue()
{
return -9223372036854775807L;
}

public static long CandidateTermIdMaxValue()
public static long LastBaseLogPositionMaxValue()
{
return 9223372036854775807L;
}

public RequestVoteEncoder CandidateTermId(long value)
public RequestVoteEncoder LastBaseLogPosition(long value)
{
_buffer.PutLong(_offset + 0, value, ByteOrder.LittleEndian);
return this;
}


public static int LastBaseLogPositionEncodingOffset()
public static int LastTermPositionEncodingOffset()
{
return 8;
}

public static int LastBaseLogPositionEncodingLength()
public static int LastTermPositionEncodingLength()
{
return 8;
}

public static long LastBaseLogPositionNullValue()
public static long LastTermPositionNullValue()
{
return -9223372036854775808L;
}

public static long LastBaseLogPositionMinValue()
public static long LastTermPositionMinValue()
{
return -9223372036854775807L;
}

public static long LastBaseLogPositionMaxValue()
public static long LastTermPositionMaxValue()
{
return 9223372036854775807L;
}

public RequestVoteEncoder LastBaseLogPosition(long value)
public RequestVoteEncoder LastTermPosition(long value)
{
_buffer.PutLong(_offset + 8, value, ByteOrder.LittleEndian);
return this;
}


public static int LastTermPositionEncodingOffset()
public static int CandidateTermIdEncodingOffset()
{
return 16;
}

public static int LastTermPositionEncodingLength()
public static int CandidateTermIdEncodingLength()
{
return 8;
}

public static long LastTermPositionNullValue()
public static long CandidateTermIdNullValue()
{
return -9223372036854775808L;
}

public static long LastTermPositionMinValue()
public static long CandidateTermIdMinValue()
{
return -9223372036854775807L;
}

public static long LastTermPositionMaxValue()
public static long CandidateTermIdMaxValue()
{
return 9223372036854775807L;
}

public RequestVoteEncoder LastTermPosition(long value)
public RequestVoteEncoder CandidateTermId(long value)
{
_buffer.PutLong(_offset + 16, value, ByteOrder.LittleEndian);
return this;
Expand Down
3 changes: 1 addition & 2 deletions src/Adaptive.Cluster/Service/ClientSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ public string ResponseChannel()
}

/// <summary>
/// Cluster session encoded principal passed from <seealso cref="io.aeron.cluster.Authenticator"/>
/// when the session was authenticated.
/// Cluster session encoded principal from when the session was authenticated.
/// </summary>
/// <returns> The encoded Principal passed. May be 0 length to indicate none present. </returns>
public byte[] EncodedPrincipal()
Expand Down
5 changes: 5 additions & 0 deletions src/Adaptive.Cluster/Service/ClusterMarkFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

namespace Adaptive.Cluster
{

/// <summary>
/// Used to indicate if a cluster service is running and what configuration it is using. Errors encountered by
/// the service are recorded in within this file by a <see cref="DistinctErrorLog"/>
/// </summary>
public class ClusterMarkFile : IDisposable
{
public const string FILENAME = "cluster-mark.dat";
Expand Down
6 changes: 3 additions & 3 deletions src/Adaptive.Cluster/aeron-cluster-codecs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,9 @@
<sbe:message name="RequestVote"
id="50"
description="Request the vote from another member to become the cluster leader">
<field name="candidateTermId" id="1" type="int64"/>
<field name="lastBaseLogPosition" id="2" type="int64"/>
<field name="lastTermPosition" id="3" type="int64"/>
<field name="lastBaseLogPosition" id="1" type="int64"/>
<field name="lastTermPosition" id="2" type="int64"/>
<field name="candidateTermId" id="3" type="int64"/>
<field name="candidateMemberId" id="4" type="int32"/>
</sbe:message>

Expand Down

0 comments on commit bd0341a

Please sign in to comment.