/** * Method buildProperties returns a new {@link Properties} instance with all property values for this type * using the given Iterable<Map.Entry<String, String>> of property values as defaults. The given Iterable will not be modified. * <p> * If no values have been set, all default properties and values will be returned. * * @return a new Properties instance */ public Properties buildProperties( Iterable<Map.Entry<String, String>> defaultProperties ) { return buildProperties( PropertyUtil.createProperties( defaultProperties ) ); }
public static String getApplicationID( Map<Object, Object> properties ) { if( properties == null ) return getAppID(); return PropertyUtil.getProperty( properties, APP_ID, getAppID() ); }
/** * Returns {@code true} if there are properties in the configDef instance. * * @return true if there are configDef properties */ @Override public boolean hasConfigDef() { return configDef != null && !configDef.isEmpty(); }
@Override protected void addPropertiesTo( Properties properties ) { setApplicationID( properties ); setApplicationName( properties, name ); setApplicationVersion( properties, version ); addApplicationTag( properties, getTags() ); addApplicationFramework( properties, getFrameworks() ); setApplicationJarClass( properties, jarClass ); setApplicationJarPath( properties, jarPath ); } }
@Override public String get( String key ) { return getProperty( properties, key ); } } );
public ConfigDef setProperties( ConfigDef configDef, ConfigDef.Mode mode ) { Properties properties = buildProperties(); for( String name : properties.stringPropertyNames() ) configDef.setProperty( mode, name, properties.getProperty( name ) ); return configDef; }
/** * Method setProperty sets the value to the given key using the {@link Mode#REPLACE} mode. * * @param key the key * @param value the value * @return the current ConfigDef instance */ public ConfigDef setProperty( String key, String value ) { return setProperty( Mode.REPLACE, key, value ); }
protected void addSessionProperties( Map<Object, Object> properties ) { if( properties == null ) return; PropertyUtil.setProperty( properties, CASCADING_FLOW_ID, getID() ); PropertyUtil.setProperty( properties, "cascading.flow.tags", getTags() ); AppProps.setApplicationID( properties ); PropertyUtil.setProperty( properties, "cascading.app.name", makeAppName( properties ) ); PropertyUtil.setProperty( properties, "cascading.app.version", makeAppVersion( properties ) ); }
@Override public Map<Object, Object> getProperties() { return PropertyUtil.asFlatMap( properties ); }
/** * Method buildProperties returns a new {@link Properties} instance with all property values for this type. * <p> * If no values have been set, all default properties and values will be returned. * * @return a new Properties instance */ public Properties buildProperties() { return buildProperties( (Properties) null ); }
@Override public Object getProperty( String key ) { return configDef.apply( key, getter ); }
/** * Creates a new AppProps instance. * * @return AppProps instance */ public static AppProps appProps() { return new AppProps(); }
public static String getApplicationName( Map<Object, Object> properties ) { return PropertyUtil.getProperty( properties, APP_NAME, (String) null ); }
/** * Method buildProperties returns a new {@link Properties} instance with all property values for this type * using the given Map of property values as defaults. The given Map will not be modified. * <p> * If no values have been set, all default properties and values will be returned. * * @return a new Properties instance */ public Properties buildProperties( Map<Object, Object> defaultProperties ) { return buildProperties( PropertyUtil.createProperties( defaultProperties, null ) ); }
/** * Returns {@code true} if there are properties in the stepConfigDef instance. * * @return true if there are stepConfigDef properties */ @Override public boolean hasStepConfigDef() { return stepConfigDef != null && !stepConfigDef.isEmpty(); }
public static String getApplicationVersion( Map<Object, Object> properties ) { return PropertyUtil.getProperty( properties, APP_VERSION, (String) null ); }
/** * Returns {@code true} if there are properties in the configDef instance. * * @return true if there are configDef properties */ public boolean hasConfigDef() { return configDef != null && !configDef.isEmpty(); }
/** * Returns {@code true} if there are properties in the stepConfigDef instance. * * @return true if there are stepConfigDef properties */ @Override public boolean hasStepConfigDef() { return stepConfigDef != null && !stepConfigDef.isEmpty(); }
/** * Returns {@code true} if there are properties in the nodeConfigDef instance. * * @return true if there are nodeConfigDef properties */ @Override public boolean hasNodeConfigDef() { return nodeConfigDef != null && !nodeConfigDef.isEmpty(); }
/** * Returns {@code true} if there are properties in the nodeConfigDef instance. * * @return true if there are nodeConfigDef properties */ @Override public boolean hasNodeConfigDef() { return nodeConfigDef != null && !nodeConfigDef.isEmpty(); }