public interface Peach
setExecutable or addExeFile
should be called. Also setJobs must be called, otherwise
a project won't be created.execute() can be
called. With normal configurateion the execute method will create all
bundles if required depending on the saved state. After the bundles are
created it will create a project and start it.nextFile() method will return the result
files one per each call. If streaming is used the method will return with
a file as soon as one is available, otherwise it will return when all
results have been downloaded. When no more files are available
nextFile returns null.done() method must be called.
This will clean up everything.| Modifier and Type | Method and Description |
|---|---|
void |
addDataFile(java.lang.String file)
Add a file into the current data bundle.
|
void |
addDataFile(java.lang.String file,
java.lang.String targetName)
Add a file into the current data bundle.
|
void |
addDataFileWithDir(java.lang.String dir,
java.lang.String file)
Add a file from a directory into the current data bundle.
|
void |
addExeFile(java.lang.String file)
Add a file into the Executor bundle.
|
void |
addExeFile(java.lang.String res,
java.lang.String file)
Add a file into the Executor bundle with given resource name.
|
void |
addExeFile(java.lang.String res,
java.lang.String file,
java.lang.String osname)
Add a file into the Executor bundle with given parameters.
|
void |
addExeFile(java.lang.String res,
java.lang.String file,
java.lang.String osname,
java.lang.String processor)
Add a file into the Executor bundle with given parameters.
|
void |
addExeImport(java.lang.String importName)
Add an import for the Executor bundle.
|
void |
addJobFile(java.lang.String... files)
Add files to be included in the Job Input Bundle.
|
void |
addJobFileWithDir(java.lang.String dir,
java.lang.String... files)
Add files from a directory to be included in the Job Input Bundle.
|
void |
addOutputFile(java.lang.String def)
Add an outpuf file definition, eg.
|
void |
addParamExternalResource(java.lang.String res)
Add External Resource to Parameter Bundle.
|
void |
addParamFile(java.lang.String file)
Add a file into the parameter bundle.
|
void |
addParamFile(java.lang.String file,
java.lang.String targetName)
Add a file into the parameter bundle and specify target name.
|
void |
addParamFileWithDir(java.lang.String dir,
java.lang.String file)
Add file into parameter bundle from a given directory.
|
void |
addParamImport(java.lang.String importName)
Add an import for the Parameter bundle.
|
void |
addSourceFile(java.lang.String file)
Add a source file.
|
void |
done()
Mark Peach call as done.
|
int |
execute()
Run the Peach.
|
java.lang.String |
getLastErrorMessage() |
java.lang.String |
getParamBundleName()
Get Name of the Parameter bundle.
|
int |
getProjectHandle()
Get the handle used for project commands.
|
int |
getProjectId()
Get the project ID of the current project.
|
void |
newDataBundle()
Start defining a new data bundle.
|
void |
newDataBundle(java.lang.String name)
Use a named databundle that already exists on the server...
|
java.lang.String |
nextFile()
Get the result file.
|
void |
postProcessed(int count) |
void |
putAllDataExtras(java.util.Map<java.lang.String,java.lang.String> extras)
Put all values of given Map into the data bundles extra parameters.
|
void |
putAllExeExtras(java.util.Map<java.lang.String,java.lang.String> extras)
Put all values of given Map into the Executor bundles extra parameters.
|
void |
putAllJobExtras(java.util.Map<java.lang.String,java.lang.String> extras)
Put all values of given Map into the Job Input Bundles extra parameters.
|
void |
putAllParamExtras(java.util.Map<java.lang.String,java.lang.String> extras)
Put all values of given Map into the parameters bundles extra
parameters.
|
void |
putAllProjectParams(java.util.Map<java.lang.String,java.lang.String> params)
Put all values of a given Map into project parameters.
|
void |
putAllSourceExtras(java.util.Map<java.lang.String,java.lang.String> extras)
Put all values of given Map into the source bundles extra parameters.
|
void |
putDataExtras(java.lang.String name,
java.lang.String value)
Put a value into the current data bundles extra parameters.
|
void |
putExeExtras(java.lang.String name,
java.lang.String value)
Put a value into the Executor bundles extra parameters.
|
void |
putJobExtras(java.lang.String name,
java.lang.String value)
Put a value into the Job Input Bundle extra parameters.
|
void |
putParamExtras(java.lang.String name,
java.lang.String value)
Put a value into the parameter bundles extra parameters.
|
void |
putProjectParam(java.lang.String name,
java.lang.String value)
Set a project parameter to a given value.
|
void |
putSourceExtras(java.lang.String name,
java.lang.String value)
Store source extra parameters.
|
void |
setAllowPartial(boolean allowPartial)
Allow partial results in download.
|
void |
setCleanup(boolean cleanup)
Cleanup handle temporary files at done().
|
void |
setClose(boolean close)
Close the handle at done().
|
void |
setDataCopy(boolean copy)
Set the bundle files copy parameter.
|
void |
setDataResource(java.lang.String resource)
Set Resources parameter for the data bundle.
|
void |
setDataSkipDigest(boolean skipDigest)
Set the skip digest bit for current data bundle.
|
void |
setDescription(java.lang.String description)
Set the description.
|
void |
setExeBundleName(java.lang.String name)
Use a precreated executor bundle.
|
void |
setExecutable(java.lang.String executable)
Set the executable.
|
void |
setExeSkipDigest(boolean skipDigest)
Set the skip digest bit for the executor bundle.
|
void |
setIntermediateResultHandler(IntermediateResultHandler irh) |
void |
setJavaExecutable()
Set the executable to use worker installed Java binary.
|
void |
setJobFileNames(java.lang.String... names)
Set job input file names.
|
void |
setJobParams(java.util.Vector<java.util.Hashtable<java.lang.String,java.lang.String>> jobParams)
Set the parameters for the jobs to be created.
|
void |
setJobs(int jobs)
Set number of jobs to be created.
|
void |
setJobSkipDigest(boolean skipDigest)
Set the skip digest bit for job input bundle.
|
void |
setMessages(boolean messages)
Enable messages printing.
|
void |
setName(java.lang.String name)
Set the peach name.
|
void |
setParamBundleName(java.lang.String name)
Set Name of the Parameter bundle.
|
void |
setParamBundleVersion(java.lang.String version)
Set Version of the Parameter bundle.
|
void |
setParamCopy(boolean copy)
Set the parameter bundle copy parameters.
|
void |
setParamResource(java.lang.String resource)
Set Resources parameter for the Parameter bundle.
|
void |
setParamSkipDigest(boolean skipDigest)
Set the Parameter bundle skip digest bit.
|
void |
setPeachVector(java.util.Vector<java.lang.String> peachVector)
Set the peachparam parameter for the jobs to be created.
|
void |
setPriority(int priority)
Set the project priority.
|
void |
setPriority(java.lang.String priority)
Set the project priority in String format.
|
void |
setProjectId(int projectid)
Set project ID.
|
void |
setRemove(boolean remove)
Remove project after it is done (done within done()).
|
void |
setResultFile(java.lang.String resultFile)
Set the result file to be used.
|
void |
setStateDir(java.lang.String stateDir)
Set the directory where state files are stored.
|
void |
setStream(boolean stream)
Set streaming mode.
|
void |
setUseDefaultOutputFile(boolean use)
When no output files are defined a default (techila_peach_result.dat)
is used in executor bundle definition.
|
boolean |
sourcesChanged()
Check if the source files have changed compared to saved state.
|
void setStateDir(java.lang.String stateDir)
stateDir - the directoryvoid setName(java.lang.String name)
name - the namevoid setDescription(java.lang.String description)
description - descriptionvoid setMessages(boolean messages)
messages - true or falsevoid setPriority(int priority)
priority - void setPriority(java.lang.String priority)
priority - Priority stringvoid setProjectId(int projectid)
projectid - void setResultFile(java.lang.String resultFile)
resultFile - void setJobs(int jobs)
jobs - void setPeachVector(java.util.Vector<java.lang.String> peachVector)
peachVector - void setJobParams(java.util.Vector<java.util.Hashtable<java.lang.String,java.lang.String>> jobParams)
jobParams - void setAllowPartial(boolean allowPartial)
allowPartial - void setRemove(boolean remove)
remove - done()void setCleanup(boolean cleanup)
cleanup - void setClose(boolean close)
close - void addSourceFile(java.lang.String file)
file - source file namevoid putSourceExtras(java.lang.String name,
java.lang.String value)
name - name of the parametervalue - value of the parametervoid putAllSourceExtras(java.util.Map<java.lang.String,java.lang.String> extras)
extras - boolean sourcesChanged()
void setExeBundleName(java.lang.String name)
name - name of the bundlevoid setExecutable(java.lang.String executable)
executable - void setJavaExecutable()
void setExeSkipDigest(boolean skipDigest)
skipDigest - void addExeFile(java.lang.String file)
file - void addExeFile(java.lang.String res,
java.lang.String file)
res - resource name, if null the file basename is usedfile - the actual file (with path if not in the current directory)void addExeFile(java.lang.String res,
java.lang.String file,
java.lang.String osname)
res - file - osname - void addExeFile(java.lang.String res,
java.lang.String file,
java.lang.String osname,
java.lang.String processor)
res - resource namefile - the file name (with path)osname - osnameprocessor - processor architechturevoid putExeExtras(java.lang.String name,
java.lang.String value)
name - value - void putAllExeExtras(java.util.Map<java.lang.String,java.lang.String> extras)
extras - void addExeImport(java.lang.String importName)
importName - void addOutputFile(java.lang.String def)
def - void setUseDefaultOutputFile(boolean use)
set - true or falsevoid newDataBundle()
void newDataBundle(java.lang.String name)
name - void setDataSkipDigest(boolean skipDigest)
skipDigest - void addDataFile(java.lang.String file)
file - void addDataFile(java.lang.String file,
java.lang.String targetName)
file - targetName - the file name to be used on the workervoid addDataFileWithDir(java.lang.String dir,
java.lang.String file)
dir - the directory where the file is, null for current dirfile - filenamevoid putDataExtras(java.lang.String name,
java.lang.String value)
name - value - void putAllDataExtras(java.util.Map<java.lang.String,java.lang.String> extras)
extras - void setDataCopy(boolean copy)
copy - void setDataResource(java.lang.String resource)
resources - void setJobSkipDigest(boolean skipDigest)
skipDigest - skipvoid setJobFileNames(java.lang.String... names)
names - void addJobFile(java.lang.String... files)
files - The names of the filesvoid addJobFileWithDir(java.lang.String dir,
java.lang.String... files)
dir - The directory where the file is, null = current dirfiles - The names of the filesvoid putJobExtras(java.lang.String name,
java.lang.String value)
name - value - void putAllJobExtras(java.util.Map<java.lang.String,java.lang.String> extras)
extras - void setParamSkipDigest(boolean skipDigest)
skipDigest - void addParamFile(java.lang.String file)
file - The filevoid addParamFileWithDir(java.lang.String dir,
java.lang.String file)
dir - directory where the file is, null for current dirfile - the filenamevoid addParamFile(java.lang.String file,
java.lang.String targetName)
file - the filetargetName - target file name in the bundlevoid putParamExtras(java.lang.String name,
java.lang.String value)
name - value - void putAllParamExtras(java.util.Map<java.lang.String,java.lang.String> extras)
extras - void addParamExternalResource(java.lang.String res)
res - void setParamCopy(boolean copy)
copy - setDataCopy(boolean)void addParamImport(java.lang.String importName)
importName - void setParamResource(java.lang.String resource)
resources - void setParamBundleName(java.lang.String name)
name - java.lang.String getParamBundleName()
void setParamBundleVersion(java.lang.String version)
version - void putProjectParam(java.lang.String name,
java.lang.String value)
name - parameter namevalue - parameter valuevoid putAllProjectParams(java.util.Map<java.lang.String,java.lang.String> params)
params - void setStream(boolean stream)
stream - void setIntermediateResultHandler(IntermediateResultHandler irh)
int execute()
java.lang.String nextFile()
void done()
int getProjectHandle()
int getProjectId()
java.lang.String getLastErrorMessage()
void postProcessed(int count)