mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-04-13 21:32:26 +01:00
Add changes to Partition Key A/B Test (#954)
This commit is contained in:
parent
a66fc06dad
commit
7e0c4b7290
@ -95,6 +95,7 @@ export class Flights {
|
|||||||
public static readonly MongoIndexing = "mongoindexing";
|
public static readonly MongoIndexing = "mongoindexing";
|
||||||
public static readonly AutoscaleTest = "autoscaletest";
|
public static readonly AutoscaleTest = "autoscaletest";
|
||||||
public static readonly PartitionKeyTest = "partitionkeytest";
|
public static readonly PartitionKeyTest = "partitionkeytest";
|
||||||
|
public static readonly PKPartitionKeyTest = "pkpartitionkeytest";
|
||||||
}
|
}
|
||||||
|
|
||||||
export class AfecFeatures {
|
export class AfecFeatures {
|
||||||
|
@ -113,11 +113,7 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
|
|||||||
collectionId: "",
|
collectionId: "",
|
||||||
enableIndexing: true,
|
enableIndexing: true,
|
||||||
isSharded: userContext.apiType !== "Tables",
|
isSharded: userContext.apiType !== "Tables",
|
||||||
partitionKey:
|
partitionKey: this.getPartitionKey(),
|
||||||
(userContext.features.partitionKeyDefault && userContext.apiType === "SQL") ||
|
|
||||||
(userContext.features.partitionKeyDefault && userContext.apiType === "Mongo")
|
|
||||||
? "/id"
|
|
||||||
: "",
|
|
||||||
enableDedicatedThroughput: false,
|
enableDedicatedThroughput: false,
|
||||||
createMongoWildCardIndex: isCapabilityEnabled("EnableMongo"),
|
createMongoWildCardIndex: isCapabilityEnabled("EnableMongo"),
|
||||||
useHashV2: false,
|
useHashV2: false,
|
||||||
@ -815,6 +811,19 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
|
|||||||
return tooltipText;
|
return tooltipText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private getPartitionKey(): string {
|
||||||
|
if (userContext.apiType !== "SQL" && userContext.apiType !== "Mongo") {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
if (userContext.features.partitionKeyDefault) {
|
||||||
|
return userContext.apiType === "SQL" ? "/id" : "_id";
|
||||||
|
}
|
||||||
|
if (userContext.features.partitionKeyDefault2) {
|
||||||
|
return userContext.apiType === "SQL" ? "/pk" : "pk";
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
private getPartitionKeySubtext(): string {
|
private getPartitionKeySubtext(): string {
|
||||||
if (
|
if (
|
||||||
userContext.features.partitionKeyDefault &&
|
userContext.features.partitionKeyDefault &&
|
||||||
|
@ -10,6 +10,7 @@ export type Features = {
|
|||||||
readonly enableSchema: boolean;
|
readonly enableSchema: boolean;
|
||||||
autoscaleDefault: boolean;
|
autoscaleDefault: boolean;
|
||||||
partitionKeyDefault: boolean;
|
partitionKeyDefault: boolean;
|
||||||
|
partitionKeyDefault2: boolean;
|
||||||
readonly enableSDKoperations: boolean;
|
readonly enableSDKoperations: boolean;
|
||||||
readonly enableSpark: boolean;
|
readonly enableSpark: boolean;
|
||||||
readonly enableTtl: boolean;
|
readonly enableTtl: boolean;
|
||||||
@ -72,5 +73,6 @@ export function extractFeatures(given = new URLSearchParams(window.location.sear
|
|||||||
ttl90Days: "true" === get("ttl90days"),
|
ttl90Days: "true" === get("ttl90days"),
|
||||||
autoscaleDefault: "true" === get("autoscaledefault"),
|
autoscaleDefault: "true" === get("autoscaledefault"),
|
||||||
partitionKeyDefault: "true" === get("partitionkeytest"),
|
partitionKeyDefault: "true" === get("partitionkeytest"),
|
||||||
|
partitionKeyDefault2: "true" === get("pkpartitionkeytest"),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -331,6 +331,12 @@ function updateContextsFromPortalMessage(inputs: DataExplorerInputsFrame) {
|
|||||||
if (inputs.flights.indexOf(Flights.PartitionKeyTest) !== -1) {
|
if (inputs.flights.indexOf(Flights.PartitionKeyTest) !== -1) {
|
||||||
userContext.features.partitionKeyDefault = true;
|
userContext.features.partitionKeyDefault = true;
|
||||||
}
|
}
|
||||||
|
if (inputs.flights.indexOf(Flights.PartitionKeyTest) !== -1) {
|
||||||
|
userContext.features.partitionKeyDefault = true;
|
||||||
|
}
|
||||||
|
if (inputs.flights.indexOf(Flights.PKPartitionKeyTest) !== -1) {
|
||||||
|
userContext.features.partitionKeyDefault2 = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user