Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
da9e781
Refactor auth tokens
RichardIrons-neo4j Nov 28, 2024
8ff9be7
Initial implementation of cache
RichardIrons-neo4j Nov 28, 2024
77e0cdd
Add supported feature for Bolt 5.8 and fix cache key for home database
RichardIrons-neo4j Dec 6, 2024
14f642f
Enhance routing and connection pool interfaces to support home databa…
RichardIrons-neo4j Dec 16, 2024
5dbdb4c
Fix for Stefan's category/classification issue in WithNotifications, …
RichardIrons-neo4j Jan 8, 2025
fa43c0c
Add test for WithNotifications to set multiple categories and classif…
RichardIrons-neo4j Jan 9, 2025
d0896cc
Merge branch 'withnotifications-fix' into home-db-cache
RichardIrons-neo4j Jan 10, 2025
a6abd50
Refactor NotificationsConfig to handle null disabled categories and c…
RichardIrons-neo4j Jan 16, 2025
f579f83
Merge branch 'withnotifications-fix' into home-db-cache
RichardIrons-neo4j Jan 17, 2025
82a8f44
Update tests to assert DisabledCategories is empty instead of null
RichardIrons-neo4j Jan 17, 2025
545419a
Merge branch 'withnotifications-fix' into home-db-cache
RichardIrons-neo4j Jan 20, 2025
5a74bf6
Cache key now working?
RichardIrons-neo4j Jan 27, 2025
5119b13
Refactor authentication token handling and update tests for response …
RichardIrons-neo4j Jan 28, 2025
005d777
Get unit tests working
RichardIrons-neo4j Jan 28, 2025
83f0f09
pre cache refactor
RichardIrons-neo4j Jan 29, 2025
70b2fb3
Refactor logging output format and introduce ConsoleTextWriter for en…
RichardIrons-neo4j Jan 30, 2025
dd334ba
testkit tests looking good
RichardIrons-neo4j Feb 13, 2025
653f362
Merge branch '5.0' into home-db-cache
RichardIrons-neo4j Feb 13, 2025
d1f7bb8
Enhance BeginResponseHandler and RunResponseHandler to support defaul…
RichardIrons-neo4j Feb 14, 2025
3095c93
Unit tests all fixed
RichardIrons-neo4j Feb 14, 2025
e1c030a
Review notes bugs fixed
RichardIrons-neo4j Feb 26, 2025
3a81e87
HomeDbCache cache purging
RichardIrons-neo4j Feb 27, 2025
8a67be9
Merge remote-tracking branch 'origin/5.0' into home-db-cache
RichardIrons-neo4j Feb 27, 2025
e83ca4a
Add support for Bolt protocol version 5.8
RichardIrons-neo4j Feb 27, 2025
371ee87
fix failing tests
RichardIrons-neo4j Feb 27, 2025
ba1464c
maybe fix testkit?
RichardIrons-neo4j Feb 28, 2025
53233b1
Add exception detail to aid in debugging testkit failures
RichardIrons-neo4j Mar 3, 2025
a7a58c8
Fix failing testkit tests
RichardIrons-neo4j Mar 3, 2025
468e80c
Implement IsDirectDriver property in connection provider and related …
RichardIrons-neo4j Mar 6, 2025
1e952e0
LoadBalancer fix for mixed clusters
RichardIrons-neo4j Mar 7, 2025
70472c2
Fix logic in "dance"
RichardIrons-neo4j Mar 10, 2025
199a50f
fix testkit tests?
RichardIrons-neo4j Mar 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 6 additions & 6 deletions Neo4j.Driver/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -369,11 +369,11 @@ dotnet_naming_symbols.types_and_namespaces_symbols.applicable_kinds = namespace,
dotnet_naming_symbols.type_parameters_symbols.applicable_accessibilities = *
dotnet_naming_symbols.type_parameters_symbols.applicable_kinds = type_parameter
dotnet_naming_symbols.unity_serialized_field_symbols.applicable_accessibilities = *
dotnet_naming_symbols.unity_serialized_field_symbols.applicable_kinds =
dotnet_naming_symbols.unity_serialized_field_symbols.applicable_kinds =
dotnet_naming_symbols.unity_serialized_field_symbols.resharper_applicable_kinds = unity_serialised_field
dotnet_naming_symbols.unity_serialized_field_symbols.resharper_required_modifiers = instance
dotnet_naming_symbols.unity_serialized_field_symbols_1.applicable_accessibilities = *
dotnet_naming_symbols.unity_serialized_field_symbols_1.applicable_kinds =
dotnet_naming_symbols.unity_serialized_field_symbols_1.applicable_kinds =
dotnet_naming_symbols.unity_serialized_field_symbols_1.resharper_applicable_kinds = unity_serialised_field
dotnet_naming_symbols.unity_serialized_field_symbols_1.resharper_required_modifiers = instance
dotnet_separate_import_directive_groups = false
Expand Down Expand Up @@ -663,8 +663,8 @@ resharper_line_break_before_requires_clause = do_not_change
resharper_linkage_specification_braces = end_of_line
resharper_linkage_specification_indentation = none
resharper_local_function_body = block_body
resharper_macro_block_begin =
resharper_macro_block_end =
resharper_macro_block_begin =
resharper_macro_block_end =
resharper_max_array_initializer_elements_on_line = 10000
resharper_max_attribute_length_for_same_line = 38
resharper_max_enum_members_on_line = 1
Expand Down Expand Up @@ -734,7 +734,7 @@ resharper_resx_attribute_indent = single_indent
resharper_resx_blank_line_after_pi = true
resharper_resx_indent_text = OneIndent
resharper_resx_keep_user_linebreaks = true
resharper_resx_linebreak_before_elements =
resharper_resx_linebreak_before_elements =
resharper_resx_max_blank_lines_between_tags = 0
resharper_resx_pi_attribute_style = do_not_touch
resharper_resx_space_before_self_closing = false
Expand Down Expand Up @@ -963,7 +963,7 @@ resharper_xml_attribute_indent = align_by_first_attribute
resharper_xml_blank_line_after_pi = true
resharper_xml_indent_text = OneIndent
resharper_xml_keep_user_linebreaks = true
resharper_xml_linebreak_before_elements =
resharper_xml_linebreak_before_elements =
resharper_xml_max_blank_lines_between_tags = 2
resharper_xml_pi_attribute_style = do_not_touch
resharper_xml_space_before_self_closing = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,10 @@

