mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-10-13 15:28:05 +01:00
feat: Integrate Fabric Native support for throughput management (#2166)
This commit is contained in:
parent
ab4f02f74a
commit
05d02f08fa
@ -11,6 +11,7 @@ import * as AutoPilotUtils from "../../../Utils/AutoPilotUtils";
|
|||||||
import * as PricingUtils from "../../../Utils/PricingUtils";
|
import * as PricingUtils from "../../../Utils/PricingUtils";
|
||||||
import { CostEstimateText } from "./CostEstimateText/CostEstimateText";
|
import { CostEstimateText } from "./CostEstimateText/CostEstimateText";
|
||||||
import "./ThroughputInput.less";
|
import "./ThroughputInput.less";
|
||||||
|
import { isFabricNative } from "../../../Platform/Fabric/FabricUtil";
|
||||||
|
|
||||||
export interface ThroughputInputProps {
|
export interface ThroughputInputProps {
|
||||||
isDatabase: boolean;
|
isDatabase: boolean;
|
||||||
@ -43,7 +44,8 @@ export const ThroughputInput: FunctionComponent<ThroughputInputProps> = ({
|
|||||||
if (
|
if (
|
||||||
isFreeTier ||
|
isFreeTier ||
|
||||||
isQuickstart ||
|
isQuickstart ||
|
||||||
[Constants.WorkloadType.Learning, Constants.WorkloadType.DevelopmentTesting].includes(workloadType)
|
[Constants.WorkloadType.Learning, Constants.WorkloadType.DevelopmentTesting].includes(workloadType) ||
|
||||||
|
isFabricNative()
|
||||||
) {
|
) {
|
||||||
defaultThroughput = AutoPilotUtils.autoPilotThroughput1K;
|
defaultThroughput = AutoPilotUtils.autoPilotThroughput1K;
|
||||||
} else if (workloadType === Constants.WorkloadType.Production) {
|
} else if (workloadType === Constants.WorkloadType.Production) {
|
||||||
|
@ -60,6 +60,7 @@ import { useDatabases } from "../../useDatabases";
|
|||||||
import { PanelFooterComponent } from "../PanelFooterComponent";
|
import { PanelFooterComponent } from "../PanelFooterComponent";
|
||||||
import { PanelInfoErrorComponent } from "../PanelInfoErrorComponent";
|
import { PanelInfoErrorComponent } from "../PanelInfoErrorComponent";
|
||||||
import { PanelLoadingScreen } from "../PanelLoadingScreen";
|
import { PanelLoadingScreen } from "../PanelLoadingScreen";
|
||||||
|
import * as AutoPilotUtils from "../../../Utils/AutoPilotUtils";
|
||||||
|
|
||||||
export interface AddCollectionPanelProps {
|
export interface AddCollectionPanelProps {
|
||||||
explorer: Explorer;
|
explorer: Explorer;
|
||||||
@ -867,7 +868,7 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
|
|||||||
</CollapsibleSectionComponent>
|
</CollapsibleSectionComponent>
|
||||||
</Stack>
|
</Stack>
|
||||||
)}
|
)}
|
||||||
{this.showFullTextSearch && (
|
{this.shouldShowFullTextSearchParameters() && (
|
||||||
<Stack>
|
<Stack>
|
||||||
<CollapsibleSectionComponent
|
<CollapsibleSectionComponent
|
||||||
title="Container Full Text Search Policy"
|
title="Container Full Text Search Policy"
|
||||||
@ -1158,6 +1159,10 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
|
|||||||
return isVectorSearchEnabled() && (isServerlessAccount() || this.shouldShowCollectionThroughputInput());
|
return isVectorSearchEnabled() && (isServerlessAccount() || this.shouldShowCollectionThroughputInput());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private shouldShowFullTextSearchParameters() {
|
||||||
|
return !isFabricNative() && this.showFullTextSearch;
|
||||||
|
}
|
||||||
|
|
||||||
private parseUniqueKeys(): DataModels.UniqueKeyPolicy {
|
private parseUniqueKeys(): DataModels.UniqueKeyPolicy {
|
||||||
if (this.state.uniqueKeys?.length === 0) {
|
if (this.state.uniqueKeys?.length === 0) {
|
||||||
return undefined;
|
return undefined;
|
||||||
@ -1344,7 +1349,12 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
|
|||||||
let offerThroughput: number;
|
let offerThroughput: number;
|
||||||
let autoPilotMaxThroughput: number;
|
let autoPilotMaxThroughput: number;
|
||||||
|
|
||||||
if (databaseLevelThroughput) {
|
// Throughput
|
||||||
|
if (isFabricNative()) {
|
||||||
|
// Fabric Native accounts are always autoscale and have a fixed throughput of 1K
|
||||||
|
autoPilotMaxThroughput = AutoPilotUtils.autoPilotThroughput1K;
|
||||||
|
offerThroughput = undefined;
|
||||||
|
} else if (databaseLevelThroughput) {
|
||||||
if (this.state.createNewDatabase) {
|
if (this.state.createNewDatabase) {
|
||||||
if (this.isNewDatabaseAutoscale) {
|
if (this.isNewDatabaseAutoscale) {
|
||||||
autoPilotMaxThroughput = this.newDatabaseThroughput;
|
autoPilotMaxThroughput = this.newDatabaseThroughput;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user