[ML] Stop reading the ml.max_open_jobs node attribute (#115524)

The ml.max_open_jobs node attribute is going away in
version 8, as the maximum number of open jobs has been
defined by a dynamic cluster-wide setting during the 7
series and there is no chance of version 8 needing to
run in a mixed version cluster with version 6.

The ml.machine_memory attribute will still be available,
so this can be checked instead as a way of detecting ML
nodes.
This commit is contained in:
David Roberts 2021-10-19 15:42:49 +01:00 committed by GitHub
parent 6a1af300f5
commit 9dcf5bf1b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,8 +17,8 @@ export async function getMlNodeCount(client: IScopedClusterClient): Promise<MlNo
if (typeof body.nodes === 'object') {
Object.keys(body.nodes).forEach((k) => {
if (body.nodes[k].attributes !== undefined) {
const maxOpenJobs = +body.nodes[k].attributes['ml.max_open_jobs'];
if (maxOpenJobs !== null && maxOpenJobs > 0) {
const machineMemory = +body.nodes[k].attributes['ml.machine_memory'];
if (machineMemory !== null && machineMemory > 0) {
count++;
}
}