@Override public Object getProperty( String key ) { return delegate.getProperty( key ); }
@Override public String get( String name, String defaultValue ) { Object value = flowProcess.getProperty( name ); return value == null ? defaultValue : String.valueOf( value ); } } );
@Override public String get( String name, String defaultValue ) { Object value = flowProcess.getProperty( name ); return value == null ? defaultValue : String.valueOf( value ); } } );
private static String getRequiredConfigurationItem(String key, String prettyName, FlowProcess flowProcess) { String result = (String)flowProcess.getProperty(key); if (result == null) { throw new RuntimeException(prettyName + " must be set with configuration item: " + key); } return result; }
public static int getThreshold( FlowProcess flowProcess, int defaultValue ) { String value = (String) flowProcess.getProperty( SpillableProps.LIST_THRESHOLD ); if( value == null || value.length() == 0 ) return defaultValue; return Integer.parseInt( value ); }
public static int getMapThreshold( FlowProcess flowProcess, int defaultValue ) { String value = (String) flowProcess.getProperty( SpillableProps.MAP_THRESHOLD ); if( value == null || value.length() == 0 ) return defaultValue; return Integer.parseInt( value ); }
public static float getMapLoadFactor( FlowProcess flowProcess, float defaultValue ) { String value = (String) flowProcess.getProperty( SpillableProps.MAP_LOADFACTOR ); if( value == null || value.length() == 0 ) return defaultValue; return Float.parseFloat( value ); }
public static int getMapCapacity( FlowProcess flowProcess, int defaultValue ) { String value = (String) flowProcess.getProperty( SpillableProps.MAP_CAPACITY ); if( value == null || value.length() == 0 ) return defaultValue; return Integer.parseInt( value ); }
@Override public String get( String key ) { Object value = getDelegate().getProperty( key ); if( value == null ) return null; return value.toString(); } };
public <Factory extends CascadingFactory> Factory loadFactoryFrom( FlowProcess flowProcess, String property, Class<Factory> defaultFactory ) { Object value = flowProcess.getProperty( property ); String className; if( value == null ) className = defaultFactory.getName(); else className = value.toString(); Factory factory = (Factory) createProvider( className ); // todo remove this cast if( factory != null ) factory.initialize( flowProcess ); return factory; } }
@Override public void sourcePrepare( FlowProcess<? extends Properties> flowProcess, SourceCall<LineNumberReader, InputStream> sourceCall ) throws IOException { if( !"connector-default".equals( flowProcess.getProperty( "default" ) ) ) throw new RuntimeException( "not default value" ); if( !"source-replace".equals( flowProcess.getProperty( "replace" ) ) ) throw new RuntimeException( "not replaced value" ); if( !"source-local".equals( flowProcess.getProperty( "local" ) ) ) throw new RuntimeException( "not local value" ); super.sourcePrepare( flowProcess, sourceCall ); }
@Override public void sinkPrepare( FlowProcess<? extends Properties> flowProcess, SinkCall<PrintWriter, OutputStream> sinkCall ) throws IOException { if( !"connector-default".equals( flowProcess.getProperty( "default" ) ) ) throw new RuntimeException( "not default value" ); if( !"sink-replace".equals( flowProcess.getProperty( "replace" ) ) ) throw new RuntimeException( "not replaced value" ); if( !"sink-local".equals( flowProcess.getProperty( "local" ) ) ) throw new RuntimeException( "not local value" ); super.sinkPrepare( flowProcess, sinkCall ); } }
@Override public void sinkConfInit( FlowProcess<? extends Properties> flowProcess, Tap<Properties, InputStream, OutputStream> tap, Properties conf ) { // we should not see any config def values here if( flowProcess.getProperty( "default" ) != null ) throw new RuntimeException( "default should be null" ); super.sinkConfInit( flowProcess, tap, conf ); }
@Override public void sourceConfInit( FlowProcess<? extends Configuration> flowProcess, Tap<Configuration, RecordReader, OutputCollector> tap, Configuration conf ) { // we should not see any config def values here if( flowProcess.getProperty( "default" ) != null ) throw new RuntimeException( "default should be null" ); super.sourceConfInit( flowProcess, tap, conf ); }
@Override public void sourceConfInit( FlowProcess<? extends Properties> flowProcess, Tap<Properties, InputStream, OutputStream> tap, Properties conf ) { if( !"connector-default".equals( flowProcess.getProperty( "default" ) ) ) throw new RuntimeException( "not default value" ); conf.setProperty( "replace", "source-replace" ); conf.setProperty( "local", "source-local" ); super.sourceConfInit( flowProcess, tap, conf ); }
@Override public void sourceConfInit( FlowProcess<? extends Properties> flowProcess, Tap<Properties, InputStream, OutputStream> tap, Properties conf ) { // we should not see any config def values here if( flowProcess.getProperty( "default" ) != null ) throw new RuntimeException( "default should be null" ); super.sourceConfInit( flowProcess, tap, conf ); }
@Override public void sourceConfInit( FlowProcess<? extends Configuration> flowProcess, Tap<Configuration, RecordReader, OutputCollector> tap, Configuration conf ) { // we should not see any config def values here if( flowProcess.getProperty( "default" ) != null ) throw new RuntimeException( "default should be null" ); super.sourceConfInit( flowProcess, tap, conf ); }
@Override public void sinkConfInit( FlowProcess<? extends Configuration> flowProcess, Tap<Configuration, RecordReader, OutputCollector> tap, Configuration conf ) { // we should not see any config def values here if( flowProcess.getProperty( "default" ) != null ) throw new RuntimeException( "default should be null" ); super.sinkConfInit( flowProcess, tap, conf ); }
@Override public void sinkConfInit( FlowProcess<? extends Properties> flowProcess, Tap<Properties, InputStream, OutputStream> tap, Properties conf ) { if( !"connector-default".equals( flowProcess.getProperty( "default" ) ) ) throw new RuntimeException( "not default value" ); conf.setProperty( "replace", "sink-replace" ); conf.setProperty( "local", "sink-local" ); super.sinkConfInit( flowProcess, tap, conf ); }
@Override public void sinkConfInit( FlowProcess<? extends Configuration> flowProcess, Tap<Configuration, RecordReader, OutputCollector> tap, Configuration conf ) { // we should not see any config def values here if( flowProcess.getProperty( "default" ) != null ) throw new RuntimeException( "default should be null" ); super.sinkConfInit( flowProcess, tap, conf ); }