-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for setting throughput on database creation (#24456)
* add support for setting throughput on database creation * added section to readme * removed locale from links * fix checkstyle issues * do not overwrite cosmosTemplate
- Loading branch information
1 parent
7f4dd0e
commit 6b96d75
Showing
7 changed files
with
202 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...ta-cosmos/src/main/java/com/azure/spring/data/cosmos/config/DatabaseThroughputConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
package com.azure.spring.data.cosmos.config; | ||
|
||
/** | ||
* Throughput config for database creation | ||
*/ | ||
public class DatabaseThroughputConfig { | ||
|
||
private final boolean autoScale; | ||
private final int requestUnits; | ||
|
||
public DatabaseThroughputConfig(boolean autoScale, int requestUnits) { | ||
this.autoScale = autoScale; | ||
this.requestUnits = requestUnits; | ||
} | ||
|
||
public boolean isAutoScale() { | ||
return autoScale; | ||
} | ||
|
||
public int getRequestUnits() { | ||
return requestUnits; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "DatabaseThroughputConfig{" | ||
+ "autoScale=" + autoScale | ||
+ ", requestUnits=" + requestUnits | ||
+ '}'; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.