ElasticsearchSettings extends Settings { @SuppressWarnings("unchecked") @Override public <T> T getSettingValue(Settings.Key key) { return (T) latestSettings.getOrDefault(key, defaultSettings.get(key).getDefault(EMPTY)); } ElasticsearchSettings(ClusterSettings clusterSettings); @SuppressWarnings("unchecked") @Override T getSettingValue(Settings.Key key); static List<Setting<?>> pluginSettings();  }
@Test void getSettingValue() { ElasticsearchSettings settings = new ElasticsearchSettings(clusterSettings); ByteSizeValue sizeValue = settings.getSettingValue(Settings.Key.PPL_QUERY_MEMORY_LIMIT); assertNotNull(sizeValue); }
@Test void update() { ElasticsearchSettings settings = new ElasticsearchSettings(clusterSettings); ByteSizeValue oldValue = settings.getSettingValue(Settings.Key.PPL_QUERY_MEMORY_LIMIT); ElasticsearchSettings.Updater updater = settings.new Updater(Settings.Key.PPL_QUERY_MEMORY_LIMIT); updater.accept(new ByteSizeValue(0L)); ByteSizeValue newValue = settings.getSettingValue(Settings.Key.PPL_QUERY_MEMORY_LIMIT); assertNotEquals(newValue.getBytes(), oldValue.getBytes()); }