Skip to content

Commit

Permalink
Ensure IEphemeralCluster extends ICluster (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mpdreamz committed Jul 10, 2023
1 parent b7c4dad commit 45c9637
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
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

0 comments on commit 45c9637

Please sign in to comment.