forked from ravendb/ravendb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RavenDB-22849 - fixes and adaptations to v.6.0 after merge
- Loading branch information
Showing
18 changed files
with
200 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/Raven.Server/Documents/TransactionMerger/Commands/DeleteLocalBackupStatusesCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Raven.Server.Documents.PeriodicBackup; | ||
using Raven.Server.ServerWide.Context; | ||
|
||
namespace Raven.Server.Documents.TransactionMerger.Commands | ||
{ | ||
public sealed class DeleteLocalBackupStatusesCommand : MergedTransactionCommand<ClusterOperationContext, ClusterTransaction> | ||
{ | ||
private readonly string _databaseName; | ||
private readonly string _dbId; | ||
private readonly HashSet<long> _taskIds; | ||
|
||
public DeleteLocalBackupStatusesCommand(HashSet<long> taskIds, string databaseName, string dbId) | ||
{ | ||
_databaseName = databaseName ?? throw new ArgumentNullException(nameof(databaseName)); | ||
_dbId = dbId ?? throw new ArgumentNullException(nameof(dbId)); | ||
_taskIds = taskIds ?? throw new ArgumentNullException(nameof(taskIds)); | ||
} | ||
|
||
protected override long ExecuteCmd(ClusterOperationContext context) | ||
{ | ||
foreach (var taskId in _taskIds) | ||
{ | ||
BackupStatusStorage.DeleteBackupStatus(context, _databaseName, _dbId, taskId); | ||
} | ||
return _taskIds.Count; | ||
} | ||
|
||
public override IReplayableCommandDto<ClusterOperationContext, ClusterTransaction, MergedTransactionCommand<ClusterOperationContext, ClusterTransaction>> ToDto(ClusterOperationContext context) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
src/Raven.Server/Documents/TransactionMerger/Commands/UpdateLocalBackupStatusCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using System; | ||
using Raven.Client.Documents.Operations.Backups; | ||
using Raven.Server.Documents.PeriodicBackup; | ||
using Raven.Server.ServerWide.Context; | ||
using Sparrow.Json; | ||
using Sparrow.Json.Parsing; | ||
|
||
namespace Raven.Server.Documents.TransactionMerger.Commands | ||
{ | ||
public sealed class UpdateLocalBackupStatusCommand : MergedTransactionCommand<ClusterOperationContext, ClusterTransaction> | ||
{ | ||
private readonly DynamicJsonValue _backupStatusAsJson; | ||
private readonly string _databaseName; | ||
private readonly string _dbId; | ||
private readonly long _taskId; | ||
|
||
public UpdateLocalBackupStatusCommand(PeriodicBackupStatus backupStatus, string databaseName, string dbId, long taskId) | ||
{ | ||
_backupStatusAsJson = (backupStatus ?? throw new ArgumentNullException(nameof(backupStatus))).ToJson(); | ||
_databaseName = databaseName ?? throw new ArgumentNullException(nameof(databaseName)); | ||
_dbId = dbId; | ||
_taskId = taskId; | ||
} | ||
|
||
protected override long ExecuteCmd(ClusterOperationContext context) | ||
{ | ||
var statusBlittable = context.ReadObject(_backupStatusAsJson, $"backup-status-update-taskId-{_taskId}", BlittableJsonDocumentBuilder.UsageMode.ToDisk); | ||
BackupStatusStorage.InsertBackupStatusBlittable(context, statusBlittable, _databaseName, _dbId, _taskId); | ||
return 1; | ||
} | ||
|
||
public override IReplayableCommandDto<ClusterOperationContext, ClusterTransaction, MergedTransactionCommand<ClusterOperationContext, ClusterTransaction>> ToDto(ClusterOperationContext context) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.