mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-20 09:20:16 +00:00
Clean up unused utility functions for creating databases and collections (#181)
This commit is contained in:
@@ -943,7 +943,7 @@ export default class AddCollectionPane extends ContextualPaneBase {
|
||||
const defaultThroughput = this.container.collectionCreationDefaults.throughput;
|
||||
this.throughputSinglePartition(defaultThroughput.fixed);
|
||||
this.throughputMultiPartition(
|
||||
AddCollectionUtility.Utilities.getMaxThroughput(this.container.collectionCreationDefaults, this.container)
|
||||
AddCollectionUtility.getMaxThroughput(this.container.collectionCreationDefaults, this.container)
|
||||
);
|
||||
|
||||
this.throughputDatabase(defaultThroughput.shared);
|
||||
@@ -1167,17 +1167,19 @@ export default class AddCollectionPane extends ContextualPaneBase {
|
||||
|
||||
private _updateThroughputLimitByCollectionStorage() {
|
||||
const storage = this.storage();
|
||||
const minThroughputRU = AddCollectionUtility.Utilities.getMinRUForStorageOption(
|
||||
this.container.collectionCreationDefaults,
|
||||
storage
|
||||
);
|
||||
const minThroughputRU =
|
||||
storage === SharedConstants.CollectionCreation.storage10Gb
|
||||
? SharedConstants.CollectionCreation.DefaultCollectionRUs400
|
||||
: this.container.collectionCreationDefaults.throughput.unlimitedmin;
|
||||
|
||||
let maxThroughputRU = AddCollectionUtility.Utilities.getMaxRUForStorageOption(
|
||||
this.container.collectionCreationDefaults,
|
||||
storage
|
||||
);
|
||||
let maxThroughputRU;
|
||||
if (this.isTryCosmosDBSubscription()) {
|
||||
maxThroughputRU = Constants.TryCosmosExperience.maxRU;
|
||||
} else {
|
||||
maxThroughputRU =
|
||||
storage === SharedConstants.CollectionCreation.storage10Gb
|
||||
? SharedConstants.CollectionCreation.DefaultCollectionRUs10K
|
||||
: this.container.collectionCreationDefaults.throughput.unlimitedmax;
|
||||
}
|
||||
|
||||
this.minThroughputRU(minThroughputRU);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import * as AddCollectionUtility from "../../Shared/AddCollectionUtility";
|
||||
import * as AutoPilotUtils from "../../Utils/AutoPilotUtils";
|
||||
import * as Constants from "../../Common/Constants";
|
||||
import * as DataModels from "../../Contracts/DataModels";
|
||||
@@ -8,15 +7,11 @@ import * as PricingUtils from "../../Utils/PricingUtils";
|
||||
import * as SharedConstants from "../../Shared/Constants";
|
||||
import * as ViewModels from "../../Contracts/ViewModels";
|
||||
import editable from "../../Common/EditableUtility";
|
||||
import EnvironmentUtility from "../../Common/EnvironmentUtility";
|
||||
import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor";
|
||||
import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstants";
|
||||
import { AddDbUtilities } from "../../Shared/AddDatabaseUtility";
|
||||
import { CassandraAPIDataClient } from "../Tables/TableDataClient";
|
||||
import { ContextualPaneBase } from "./ContextualPaneBase";
|
||||
import { createDatabase } from "../../Common/dataAccess/createDatabase";
|
||||
import { PlatformType } from "../../PlatformType";
|
||||
import { userContext } from "../../UserContext";
|
||||
|
||||
export default class AddDatabasePane extends ContextualPaneBase {
|
||||
public defaultExperience: ko.Computed<string>;
|
||||
|
||||
@@ -494,9 +494,7 @@ export default class CassandraAddCollectionPane extends ContextualPaneBase {
|
||||
this.selectedSharedAutoPilotTier(null);
|
||||
this.selectedAutoPilotThroughput(AutoPilotUtils.minAutoPilotThroughput);
|
||||
this.sharedAutoPilotThroughput(AutoPilotUtils.minAutoPilotThroughput);
|
||||
this.throughput(
|
||||
AddCollectionUtility.Utilities.getMaxThroughput(this.container.collectionCreationDefaults, this.container)
|
||||
);
|
||||
this.throughput(AddCollectionUtility.getMaxThroughput(this.container.collectionCreationDefaults, this.container));
|
||||
this.keyspaceThroughput(throughputDefaults.shared);
|
||||
this.maxThroughputRU(throughputDefaults.unlimitedmax);
|
||||
this.minThroughputRU(throughputDefaults.unlimitedmin);
|
||||
|
||||
Reference in New Issue
Block a user