Skip to content

Commit 20ada7c

Browse files
committed
rename bucket to partition
1 parent c615157 commit 20ada7c

18 files changed

+401
-401
lines changed

DynamoDbEncryption/dafny/DynamoDbEncryption/Model/AwsCryptographyDbEncryptionSdkDynamoDbTypes.dfy

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -47,29 +47,29 @@ module {:extern "software.amazon.cryptography.dbencryptionsdk.dynamodb.internald
4747
nameonly virtualFields: Option<VirtualFieldList> := Option.None ,
4848
nameonly encryptedParts: Option<EncryptedPartsList> := Option.None ,
4949
nameonly signedParts: Option<SignedPartsList> := Option.None ,
50-
nameonly maximumNumberOfBuckets: Option<BucketCount> := Option.None ,
51-
nameonly defaultNumberOfBuckets: Option<BucketCount> := Option.None ,
52-
nameonly bucketSelector: Option<IBucketSelector> := Option.None
50+
nameonly maximumNumberOfPartitions: Option<PartitionCount> := Option.None ,
51+
nameonly defaultNumberOfPartitions: Option<PartitionCount> := Option.None ,
52+
nameonly partitionSelector: Option<IPartitionSelector> := Option.None
5353
)
5454
type BeaconVersionList = x: seq<BeaconVersion> | IsValid_BeaconVersionList(x) witness *
5555
predicate method IsValid_BeaconVersionList(x: seq<BeaconVersion>) {
5656
( 1 <= |x| <= 1 )
5757
}
58-
type BucketCount = x: int32 | IsValid_BucketCount(x) witness *
59-
predicate method IsValid_BucketCount(x: int32) {
58+
type PartitionCount = x: int32 | IsValid_PartitionCount(x) witness *
59+
predicate method IsValid_PartitionCount(x: int32) {
6060
( 1 <= x <= 255 )
6161
}
62-
type BucketNumber = x: int32 | IsValid_BucketNumber(x) witness *
63-
predicate method IsValid_BucketNumber(x: int32) {
62+
type PartitionNumber = x: int32 | IsValid_PartitionNumber(x) witness *
63+
predicate method IsValid_PartitionNumber(x: int32) {
6464
( 0 <= x <= 254 )
6565
}
66-
class IBucketSelectorCallHistory {
66+
class IPartitionSelectorCallHistory {
6767
ghost constructor() {
68-
GetBucketNumber := [];
68+
GetPartitionNumber := [];
6969
}
70-
ghost var GetBucketNumber: seq<DafnyCallEvent<GetBucketNumberInput, Result<GetBucketNumberOutput, Error>>>
70+
ghost var GetPartitionNumber: seq<DafnyCallEvent<GetPartitionNumberInput, Result<GetPartitionNumberOutput, Error>>>
7171
}
72-
trait {:termination false} IBucketSelector
72+
trait {:termination false} IPartitionSelector
7373
{
7474
// Helper to define any additional modifies/reads clauses.
7575
// If your operations need to mutate state,
@@ -95,36 +95,36 @@ module {:extern "software.amazon.cryptography.dbencryptionsdk.dynamodb.internald
9595
// You MUST also ensure ValidState in your constructor.
9696
predicate ValidState()
9797
ensures ValidState() ==> History in Modifies
98-
ghost const History: IBucketSelectorCallHistory
99-
predicate GetBucketNumberEnsuresPublicly(input: GetBucketNumberInput , output: Result<GetBucketNumberOutput, Error>)
98+
ghost const History: IPartitionSelectorCallHistory
99+
predicate GetPartitionNumberEnsuresPublicly(input: GetPartitionNumberInput , output: Result<GetPartitionNumberOutput, Error>)
100100
// The public method to be called by library consumers
101-
method GetBucketNumber ( input: GetBucketNumberInput )
102-
returns (output: Result<GetBucketNumberOutput, Error>)
101+
method GetPartitionNumber ( input: GetPartitionNumberInput )
102+
returns (output: Result<GetPartitionNumberOutput, Error>)
103103
requires
104104
&& ValidState()
105105
modifies Modifies - {History} ,
106-
History`GetBucketNumber
106+
History`GetPartitionNumber
107107
// Dafny will skip type parameters when generating a default decreases clause.
108108
decreases Modifies - {History}
109109
ensures
110110
&& ValidState()
111-
ensures GetBucketNumberEnsuresPublicly(input, output)
112-
ensures History.GetBucketNumber == old(History.GetBucketNumber) + [DafnyCallEvent(input, output)]
111+
ensures GetPartitionNumberEnsuresPublicly(input, output)
112+
ensures History.GetPartitionNumber == old(History.GetPartitionNumber) + [DafnyCallEvent(input, output)]
113113
{
114-
output := GetBucketNumber' (input);
115-
History.GetBucketNumber := History.GetBucketNumber + [DafnyCallEvent(input, output)];
114+
output := GetPartitionNumber' (input);
115+
History.GetPartitionNumber := History.GetPartitionNumber + [DafnyCallEvent(input, output)];
116116
}
117117
// The method to implement in the concrete class.
118-
method GetBucketNumber' ( input: GetBucketNumberInput )
119-
returns (output: Result<GetBucketNumberOutput, Error>)
118+
method GetPartitionNumber' ( input: GetPartitionNumberInput )
119+
returns (output: Result<GetPartitionNumberOutput, Error>)
120120
requires
121121
&& ValidState()
122122
modifies Modifies - {History}
123123
// Dafny will skip type parameters when generating a default decreases clause.
124124
decreases Modifies - {History}
125125
ensures
126126
&& ValidState()
127-
ensures GetBucketNumberEnsuresPublicly(input, output)
127+
ensures GetPartitionNumberEnsuresPublicly(input, output)
128128
ensures unchanged(History)
129129

130130
}
@@ -348,13 +348,13 @@ module {:extern "software.amazon.cryptography.dbencryptionsdk.dynamodb.internald
348348
datatype GetBranchKeyIdFromDdbKeyOutput = | GetBranchKeyIdFromDdbKeyOutput (
349349
nameonly branchKeyId: string
350350
)
351-
datatype GetBucketNumberInput = | GetBucketNumberInput (
351+
datatype GetPartitionNumberInput = | GetPartitionNumberInput (
352352
nameonly item: ComAmazonawsDynamodbTypes.AttributeMap ,
353-
nameonly numberOfBuckets: BucketCount ,
353+
nameonly numberOfPartitions: PartitionCount ,
354354
nameonly logicalTableName: string
355355
)
356-
datatype GetBucketNumberOutput = | GetBucketNumberOutput (
357-
nameonly bucketNumber: BucketNumber
356+
datatype GetPartitionNumberOutput = | GetPartitionNumberOutput (
357+
nameonly partitionNumber: PartitionNumber
358358
)
359359
datatype GetEncryptedDataKeyDescriptionInput = | GetEncryptedDataKeyDescriptionInput (
360360
nameonly input: GetEncryptedDataKeyDescriptionUnion
@@ -482,7 +482,7 @@ module {:extern "software.amazon.cryptography.dbencryptionsdk.dynamodb.internald
482482
nameonly length: BeaconBitLength ,
483483
nameonly loc: Option<TerminalLocation> := Option.None ,
484484
nameonly style: Option<BeaconStyle> := Option.None ,
485-
nameonly numberOfBuckets: Option<BucketCount> := Option.None
485+
nameonly numberOfPartitions: Option<PartitionCount> := Option.None
486486
)
487487
type StandardBeaconList = x: seq<StandardBeacon> | IsValid_StandardBeaconList(x) witness *
488488
predicate method IsValid_StandardBeaconList(x: seq<StandardBeacon>) {

DynamoDbEncryption/dafny/DynamoDbEncryption/Model/DynamoDbEncryption.smithy

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -49,44 +49,44 @@ service DynamoDbEncryption {
4949
errors: [ DynamoDbEncryptionException ]
5050
}
5151

52-
resource BucketSelector {
53-
operations: [GetBucketNumber]
52+
resource PartitionSelector {
53+
operations: [GetPartitionNumber]
5454
}
5555

56-
@reference(resource: BucketSelector)
57-
structure BucketSelectorReference {}
56+
@reference(resource: PartitionSelector)
57+
structure PartitionSelectorReference {}
5858

59-
operation GetBucketNumber {
60-
input: GetBucketNumberInput,
61-
output: GetBucketNumberOutput,
59+
operation GetPartitionNumber {
60+
input: GetPartitionNumberInput,
61+
output: GetPartitionNumberOutput,
6262
}
6363

64-
//= specification/searchable-encryption/search-config.md#bucket-selector
64+
//= specification/searchable-encryption/search-config.md#partition-selector
6565
//= type=implication
66-
//# GetBucketNumber MUST take as input
66+
//# GetPartitionNumber MUST take as input
6767
//#
6868
//# - A DynamoDB Item (i.e an AttributeMap)
69-
//# - The [number of buckets](#max-buckets) defined in the associated [beacon version](#beacon-version-initialization).
69+
//# - The [number of partitions](#max-partitions) defined in the associated [beacon version](#beacon-version-initialization).
7070
//# - The logical table name for this defined in the associated [table config](../dynamodb-encryption-client/ddb-table-encryption-config.md#structure).
7171

72-
structure GetBucketNumberInput {
72+
structure GetPartitionNumberInput {
7373
@required
7474
item: AttributeMap,
7575
@required
76-
numberOfBuckets : BucketCount,
76+
numberOfPartitions : PartitionCount,
7777
@required
7878
logicalTableName: String,
7979
}
8080

81-
//= specification/searchable-encryption/search-config.md#bucket-selector
81+
//= specification/searchable-encryption/search-config.md#partition-selector
8282
//= type=implication
83-
//# GetBucketNumber MUST return
83+
//# GetPartitionNumber MUST return
8484
//#
85-
//# - The number of the bucket to use for this item
85+
//# - The number of the partition to use for this item
8686

87-
structure GetBucketNumberOutput {
87+
structure GetPartitionNumberOutput {
8888
@required
89-
bucketNumber: BucketNumber
89+
partitionNumber: PartitionNumber
9090
}
9191

9292
@javadoc("Returns encrypted data key description.")
@@ -327,10 +327,10 @@ integer BeaconBitLength
327327
integer VersionNumber
328328

329329
@range(min: 1, max: 255)
330-
integer BucketCount
330+
integer PartitionCount
331331

332332
@range(min: 0, max: 254)
333-
integer BucketNumber
333+
integer PartitionNumber
334334

335335
@length(min: 1, max: 1)
336336
string Char
@@ -715,8 +715,8 @@ structure StandardBeacon {
715715
loc : TerminalLocation,
716716
@javadoc("Optional augmented behavior.")
717717
style : BeaconStyle,
718-
@javadoc("The number of separate buckets across which this particular beacon should be divided. Ths must be no greater than the global numberOfBuckets, and can never be changed once an item containing this beacon has been written.")
719-
numberOfBuckets : BucketCount
718+
@javadoc("The number of separate partitions across which this particular beacon should be divided. Ths must be no greater than the global numberOfPartitions, and can never be changed once an item containing this beacon has been written.")
719+
numberOfPartitions : PartitionCount
720720
}
721721

722722
//= specification/searchable-encryption/beacons.md#compound-beacon-initialization
@@ -845,14 +845,14 @@ structure BeaconVersion {
845845
@javadoc("The list of Signed Parts that may be included in any compound beacon.")
846846
signedParts : SignedPartsList,
847847

848-
@javadoc("The number of separate buckets across which beacons should be divided.")
849-
maximumNumberOfBuckets : BucketCount,
848+
@javadoc("The number of separate partitions across which beacons should be divided.")
849+
maximumNumberOfPartitions : PartitionCount,
850850

851-
@javadoc("The number of buckets for any beacon that doesn't specify a numberOfBuckets")
852-
defaultNumberOfBuckets : BucketCount,
851+
@javadoc("The number of partitions for any beacon that doesn't specify a numberOfPartitions")
852+
defaultNumberOfPartitions : PartitionCount,
853853

854-
@javadoc("How to choose the bucket for an item. Default behavior is a random between 0 and maximumNumberOfBuckets.")
855-
bucketSelector: BucketSelectorReference,
854+
@javadoc("How to choose the partition for an item. Default behavior is a random between 0 and maximumNumberOfPartitions.")
855+
partitionSelector: PartitionSelectorReference,
856856
}
857857

858858
//= specification/searchable-encryption/search-config.md#initialization

0 commit comments

Comments
 (0)