cascading.property
Class AppProps

java.lang.Object
  extended by cascading.property.Props
      extended by cascading.property.AppProps

public class AppProps
extends Props

Class AppPros is a fluent helper for setting various application level properties that every Flow may or may not be required to have set. These properties are typically passed to a Flow via a FlowConnector.

In prior releases, the FlowConnector was responsible for setting the "application jar" class or path. Those methods have been deprecated and moved to AppProps.

New property settings that may be set in Cascading 2 are application name, version, and any tags.


Field Summary
static String APP_FRAMEWORKS
           
static String APP_ID
           
static String APP_JAR_CLASS
           
static String APP_JAR_PATH
           
static String APP_NAME
           
static String APP_TAGS
           
static String APP_VERSION
           
protected  Set<String> frameworks
           
protected  Class jarClass
           
protected  String jarPath
           
protected  String name
           
protected  Set<String> tags
           
protected  String version
           
 
Constructor Summary
AppProps()
           
AppProps(String name, String version)
          Sets the name and version of this application.
 
Method Summary
static void addApplicationFramework(Map<Object,Object> properties, String framework)
           
static void addApplicationTag(Map<Object,Object> properties, String tag)
           
 AppProps addFramework(String framework)
          Adds a new framework name to the list of frameworks used.
 AppProps addFramework(String framework, String version)
          Adds a new framework name and its version to the list of frameworks used.
 AppProps addFrameworks(String... frameworks)
          Adds new framework names to the list of frameworks used.
protected  void addPropertiesTo(Properties properties)
           
 AppProps addTag(String tag)
           
 AppProps addTags(String... tags)
           
static AppProps appProps()
           
static String getApplicationFrameworks(Map<Object,Object> properties)
           
static String getApplicationID(Map<Object,Object> properties)
           
static Class getApplicationJarClass(Map<Object,Object> properties)
          Method getApplicationJarClass returns the Class set by the setApplicationJarClass method.
static String getApplicationJarPath(Map<Object,Object> properties)
          Method getApplicationJarPath return the path set by the setApplicationJarPath method.
static String getApplicationName(Map<Object,Object> properties)
           
static String getApplicationTags(Map<Object,Object> properties)
           
static String getApplicationVersion(Map<Object,Object> properties)
           
 String getFrameworks()
          Returns a list of frameworks used to build this App.
 String getTags()
           
static void resetAppID()
          Sets the static appID value to null.
static void setApplicationID(Map<Object,Object> properties)
           
static void setApplicationJarClass(Map<Object,Object> properties, Class type)
          Method setApplicationJarClass is used to set the application jar file.
static void setApplicationJarPath(Map<Object,Object> properties, String path)
          Method setApplicationJarPath is used to set the application jar file.
static void setApplicationName(Map<Object,Object> properties, String name)
           
static void setApplicationVersion(Map<Object,Object> properties, String version)
           
 AppProps setJarClass(Class jarClass)
          Method setJarClass is used to set the application jar file.
 AppProps setJarPath(String jarPath)
          Method setJarPath is used to set the application jar file.
 AppProps setName(String name)
           
 AppProps setVersion(String version)
           
 
Methods inherited from class cascading.property.Props
buildProperties, buildProperties, buildProperties, buildProperties, setProperties, setProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APP_ID

public static final String APP_ID
See Also:
Constant Field Values

APP_NAME

public static final String APP_NAME
See Also:
Constant Field Values

APP_VERSION

public static final String APP_VERSION
See Also:
Constant Field Values

APP_TAGS

public static final String APP_TAGS
See Also:
Constant Field Values

APP_FRAMEWORKS

public static final String APP_FRAMEWORKS
See Also:
Constant Field Values

APP_JAR_CLASS

public static final String APP_JAR_CLASS
See Also:
Constant Field Values

APP_JAR_PATH

public static final String APP_JAR_PATH
See Also:
Constant Field Values

name

protected String name

version

protected String version

tags

protected Set<String> tags

jarClass

protected Class jarClass

jarPath

protected String jarPath

frameworks

protected Set<String> frameworks
Constructor Detail

AppProps

public AppProps()

AppProps

public AppProps(String name,
                String version)
Sets the name and version of this application.

Parameters:
name - of type String
version - of type String
Method Detail

appProps

