Skip to content
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.

Commit

Permalink
Delete Db2Lucene, Catalog2Lucene, and associated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joelverhagen committed Jan 28, 2020
1 parent 42fbd1c commit b4bae8c
Show file tree
Hide file tree
Showing 69 changed files with 0 additions and 8,871 deletions.
1 change: 0 additions & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ Invoke-BuildStep 'Creating artifacts' {
$nuspecPackages = `
"src\Ng\Catalog2Dnx.nuspec", `
"src\Ng\Catalog2icon.nuspec", `
"src\Ng\Catalog2Lucene.nuspec", `
"src\Ng\Catalog2Monitoring.nuspec", `
"src\Ng\Catalog2Registration.nuspec", `
"src\Ng\Db2Catalog.nuspec", `
Expand Down
12 changes: 0 additions & 12 deletions sign.thirdparty.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,6 @@
<ThirdPartyBinaries Include="HtmlAgilityPack.dll" />
<ThirdPartyBinaries Include="ICSharpCode.SharpZipLib.dll" />
<ThirdPartyBinaries Include="json-ld.net.StrongName.dll" />
<ThirdPartyBinaries Include="Lucene.Net.Contrib.Analyzers.dll" />
<ThirdPartyBinaries Include="Lucene.Net.Contrib.Core.dll" />
<ThirdPartyBinaries Include="Lucene.Net.Contrib.FastVectorHighlighter.dll" />
<ThirdPartyBinaries Include="Lucene.Net.Contrib.Highlighter.dll" />
<ThirdPartyBinaries Include="Lucene.Net.Contrib.Memory.dll" />
<ThirdPartyBinaries Include="Lucene.Net.Contrib.Queries.dll" />
<ThirdPartyBinaries Include="Lucene.Net.Contrib.Regex.dll" />
<ThirdPartyBinaries Include="Lucene.Net.Contrib.SimpleFacetedSearch.dll" />
<ThirdPartyBinaries Include="Lucene.Net.Contrib.Snowball.dll" />
<ThirdPartyBinaries Include="Lucene.Net.Contrib.SpellChecker.dll" />
<ThirdPartyBinaries Include="Lucene.Net.dll" />
<ThirdPartyBinaries Include="Lucene.Net.Store.Azure.dll" />
<ThirdPartyBinaries Include="Markdig.dll" />
<ThirdPartyBinaries Include="MarkdownSharp.dll" />
<ThirdPartyBinaries Include="Newtonsoft.Json.dll" />
Expand Down
28 changes: 0 additions & 28 deletions src/Ng/Arguments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ public static class Arguments
public const int DefaultReinitializeIntervalSec = 60 * 60; // 1 hour
public const string ReinitializeIntervalSec = "ReinitializeIntervalSec";

public const string LuceneDirectoryType = "luceneDirectoryType";
public const string LucenePath = "lucenePath";
public const string LuceneStorageAccountName = "luceneStorageAccountName";
public const string LuceneStorageContainer = "luceneStorageContainer";
public const string LuceneStorageKeyValue = "luceneStorageKeyValue";


public const string AzureStorageType = "azure";
public const string FileStorageType = "file";
Expand Down Expand Up @@ -65,13 +59,6 @@ public static class Arguments

#endregion

#region Catalog2Lucene
public const string CatalogBaseAddress = "catalogBaseAddress";
public const string Registration = "registration";
public const string CommitTimeoutInSeconds = "commitTimeoutInSeconds";
public const string FlatContainerBaseAddress = "flatContainerBaseAddress";
#endregion

#region Catalog2Registration
public const string CompressedStorageAccountName = "compressedStorageAccountName";
public const string CompressedStorageBaseAddress = "compressedStorageBaseAddress";
Expand Down Expand Up @@ -99,21 +86,6 @@ public static class Arguments
public const string Verify = "verify";
#endregion

#region CopyLucene
public const string DestDirectoryType = "destDirectoryType";
public const string DestPath = "destPath";
public const string DestStorageAccountName = "destStorageAccountName";
public const string DestStorageContainer = "destStorageContainer";
public const string DestStorageKeyValue = "destStorageKeyValue";

public const string SrcDirectoryType = "srcDirectoryType";
public const string SrcPath = "srcPath";
public const string SrcStorageAccountName = "srcStorageAccountName";
public const string SrcStorageContainer = "srcStorageContainer";
public const string SrcStorageKeyValue = "srcStorageKeyValue";

#endregion

#region Db2Catalog
public const string StartDate = "startDate";
public const string PackageContentUrlFormat = "packageContentUrlFormat";
Expand Down
16 changes: 0 additions & 16 deletions src/Ng/Catalog2Lucene.nuspec

This file was deleted.

114 changes: 0 additions & 114 deletions src/Ng/CommandHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Security.Cryptography.X509Certificates;
using Lucene.Net.Store;
using Lucene.Net.Store.Azure;
using Microsoft.Extensions.Logging;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Auth;
Expand Down Expand Up @@ -310,117 +307,6 @@ private static TimeSpan MaxExecutionTime(int seconds)
return TimeSpan.FromSeconds(seconds);
}

public static Lucene.Net.Store.Directory GetLuceneDirectory(
IDictionary<string, string> arguments,
bool required = true)
{
return GetLuceneDirectory(arguments, out var destination, required);
}

public static Lucene.Net.Store.Directory GetLuceneDirectory(
IDictionary<string, string> arguments,
out string destination,
bool required = true)
{
IDictionary<string, string> names = new Dictionary<string, string>
{
{ Arguments.DirectoryType, Arguments.LuceneDirectoryType },
{ Arguments.Path, Arguments.LucenePath },
{ Arguments.StorageAccountName, Arguments.LuceneStorageAccountName },
{ Arguments.StorageKeyValue, Arguments.LuceneStorageKeyValue },
{ Arguments.StorageContainer, Arguments.LuceneStorageContainer }
};

return GetLuceneDirectoryImpl(arguments, names, out destination, required);
}

public static Lucene.Net.Store.Directory GetCopySrcLuceneDirectory(IDictionary<string, string> arguments, bool required = true)
{
IDictionary<string, string> names = new Dictionary<string, string>
{
{ Arguments.DirectoryType, Arguments.SrcDirectoryType },
{ Arguments.Path, Arguments.SrcPath },
{ Arguments.StorageAccountName, Arguments.SrcStorageAccountName },
{ Arguments.StorageKeyValue, Arguments.SrcStorageKeyValue },
{ Arguments.StorageContainer, Arguments.SrcStorageContainer }
};

return GetLuceneDirectoryImpl(arguments, names, out var destination, required);
}

public static Lucene.Net.Store.Directory GetCopyDestLuceneDirectory(IDictionary<string, string> arguments, bool required = true)
{
IDictionary<string, string> names = new Dictionary<string, string>
{
{ Arguments.DirectoryType, Arguments.DestDirectoryType },
{ Arguments.Path, Arguments.DestPath },
{ Arguments.StorageAccountName, Arguments.DestStorageAccountName },
{ Arguments.StorageKeyValue, Arguments.DestStorageKeyValue },
{ Arguments.StorageContainer, Arguments.DestStorageContainer }
};

return GetLuceneDirectoryImpl(arguments, names, out var destination, required);
}

public static Lucene.Net.Store.Directory GetLuceneDirectoryImpl(
IDictionary<string, string> arguments,
IDictionary<string, string> argumentNameMap,
out string destination,
bool required = true)
{
destination = null;

try
{
var luceneDirectoryType = arguments.GetOrThrow<string>(argumentNameMap[Arguments.DirectoryType]);

if (luceneDirectoryType.Equals(Arguments.FileStorageType, StringComparison.InvariantCultureIgnoreCase))
{
var lucenePath = arguments.GetOrThrow<string>(argumentNameMap[Arguments.Path]);

var directoryInfo = new DirectoryInfo(lucenePath);

destination = lucenePath;

if (directoryInfo.Exists)
{
return new SimpleFSDirectory(directoryInfo);
}

directoryInfo.Create();
directoryInfo.Refresh();

return new SimpleFSDirectory(directoryInfo);
}
if (luceneDirectoryType.Equals(Arguments.AzureStorageType, StringComparison.InvariantCultureIgnoreCase))
{
var luceneStorageAccountName = arguments.GetOrThrow<string>(argumentNameMap[Arguments.StorageAccountName]);

var luceneStorageKeyValue = arguments.GetOrThrow<string>(argumentNameMap[Arguments.StorageKeyValue]);

var luceneStorageContainer = arguments.GetOrThrow<string>(argumentNameMap[Arguments.StorageContainer]);

var credentials = new StorageCredentials(luceneStorageAccountName, luceneStorageKeyValue);
var account = new CloudStorageAccount(credentials, useHttps: true);

destination = luceneStorageContainer;

return new AzureDirectory(account, luceneStorageContainer);
}
Trace.TraceError("Unrecognized Lucene Directory Type \"{0}\"", luceneDirectoryType);
return null;
}
catch (ArgumentException)
{
if (required)
{
throw;
}

return null;
}
}

public static Func<HttpMessageHandler> GetHttpMessageHandlerFactory(
ITelemetryService telemetryService,
bool verbose,
Expand Down
Loading

0 comments on commit b4bae8c

Please sign in to comment.