Skip to content

Commit

Permalink
RavenDB-20325 : cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
aviv committed May 8, 2024
1 parent 65bd1cc commit 05c02c8
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 15 deletions.
4 changes: 1 addition & 3 deletions src/Raven.Server/Documents/Handlers/TimeSeriesHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,6 @@ protected override long ExecuteCmd(DocumentsOperationContext context)

foreach (var (docId, items) in _deletedRanges)
{
//var collectionName = _database.DocumentsStorage.ExtractCollectionName(context, items[0].Collection);
foreach (var item in items)
{
using (item)
Expand Down Expand Up @@ -1278,11 +1277,10 @@ public bool AddToDictionary(TimeSeriesItem item)
public bool AddToDeletedRanges(TimeSeriesDeletedRangeItem item)
{
bool newItem = false;
//TimeSeriesValuesSegment.ParseTimeSeriesKey(item.Key.Buffer, item.Size, _context, out var docId, out _);

if (_deletedRanges.TryGetValue(item.DocId, out var deletedRangesList) == false)
{
_deletedRanges[item.DocId] = deletedRangesList = new List<TimeSeriesDeletedRangeItem>();
_deletedRanges[item.DocId] = deletedRangesList = [];
newItem = true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Raven.Server/Smuggler/Documents/CsvStreamSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ public SmugglerSourceType GetSourceType()

public IAsyncEnumerable<TimeSeriesDeletedRangeItem> GetTimeSeriesDeletedRangesAsync(ITimeSeriesActions action, List<string> collectionsToExport)
{
throw new NotImplementedException();
return AsyncEnumerable.Empty<TimeSeriesDeletedRangeItem>();
}

public void Dispose()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public interface ITimeSeriesActions : IAsyncDisposable, INewItemActions
{
ValueTask WriteTimeSeriesAsync(TimeSeriesItem ts);

ValueTask WriteTimeSeriesDeletedRangeAsync(TimeSeriesDeletedRangeItem ts);
ValueTask WriteDeletedRangeAsync(TimeSeriesDeletedRangeItem ts);


void RegisterForDisposal(IDisposable data);
Expand Down
2 changes: 1 addition & 1 deletion src/Raven.Server/Smuggler/Documents/DatabaseDestination.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2404,7 +2404,7 @@ public async ValueTask WriteTimeSeriesAsync(TimeSeriesItem ts)
await HandleBatchOfTimeSeriesIfNecessaryAsync();
}

public async ValueTask WriteTimeSeriesDeletedRangeAsync(TimeSeriesDeletedRangeItem deletedRange)
public async ValueTask WriteDeletedRangeAsync(TimeSeriesDeletedRangeItem deletedRange)
{
AddToBatch(deletedRange);
await HandleBatchOfTimeSeriesIfNecessaryAsync();
Expand Down
2 changes: 1 addition & 1 deletion src/Raven.Server/Smuggler/Documents/DatabaseSmuggler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@ static bool ShouldSkip(TimeSeriesItem ts, SmugglerPatcher patcher, bool isFullBa
AddInfoToSmugglerResult(result, $"Time Series deleted ranges entries {result.TimeSeriesDeletedRanges}");

if (ShouldSkip(deletedRange, _patcher) == false)
await actions.WriteTimeSeriesDeletedRangeAsync(deletedRange);
await actions.WriteDeletedRangeAsync(deletedRange);

else
result.TimeSeriesDeletedRanges.SkippedCount++;
Expand Down
5 changes: 0 additions & 5 deletions src/Raven.Server/Smuggler/Documents/DatabaseSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,9 @@ public class DatabaseSource : ISmugglerSource
DatabaseItemType.CompareExchangeTombstones,
DatabaseItemType.CounterGroups,
DatabaseItemType.Subscriptions,


DatabaseItemType.TimeSeriesDeletedRanges,


DatabaseItemType.TimeSeries,
DatabaseItemType.ReplicationHubCertificates,
//DatabaseItemType.TimeSeriesDeletedRanges,
DatabaseItemType.None
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public void Dispose()
DocId?.Dispose();
Name?.Dispose();
Collection?.Dispose();
ChangeVector?.Dispose();
}
}
}
6 changes: 3 additions & 3 deletions src/Raven.Server/Smuggler/Documents/StreamDestination.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,7 @@ public async ValueTask WriteTimeSeriesAsync(TimeSeriesItem item)
}
}

public async ValueTask WriteTimeSeriesDeletedRangeAsync(TimeSeriesDeletedRangeItem deletedRangeItem)
public async ValueTask WriteDeletedRangeAsync(TimeSeriesDeletedRangeItem deletedRangeItem)
{
using (deletedRangeItem)
{
Expand Down Expand Up @@ -1170,11 +1170,11 @@ public async ValueTask WriteTimeSeriesDeletedRangeAsync(TimeSeriesDeletedRangeIt
Writer.WriteComma();

Writer.WritePropertyName(nameof(TimeSeriesDeletedRangeItem.From));
Writer.WriteDateTime(deletedRangeItem.From, true);
Writer.WriteDateTime(deletedRangeItem.From, isUtc: true);
Writer.WriteComma();

Writer.WritePropertyName(nameof(TimeSeriesDeletedRangeItem.To));
Writer.WriteDateTime(deletedRangeItem.To, true);
Writer.WriteDateTime(deletedRangeItem.To, isUtc: true);

Writer.WriteEndObject();

Expand Down

0 comments on commit 05c02c8

Please sign in to comment.