Skip to content
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
4 changes: 2 additions & 2 deletions Orleans.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<Project Path="src/Orleans.Persistence.Memory/Orleans.Persistence.Memory.csproj" />
<Project Path="src/Orleans.Reminders/Orleans.Reminders.csproj" />
<Project Path="src/Orleans.Runtime/Orleans.Runtime.csproj" />
<Project Path="src/Orleans.ScheduledJobs/Orleans.ScheduledJobs.csproj" Id="ab4cc723-b3cf-4c32-be4c-1a180a49797c" />
<Project Path="src/Orleans.DurableJobs/Orleans.DurableJobs.csproj" Id="ab4cc723-b3cf-4c32-be4c-1a180a49797c" />
<Project Path="src/Orleans.Sdk/Orleans.Sdk.csproj" />
<Project Path="src/Orleans.Serialization.Abstractions/Orleans.Serialization.Abstractions.csproj" />
<Project Path="src/Orleans.Serialization.FSharp/Orleans.Serialization.FSharp.csproj" />
Expand Down Expand Up @@ -77,7 +77,7 @@
<Project Path="src/Azure/Orleans.Persistence.Cosmos/Orleans.Persistence.Cosmos.csproj" />
<Project Path="src/Azure/Orleans.Reminders.AzureStorage/Orleans.Reminders.AzureStorage.csproj" />
<Project Path="src/Azure/Orleans.Reminders.Cosmos/Orleans.Reminders.Cosmos.csproj" />
<Project Path="src/Azure/Orleans.ScheduledJobs.AzureStorage/Orleans.ScheduledJobs.AzureStorage.csproj" Id="5bbb1058-9ab2-44e9-b237-49f5b6bee151" />
<Project Path="src/Azure/Orleans.DurableJobs.AzureStorage/Orleans.DurableJobs.AzureStorage.csproj" Id="5bbb1058-9ab2-44e9-b237-49f5b6bee151" />
<Project Path="src/Azure/Orleans.Streaming.AzureStorage/Orleans.Streaming.AzureStorage.csproj" />
<Project Path="src/Azure/Orleans.Streaming.EventHubs/Orleans.Streaming.EventHubs.csproj" />
<Project Path="src/Azure/Orleans.Transactions.AzureStorage/Orleans.Transactions.AzureStorage.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using Microsoft.Extensions.Logging;

namespace Orleans.ScheduledJobs.AzureStorage;
namespace Orleans.DurableJobs.AzureStorage;

internal sealed partial class AzureStorageJobShard
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
using Orleans.Runtime;
using Orleans.Serialization.Buffers.Adaptors;

namespace Orleans.ScheduledJobs.AzureStorage;
namespace Orleans.DurableJobs.AzureStorage;

internal sealed partial class AzureStorageJobShard : JobShard
{
Expand Down Expand Up @@ -136,7 +136,7 @@ public async ValueTask InitializeAsync(CancellationToken cancellationToken)
dueTime = retryEntries.newDueTime ?? dueTime;
}