namespace Neo4j.Driver.Tests.BenchkitBackend.Abstractions;

/// <summary>
/// Defines methods for executing a workload.
/// </summary>
/// <summary>Defines methods for executing a workload.</summary>
public interface IWorkloadExecutor
{
/// <summary>
/// Execute a workload.
/// </summary>
/// <summary>Execute a workload.</summary>
/// <param name="workload">The workload to execute.</param>
/// <returns>A task that completes when the workload has been executed.</returns>
Task ExecuteWorkloadAsync(Workload workload);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Copyright (c) "Neo4j"
// Neo4j Sweden AB [https://neo4j.com]
//
//
// Licensed under the Apache License, Version 2.0 (the "License").
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -17,14 +17,10 @@

namespace Neo4j.Driver.Tests.BenchkitBackend.Abstractions;

/// <summary>
/// Methods for forwarding a workload to the correct executor.
/// </summary>
/// <summary>Methods for forwarding a workload to the correct executor.</summary>
public interface IWorkloadExecutorSelector
{
/// <summary>
/// Gets the correct executor for the workload.
/// </summary>
/// <summary>Gets the correct executor for the workload.</summary>
/// <param name="workload">The workload to execute.</param>
public IWorkloadExecutor GetExecutor(Workload workload);
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Copyright (c) "Neo4j"
// Neo4j Sweden AB [https://neo4j.com]
//
//
// Licensed under the Apache License, Version 2.0 (the "License").
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -17,41 +17,29 @@

namespace Neo4j.Driver.Tests.BenchkitBackend.Abstractions;

/// <summary>
/// Represents a store for managing workloads.
/// </summary>
/// <summary>Represents a store for managing workloads.</summary>
public interface IWorkloadStore
{
/// <summary>
/// Creates a new workload in the store.
/// </summary>
/// <summary>Creates a new workload in the store.</summary>
/// <param name="workload">The workload to create.</param>
/// <returns>The ID of the created workload.</returns>
string CreateWorkload(Workload workload);

/// <summary>
/// Retrieves a workload from the store.
/// </summary>
/// <summary>Retrieves a workload from the store.</summary>
/// <param name="id">The ID of the workload to retrieve.</param>
/// <returns>The retrieved workload.</returns>
Workload GetWorkload(string id);

/// <summary>
/// Updates a workload in the store.
/// </summary>
/// <summary>Updates a workload in the store.</summary>
/// <param name="id">The ID of the workload to update.</param>
/// <param name="workload">The updated workload.</param>
/// <returns>The updated workload.</returns>
Workload UpdateWorkload(string id, Workload workload);

/// <summary>
/// Deletes a workload from the store.
/// </summary>
/// <summary>Deletes a workload from the store.</summary>
/// <param name="id">The ID of the workload to delete.</param>
void DeleteWorkload(string id);

/// <summary>
/// Retrieves the full list of workloads from the store.
/// </summary>
/// <summary>Retrieves the full list of workloads from the store.</summary>
IDictionary<string, Workload> GetAllWorkloads();
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Copyright (c) "Neo4j"
// Neo4j Sweden AB [https://neo4j.com]
//
//
// Licensed under the Apache License, Version 2.0 (the "License").
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -19,9 +19,7 @@ namespace Neo4j.Driver.Tests.BenchkitBackend.Controllers;

using ILogger = Microsoft.Extensions.Logging.ILogger;

/// <summary>
/// Check if the service is ready.
/// </summary>
/// <summary>Check if the service is ready.</summary>
[ApiController]
[Route("[controller]")]
public class ReadyController(
Expand All @@ -30,12 +28,10 @@ public class ReadyController(
: ControllerBase
{
// GET
/// <summary>
/// Check if the service is ready.
/// </summary>
/// <summary>Check if the service is ready.</summary>
/// <remarks>
/// This endpoint can be used to check if the service is ready to receive requests. This obviously includes
/// the web server, but also whether the backend can successfully connect to the DBMS.
/// This endpoint can be used to check if the service is ready to receive requests. This obviously includes the
/// web server, but also whether the backend can successfully connect to the DBMS.
/// </remarks>
[HttpGet]
[ProducesResponseType(StatusCodes.Status204NoContent)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,14 @@ namespace Neo4j.Driver.Tests.BenchkitBackend.Controllers;

using ILogger = Microsoft.Extensions.Logging.ILogger;

/// <summary>
/// Define and run workloads in the Neo4j driver.
/// </summary>
/// <summary>Define and run workloads in the Neo4j driver.</summary>
[ApiController]
[Route("[controller]")]
public class WorkloadController(
IWorkloadStore workloadStore,
IWorkloadExecutorSelector workloadExecutorSelector,
ILogger logger,
LinkGenerator linkGenerator)
IWorkloadStore workloadStore,
IWorkloadExecutorSelector workloadExecutorSelector,
ILogger logger,
LinkGenerator linkGenerator)
: ControllerBase
{
// GET
Expand Down Expand Up @@ -95,8 +93,7 @@ public async Task<ActionResult> ExecuteEphemeral([FromBody] Workload workload)

// DELETE
/// <summary>Deletes a driver workload.</summary>
/// <remarks>This endpoint deletes the workload from memory. Ongoing executions will not be
/// canceled or stopped.</remarks>
/// <remarks>This endpoint deletes the workload from memory. Ongoing executions will not be canceled or stopped.</remarks>
[HttpDelete("{id}")]
[ProducesResponseType(StatusCodes.Status204NoContent)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Copyright (c) "Neo4j"
// Neo4j Sweden AB [https://neo4j.com]
//
//
// Licensed under the Apache License, Version 2.0 (the "License").
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -21,9 +21,9 @@ namespace Neo4j.Driver.Tests.BenchkitBackend.Implementations;
using ILogger = Microsoft.Extensions.Logging.ILogger;

internal class ExecuteQueryWorkloadExecutor(
IDriver driver,
IRecordConsumer recordConsumer,
ILogger logger)
IDriver driver,
IRecordConsumer recordConsumer,
ILogger logger)
: IWorkloadExecutor
{
public async Task ExecuteWorkloadAsync(Workload workload)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ namespace Neo4j.Driver.Tests.BenchkitBackend.Implementations;
using ILogger = Microsoft.Extensions.Logging.ILogger;

internal class ExecuteReadWriteWorkloadExecutor(
IDriver driver,
IRecordConsumer recordConsumer,
IWorkloadSessionBuilder sessionBuilder,
ILogger logger)
IDriver driver,
IRecordConsumer recordConsumer,
IWorkloadSessionBuilder sessionBuilder,
ILogger logger)
: IWorkloadExecutor
{
public async Task ExecuteWorkloadAsync(Workload workload)
Expand Down Expand Up @@ -145,7 +145,7 @@ await execute(

return 0;
},
_ => { });
_ => {});

logger.LogDebug("Workload completed");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Copyright (c) "Neo4j"
// Neo4j Sweden AB [https://neo4j.com]
//
//
// Licensed under the Apache License, Version 2.0 (the "License").
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -20,7 +20,7 @@ namespace Neo4j.Driver.Tests.BenchkitBackend.Implementations;
using ILogger = Microsoft.Extensions.Logging.ILogger;

internal class RecordConsumer(
ILogger logger)
ILogger logger)
: IRecordConsumer
{
public void ConsumeRecords(IEnumerable<IRecord> records)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Copyright (c) "Neo4j"
// Neo4j Sweden AB [https://neo4j.com]
//
//
// Licensed under the Apache License, Version 2.0 (the "License").
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -21,10 +21,10 @@ namespace Neo4j.Driver.Tests.BenchkitBackend.Implementations;
using ILogger = Microsoft.Extensions.Logging.ILogger;

internal class SessionRunWorkloadExecutor(
IDriver driver,
IRecordConsumer recordConsumer,
IWorkloadSessionBuilder sessionBuilder,
ILogger logger)
IDriver driver,
IRecordConsumer recordConsumer,
IWorkloadSessionBuilder sessionBuilder,
ILogger logger)
: IWorkloadExecutor
{
public async Task ExecuteWorkloadAsync(Workload workload)
Expand All @@ -47,17 +47,18 @@ private async Task ExecuteInParallelSessionsAsync(Workload workload)
{
var queryToRun = new Query(query.Text, query.Parameters);
logger.LogDebug("Starting query {Query} in parallel session", queryToRun.Text);
tasks.Add(Task.Run(
async () =>
{
// create a new session in parallel for each query
await using var session = sessionBuilder.BuildSession(driver, workload);

var resultCursor = await session.RunAsync(queryToRun);
var records = await resultCursor.ToListAsync();
logger.LogDebug("Received {RecordCount} records", records.Count);
recordConsumer.ConsumeRecords(records);
}));
tasks.Add(
Task.Run(
async () =>
{
// create a new session in parallel for each query
await using var session = sessionBuilder.BuildSession(driver, workload);

var resultCursor = await session.RunAsync(queryToRun);
var records = await resultCursor.ToListAsync();
logger.LogDebug("Received {RecordCount} records", records.Count);
recordConsumer.ConsumeRecords(records);
}));
}

logger.LogDebug("Waiting for {TaskCount} parallel tasks to complete", tasks.Count);
Expand Down
Loading