Skip to content

Commit 32f48b2

Browse files
committed
Move RestoreObservable to where other Restore components are situated
1 parent ef7eece commit 32f48b2

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

src/Nest/Modules/SnapshotAndRestore/Restore/RestoreObservable/ElasticClient-RestoreObservable.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,5 @@ public IObservable<IRecoveryStatusResponse> RestoreObservable(Name repository, N
2424
/// <inheritdoc/>
2525
public IObservable<IRecoveryStatusResponse> RestoreObservable(TimeSpan interval, IRestoreRequest request)=>
2626
new RestoreObservable(this, request, interval);
27-
2827
}
2928
}

src/Nest/Document/Multiple/Reindex/RestoreObservable.cs renamed to src/Nest/Modules/SnapshotAndRestore/Restore/RestoreObservable/RestoreObservable.cs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
using Elasticsearch.Net;
2-
using System;
1+
using System;
32
using System.Diagnostics;
43
using System.Linq;
54
using System.Text.RegularExpressions;
65
using System.Threading;
6+
using Elasticsearch.Net;
77

88
namespace Nest
99
{
@@ -109,7 +109,8 @@ public void Dispose()
109109
protected virtual void Dispose(bool disposing)
110110
{
111111
if (_disposed) return;
112-
if (_timer != null) _timer.Dispose();
112+
_timer?.Dispose();
113+
113114
if (_restoreStatusHumbleObject != null)
114115
{
115116
_restoreStatusHumbleObject.Next -= _nextEventHandlers;
@@ -131,7 +132,7 @@ protected virtual void Dispose(bool disposing)
131132

132133
public class RestoreNextEventArgs : EventArgs
133134
{
134-
public IRecoveryStatusResponse RecoveryStatusResponse { get; private set; }
135+
public IRecoveryStatusResponse RecoveryStatusResponse { get; }
135136

136137
public RestoreNextEventArgs(IRecoveryStatusResponse recoveryStatusResponse)
137138
{
@@ -141,7 +142,7 @@ public RestoreNextEventArgs(IRecoveryStatusResponse recoveryStatusResponse)
141142

142143
public class RestoreCompletedEventArgs : EventArgs
143144
{
144-
public IRecoveryStatusResponse RecoveryStatusResponse { get; private set; }
145+
public IRecoveryStatusResponse RecoveryStatusResponse { get; }
145146

146147
public RestoreCompletedEventArgs(IRecoveryStatusResponse recoveryStatusResponse)
147148
{
@@ -151,7 +152,7 @@ public RestoreCompletedEventArgs(IRecoveryStatusResponse recoveryStatusResponse)
151152

152153
public class RestoreErrorEventArgs : EventArgs
153154
{
154-
public Exception Exception { get; private set; }
155+
public Exception Exception { get; }
155156

156157
public RestoreErrorEventArgs(Exception exception)
157158
{
@@ -220,19 +221,19 @@ public void CheckStatus()
220221
protected virtual void OnNext(RestoreNextEventArgs nextEventArgs)
221222
{
222223
var handler = Next;
223-
if (handler != null) handler(this, nextEventArgs);
224+
handler?.Invoke(this, nextEventArgs);
224225
}
225226

226227
protected virtual void OnCompleted(RestoreCompletedEventArgs completedEventArgs)
227228
{
228229
var handler = Completed;
229-
if (handler != null) handler(this, completedEventArgs);
230+
handler?.Invoke(this, completedEventArgs);
230231
}
231232

232233
protected virtual void OnError(RestoreErrorEventArgs errorEventArgs)
233234
{
234235
var handler = Error;
235-
if (handler != null) handler(this, errorEventArgs);
236+
handler?.Invoke(this, errorEventArgs);
236237
}
237238
}
238239
}

src/Nest/Search/CovariantSearch.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ internal static class CovariantSearch
99
/// Based on the type information present in this descriptor create method that takes
1010
/// the returned _source and hit and returns the ClrType it should deserialize too.
1111
/// This is so that Documents[A] can contain actual instances of subclasses B, C as well.
12-
/// If you specify types using .Types(typeof(B), typeof(C)) then NEST can automagically
12+
/// If you specify types using .Type(typeof(B), typeof(C)) then NEST can automagically
1313
/// create a TypeSelector based on the hits _type property.
1414
/// </summary>
1515
public static void CloseOverAutomagicCovariantResultSelector(Inferrer infer, ICovariantSearchRequest self)
@@ -33,12 +33,11 @@ public static void CloseOverAutomagicCovariantResultSelector(Inferrer infer, ICo
3333
};
3434
}
3535
}
36+
3637
public interface ICovariantSearchRequest
3738
{
3839
Type ClrType { get; }
3940
Types ElasticsearchTypes { get; }
4041
Func<dynamic, Hit<dynamic>, Type> TypeSelector { get; set;}
4142
}
42-
43-
4443
}

0 commit comments

Comments
 (0)