Skip to content

Commit

Permalink
fix(NODE-1837): remove zstc level option
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed May 16, 2022
1 parent 6992259 commit 1412056
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 38 deletions.
4 changes: 0 additions & 4 deletions src/cmap/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -795,10 +795,6 @@ function write(
if (conn[kDescription].zlibCompressionLevel) {
operationDescription.zlibCompressionLevel = conn[kDescription].zlibCompressionLevel;
}

if (conn[kDescription].zstdCompressionLevel) {
operationDescription.zstdCompressionLevel = conn[kDescription].zstdCompressionLevel;
}
}

if (typeof options.socketTimeoutMS === 'number') {
Expand Down
1 change: 0 additions & 1 deletion src/cmap/message_stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export interface OperationDescription extends BSONSerializeOptions {
socketTimeoutOverride?: boolean;
agreedCompressor?: CompressorName;
zlibCompressionLevel?: number;
zstdCompressionLevel?: number;
$clusterTime?: Document;
}

Expand Down
1 change: 0 additions & 1 deletion src/cmap/stream_description.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export class StreamDescription {
__nodejs_mock_server__?: boolean;

zlibCompressionLevel?: number;
zstdCompressionLevel?: number;

constructor(address: string, options?: StreamDescriptionOptions) {
this.address = address;
Expand Down
3 changes: 2 additions & 1 deletion src/cmap/wire_protocol/compression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const uncompressibleCommands = new Set([
]);

const MAX_COMPRESSOR_ID = 3;
const ZSTD_COMPRESSION_LEVEL = 3;

// Facilitate compressing a message using an agreed compressor
export function compress(
Expand Down Expand Up @@ -68,7 +69,7 @@ export function compress(
if ('kModuleError' in ZStandard) {
return callback(ZStandard['kModuleError']);
}
ZStandard.compress(dataToBeCompressed, self.options.zstdCompressionLevel).then(
ZStandard.compress(dataToBeCompressed, ZSTD_COMPRESSION_LEVEL).then(
buffer => callback(undefined, buffer),
error => callback(error)
);
Expand Down
4 changes: 0 additions & 4 deletions src/connection_string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1210,10 +1210,6 @@ export const OPTIONS = {
default: 0,
type: 'int'
},
zstdCompressionLevel: {
default: 3,
type: 'int'
},
// Custom types for modifying core behavior
connectionType: { type: 'any' },
srvPoller: { type: 'any' },
Expand Down
27 changes: 0 additions & 27 deletions src/mongo_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,32 +127,6 @@ export interface MongoClientOptions extends BSONSerializeOptions, SupportedNodeC
compressors?: CompressorName[] | string;
/** An integer that specifies the compression level if using zlib for network compression. */
zlibCompressionLevel?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | undefined;
/** An integer specifying zstd compression level. */
zstdCompressionLevel?:
| 0
| 1
| 2
| 3
| 4
| 5
| 6
| 7
| 8
| 9
| 10
| 11
| 12
| 13
| 14
| 15
| 16
| 17
| 18
| 19
| 20
| 21
| 22
| undefined;
/** The maximum number of hosts to connect to when using an srv connection string, a setting of `0` means unlimited hosts */
srvMaxHosts?: number;
/**
Expand Down Expand Up @@ -684,7 +658,6 @@ export interface MongoOptions
| 'tlsInsecure'
| 'waitQueueTimeoutMS'
| 'zlibCompressionLevel'
| 'zstdCompressionLevel'
>
>,
SupportedNodeConnectionOptions {
Expand Down

0 comments on commit 1412056

Please sign in to comment.