
gov.nasa.pds.registry.common.connection.aws.SettingRespImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of registry-common Show documentation
Show all versions of registry-common Show documentation
Common code used by Harvest and Registry Manager.
The newest version!
package gov.nasa.pds.registry.common.connection.aws;
import org.opensearch.client.opensearch.indices.GetIndicesSettingsResponse;
import org.opensearch.client.opensearch.indices.IndexState;
import gov.nasa.pds.registry.common.Response;
class SettingRespImpl implements Response.Settings {
final private int replicas;
final private int shards;
SettingRespImpl (GetIndicesSettingsResponse response) {
int r = -1, s = -1;
for (IndexState state : response.result().values()) {
// should only ever be one
r = Integer.valueOf(state.settings().numberOfReplicas());
s = Integer.valueOf(state.settings().numberOfShards());
}
this.replicas = r;
this.shards = s;
}
@Override
public int replicas() {
return this.replicas;
}
@Override
public int shards() {
return this.shards;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy