private JobEvent(Builder builder) { this.jobId = Preconditions.checkNotNull(builder.jobId); this.inputModuleName = Preconditions.checkNotNull(builder.inputModuleName); this.bindings = ImmutableSortedMap.copyOf(builder.bindings); this.status = Preconditions.checkNotNull(builder.status); this.message = builder.message == null ? status.defaultMessage : builder.message; this.arguments = ImmutableList.copyOf(builder.args); this.tags = ImmutableList.copyOf(builder.tags); this.metricMap = ImmutableSortedMap.copyOf(builder.metricMap); // The following fields may be null. this.outputModuleName = builder.outputModuleName; this.compileDir = builder.compileDir; this.compileStrategy = builder.compileStrategy; // Any new fields added should allow nulls for backward compatibility. }
private JobEvent(Builder builder) { this.jobId = Preconditions.checkNotNull(builder.jobId); this.inputModuleName = Preconditions.checkNotNull(builder.inputModuleName); this.bindings = ImmutableSortedMap.copyOf(builder.bindings); this.status = Preconditions.checkNotNull(builder.status); this.message = builder.message == null ? status.defaultMessage : builder.message; this.arguments = ImmutableList.copyOf(builder.args); this.tags = ImmutableList.copyOf(builder.tags); this.metricMap = ImmutableSortedMap.copyOf(builder.metricMap); // The following fields may be null. this.outputModuleName = builder.outputModuleName; this.compileDir = builder.compileDir; this.compileStrategy = builder.compileStrategy; // Any new fields added should allow nulls for backward compatibility. }
/** * Creates a job to update an outbox. * @param bindingProperties Properties that uniquely identify a permutation. * (Otherwise, more than one permutation will be compiled.) * @param parentLogger The parent of the logger that will be used for this job. */ Job(Outbox box, Map<String, String> bindingProperties, TreeLogger parentLogger, Options options) { this.id = chooseNextId(box); this.outbox = box; this.inputModuleName = box.getInputModuleName(); // TODO: we will use the binding properties to find or create the outbox, // then take binding properties from the outbox here. this.bindingProperties = ImmutableSortedMap.copyOf(bindingProperties); this.recompileListener = Preconditions.checkNotNull(options.getRecompileListener()); this.jobChangeListener = Preconditions.checkNotNull(options.getJobChangeListener()); this.args = Preconditions.checkNotNull(options.getArgs()); this.tags = Preconditions.checkNotNull(options.getTags()); this.logSupplier = new LogSupplier(parentLogger, id); }
/** * Creates a job to update an outbox. * @param bindingProperties Properties that uniquely identify a permutation. * (Otherwise, more than one permutation will be compiled.) * @param parentLogger The parent of the logger that will be used for this job. */ Job(Outbox box, Map<String, String> bindingProperties, TreeLogger parentLogger, Options options) { this.id = chooseNextId(box); this.outbox = box; this.inputModuleName = box.getInputModuleName(); // TODO: we will use the binding properties to find or create the outbox, // then take binding properties from the outbox here. this.bindingProperties = ImmutableSortedMap.copyOf(bindingProperties); this.recompileListener = Preconditions.checkNotNull(options.getRecompileListener()); this.jobChangeListener = Preconditions.checkNotNull(options.getJobChangeListener()); this.args = Preconditions.checkNotNull(options.getArgs()); this.tags = Preconditions.checkNotNull(options.getTags()); this.logSupplier = new LogSupplier(parentLogger, id); }