public static AppProps appProps()

setApplicationJarClass

public static void setApplicationJarClass(Map<Object,Object> properties,
                                          Class type)
Method setApplicationJarClass is used to set the application jar file.

All cluster executed Cascading applications need to call setApplicationJarClass(java.util.Map, Class) or setApplicationJarPath(java.util.Map, String), otherwise ClassNotFound exceptions are likely.

Parameters:
properties - of type Map
type - of type Class

getApplicationJarClass

public static Class getApplicationJarClass(Map<Object,Object> properties)
Method getApplicationJarClass returns the Class set by the setApplicationJarClass method.

Parameters:
properties - of type Map
Returns:
Class

setApplicationJarPath

public static void setApplicationJarPath(Map<Object,Object> properties,
                                         String path)
Method setApplicationJarPath is used to set the application jar file.

All cluster executed Cascading applications need to call setApplicationJarClass(java.util.Map, Class) or setApplicationJarPath(java.util.Map, String), otherwise ClassNotFound exceptions are likely.

Parameters:
properties - of type Map
path - of type String

getApplicationJarPath

public static String getApplicationJarPath(Map<Object,Object> properties)
Method getApplicationJarPath return the path set by the setApplicationJarPath method.

Parameters:
properties - of type Map
Returns:
String

setApplicationID

public static void setApplicationID(Map<Object,Object> properties)

getApplicationID

public static String getApplicationID(Map<Object,Object> properties)

resetAppID

public static void resetAppID()
Sets the static appID value to null. For debugging purposes.


setApplicationName

public static void setApplicationName(Map<Object,Object> properties,
                                      String name)

getApplicationName

public static String getApplicationName(Map<Object,Object> properties)

setApplicationVersion

public static void setApplicationVersion(Map<Object,Object> properties,
                                         String version)

getApplicationVersion

public static String getApplicationVersion(Map<Object,Object> properties)

addApplicationTag

public static void addApplicationTag(Map<Object,Object> properties,
                                     String tag)

getApplicationTags

public static String getApplicationTags(Map<Object,Object> properties)

addApplicationFramework

public static void addApplicationFramework(Map<Object,Object> properties,
                                           String framework)

getApplicationFrameworks

public static String getApplicationFrameworks(Map<Object,Object> properties)

setName

public AppProps setName(String name)

setVersion

public AppProps setVersion(String version)

getTags

public String getTags()

addTag

public AppProps addTag(String tag)

addTags

public AppProps addTags(String... tags)

getFrameworks

public String getFrameworks()
Returns a list of frameworks used to build this App.

Returns:
Registered frameworks

addFramework

public AppProps addFramework(String framework)
Adds a new framework name to the list of frameworks used.

Higher level tools should register themselves, and preferably with their version, for example foo-flow-builder:1.2.3.

See addFramework(String, String).

Parameters:
framework - A String
Returns:
this AppProps instance

addFramework

public AppProps addFramework(String framework,
                             String version)
Adds a new framework name and its version to the list of frameworks used.

Higher level tools should register themselves, and preferably with their version, for example foo-flow-builder:1.2.3.

Parameters:
framework - A String
Returns:
this AppProps instance

addFrameworks

public AppProps addFrameworks(String... frameworks)
Adds new framework names to the list of frameworks used.

Higher level tools should register themselves, and preferably with their version, for example foo-flow-builder:1.2.3.

Parameters:
frameworks - Strings
Returns:
this AppProps instance

setJarClass

public AppProps setJarClass(Class jarClass)
Method setJarClass is used to set the application jar file.

All cluster executed Cascading applications need to call setApplicationJarClass(java.util.Map, Class) or setApplicationJarPath(java.util.Map, String), otherwise ClassNotFound exceptions are likely.

Parameters:
jarClass - of type Class

setJarPath

public AppProps setJarPath(String jarPath)
Method setJarPath is used to set the application jar file.

All cluster executed Cascading applications need to call setJarClass(Class) or setJarPath(java.util.Map, String), otherwise ClassNotFound exceptions are likely.

Parameters:
jarPath - of type String

addPropertiesTo

protected void addPropertiesTo(Properties properties)
Specified by:
addPropertiesTo in class Props


Copyright © 2007-2012 Concurrent, Inc. All Rights Reserved.