EnqueueJob(new ScheduledJob
EnqueueJob(new DurableJob
{
Id = op.Id,
Name = op.Name!,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using Orleans.Hosting;
using Orleans.Runtime;

namespace Orleans.ScheduledJobs.AzureStorage;
namespace Orleans.DurableJobs.AzureStorage;

public sealed partial class AzureStorageJobShardManager : JobShardManager
{
Expand Down Expand Up @@ -57,12 +57,12 @@ public AzureStorageJobShardManager(
{
}

public override async Task<List<IJobShard>> AssignJobShardsAsync(DateTimeOffset maxShardStartTime, CancellationToken cancellationToken)
public override async Task<List<Orleans.DurableJobs.IJobShard>> AssignJobShardsAsync(DateTimeOffset maxShardStartTime, CancellationToken cancellationToken)
{
await InitializeIfNeeded(cancellationToken);
LogAssigningShards(_logger, SiloAddress, maxShardStartTime, _containerName);

var result = new List<IJobShard>();
var result = new List<Orleans.DurableJobs.IJobShard>();
await foreach (var blob in _client.GetBlobsAsync(traits: BlobTraits.Metadata, cancellationToken: cancellationToken, prefix: _blobPrefix))
{
// Get the owner and creator of the shard
Expand Down Expand Up @@ -174,7 +174,7 @@ async Task<bool> TryTakeOwnership(AzureStorageJobShard shard, IDictionary<string
}
}

public override async Task<IJobShard> CreateShardAsync(DateTimeOffset minDueTime, DateTimeOffset maxDueTime, IDictionary<string, string> metadata, CancellationToken cancellationToken)
public override async Task<Orleans.DurableJobs.IJobShard> CreateShardAsync(DateTimeOffset minDueTime, DateTimeOffset maxDueTime, IDictionary<string, string> metadata, CancellationToken cancellationToken)
{
await InitializeIfNeeded(cancellationToken);
LogRegisteringShard(_logger, SiloAddress, minDueTime, maxDueTime, _containerName);
Expand Down Expand Up @@ -217,7 +217,7 @@ public override async Task<IJobShard> CreateShardAsync(DateTimeOffset minDueTime
}
}

public override async Task UnregisterShardAsync(IJobShard shard, CancellationToken cancellationToken)
public override async Task UnregisterShardAsync(Orleans.DurableJobs.IJobShard shard, CancellationToken cancellationToken)
{
var azureShard = shard as AzureStorageJobShard ?? throw new ArgumentException("Shard is not an AzureStorageJobShard", nameof(shard));
LogUnregisteringShard(_logger, shard.Id, SiloAddress);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,36 @@
using Microsoft.Extensions.Options;
using Orleans.Configuration;
using Orleans.Configuration.Internal;
using Orleans.ScheduledJobs;
using Orleans.ScheduledJobs.AzureStorage;
using Orleans.DurableJobs;
using Orleans.DurableJobs.AzureStorage;

namespace Orleans.Hosting;

/// <summary>
/// Extensions for configuring Azure Blob Storage scheduled jobs.
/// Extensions for configuring Azure Blob Storage durable jobs.
/// </summary>
public static class AzureStorageScheduledJobsExtensions
public static class AzureStorageDurableJobsExtensions
{
/// <summary>
/// Adds scheduled jobs storage backed by Azure Blob Storage.
/// Adds durable jobs storage backed by Azure Blob Storage.
/// </summary>
/// <param name="builder">
/// The builder.
/// </param>
/// <param name="configure">
/// The delegate used to configure the scheduled jobs storage.
/// The delegate used to configure the durable jobs storage.
/// </param>
/// <returns>
/// The provided <see cref="ISiloBuilder"/>, for chaining.
/// </returns>
public static ISiloBuilder UseAzureBlobScheduledJobs(this ISiloBuilder builder, Action<AzureStorageJobShardOptions> configure)
public static ISiloBuilder UseAzureBlobDurableJobs(this ISiloBuilder builder, Action<AzureStorageJobShardOptions> configure)
{
builder.ConfigureServices(services => services.UseAzureBlobScheduledJobs(configure));
builder.ConfigureServices(services => services.UseAzureBlobDurableJobs(configure));
return builder;
}

/// <summary>
/// Adds scheduled jobs storage backed by Azure Blob Storage.
/// Adds durable jobs storage backed by Azure Blob Storage.
/// </summary>
/// <param name="builder">
/// The builder.
Expand All @@ -43,36 +43,36 @@ public static ISiloBuilder UseAzureBlobScheduledJobs(this ISiloBuilder builder,
/// <returns>
/// The provided <see cref="ISiloBuilder"/>, for chaining.
/// </returns>
public static ISiloBuilder UseAzureBlobScheduledJobs(this ISiloBuilder builder, Action<OptionsBuilder<AzureStorageJobShardOptions>> configureOptions)
public static ISiloBuilder UseAzureBlobDurableJobs(this ISiloBuilder builder, Action<OptionsBuilder<AzureStorageJobShardOptions>> configureOptions)
{
builder.ConfigureServices(services => services.UseAzureBlobScheduledJobs(configureOptions));
builder.ConfigureServices(services => services.UseAzureBlobDurableJobs(configureOptions));
return builder;
}

/// <summary>
/// Adds scheduled jobs storage backed by Azure Blob Storage.
/// Adds durable jobs storage backed by Azure Blob Storage.
/// </summary>
/// <param name="services">
/// The service collection.
/// </param>
/// <param name="configure">
/// The delegate used to configure the scheduled jobs storage.
/// The delegate used to configure the durable jobs storage.
/// </param>
/// <returns>
/// The provided <see cref="IServiceCollection"/>, for chaining.
/// </returns>
public static IServiceCollection UseAzureBlobScheduledJobs(this IServiceCollection services, Action<AzureStorageJobShardOptions> configure)
public static IServiceCollection UseAzureBlobDurableJobs(this IServiceCollection services, Action<AzureStorageJobShardOptions> configure)
{
services.AddScheduledJobs();
services.AddDurableJobs();
services.AddSingleton<AzureStorageJobShardManager>();
services.AddFromExisting<JobShardManager, AzureStorageJobShardManager>();
services.AddFromExisting<Orleans.DurableJobs.JobShardManager, AzureStorageJobShardManager>();
services.Configure<AzureStorageJobShardOptions>(configure);
services.ConfigureFormatter<AzureStorageJobShardOptions>();
return services;
}

/// <summary>
/// Adds scheduled jobs storage backed by Azure Blob Storage.
/// Adds durable jobs storage backed by Azure Blob Storage.
/// </summary>
/// <param name="services">
/// The service collection.
Expand All @@ -83,11 +83,11 @@ public static IServiceCollection UseAzureBlobScheduledJobs(this IServiceCollecti
/// <returns>
/// The provided <see cref="IServiceCollection"/>, for chaining.
/// </returns>
public static IServiceCollection UseAzureBlobScheduledJobs(this IServiceCollection services, Action<OptionsBuilder<AzureStorageJobShardOptions>> configureOptions)
public static IServiceCollection UseAzureBlobDurableJobs(this IServiceCollection services, Action<OptionsBuilder<AzureStorageJobShardOptions>> configureOptions)
{
services.AddScheduledJobs();
services.AddDurableJobs();
services.AddSingleton<AzureStorageJobShardManager>();
services.AddFromExisting<JobShardManager, AzureStorageJobShardManager>();
services.AddFromExisting<Orleans.DurableJobs.JobShardManager, AzureStorageJobShardManager>();
configureOptions?.Invoke(services.AddOptions<AzureStorageJobShardOptions>());
services.ConfigureFormatter<AzureStorageJobShardOptions>();
services.AddTransient<IConfigurationValidator>(sp => new AzureStorageJobShardOptionsValidator(sp.GetRequiredService<IOptionsMonitor<AzureStorageJobShardOptions>>().Get(Options.DefaultName), Options.DefaultName));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class AzureStorageJobShardOptions
public BlobServiceClient BlobServiceClient { get; set; } = null!;

/// <summary>
/// Gets or sets the name of the container used to store scheduled jobs.
/// Gets or sets the name of the container used to store durable jobs.
/// </summary>
public string ContainerName { get; set; } = "jobs";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
using System.Text.Json.Serialization;
using Orleans.Runtime;

namespace Orleans.ScheduledJobs.AzureStorage;
namespace Orleans.DurableJobs.AzureStorage;

/// <summary>
/// Represents an operation to be performed on a scheduled job.
/// Represents an operation to be performed on a durable job.
/// </summary>
internal struct JobOperation
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using System.Threading.Tasks;
using Orleans.Serialization.Buffers.Adaptors;

namespace Orleans.ScheduledJobs.AzureStorage;
namespace Orleans.DurableJobs.AzureStorage;

/// <summary>
/// Provides methods for serializing and deserializing JSON data using the netstring format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

<PropertyGroup>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageId>Microsoft.Orleans.ScheduledJobs.AzureStorage</PackageId>
<Title>Microsoft Orleans Azure Storage Scheduled Jobs Provider</Title>
<Description>Microsoft Orleans scheduled jobs provider backed by Azure Blob Storage</Description>
<PackageId>Microsoft.Orleans.DurableJobs.AzureStorage</PackageId>
<Title>Microsoft Orleans Azure Storage Durable Jobs Provider</Title>
<Description>Microsoft Orleans durable jobs provider backed by Azure Blob Storage</Description>
<PackageTags>$(PackageTags) Azure Storage</PackageTags>
<TargetFrameworks>$(DefaultTargetFrameworks)</TargetFrameworks>
<AssemblyName>Orleans.ScheduledJobs.AzureStorage</AssemblyName>
<RootNamespace>Orleans.ScheduledJobs.AzureStorage</RootNamespace>
<AssemblyName>Orleans.DurableJobs.AzureStorage</AssemblyName>
<RootNamespace>Orleans.DurableJobs.AzureStorage</RootNamespace>
<OrleansBuildTimeCodeGen>true</OrleansBuildTimeCodeGen>
<DefineConstants>$(DefineConstants)</DefineConstants>
<Nullable>enable</Nullable>
Expand All @@ -18,7 +18,7 @@

<ItemGroup>
<ProjectReference Include="$(SourceRoot)src\Orleans.Runtime\Orleans.Runtime.csproj" />
<ProjectReference Include="$(SourceRoot)src\Orleans.ScheduledJobs\Orleans.ScheduledJobs.csproj" />
<ProjectReference Include="$(SourceRoot)src\Orleans.DurableJobs\Orleans.DurableJobs.csproj" />
<PackageReference Include="Azure.Core" />
<PackageReference Include="Azure.Storage.Blobs" />
</ItemGroup>
Expand Down
Loading
Loading