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 String
APP_CLASS_STR
static String
EDGE_INPUT_FORMAT_CLASS_STR
static String
EDGE_MANAGER_STR
static String
MASTER_COMPUTE_CLASS_STR
static String
MESSAGE_COMBINER_CLASS_STR
static String
VERTEX_INPUT_FORMAT_CLASS_STR
static String
VERTEX_OUTPUT_FORMAT_CLASS_STR
static String
VERTEX_OUTPUT_FORMAT_SUBDIR_STR
static String
VERTEX_OUTPUT_PATH_STR
static String
WORKER_CONTEXT_CLASS_STR
-
Constructor Summary
Constructors Constructor Description ConfigurationUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
checkTypeConsistency(Class<?> grapeTypeClass, Class<? extends org.apache.hadoop.io.Writable> giraphTypeClass)
static void
configureIfPossible(Object object, ImmutableClassesGiraphConfiguration configuration)
Configure an object with anImmutableClassesGiraphConfiguration
if 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 void
parseArgs(GiraphConfiguration giraphConfiguration, com.alibaba.fastjson.JSONObject jsonObject)
Translate CLI arguments to GiraphRunner into Configuration Key-Value pairs.static void
parseJavaFragment(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
TypesHolder
class directly. 2) TheComputation
class, as that holds all the types.- Parameters:
conf
- Configuration- Returns:
TypesHolder
or 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 anImmutableClassesGiraphConfiguration
if that objects supports it.- Parameters:
object
- The object to configureconfiguration
- The configuration
-
-