Class InternalUtilities

    • Field Detail

      • LOG

        public static final org.apache.commons.logging.Log LOG
    • Constructor Detail

      • InternalUtilities

        public InternalUtilities()
    • Method Detail

      • getInputContentSource

        public static com.marklogic.xcc.ContentSource getInputContentSource​(org.apache.hadoop.conf.Configuration conf)
                                                                     throws URISyntaxException,
                                                                            com.marklogic.xcc.exceptions.XccConfigException,
                                                                            IOException
        Get content source for input server.
        Parameters:
        conf - job configuration.
        Returns:
        ContentSource for input server.
        Throws:
        URISyntaxException
        com.marklogic.xcc.exceptions.XccConfigException
        IOException
      • getInputContentSource

        public static com.marklogic.xcc.ContentSource getInputContentSource​(org.apache.hadoop.conf.Configuration conf,
                                                                            String host)
                                                                     throws com.marklogic.xcc.exceptions.XccConfigException,
                                                                            IOException
        Get input content source.
        Parameters:
        conf - job configuration
        host - host to connect to
        Returns:
        content source
        Throws:
        IOException
        com.marklogic.xcc.exceptions.XccConfigException
      • assignResultValue

        public static <VALUEIN> void assignResultValue​(Class<? extends org.apache.hadoop.io.Writable> valueClass,
                                                       com.marklogic.xcc.ResultItem result,
                                                       VALUEIN value)
        Assign value in Writable type from XCC result item.
        Type Parameters:
        VALUEIN -
        Parameters:
        valueClass -
        result -
        value -
      • getOutputContentSource

        public static com.marklogic.xcc.ContentSource getOutputContentSource​(org.apache.hadoop.conf.Configuration conf,
                                                                             String hostName)
                                                                      throws com.marklogic.xcc.exceptions.XccConfigException,
                                                                             IOException
        Get output content source.
        Parameters:
        conf - job configuration
        hostName - host name
        Returns:
        content source
        Throws:
        IOException
        com.marklogic.xcc.exceptions.XccConfigException
        IOException
      • getHost

        public static String getHost​(TextArrayWritable hosts)
                              throws IOException
        Return the host from the host array based on a random fashion
        Parameters:
        hosts - a WritableArray of host names
        Returns:
        the host name
        Throws:
        IOException
      • newValue

        public static com.marklogic.xcc.types.XdmValue newValue​(com.marklogic.xcc.types.ValueType valueType,
                                                                Object value)
        Create new XdmValue from value type and Writables.
      • getUriWithOutputDir

        public static String getUriWithOutputDir​(DocumentURI key,
                                                 String outputDir)
        If outputDir is available and valid, modify DocumentURI, and return uri in string
        Parameters:
        key -
        outputDir -
        Returns:
        URI
      • compareUnsignedLong

        public static int compareUnsignedLong​(long x,
                                              long y)
      • checkQueryLanguage

        public static void checkQueryLanguage​(String s)
      • verifyHosts

        public static void verifyHosts​(String hostList,
                                       String portStr)