(client, parent, profile, defaultProfile)
| 453 | } |
| 454 | |
| 455 | function setExecutionProfileProperties(client, parent, profile, defaultProfile) { |
| 456 | const output = parent[profile.name] = {}; |
| 457 | setExecutionProfileItem(output, profile, defaultProfile, 'readTimeout'); |
| 458 | setExecutionProfileItem(output, profile, defaultProfile, 'loadBalancing', getPolicyInfo); |
| 459 | setExecutionProfileItem(output, profile, defaultProfile, 'retry', getPolicyInfo); |
| 460 | setExecutionProfileItem(output, profile, defaultProfile, 'consistency', getConsistencyString); |
| 461 | setExecutionProfileItem(output, profile, defaultProfile, 'serialConsistency', getConsistencyString); |
| 462 | |
| 463 | if (profile === defaultProfile) { |
| 464 | // Speculative execution policy is included in the profiles as some drivers support |
| 465 | // different spec exec policy per profile, in this case is fixed for all profiles |
| 466 | output.speculativeExecution = getPolicyInfo(client.options.policies.speculativeExecution); |
| 467 | } |
| 468 | |
| 469 | if (profile.graphOptions) { |
| 470 | output.graphOptions = {}; |
| 471 | const defaultGraphOptions = defaultProfile.graphOptions || utils.emptyObject; |
| 472 | setExecutionProfileItem(output.graphOptions, profile.graphOptions, defaultGraphOptions, 'language'); |
| 473 | setExecutionProfileItem(output.graphOptions, profile.graphOptions, defaultGraphOptions, 'name'); |
| 474 | setExecutionProfileItem(output.graphOptions, profile.graphOptions, defaultGraphOptions, 'readConsistency', |
| 475 | getConsistencyString); |
| 476 | setExecutionProfileItem(output.graphOptions, profile.graphOptions, defaultGraphOptions, 'source'); |
| 477 | setExecutionProfileItem(output.graphOptions, profile.graphOptions, defaultGraphOptions, 'writeConsistency', |
| 478 | getConsistencyString); |
| 479 | |
| 480 | if (Object.keys(output.graphOptions).length === 0) { |
| 481 | // Properties that are undefined will not be included in the JSON |
| 482 | output.graphOptions = undefined; |
| 483 | } |
| 484 | } |
| 485 | } |
| 486 | |
| 487 | function setExecutionProfileItem(output, profile, defaultProfile, prop, valueGetter) { |
| 488 | const value = profile[prop]; |
no test coverage detected