Skip to content

Commit 5c5d5c2

Browse files
committed
More renaming.
1 parent 6ae284b commit 5c5d5c2

5 files changed

Lines changed: 73 additions & 73 deletions

File tree

modules/module-mongodb/test/src/change_stream_utils.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,21 +110,21 @@ export class ChangeStreamTestContext {
110110
}
111111

112112
async loadNextSyncRules() {
113-
const syncRules = await this.factory.getDeployingSyncConfigContent();
114-
if (syncRules == null) {
113+
const syncConfigContent = await this.factory.getDeployingSyncConfigContent();
114+
if (syncConfigContent == null) {
115115
throw new Error(`Next sync config not available`);
116116
}
117117

118-
this.syncRulesContent = syncRules;
119-
const replicationStream = await this.factory.getReplicationStream(syncRules.replicationStreamId);
118+
this.syncRulesContent = syncConfigContent;
119+
const replicationStream = await this.factory.getReplicationStream(syncConfigContent.replicationStreamId);
120120
if (replicationStream == null) {
121121
throw new Error(`Next replication stream not available`);
122122
}
123123
this.storage = this.factory.getInstance(replicationStream);
124124
return this.storage!;
125125
}
126126

127-
private getSyncRulesContent(): storage.PersistedSyncConfigContent {
127+
private getSyncConfigContent(): storage.PersistedSyncConfigContent {
128128
if (this.syncRulesContent == null) {
129129
throw new Error('Sync config not configured - call updateSyncRules() first');
130130
}
@@ -201,8 +201,8 @@ export class ChangeStreamTestContext {
201201

202202
async getBucketsDataBatch(buckets: Record<string, InternalOpId>, options?: { timeout?: number }) {
203203
let checkpoint = await this.getCheckpoint(options);
204-
const syncRules = this.getSyncRulesContent();
205-
const map = Object.entries(buckets).map(([bucket, start]) => bucketRequest(syncRules, bucket, start));
204+
const syncConfigContent = this.getSyncConfigContent();
205+
const map = Object.entries(buckets).map(([bucket, start]) => bucketRequest(syncConfigContent, bucket, start));
206206
return test_utils.fromAsync(this.storage!.getBucketDataBatch(checkpoint, map));
207207
}
208208

@@ -211,9 +211,9 @@ export class ChangeStreamTestContext {
211211
if (typeof start == 'string') {
212212
start = BigInt(start);
213213
}
214-
const syncRules = this.getSyncRulesContent();
214+
const syncConfigContent = this.getSyncConfigContent();
215215
const checkpoint = await this.getCheckpoint(options);
216-
let map = [bucketRequest(syncRules, bucket, start)];
216+
let map = [bucketRequest(syncConfigContent, bucket, start)];
217217
let data: OplogEntry[] = [];
218218
while (true) {
219219
const batch = this.storage!.getBucketDataBatch(checkpoint, map);
@@ -223,15 +223,15 @@ export class ChangeStreamTestContext {
223223
if (batches.length == 0 || !batches[0]!.chunkData.has_more) {
224224
break;
225225
}
226-
map = [bucketRequest(syncRules, bucket, BigInt(batches[0]!.chunkData.next_after))];
226+
map = [bucketRequest(syncConfigContent, bucket, BigInt(batches[0]!.chunkData.next_after))];
227227
}
228228
return data;
229229
}
230230

231231
async getChecksums(buckets: string[], options?: { timeout?: number }): Promise<utils.ChecksumMap> {
232232
let checkpoint = await this.getCheckpoint(options);
233-
const syncRules = this.getSyncRulesContent();
234-
const versionedBuckets = buckets.map((bucket) => bucketRequest(syncRules, bucket, 0n));
233+
const syncConfigContent = this.getSyncConfigContent();
234+
const versionedBuckets = buckets.map((bucket) => bucketRequest(syncConfigContent, bucket, 0n));
235235
const checksums = await this.storage!.getChecksums(checkpoint, versionedBuckets);
236236

237237
const unversioned: utils.ChecksumMap = new Map();

modules/module-mssql/test/src/CDCStreamTestContext.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ export class CDCStreamTestContext implements AsyncDisposable {
8484
}
8585

8686
async loadNextSyncRules() {
87-
const syncRules = await this.factory.getDeployingSyncConfigContent();
88-
if (syncRules == null) {
87+
const syncConfigContent = await this.factory.getDeployingSyncConfigContent();
88+
if (syncConfigContent == null) {
8989
throw new Error(`Next replication stream not available`);
9090
}
9191

92-
this.syncRulesContent = syncRules;
93-
const replicationStream = await this.factory.getReplicationStream(syncRules.replicationStreamId);
92+
this.syncRulesContent = syncConfigContent;
93+
const replicationStream = await this.factory.getReplicationStream(syncConfigContent.replicationStreamId);
9494
if (replicationStream == null) {
9595
throw new Error(`Next replication stream not available`);
9696
}
@@ -99,21 +99,21 @@ export class CDCStreamTestContext implements AsyncDisposable {
9999
}
100100

101101
async loadActiveSyncRules() {
102-
const syncRules = await this.factory.getActiveSyncConfigContent();
103-
if (syncRules == null) {
102+
const syncConfigContent = await this.factory.getActiveSyncConfigContent();
103+
if (syncConfigContent == null) {
104104
throw new Error(`Active replication stream not available`);
105105
}
106106

107-
this.syncRulesContent = syncRules;
108-
const replicationStream = await this.factory.getReplicationStream(syncRules.replicationStreamId);
107+
this.syncRulesContent = syncConfigContent;
108+
const replicationStream = await this.factory.getReplicationStream(syncConfigContent.replicationStreamId);
109109
if (replicationStream == null) {
110110
throw new Error(`Active replication stream not available`);
111111
}
112112
this.storage = this.factory.getInstance(replicationStream);
113113
return this.storage!;
114114
}
115115

116-
private getSyncRulesContent(): storage.PersistedSyncConfigContent {
116+
private getSyncConfigContent(): storage.PersistedSyncConfigContent {
117117
if (this.syncRulesContent == null) {
118118
throw new Error('Sync config not configured - call updateSyncRules() first');
119119
}
@@ -191,8 +191,8 @@ export class CDCStreamTestContext implements AsyncDisposable {
191191

192192
async getBucketsDataBatch(buckets: Record<string, InternalOpId>, options?: { timeout?: number }) {
193193
let checkpoint = await this.getCheckpoint(options);
194-
const syncRules = this.getSyncRulesContent();
195-
const map = Object.entries(buckets).map(([bucket, start]) => bucketRequest(syncRules, bucket, start));
194+
const syncConfigContent = this.getSyncConfigContent();
195+
const map = Object.entries(buckets).map(([bucket, start]) => bucketRequest(syncConfigContent, bucket, start));
196196
return test_utils.fromAsync(this.storage!.getBucketDataBatch(checkpoint, map));
197197
}
198198

@@ -204,9 +204,9 @@ export class CDCStreamTestContext implements AsyncDisposable {
204204
if (typeof start == 'string') {
205205
start = BigInt(start);
206206
}
207-
const syncRules = this.getSyncRulesContent();
207+
const syncConfigContent = this.getSyncConfigContent();
208208
const checkpoint = await this.getCheckpoint(options);
209-
let map = [bucketRequest(syncRules, bucket, start)];
209+
let map = [bucketRequest(syncConfigContent, bucket, start)];
210210
let data: OplogEntry[] = [];
211211
while (true) {
212212
const batch = this.storage!.getBucketDataBatch(checkpoint, map);
@@ -216,7 +216,7 @@ export class CDCStreamTestContext implements AsyncDisposable {
216216
if (batches.length == 0 || !batches[0]!.chunkData.has_more) {
217217
break;
218218
}
219-
map = [bucketRequest(syncRules, bucket, BigInt(batches[0]!.chunkData.next_after))];
219+
map = [bucketRequest(syncConfigContent, bucket, BigInt(batches[0]!.chunkData.next_after))];
220220
}
221221
return data;
222222
}
@@ -235,8 +235,8 @@ export class CDCStreamTestContext implements AsyncDisposable {
235235
start = BigInt(start);
236236
}
237237
const { checkpoint } = await this.storage!.getCheckpoint();
238-
const syncRules = this.getSyncRulesContent();
239-
const map = [bucketRequest(syncRules, bucket, start)];
238+
const syncConfigContent = this.getSyncConfigContent();
239+
const map = [bucketRequest(syncConfigContent, bucket, start)];
240240
const batch = this.storage!.getBucketDataBatch(checkpoint, map);
241241
const batches = await test_utils.fromAsync(batch);
242242
return batches[0]?.chunkData.data ?? [];

modules/module-mysql/test/src/BinlogStreamUtils.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ export class BinlogStreamTestContext {
8080
}
8181

8282
async loadNextSyncRules() {
83-
const syncRules = await this.factory.getDeployingSyncConfigContent();
84-
if (syncRules == null) {
83+
const syncConfigContent = await this.factory.getDeployingSyncConfigContent();
84+
if (syncConfigContent == null) {
8585
throw new Error(`Next replication stream not available`);
8686
}
8787

88-
this.syncRulesContent = syncRules;
89-
const replicationStream = await this.factory.getReplicationStream(syncRules.replicationStreamId);
88+
this.syncRulesContent = syncConfigContent;
89+
const replicationStream = await this.factory.getReplicationStream(syncConfigContent.replicationStreamId);
9090
if (replicationStream == null) {
9191
throw new Error(`Next replication stream not available`);
9292
}
@@ -95,13 +95,13 @@ export class BinlogStreamTestContext {
9595
}
9696

9797
async loadActiveSyncRules() {
98-
const syncRules = await this.factory.getActiveSyncConfigContent();
99-
if (syncRules == null) {
98+
const syncConfigContent = await this.factory.getActiveSyncConfigContent();
99+
if (syncConfigContent == null) {
100100
throw new Error(`Active replication stream not available`);
101101
}
102102

103-
this.syncRulesContent = syncRules;
104-
const replicationStream = await this.factory.getReplicationStream(syncRules.replicationStreamId);
103+
this.syncRulesContent = syncConfigContent;
104+
const replicationStream = await this.factory.getReplicationStream(syncConfigContent.replicationStreamId);
105105
if (replicationStream == null) {
106106
throw new Error(`Active replication stream not available`);
107107
}
@@ -110,7 +110,7 @@ export class BinlogStreamTestContext {
110110
return this.storage!;
111111
}
112112

113-
private getSyncRulesContent(): storage.PersistedSyncConfigContent {
113+
private getSyncConfigContent(): storage.PersistedSyncConfigContent {
114114
if (this.syncRulesContent == null) {
115115
throw new Error('Sync config not configured - call updateSyncRules() first');
116116
}
@@ -173,8 +173,8 @@ export class BinlogStreamTestContext {
173173

174174
async getBucketsDataBatch(buckets: Record<string, InternalOpId>, options?: { timeout?: number }) {
175175
const checkpoint = await this.getCheckpoint(options);
176-
const syncRules = this.getSyncRulesContent();
177-
const map = Object.entries(buckets).map(([bucket, start]) => bucketRequest(syncRules, bucket, start));
176+
const syncConfigContent = this.getSyncConfigContent();
177+
const map = Object.entries(buckets).map(([bucket, start]) => bucketRequest(syncConfigContent, bucket, start));
178178
return test_utils.fromAsync(this.storage!.getBucketDataBatch(checkpoint, map));
179179
}
180180

@@ -187,9 +187,9 @@ export class BinlogStreamTestContext {
187187
if (typeof start == 'string') {
188188
start = BigInt(start);
189189
}
190-
const syncRules = this.getSyncRulesContent();
190+
const syncConfigContent = this.getSyncConfigContent();
191191
const checkpoint = await this.getCheckpoint(options);
192-
const map = [bucketRequest(syncRules, bucket, start)];
192+
const map = [bucketRequest(syncConfigContent, bucket, start)];
193193
const batch = this.storage!.getBucketDataBatch(checkpoint, map);
194194
const batches = await test_utils.fromAsync(batch);
195195
return batches[0]?.chunkData.data ?? [];

modules/module-postgres/test/src/wal_stream_utils.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,13 @@ export class WalStreamTestContext implements AsyncDisposable {
9898
}
9999

100100
async loadNextSyncRules() {
101-
const syncRules = await this.factory.getDeployingSyncConfigContent();
102-
if (syncRules == null) {
101+
const syncConfigContent = await this.factory.getDeployingSyncConfigContent();
102+
if (syncConfigContent == null) {
103103
throw new Error(`Next replication stream not available`);
104104
}
105105

106-
this.syncRulesContent = syncRules;
107-
const replicationStream = await this.factory.getReplicationStream(syncRules.replicationStreamId);
106+
this.syncRulesContent = syncConfigContent;
107+
const replicationStream = await this.factory.getReplicationStream(syncConfigContent.replicationStreamId);
108108
if (replicationStream == null) {
109109
throw new Error(`Next replication stream not available`);
110110
}
@@ -113,21 +113,21 @@ export class WalStreamTestContext implements AsyncDisposable {
113113
}
114114

115115
async loadActiveSyncRules() {
116-
const syncRules = await this.factory.getActiveSyncConfigContent();
117-
if (syncRules == null) {
116+
const syncConfigContent = await this.factory.getActiveSyncConfigContent();
117+
if (syncConfigContent == null) {
118118
throw new Error(`Active replication stream not available`);
119119
}
120120

121-
this.syncRulesContent = syncRules;
122-
const replicationStream = await this.factory.getReplicationStream(syncRules.replicationStreamId);
121+
this.syncRulesContent = syncConfigContent;
122+
const replicationStream = await this.factory.getReplicationStream(syncConfigContent.replicationStreamId);
123123
if (replicationStream == null) {
124124
throw new Error(`Active replication stream not available`);
125125
}
126126
this.storage = this.factory.getInstance(replicationStream);
127127
return this.storage!;
128128
}
129129

130-
private getSyncRulesContent(): storage.PersistedSyncConfigContent {
130+
private getSyncConfigContent(): storage.PersistedSyncConfigContent {
131131
if (this.syncRulesContent == null) {
132132
throw new Error('Sync config not configured - call updateSyncRules() first');
133133
}
@@ -194,7 +194,7 @@ export class WalStreamTestContext implements AsyncDisposable {
194194
}
195195

196196
async getBucketsDataBatch(buckets: Record<string, InternalOpId>, options?: { timeout?: number }) {
197-
const helpers = new StorageDataHelpers(this.storage!, this.getSyncRulesContent());
197+
const helpers = new StorageDataHelpers(this.storage!, this.getSyncConfigContent());
198198
const checkpoint = await this.getCheckpoint(options);
199199
return helpers.getBucketsDataBatch(buckets, checkpoint);
200200
}
@@ -203,15 +203,15 @@ export class WalStreamTestContext implements AsyncDisposable {
203203
* This waits for a client checkpoint.
204204
*/
205205
async getBucketData(bucket: string, start?: InternalOpId | string | undefined, options?: { timeout?: number }) {
206-
const helpers = new StorageDataHelpers(this.storage!, this.getSyncRulesContent());
206+
const helpers = new StorageDataHelpers(this.storage!, this.getSyncConfigContent());
207207
const checkpoint = await this.getCheckpoint(options);
208208
return helpers.getBucketData(bucket, checkpoint, start);
209209
}
210210

211211
async getChecksums(buckets: string[], options?: { timeout?: number }) {
212212
const checkpoint = await this.getCheckpoint(options);
213-
const syncRules = this.getSyncRulesContent();
214-
const versionedBuckets = buckets.map((bucket) => bucketRequest(syncRules, bucket, 0n));
213+
const syncConfigContent = this.getSyncConfigContent();
214+
const versionedBuckets = buckets.map((bucket) => bucketRequest(syncConfigContent, bucket, 0n));
215215
const checksums = await this.storage!.getChecksums(checkpoint, versionedBuckets);
216216

217217
const unversioned = new Map();
@@ -235,9 +235,9 @@ export class WalStreamTestContext implements AsyncDisposable {
235235
if (typeof start == 'string') {
236236
start = BigInt(start);
237237
}
238-
const syncRules = this.getSyncRulesContent();
238+
const syncConfigContent = this.getSyncConfigContent();
239239
const { checkpoint } = await this.storage!.getCheckpoint();
240-
const map = [bucketRequest(syncRules, bucket, start)];
240+
const map = [bucketRequest(syncConfigContent, bucket, start)];
241241
const batch = this.storage!.getBucketDataBatch(checkpoint, map);
242242
const batches = await test_utils.fromAsync(batch);
243243
return batches[0]?.chunkData.data ?? [];

0 commit comments

Comments
 (0)