Skip to content

Commit

Permalink
Documentaiton changes, fix force single node
Browse files Browse the repository at this point in the history
  • Loading branch information
shannonklaus committed Nov 26, 2024
1 parent 2f03235 commit 8cfec04
Show file tree
Hide file tree
Showing 27 changed files with 159 additions and 202 deletions.
2 changes: 1 addition & 1 deletion .github/actions/run-ee-server/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ runs:
- name: Build and push
uses: docker/build-push-action@v6
with:
# Don't want to use default Git context or else it will clone the whole Python client repo again
# Don't want to use default Git context or else it will clone the whole client repo again
context: .github/workflows/docker-build-context
build-args: |
server_image=${{ env.IMAGE_NAME }}
Expand Down
85 changes: 0 additions & 85 deletions .github/workflows/dotnet.yml

This file was deleted.

31 changes: 3 additions & 28 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,6 @@ on:
required: true

jobs:
#build:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
#
# steps:
# - uses: actions/checkout@v4
# - name: Setup .NET
# uses: actions/setup-dotnet@v4
# with:
# dotnet-version: 6.0.x
# - name: Restore dependencies
# run: dotnet restore /p:EnableWindowsTargeting=true
# #- name: Install dependencies
# # run: dotnet add package NeoLua --version 1.3.14
# - name: Build
# run: dotnet build --configuration Release --no-restore /p:EnableWindowsTargeting=true
#
# - name: Publish
# run: dotnet publish -c Release -o ../publish
#
# - name: Send files to test jobs
# uses: actions/upload-artifact@v3
# with:
# name: AerospikeClient.dll
# path: ./AerospikeClient/bin/Debug/*.whl

test-ee:
runs-on: ubuntu-latest
Expand All @@ -61,14 +35,15 @@ jobs:
use-server-rc: true
docker-hub-username: ${{ secrets.DOCKER_HUB_BOT_USERNAME }}
docker-hub-password: ${{ secrets.DOCKER_HUB_BOT_PW }}

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x

- name: Restore dependencies
run: dotnet restore /p:EnableWindowsTargeting=true
#- name: Install dependencies
# run: dotnet add package NeoLua --version 1.3.14

- name: Build
run: dotnet build --configuration Release --no-restore /p:EnableWindowsTargeting=true

Expand Down
2 changes: 1 addition & 1 deletion AerospikeClient/Admin/Role.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 Aerospike, Inc.
* Copyright 2012-2024 Aerospike, Inc.
*
* Portions may be licensed to Aerospike, Inc. under one or more contributor
* license agreements.
Expand Down
33 changes: 20 additions & 13 deletions AerospikeClient/Async/AsyncClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,19 @@ public AsyncClient(AsyncClientPolicy policy, params Host[] hosts)
// Multi-Record Transactions
//-------------------------------------------------------

/// <summary>
/// Asynchronously attempt to commit the given multi-record transaction.
/// Create listener, call asynchronous commit and return task monitor.
/// </summary>
/// <param name="txn">multi-record transaction</param>
/// <param name="token">cancellation token</param>
public Task Commit(Txn txn, CancellationToken token)
{
var listener = new CommitListenerAdapter(token);
Commit(listener, txn);
return listener.Task;
}

/// <summary>
/// Asynchronously attempt to commit the given multi-record transaction. First, the expected
/// record versions are sent to the server nodes for verification. If all nodes return success,
Expand Down Expand Up @@ -177,22 +190,23 @@ public void Commit(CommitListener listener, Txn txn)
}

/// <summary>
/// Asynchronously attempt to commit the given multi-record transaction.
/// Create listener, call asynchronous put and return task monitor.
/// Asynchronously attempt to abort and rollback the given multi-record transaction.
/// Create listener, call asynchronous commit and return task monitor.
/// </summary>
/// <param name="txn">multi-record transaction</param>
/// <param name="token">cancellation token</param>
public Task Commit(Txn txn, CancellationToken token)
public Task Abort(Txn txn, CancellationToken token)
{
var listener = new CommitListenerAdapter(token);
Commit(listener, txn);
var listener = new AbortListenerAdapter(token);
Abort(listener, txn);
return listener.Task;
}


/// <summary>
/// Asynchronously abort and rollback the given multi-record transaction.
/// <para>
/// Schedules the commit command with a channel selector and return.
/// Schedules the abort command with a channel selector and return.
/// Another thread will process the command and send the results to the listener.
/// </para><para>
/// Requires server version 8.0+
Expand Down Expand Up @@ -222,13 +236,6 @@ public void Abort(AbortListener listener, Txn txn)
}
}

public Task Abort(Txn txn, CancellationToken token)
{
var listener = new AbortListenerAdapter(token);
Abort(listener, txn);
return listener.Task;
}

//-------------------------------------------------------
// Write Record Operations
//-------------------------------------------------------
Expand Down
2 changes: 0 additions & 2 deletions AerospikeClient/Async/AsyncQueryPartitionExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
using System;
using System.Collections.Generic;

