Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop old reindex stored procedure #3830

Merged
merged 2 commits into from
Apr 30, 2024
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
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
IF object_id('dbo.ReindexResource') IS NOT NULL DROP PROCEDURE dbo.ReindexResource -- Ths still exists on old accounts and prevents TVP drop
GO
DECLARE @Names TABLE (Name varchar(100) PRIMARY KEY)
INSERT INTO @Names SELECT name FROM sys.objects WHERE type = 'p' AND name LIKE '%[0-9]' AND name NOT LIKE '%ResourceChanges%'
DECLARE @Name varchar(100)
Expand Down
4 changes: 3 additions & 1 deletion tools/BlobRewriter/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
<add key="WritesEnabled" value="true" />
<!-- If false splits lines in blob by first characters of ResourceId (assumes ndjson format). -->
<add key="SplitBySize" value="true" />
<!-- Filter on blob names. If empoty string - no filtering. -->
<!-- Filter on blob names. If empty string - no filtering. -->
<add key="NameFilter" value="" />
<!-- extension -->
<add key="ExtensionFilter" value="ndjson" />
<!-- If true tries to replace {"resourceType": by {"meta":{"versionId":"seconds from last updated","lastUpdated":"YYYY-MM-DDThh:mm:ss"},"resourceType": -->
<add key="AddMeta" value="false" />
</appSettings>
Expand Down
3 changes: 2 additions & 1 deletion tools/BlobRewriter/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public static class Program
private static readonly bool WritesEnabled = bool.Parse(ConfigurationManager.AppSettings["WritesEnabled"]);
private static readonly bool SplitBySize = bool.Parse(ConfigurationManager.AppSettings["SplitBySize"]);
private static readonly string NameFilter = ConfigurationManager.AppSettings["NameFilter"];
private static readonly string ExtensionFilter = ConfigurationManager.AppSettings["ExtensionFilter"];
private static readonly bool AddMeta = bool.Parse(ConfigurationManager.AppSettings["AddMeta"]);
private static readonly string BundleType = ConfigurationManager.AppSettings["BundleType"];
private static readonly bool MultiResourceTypes = bool.Parse(ConfigurationManager.AppSettings["MultiResourceTypes"]);
Expand All @@ -50,7 +51,7 @@ public static void Main()
var gPrefix = $"BlobRewriter.Threads={Threads}.Source={SourceContainerName}{(WritesEnabled ? $".Target={TargetContainerName}" : string.Empty)}";
Console.WriteLine($"{DateTime.UtcNow:s}: {gPrefix}: Starting...");
var blobs = WritesEnabled
? sourceContainer.GetBlobs().Where(_ => _.Name.Contains(NameFilter, StringComparison.OrdinalIgnoreCase) && _.Name.EndsWith(".ndjson", StringComparison.OrdinalIgnoreCase)).OrderBy(_ => _.Name).Take(SourceBlobs)
? sourceContainer.GetBlobs().Where(_ => _.Name.Contains(NameFilter, StringComparison.OrdinalIgnoreCase) && _.Name.EndsWith($".{ExtensionFilter}", StringComparison.OrdinalIgnoreCase)).OrderBy(_ => _.Name).Take(SourceBlobs)
: sourceContainer.GetBlobs().Where(_ => _.Name.Contains(NameFilter, StringComparison.OrdinalIgnoreCase)).Take(SourceBlobs);
if (WritesEnabled)
{
Expand Down
Loading