Package com.alibaba.graphscope.utils
Class ConfigurationUtils
- java.lang.Object
-
- com.alibaba.graphscope.utils.ConfigurationUtils
-
public class ConfigurationUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringAPP_CLASS_STRstatic StringEDGE_INPUT_FORMAT_CLASS_STRstatic StringEDGE_MANAGER_STRstatic StringMASTER_COMPUTE_CLASS_STRstatic StringMESSAGE_COMBINER_CLASS_STRstatic StringVERTEX_INPUT_FORMAT_CLASS_STRstatic StringVERTEX_OUTPUT_FORMAT_CLASS_STRstatic StringVERTEX_OUTPUT_FORMAT_SUBDIR_STRstatic StringVERTEX_OUTPUT_PATH_STRstatic StringWORKER_CONTEXT_CLASS_STR
-
Constructor Summary
Constructors Constructor Description ConfigurationUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancheckTypeConsistency(Class<?> grapeTypeClass, Class<? extends org.apache.hadoop.io.Writable> giraphTypeClass)static voidconfigureIfPossible(Object object, ImmutableClassesGiraphConfiguration configuration)Configure an object with anImmutableClassesGiraphConfigurationif that objects supports it.static Class<? extends org.apache.giraph.conf.TypesHolder>getTypesHolderClass(org.apache.hadoop.conf.Configuration conf)Get a class which is parameterized by the graph types defined by user.static voidparseArgs(GiraphConfiguration giraphConfiguration, com.alibaba.fastjson.JSONObject jsonObject)Translate CLI arguments to GiraphRunner into Configuration Key-Value pairs.static voidparseJavaFragment(GiraphConfiguration giraphConfiguration, IFragment fragment)For input IFragment, we check parse the type arguments, and set to giraphConfiguration.
-
-
-
Field Detail
-
APP_CLASS_STR
public static final String APP_CLASS_STR
- See Also:
- Constant Field Values
-
WORKER_CONTEXT_CLASS_STR
public static final String WORKER_CONTEXT_CLASS_STR
- See Also:
- Constant Field Values
-
VERTEX_INPUT_FORMAT_CLASS_STR
public static final String VERTEX_INPUT_FORMAT_CLASS_STR
- See Also:
- Constant Field Values
-
EDGE_INPUT_FORMAT_CLASS_STR
public static final String EDGE_INPUT_FORMAT_CLASS_STR
- See Also:
- Constant Field Values
-
VERTEX_OUTPUT_FORMAT_CLASS_STR
public static final String VERTEX_OUTPUT_FORMAT_CLASS_STR
- See Also:
- Constant Field Values
-
VERTEX_OUTPUT_FORMAT_SUBDIR_STR
public static final String VERTEX_OUTPUT_FORMAT_SUBDIR_STR
- See Also:
- Constant Field Values
-
VERTEX_OUTPUT_PATH_STR
public static final String VERTEX_OUTPUT_PATH_STR
- See Also:
- Constant Field Values
-
MESSAGE_COMBINER_CLASS_STR
public static final String MESSAGE_COMBINER_CLASS_STR
- See Also:
- Constant Field Values
-
MASTER_COMPUTE_CLASS_STR
public static final String MASTER_COMPUTE_CLASS_STR
- See Also:
- Constant Field Values
-
EDGE_MANAGER_STR
public static final String EDGE_MANAGER_STR
- See Also:
- Constant Field Values
-
-
Method Detail
-
parseArgs
public static void parseArgs(GiraphConfiguration giraphConfiguration, com.alibaba.fastjson.JSONObject jsonObject) throws ClassNotFoundException
Translate CLI arguments to GiraphRunner into Configuration Key-Value pairs.- Parameters:
giraphConfiguration- configuration to set.jsonObject- input json params- Throws:
ClassNotFoundException
-
getTypesHolderClass
public static Class<? extends org.apache.giraph.conf.TypesHolder> getTypesHolderClass(org.apache.hadoop.conf.Configuration conf)
Get a class which is parameterized by the graph types defined by user. The types holder is actually an interface that any class which holds all of Giraph types can implement. It is used with reflection to infer the Giraph types.The current order of type holders we try are: 1) The
TypesHolderclass directly. 2) TheComputationclass, as that holds all the types.- Parameters:
conf- Configuration- Returns:
TypesHolderor null if could not find one.
-
parseJavaFragment
public static void parseJavaFragment(GiraphConfiguration giraphConfiguration, IFragment fragment)
For input IFragment, we check parse the type arguments, and set to giraphConfiguration.- Parameters:
giraphConfiguration- configuration to set.fragment- IFragment obj.
-
checkTypeConsistency
public static boolean checkTypeConsistency(Class<?> grapeTypeClass, Class<? extends org.apache.hadoop.io.Writable> giraphTypeClass)
-
configureIfPossible
public static void configureIfPossible(Object object, ImmutableClassesGiraphConfiguration configuration)
Configure an object with anImmutableClassesGiraphConfigurationif that objects supports it.- Parameters:
object- The object to configureconfiguration- The configuration
-
-