public ImageJob deepCopy() { return new ImageJob(this); }
public java.lang.Object getFieldValue(_Fields field) { switch (field) { case NAME: return getName(); case FRAGMENT_SOURCE: return getFragmentSource(); case VERTEX_SOURCE: return getVertexSource(); case COMPUTE_SOURCE: return getComputeSource(); case UNIFORMS_INFO: return getUniformsInfo(); case COMPUTE_INFO: return getComputeInfo(); case POINTS: return getPoints(); case TEXTURE_POINTS: return getTexturePoints(); case TEXTURE_BINARY: return getTextureBinary(); case SKIP_RENDER: return isSkipRender(); case RESULT: return getResult(); } throw new java.lang.IllegalStateException(); }
case NAME: if (value == null) { unsetName(); } else { setName((java.lang.String)value); unsetFragmentSource(); } else { setFragmentSource((java.lang.String)value); unsetVertexSource(); } else { setVertexSource((java.lang.String)value); unsetComputeSource(); } else { setComputeSource((java.lang.String)value); unsetUniformsInfo(); } else { setUniformsInfo((java.lang.String)value); unsetComputeInfo(); } else { setComputeInfo((java.lang.String)value); unsetPoints(); } else { setPoints((java.util.List<java.lang.Double>)value);
return isSetName(); case FRAGMENT_SOURCE: return isSetFragmentSource(); case VERTEX_SOURCE: return isSetVertexSource(); case COMPUTE_SOURCE: return isSetComputeSource(); case UNIFORMS_INFO: return isSetUniformsInfo(); case COMPUTE_INFO: return isSetComputeInfo(); case POINTS: return isSetPoints(); case TEXTURE_POINTS: return isSetTexturePoints(); case TEXTURE_BINARY: return isSetTextureBinary(); case SKIP_RENDER: return isSetSkipRender(); case RESULT: return isSetResult();
@Override public ImageJobResult getImage(ImageJob imageJob) throws ShaderDispatchException, InterruptedException { // For running shaders locally, we write the necessary files to a temp directory, // run the get_image tool, and then collect the results in an ImageJobResult. // Due to strange Thrift behaviour, we set this default value explicitly // otherwise "isSetSkipRender()" is false. if (!imageJob.isSetSkipRender()) { imageJob.setSkipRender(false); } File localTempShaderJobFile = new File( tempDir, (imageJob.getName() != null ? imageJob.getName() + ".json" : "temp.json") ); try { return fileOps.runGetImageOnImageJob(imageJob, localTempShaderJobFile, usingSwiftShader); } catch (IOException exception) { throw new ShaderDispatchException(exception); } }
if (imageJob.isSetComputeSource()) { writeStringToFile( new File(outputShaderJobFileNoExtension + ".json"), imageJob.getComputeInfo()); imageJob.getComputeSource()); imageJob.getUniformsInfo()); if (imageJob.getVertexSource() != null) { writeStringToFile( new File(outputShaderJobFileNoExtension + ".vert"), imageJob.getVertexSource()); if (imageJob.getFragmentSource() != null) { writeStringToFile( new File(outputShaderJobFileNoExtension + ".frag"), imageJob.getFragmentSource()); if (imageJob.getComputeSource() != null) { writeStringToFile( new File(outputShaderJobFileNoExtension + ".comp"), imageJob.getComputeSource());
ImageJob imageJob = new ImageJob(); fileOps.readShaderJobFileToImageJob(shaderJobFile, imageJob); imageJob.setSkipRender(skipRender);
private List<String> getJobQueueAsJobInfoList(Queue<IServerJob> jobQueue) { List<String> res = new ArrayList<>(); for (IServerJob job : jobQueue) { if (job instanceof SingleJob) { SingleJob sj = (SingleJob) job; if (sj.job.isSetImageJob()) { ImageJob ij = sj.job.getImageJob(); StringBuilder infoString = new StringBuilder(); if (ij.isSetName()) { infoString.append(ij.getName()); } if (ij.isSetName()) { infoString.append(ij.getName()); infoString.append("; "); } res.add(infoString.toString()); continue; } } // otherwise: res.add(job.toString()); } return res; }
logmsg.append("jobDone(): JobId#" + job.getJobId() + " Queue has size: " + session.jobQueue.size()); if (job.isSetImageJob() && job.getImageJob().isSetResult()) { logmsg.append(" job status: " + job.getImageJob().getResult().getStatus());
@Override public void read(org.apache.thrift.protocol.TProtocol prot, Job struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.jobId = iprot.readI64(); struct.setJobIdIsSet(true); java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.noJob = new NoJob(); struct.noJob.read(iprot); struct.setNoJobIsSet(true); } if (incoming.get(1)) { struct.imageJob = new ImageJob(); struct.imageJob.read(iprot); struct.setImageJobIsSet(true); } if (incoming.get(2)) { struct.skipJob = new SkipJob(); struct.skipJob.read(iprot); struct.setSkipJobIsSet(true); } } }
private ImageJobResult getImageHelper( ImageJob imageJob, FuzzerServiceManager.Iface fuzzerServiceManagerProxy) throws TException { final Job job = new Job() .setJobId(jobCounter.incrementAndGet()) .setImageJob(imageJob); return fuzzerServiceManagerProxy.submitJob(job, worker, retryLimit) .getImageJob() .getResult(); }
} else if (res.isSetImageJob()) { logmsg.append("(name: "); logmsg.append(res.getImageJob().getName()); logmsg.append(")"); } else {
hashCode = hashCode * 8191 + ((isSetName()) ? 131071 : 524287); if (isSetName()) hashCode = hashCode * 8191 + name.hashCode(); hashCode = hashCode * 8191 + ((isSetFragmentSource()) ? 131071 : 524287); if (isSetFragmentSource()) hashCode = hashCode * 8191 + fragmentSource.hashCode(); hashCode = hashCode * 8191 + ((isSetVertexSource()) ? 131071 : 524287); if (isSetVertexSource()) hashCode = hashCode * 8191 + vertexSource.hashCode(); hashCode = hashCode * 8191 + ((isSetComputeSource()) ? 131071 : 524287); if (isSetComputeSource()) hashCode = hashCode * 8191 + computeSource.hashCode(); hashCode = hashCode * 8191 + ((isSetUniformsInfo()) ? 131071 : 524287); if (isSetUniformsInfo()) hashCode = hashCode * 8191 + uniformsInfo.hashCode(); hashCode = hashCode * 8191 + ((isSetComputeInfo()) ? 131071 : 524287); if (isSetComputeInfo()) hashCode = hashCode * 8191 + computeInfo.hashCode(); hashCode = hashCode * 8191 + ((isSetPoints()) ? 131071 : 524287); if (isSetPoints()) hashCode = hashCode * 8191 + points.hashCode(); hashCode = hashCode * 8191 + ((isSetTexturePoints()) ? 131071 : 524287);
@Override public ImageJobResult getImage(ImageJob imageJob) throws ShaderDispatchException { LOGGER.info("Get image (via server) job: {}", imageJob.getName()); // Due to strange Thrift behaviour, we set this default value explicitly // otherwise "isSetSkipRender()" is false. if (!imageJob.isSetSkipRender()) { imageJob.setSkipRender(false); } // Optimisation: no need to actually use HTTP if we are on the server. if (fuzzerServiceManager != null) { try { return getImageHelper(imageJob, fuzzerServiceManager); } catch (TException exception) { throw new ShaderDispatchException(exception); } } else { try (CloseableHttpClient httpClient = HttpClients.createDefault()) { return getImageHelper(imageJob, getFuzzerServiceManagerProxy(httpClient)); } catch (IOException | TException exception) { throw new ShaderDispatchException(exception); } } }
ImageJob imageJob = new ImageJob(); fileOps.readShaderJobFileToImageJob(shaderJobFile, imageJob); imageJob.setSkipRender(false);
if (other.isSetName()) { this.name = other.name; if (other.isSetFragmentSource()) { this.fragmentSource = other.fragmentSource; if (other.isSetVertexSource()) { this.vertexSource = other.vertexSource; if (other.isSetComputeSource()) { this.computeSource = other.computeSource; if (other.isSetUniformsInfo()) { this.uniformsInfo = other.uniformsInfo; if (other.isSetComputeInfo()) { this.computeInfo = other.computeInfo; if (other.isSetPoints()) { java.util.List<java.lang.Double> __this__points = new java.util.ArrayList<java.lang.Double>(other.points); this.points = __this__points; if (other.isSetTexturePoints()) { java.util.List<java.lang.Double> __this__texturePoints = new java.util.ArrayList<java.lang.Double>(other.texturePoints); this.texturePoints = __this__texturePoints; if (other.isSetTextureBinary()) { this.textureBinary = org.apache.thrift.TBaseHelper.copyBinary(other.textureBinary);
ImageJob imageJob = new ImageJob(); fileOps.readShaderJobFileToImageJob(shaderJobFile, imageJob);
boolean this_present_name = true && this.isSetName(); boolean that_present_name = true && that.isSetName(); if (this_present_name || that_present_name) { if (!(this_present_name && that_present_name)) boolean this_present_fragmentSource = true && this.isSetFragmentSource(); boolean that_present_fragmentSource = true && that.isSetFragmentSource(); if (this_present_fragmentSource || that_present_fragmentSource) { if (!(this_present_fragmentSource && that_present_fragmentSource)) boolean this_present_vertexSource = true && this.isSetVertexSource(); boolean that_present_vertexSource = true && that.isSetVertexSource(); if (this_present_vertexSource || that_present_vertexSource) { if (!(this_present_vertexSource && that_present_vertexSource)) boolean this_present_computeSource = true && this.isSetComputeSource(); boolean that_present_computeSource = true && that.isSetComputeSource(); if (this_present_computeSource || that_present_computeSource) { if (!(this_present_computeSource && that_present_computeSource)) boolean this_present_uniformsInfo = true && this.isSetUniformsInfo(); boolean that_present_uniformsInfo = true && that.isSetUniformsInfo(); if (this_present_uniformsInfo || that_present_uniformsInfo) { if (!(this_present_uniformsInfo && that_present_uniformsInfo)) boolean this_present_computeInfo = true && this.isSetComputeInfo(); boolean that_present_computeInfo = true && that.isSetComputeInfo(); if (this_present_computeInfo || that_present_computeInfo) { if (!(this_present_computeInfo && that_present_computeInfo))
/** * Performs a deep copy on <i>other</i>. */ public Job(Job other) { __isset_bitfield = other.__isset_bitfield; this.jobId = other.jobId; if (other.isSetNoJob()) { this.noJob = new NoJob(other.noJob); } if (other.isSetImageJob()) { this.imageJob = new ImageJob(other.imageJob); } if (other.isSetSkipJob()) { this.skipJob = new SkipJob(other.skipJob); } }