@Test public void toMap() throws Exception { String testKeyName = "alluxio.extensions.dir"; PropertyKey nestedKey = PropertyKey.SECURITY_LOGIN_USERNAME; String nestedValue = String.format("${%s}.test", testKeyName); mConfiguration.set(nestedKey, nestedValue); Map<String, String> resolvedMap = mConfiguration.toMap(); assertEquals(mConfiguration.get(PropertyKey.fromString(testKeyName)), resolvedMap.get(testKeyName)); String nestedResolvedValue = String.format("%s.test", resolvedMap.get(testKeyName)); assertEquals(nestedResolvedValue, resolvedMap.get(nestedKey.toString())); String resolvedValue1 = String.format("%s/extensions", resolvedMap.get("alluxio.home")); assertEquals(resolvedValue1, resolvedMap.get(testKeyName)); String resolvedValue2 = String.format("%s/logs", resolvedMap.get("alluxio.work.dir")); assertEquals(resolvedValue2, resolvedMap.get("alluxio.logs.dir")); assertTrue(resolvedMap.containsKey("alluxio.debug")); assertTrue(resolvedMap.containsKey("alluxio.fuse.fs.name")); assertTrue(resolvedMap.containsKey("alluxio.master.journal.folder")); assertTrue(resolvedMap.containsKey("alluxio.proxy.web.port")); assertTrue(resolvedMap.containsKey("alluxio.security.authentication.type")); assertTrue(resolvedMap.containsKey("alluxio.user.block.master.client.pool.size.max")); assertTrue(resolvedMap.containsKey("alluxio.worker.bind.host")); }
@Override public Map<String, String> toMap(ConfigurationValueOptions opts) { Map<String, String> map = new HashMap<>(); keySet().forEach(key -> map.put(key.getName(), getOrDefault(key, null, opts))); return map; }
InstancedConfiguration implements AlluxioConfiguration { @Override public Map<String, String> toMap(ConfigurationValueOptions opts) { Map<String, String> map = new HashMap<>(); keySet().forEach(key -> map.put(key.getName(), getOrDefault(key, null, opts))); return map; } }
InstancedConfiguration implements AlluxioConfiguration { @Override public Map<String, String> toMap(ConfigurationValueOptions opts) { Map<String, String> map = new HashMap<>(); keySet().forEach(key -> map.put(key.getName(), getOrDefault(key, null, opts))); return map; } InstancedConfiguration(AlluxioProperties properties);  InstancedConfiguration(AlluxioProperties properties, boolean clusterDefaultsLoaded);  InstancedConfiguration(AlluxioConfiguration conf); }
InstancedConfiguration implements AlluxioConfiguration { @Override public Map<String, String> toMap(ConfigurationValueOptions opts) { Map<String, String> map = new HashMap<>(); keySet().forEach(key -> map.put(key.getName(), getOrDefault(key, null, opts))); return map; } InstancedConfiguration(AlluxioProperties properties);  InstancedConfiguration(AlluxioProperties properties, boolean clusterDefaultsLoaded);  InstancedConfiguration(AlluxioConfiguration conf); static InstancedConfiguration defaults(); AlluxioProperties copyProperties(); @Override String get(PropertyKey key); @Override String get(PropertyKey key, ConfigurationValueOptions options); @Override boolean isSet(PropertyKey key); @Override boolean isSetByUser(PropertyKey key); void set(PropertyKey key, Object value); void set(@Nonnull PropertyKey key, @Nonnull Object value, @Nonnull Source source); void unset(PropertyKey key); void merge(Map<?, ?> properties, Source source); @Override Set<PropertyKey> keySet(); @Override Set<PropertyKey> userKeySet(); @Override int getInt(PropertyKey key); @Override long getLong(PropertyKey key); @Override double getDouble(PropertyKey key); @Override float getFloat(PropertyKey key); @Override boolean getBoolean(PropertyKey key); @Override List<String> getList(PropertyKey key, String delimiter); @Override T getEnum(PropertyKey key, Class<T> enumType); @Override long getBytes(PropertyKey key); @Override long getMs(PropertyKey key); @Override Duration getDuration(PropertyKey key); @Override Class<T> getClass(PropertyKey key); @Override Map<String, String> getNestedProperties(PropertyKey prefixKey); @Override Source getSource(PropertyKey key); @Override Map<String, String> toMap(ConfigurationValueOptions opts); @Override void validate(); @Override boolean clusterDefaultsLoaded(); @Override String hash(); }
InstancedConfiguration implements AlluxioConfiguration { @Override public Map<String, String> toMap(ConfigurationValueOptions opts) { Map<String, String> map = new HashMap<>(); keySet().forEach(key -> map.put(key.getName(), getOrDefault(key, null, opts))); return map; } InstancedConfiguration(AlluxioProperties properties);  InstancedConfiguration(AlluxioProperties properties, boolean clusterDefaultsLoaded);  InstancedConfiguration(AlluxioConfiguration conf); static InstancedConfiguration defaults(); AlluxioProperties copyProperties(); @Override String get(PropertyKey key); @Override String get(PropertyKey key, ConfigurationValueOptions options); @Override boolean isSet(PropertyKey key); @Override boolean isSetByUser(PropertyKey key); void set(PropertyKey key, Object value); void set(@Nonnull PropertyKey key, @Nonnull Object value, @Nonnull Source source); void unset(PropertyKey key); void merge(Map<?, ?> properties, Source source); @Override Set<PropertyKey> keySet(); @Override Set<PropertyKey> userKeySet(); @Override int getInt(PropertyKey key); @Override long getLong(PropertyKey key); @Override double getDouble(PropertyKey key); @Override float getFloat(PropertyKey key); @Override boolean getBoolean(PropertyKey key); @Override List<String> getList(PropertyKey key, String delimiter); @Override T getEnum(PropertyKey key, Class<T> enumType); @Override long getBytes(PropertyKey key); @Override long getMs(PropertyKey key); @Override Duration getDuration(PropertyKey key); @Override Class<T> getClass(PropertyKey key); @Override Map<String, String> getNestedProperties(PropertyKey prefixKey); @Override Source getSource(PropertyKey key); @Override Map<String, String> toMap(ConfigurationValueOptions opts); @Override void validate(); @Override boolean clusterDefaultsLoaded(); @Override String hash();  }