Class ConfigurationUtils


  • public class ConfigurationUtils
    extends Object
    • Constructor Detail

      • ConfigurationUtils

        public ConfigurationUtils()
    • 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) The Computation 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)