Skip to content

Commit

Permalink
Update Indexer and ServiceStats Limits
Browse files Browse the repository at this point in the history
  • Loading branch information
enjaimes committed Jul 29, 2019
1 parent 4d462e5 commit e45488b
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Installing AutoRest version: latest
AutoRest installed successfully.
Commencing code generation
Generating CSharp code
Executing AutoRest command
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/search/data-plane/Microsoft.Azure.Search.Service/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=C:\repos\azure-sdk-for-net\sdk
2019-07-25 22:29:05 UTC
Azure-rest-api-specs repository information
GitHub fork: Azure
Branch: master
Commit: a28a3fca492d332b0e515f0017551cb692772b29
AutoRest information
Requested version: latest
Bootstrapper version: [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ public IndexerExecutionInfo()
/// in-progress indexer execution.</param>
/// <param name="executionHistory">History of the recent indexer
/// executions, sorted in reverse chronological order.</param>
public IndexerExecutionInfo(IndexerStatus status = default(IndexerStatus), IndexerExecutionResult lastResult = default(IndexerExecutionResult), IList<IndexerExecutionResult> executionHistory = default(IList<IndexerExecutionResult>))
/// <param name="limits">The execution limits for the indexer.</param>
public IndexerExecutionInfo(IndexerStatus status = default(IndexerStatus), IndexerExecutionResult lastResult = default(IndexerExecutionResult), IList<IndexerExecutionResult> executionHistory = default(IList<IndexerExecutionResult>), IndexerLimits limits = default(IndexerLimits))
{
Status = status;
LastResult = lastResult;
ExecutionHistory = executionHistory;
Limits = limits;
CustomInit();
}

Expand Down Expand Up @@ -71,5 +73,11 @@ public IndexerExecutionInfo()
[JsonProperty(PropertyName = "executionHistory")]
public IList<IndexerExecutionResult> ExecutionHistory { get; private set; }

/// <summary>
/// Gets the execution limits for the indexer.
/// </summary>
[JsonProperty(PropertyName = "limits")]
public IndexerLimits Limits { get; private set; }

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>

namespace Microsoft.Azure.Search.Models
{
using Newtonsoft.Json;
using System.Linq;

public partial class IndexerLimits
{
/// <summary>
/// Initializes a new instance of the IndexerLimits class.
/// </summary>
public IndexerLimits()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the IndexerLimits class.
/// </summary>
/// <param name="maxRunTime">The maximum duration that the indexer is
/// permitted to run for one execution.</param>
/// <param name="maxDocumentExtractionSize">The maximum size of a
/// document, in bytes, which will be considered valid for
/// indexing.</param>
/// <param name="maxDocumentContentCharactersToExtract">The maximum
/// number of characters that will be extracted from a document picked
/// up for indexing.</param>
public IndexerLimits(System.TimeSpan? maxRunTime = default(System.TimeSpan?), double? maxDocumentExtractionSize = default(double?), double? maxDocumentContentCharactersToExtract = default(double?))
{
MaxRunTime = maxRunTime;
MaxDocumentExtractionSize = maxDocumentExtractionSize;
MaxDocumentContentCharactersToExtract = maxDocumentContentCharactersToExtract;
CustomInit();
}

/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();

/// <summary>
/// Gets the maximum duration that the indexer is permitted to run for
/// one execution.
/// </summary>
[JsonProperty(PropertyName = "maxRunTime")]
public System.TimeSpan? MaxRunTime { get; private set; }

/// <summary>
/// Gets the maximum size of a document, in bytes, which will be
/// considered valid for indexing.
/// </summary>
[JsonProperty(PropertyName = "maxDocumentExtractionSize")]
public double? MaxDocumentExtractionSize { get; private set; }

/// <summary>
/// Gets the maximum number of characters that will be extracted from a
/// document picked up for indexing.
/// </summary>
[JsonProperty(PropertyName = "maxDocumentContentCharactersToExtract")]
public double? MaxDocumentContentCharactersToExtract { get; private set; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,15 @@ public ServiceLimits()
/// <param name="maxComplexCollectionFieldsPerIndex">The maximum number
/// of fields of type Collection(Edm.ComplexType) allowed in an
/// index.</param>
public ServiceLimits(int? maxFieldsPerIndex = default(int?), int? maxFieldNestingDepthPerIndex = default(int?), int? maxComplexCollectionFieldsPerIndex = default(int?))
/// <param name="maxComplexObjectsInCollectionsPerDocument">The maximum
/// number of objects in complex collections allowed per
/// document.</param>
public ServiceLimits(int? maxFieldsPerIndex = default(int?), int? maxFieldNestingDepthPerIndex = default(int?), int? maxComplexCollectionFieldsPerIndex = default(int?), int? maxComplexObjectsInCollectionsPerDocument = default(int?))
{
MaxFieldsPerIndex = maxFieldsPerIndex;
MaxFieldNestingDepthPerIndex = maxFieldNestingDepthPerIndex;
MaxComplexCollectionFieldsPerIndex = maxComplexCollectionFieldsPerIndex;
MaxComplexObjectsInCollectionsPerDocument = maxComplexObjectsInCollectionsPerDocument;
CustomInit();
}

Expand Down Expand Up @@ -71,5 +75,12 @@ public ServiceLimits()
[JsonProperty(PropertyName = "maxComplexCollectionFieldsPerIndex")]
public int? MaxComplexCollectionFieldsPerIndex { get; set; }

/// <summary>
/// Gets or sets the maximum number of objects in complex collections
/// allowed per document.
/// </summary>
[JsonProperty(PropertyName = "maxComplexObjectsInCollectionsPerDocument")]
public int? MaxComplexObjectsInCollectionsPerDocument { get; set; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ public static IEnumerable<Tuple<string, string, string>> ApiInfo_SearchServiceCl
// BEGIN: Code Generation Metadata Section
public static readonly String AutoRestVersion = "latest";
public static readonly String AutoRestBootStrapperVersion = "[email protected]";
public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/search/data-plane/Microsoft.Azure.Search.Service/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=E:\\github\\azure-sdk-for-net\\src\\SDKs";
public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/search/data-plane/Microsoft.Azure.Search.Service/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=C:\\repos\\azure-sdk-for-net\\sdk";
public static readonly String GithubForkName = "Azure";
public static readonly String GithubBranchName = "master";
public static readonly String GithubCommidId = "fd4cebfb65fed63d5136e872ab8431dd324d8c40";
public static readonly String GithubCommidId = "a28a3fca492d332b0e515f0017551cb692772b29";
public static readonly String CodeGenerationErrors = "";
public static readonly String GithubRepoName = "azure-rest-api-specs";
// END: Code Generation Metadata Section
Expand Down
5 changes: 5 additions & 0 deletions sdk/search/Microsoft.Azure.Search/tests/Tests/IndexerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,11 @@ public void CanRunIndexerAndGetIndexerStatus()
Assert.Equal(IndexerExecutionStatus.InProgress, info.LastResult.Status);
Assert.Equal(3, info.ExecutionHistory.Count);

Assert.NotNull(info.Limits);
Assert.Equal(100000, info.Limits.MaxDocumentContentCharactersToExtract);
Assert.Equal(1000, info.Limits.MaxDocumentExtractionSize);
Assert.Equal(TimeSpan.FromDays(1), info.Limits.MaxRunTime);

IndexerExecutionResult newestResult = info.ExecutionHistory[0];
IndexerExecutionResult middleResult = info.ExecutionHistory[1];
IndexerExecutionResult oldestResult = info.ExecutionHistory[2];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public void GetServiceStatsReturnsCorrectDefinition()
{
MaxFieldsPerIndex = 1000,
MaxFieldNestingDepthPerIndex = 10,
MaxComplexCollectionFieldsPerIndex = 40
MaxComplexCollectionFieldsPerIndex = 40,
MaxComplexObjectsInCollectionsPerDocument = 3000
}
};

Expand Down

0 comments on commit e45488b

Please sign in to comment.