Code example for Properties

Methods: getProperty

0
 
  @Override 
  public Map<String, String> convert(Properties props)
  { 
    String type = null;
    if (Boolean.parseBoolean(props.getProperty("druid.pusher.local", "false"))) {
      type = "local";
    } 
    else if (Boolean.parseBoolean(props.getProperty("druid.pusher.cassandra", "false"))) {
      type = "c*";
    } 
    else if (Boolean.parseBoolean(props.getProperty("druid.pusher.hdfs", "false"))) {
      type = "hdfs";
    } 
 
    if (type != null) {
      return ImmutableMap.of("druid.storage.type", type);
    } 
 
    // It's an s3 property, which means we need to set the type and convert the other values. 
    Map<String, String> retVal = Maps.newHashMap();
 
    retVal.put("druid.pusher.type", type);
    retVal.putAll(new Rename("druid.pusher.s3.bucket", "druid.storage.bucket").convert(props));
    retVal.putAll(new Rename("druid.pusher.s3.baseKey", "druid.storage.baseKey").convert(props));
    retVal.putAll(new Rename("druid.pusher.s3.disableAcl", "druid.storage.disableAcl").convert(props));
 
    return retVal;
  } 
}