namespace Aerospike.Client
{
Expand Down
2 changes: 0 additions & 2 deletions AerospikeClient/Async/AsyncScanPartitionExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
using System;
using System.Collections.Generic;

namespace Aerospike.Client
{
Expand Down
35 changes: 26 additions & 9 deletions AerospikeClient/Async/IAsyncClient.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 Aerospike, Inc.
* Copyright 2012-2024 Aerospike, Inc.
*
* Portions may be licensed to Aerospike, Inc. under one or more contributor
* license agreements.
Expand Down Expand Up @@ -41,32 +41,49 @@ public interface IAsyncClient : IAerospikeClient
// Multi-Record Transactions
//-------------------------------------------------------

/// <summary>
/// Asynchronously attempt to commit the given multi-record transaction.
/// Create listener, call asynchronous commit and return task monitor.
/// </summary>
/// <param name="txn">multi-record transaction</param>
/// <param name="token">cancellation token</param>
public Task Commit(Txn txn, CancellationToken token);

/// <summary>
/// Asynchronously attempt to commit the given multi-record transaction. First, the expected
/// record versions are sent to the server nodes for verification.If all nodes return success,
/// record versions are sent to the server nodes for verification. If all nodes return success,
/// the transaction is committed. Otherwise, the transaction is aborted.
/// <para>
/// This method registers the command with an event loop and returns.
/// The event loop thread will process the command and send the results to the listener.
/// </para><para>
/// Schedules the commit command with a channel selector and return.
/// Another thread will process the command and send the results to the listener.
/// </para>
/// <para>
/// Requires server version 8.0+
/// </para>
/// </summary>
/// <param name="listener">where to send results</param>
/// <param name="txn">multi-record transaction</param>
void Commit(CommitListener listener, Txn txn);

/// <summary>
/// Asynchronously attempt to abort and rollback the given multi-record transaction.
/// Create listener, call asynchronous commit and return task monitor.
/// </summary>
/// <param name="txn">multi-record transaction</param>
/// <param name="token">cancellation token</param>
public Task Abort(Txn txn, CancellationToken token);

/// <summary>
/// Asynchronously abort and rollback the given multi-record transaction.
/// <para>
/// This method registers the command with an event loop and returns.
/// The event loop thread will process the command and send the results to the listener.
/// Schedules the abort command with a channel selector and return.
/// Another thread will process the command and send the results to the listener.
/// </para><para>
/// Requires server version 8.0+
/// </para>
/// </summary>
/// <param name="listener"></param>
/// <param name="txn"></param>
/// <param name="listener">where to send results</param>
/// <param name="txn">multi-record transaction</param>
void Abort(AbortListener listener, Txn txn);

//-------------------------------------------------------
Expand Down
5 changes: 5 additions & 0 deletions AerospikeClient/Cluster/NodeValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ public Node SeedNode(Cluster cluster, Host host, Peers peers)

private bool ValidatePeers(Peers peers, Node node)
{
if (peers == null)
{
return true;
}

try
{
peers.refreshCount = 0;
Expand Down
2 changes: 1 addition & 1 deletion AerospikeClient/Command/Batch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ protected internal override bool ParseRow()

BatchRecord record = records[batchIndex];

if (resultCode == 0)
if (resultCode == ResultCode.OK)
{
record.resultCode = resultCode;
}
Expand Down
5 changes: 3 additions & 2 deletions AerospikeClient/Command/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ public void SetTxnMarkRollForward(Key key)
Begin();
int fieldCount = EstimateKeySize(key);
EstimateOperationSize(bin);
SizeBuffer();
//SizeBuffer();
WriteTxnMonitor(key, 0, Command.INFO2_WRITE, fieldCount, 1);
WriteOperation(bin, Operation.Type.WRITE);
End();
Expand Down Expand Up @@ -462,14 +462,15 @@ public void SetTxnClose(Txn txn, Key key)
{
Begin();
int fieldCount = EstimateKeySize(key);
SizeBuffer();
//SizeBuffer();
WriteTxnMonitor(key, 0, Command.INFO2_WRITE | Command.INFO2_DELETE | Command.INFO2_DURABLE_DELETE,
fieldCount, 0);
End();
}

private void WriteTxnMonitor(Key key, int readAttr, int writeAttr, int fieldCount, int opCount)
{
SizeBuffer();
dataOffset += 8;
dataBuffer[dataOffset++] = MSG_REMAINING_HEADER_SIZE;
dataBuffer[dataOffset++] = (byte)readAttr;
Expand Down
2 changes: 1 addition & 1 deletion AerospikeClient/Command/ExecuteCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public sealed class ExecuteCommand : SyncWriteCommand
private readonly string packageName;
private readonly string functionName;
private readonly Value[] args;
public Record Record { get; private set; }
public Record Record { get; private set; }

public ExecuteCommand
(
Expand Down
2 changes: 1 addition & 1 deletion AerospikeClient/Command/OperateArgs.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 Aerospike, Inc.
* Copyright 2012-2024 Aerospike, Inc.
*
* Portions may be licensed to Aerospike, Inc. under one or more contributor
* license agreements.
Expand Down
1 change: 1 addition & 0 deletions AerospikeClient/Command/ReadCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ protected internal override void ParseResult(Connection conn)
{
ParseHeader(conn);
ParseFields(policy.Txn, key, false);

if (resultCode == ResultCode.OK)
{
this.record = policy.recordParser.ParseRecord(dataBuffer, ref dataOffset, opCount, generation, expiration, isOperation);
Expand Down
2 changes: 1 addition & 1 deletion AerospikeClient/Listener/CommitListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace Aerospike.Client
public interface CommitListener
{
/// <summary>
/// This method is called when the records are verified and the commit succeeds.
/// This method is called when the records are verified and the commit succeeded or will succeed.
/// </summary>
void OnSuccess(CommitStatusType status);

Expand Down
Loading

0 comments on commit 8cfec04

Please sign in to comment.