Class JobRequest.Builder

    • Constructor Detail

      • Builder

        public Builder​(java.lang.String name,
                       java.lang.String user,
                       java.lang.String version,
                       java.util.List<ClusterCriteria> clusterCriterias,
                       java.util.Set<java.lang.String> commandCriteria)
        Constructor which has required fields.
        Parameters:
        name - The name to use for the Job
        user - The user to use for the Job
        version - The version to use for the Job
        clusterCriterias - The list of cluster criteria for the Job
        commandCriteria - The list of command criteria for the Job
        Since:
        3.3.0
      • Builder

        @Deprecated
        public Builder​(java.lang.String name,
                       java.lang.String user,
                       java.lang.String version,
                       @Nullable
                       java.lang.String commandArgs,
                       java.util.List<ClusterCriteria> clusterCriterias,
                       java.util.Set<java.lang.String> commandCriteria)
        Constructor which has required fields.

        DEPRECATED: Will be removed in 4.0.0 as command args are optional and should be a List now

        Parameters:
        name - The name to use for the Job
        user - The user to use for the Job
        version - The version to use for the Job
        commandArgs - The command line arguments for the Job
        clusterCriterias - The list of cluster criteria for the Job
        commandCriteria - The list of command criteria for the Job
    • Method Detail

      • withCommandArgs

        @Deprecated
        public JobRequest.Builder withCommandArgs​(@Nullable
                                                  java.lang.String commandArgs)
        Deprecated.
        The command arguments to use in conjunction witOh the command executable selected for this job.

        DEPRECATED: This API will be removed in 4.0.0 in favor of the List based method for improved control over escaping of arguments.

        Parameters:
        commandArgs - The command args. Max length is 10,000 characters
        Returns:
        The builder
        Since:
        3.3.0
      • withCommandArgs

        public JobRequest.Builder withCommandArgs​(@Nullable
                                                  java.util.List<java.lang.String> commandArgs)
        The command arguments to use in conjunction with the command executable selected for this job.
        Parameters:
        commandArgs - The command args. The maximum combined length of the command args plus one space between each argument must be less than or equal to 10,000 characters
        Returns:
        The builder
        Since:
        3.3.0
      • withGroup

        public JobRequest.Builder withGroup​(@Nullable
                                            java.lang.String group)
        Set the group for the job.
        Parameters:
        group - The group
        Returns:
        The builder
      • withDisableLogArchival

        public JobRequest.Builder withDisableLogArchival​(boolean disableLogArchival)
        Set whether to disable log archive for the job.
        Parameters:
        disableLogArchival - true if you want to disable log archival
        Returns:
        The builder
      • withEmail

        public JobRequest.Builder withEmail​(@Nullable
                                            java.lang.String email)
        Set the email to use for alerting of job completion. If no alert desired leave blank.
        Parameters:
        email - the email address to use
        Returns:
        The builder
      • withCpu

        public JobRequest.Builder withCpu​(@Nullable
                                          java.lang.Integer cpu)
        Set the number of cpu's being requested to run the job. Defaults to 1 if not set.
        Parameters:
        cpu - The number of cpu's. Must be greater than 0.
        Returns:
        The builder
      • withMemory

        public JobRequest.Builder withMemory​(@Nullable
                                             java.lang.Integer memory)
        Set the amount of memory being requested to run the job..
        Parameters:
        memory - The amount of memory in terms of MB's. Must be greater than 0.
        Returns:
        The builder
      • withApplications

        public JobRequest.Builder withApplications​(@Nullable
                                                   java.util.List<java.lang.String> applications)
        Set the ids of applications to override the default applications from the command with.
        Parameters:
        applications - The ids of applications to override
        Returns:
        The builder
      • withTimeout

        public JobRequest.Builder withTimeout​(@Nullable
                                              java.lang.Integer timeout)
        Set the length of the job timeout in seconds after which Genie will kill the client process.
        Parameters:
        timeout - The timeout to use
        Returns:
        The builder
      • withGrouping

        public JobRequest.Builder withGrouping​(@Nullable
                                               java.lang.String grouping)
        Set the grouping to use for this job.
        Parameters:
        grouping - The grouping
        Returns:
        The builder
        Since:
        3.3.0
      • withGroupingInstance

        public JobRequest.Builder withGroupingInstance​(@Nullable
                                                       java.lang.String groupingInstance)
        Set the grouping instance to use for this job.
        Parameters:
        groupingInstance - The grouping instance
        Returns:
        The builder
        Since:
        3.3.0
      • build

        public JobRequest build()
        Build the job request.
        Returns:
        Create the final read-only JobRequest instance