@Test public void multipleUfsMountOptions() { Map<String, String> opts = new ImmutableMap.Builder<String, String>() .put("my.special.key", "myspecialvalue") .put(ConfigurationUtils.MOUNT_PREFIX + "{ufs: .put(ConfigurationUtils.MOUNT_PREFIX + "{ufs: .put(ConfigurationUtils.MOUNT_PREFIX + "{ufs: .put(ConfigurationUtils.MOUNT_PREFIX + "{file}.key2", "v4") .build(); UdbConfiguration conf = new UdbConfiguration(opts); assertEquals(3, Whitebox.<Map<String, String>>getInternalState(conf, "mMountOptions").size()); assertEquals(0, conf.getMountOption("").size()); assertEquals(1, conf.getMountOption("ufs: assertEquals(2, conf.getMountOption("ufs: assertEquals(1, conf.getMountOption("file").size()); }
public Map<String, String> getMountOption(String schemeAuthority) { if (!schemeAuthority.endsWith("/")) { schemeAuthority += "/"; } return mMountOptions.getOrDefault(schemeAuthority, Collections.emptyMap()); }
UdbConfiguration extends BaseConfiguration<UdbProperty> { public Map<String, String> getMountOption(String schemeAuthority) { if (!schemeAuthority.endsWith("/")) { schemeAuthority += "/"; } return mMountOptions.getOrDefault(schemeAuthority, Collections.emptyMap()); } }
UdbConfiguration extends BaseConfiguration<UdbProperty> { public Map<String, String> getMountOption(String schemeAuthority) { if (!schemeAuthority.endsWith("/")) { schemeAuthority += "/"; } return mMountOptions.getOrDefault(schemeAuthority, Collections.emptyMap()); } UdbConfiguration(Map<String, String> values); }
UdbConfiguration extends BaseConfiguration<UdbProperty> { public Map<String, String> getMountOption(String schemeAuthority) { if (!schemeAuthority.endsWith("/")) { schemeAuthority += "/"; } return mMountOptions.getOrDefault(schemeAuthority, Collections.emptyMap()); } UdbConfiguration(Map<String, String> values); Map<String, String> getMountOption(String schemeAuthority); }
UdbConfiguration extends BaseConfiguration<UdbProperty> { public Map<String, String> getMountOption(String schemeAuthority) { if (!schemeAuthority.endsWith("/")) { schemeAuthority += "/"; } return mMountOptions.getOrDefault(schemeAuthority, Collections.emptyMap()); } UdbConfiguration(Map<String, String> values); Map<String, String> getMountOption(String schemeAuthority); static final String READ_ONLY_OPTION; static final String SHARED_OPTION; }