Skip to content

Ensure IEphemeralCluster extends ICluster #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Elastic.Elasticsearch.Ephemeral/IEphemeralCluster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Elastic.Elasticsearch.Ephemeral
{
public interface IEphemeralCluster
public interface IEphemeralCluster : ICluster
{
ICollection<Uri> NodesUris(string hostName = null);
string GetCacheFolderName();
Expand Down
29 changes: 21 additions & 8 deletions src/Elastic.Elasticsearch.Managed/ClusterBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,39 @@

namespace Elastic.Elasticsearch.Managed
{
public interface ICluster<out TConfiguration> : IDisposable
where TConfiguration : IClusterConfiguration<NodeFileSystem>
public interface ICluster
{
/// <summary>
/// Whether known proxies were detected as running during startup
/// </summary>
DetectedProxySoftware DetectedProxy { get; }

/// <summary> A friendly name for this cluster, derived from the implementation name</summary>
string ClusterMoniker { get; }
TConfiguration ClusterConfiguration { get; }

/// <inheritdoc cref="INodeFileSystem"/>
INodeFileSystem FileSystem { get; }

/// <summary> Indicating if this cluster was started correctly </summary>
bool Started { get; }

/// <summary>
/// The collection of <see cref="ElasticsearchNode"/>'s that make up the cluster
/// </summary>
ReadOnlyCollection<ElasticsearchNode> Nodes { get; }
}

public interface ICluster<out TConfiguration> : ICluster,IDisposable
where TConfiguration : IClusterConfiguration<NodeFileSystem>
{
TConfiguration ClusterConfiguration { get; }
IConsoleLineHandler Writer { get; }

IDisposable Start();

IDisposable Start(TimeSpan waitForStarted);

IDisposable Start(IConsoleLineHandler writer, TimeSpan waitForStarted);

/// <summary>
/// Whether known proxies were detected as running during startup
/// </summary>
DetectedProxySoftware DetectedProxy { get; }
}


Expand Down
3 changes: 1 addition & 2 deletions src/Elastic.Elasticsearch.Xunit/XunitClusterExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ namespace Elastic.Elasticsearch.Xunit
/// </summary>
public static class XunitClusterExtensions
{
private static readonly ConcurrentDictionary<IEphemeralCluster, object> Clients =
new ConcurrentDictionary<IEphemeralCluster, object>();
private static readonly ConcurrentDictionary<IEphemeralCluster, object> Clients = new();

/// <summary>
/// Gets a client for the cluster if one exists, or creates a new client if one doesn't.
Expand Down