Package com.gpudb.protocol
Class CreateProcRequest
- java.lang.Object
-
- com.gpudb.protocol.CreateProcRequest
-
- All Implemented Interfaces:
org.apache.avro.generic.GenericContainer,org.apache.avro.generic.IndexedRecord
public class CreateProcRequest extends Object implements org.apache.avro.generic.IndexedRecord
A set of parameters forGPUdb.createProc.Creates an instance (proc) of the user-defined functions (UDF) specified by the given command, options, and files, and makes it available for execution.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCreateProcRequest.ExecutionModeA set of string constants for theCreateProcRequestparameterexecutionMode.static classCreateProcRequest.OptionsA set of string constants for theCreateProcRequestparameteroptions.
-
Constructor Summary
Constructors Constructor Description CreateProcRequest()Constructs a CreateProcRequest object with default parameters.CreateProcRequest(String procName, String executionMode, Map<String,ByteBuffer> files, String command, List<String> args, Map<String,String> options)Constructs a CreateProcRequest object with the specified parameters.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Objectget(int index)This method supports the Avro framework and is not intended to be called directly by the user.List<String>getArgs()An array of command-line arguments that will be passed tocommandwhen the proc is executed.static org.apache.avro.SchemagetClassSchema()This method supports the Avro framework and is not intended to be called directly by the user.StringgetCommand()The command (excluding arguments) that will be invoked when the proc is executed.StringgetExecutionMode()The execution mode of the proc.Map<String,ByteBuffer>getFiles()A map of the files that make up the proc.Map<String,String>getOptions()Optional parameters.StringgetProcName()Name of the proc to be created.org.apache.avro.SchemagetSchema()This method supports the Avro framework and is not intended to be called directly by the user.inthashCode()voidput(int index, Object value)This method supports the Avro framework and is not intended to be called directly by the user.CreateProcRequestsetArgs(List<String> args)An array of command-line arguments that will be passed tocommandwhen the proc is executed.CreateProcRequestsetCommand(String command)The command (excluding arguments) that will be invoked when the proc is executed.CreateProcRequestsetExecutionMode(String executionMode)The execution mode of the proc.CreateProcRequestsetFiles(Map<String,ByteBuffer> files)A map of the files that make up the proc.CreateProcRequestsetOptions(Map<String,String> options)Optional parameters.CreateProcRequestsetProcName(String procName)Name of the proc to be created.StringtoString()
-
-
-
Constructor Detail
-
CreateProcRequest
public CreateProcRequest()
Constructs a CreateProcRequest object with default parameters.
-
CreateProcRequest
public CreateProcRequest(String procName, String executionMode, Map<String,ByteBuffer> files, String command, List<String> args, Map<String,String> options)
Constructs a CreateProcRequest object with the specified parameters.- Parameters:
procName- Name of the proc to be created. Must not be the name of a currently existing proc.executionMode- The execution mode of the proc. Supported values:DISTRIBUTED: Input table data will be divided into data segments that are distributed across all nodes in the cluster, and the proc command will be invoked once per data segment in parallel. Output table data from each invocation will be saved to the same node as the corresponding input data.NONDISTRIBUTED: The proc command will be invoked only once per execution, and will not have direct access to any tables named as input or output table parameters in the call toGPUdb.executeProc. It will, however, be able to access the database using native API calls.
DISTRIBUTED.files- A map of the files that make up the proc. The keys of the map are file names, and the values are the binary contents of the files. The file names may include subdirectory names (e.g. 'subdir/file') but must not resolve to a directory above the root for the proc. Files may be loaded from existing files in KiFS. Those file names should be prefixed with the uri kifs:// and the values in the map should be empty. The default value is an emptyMap.command- The command (excluding arguments) that will be invoked when the proc is executed. It will be invoked from the directory containing the procfilesand may be any command that can be resolved from that directory. It need not refer to a file actually in that directory; for example, it could be 'java' if the proc is a Java application; however, any necessary external programs must be preinstalled on every database node. If the command refers to a file in that directory, it must be preceded with './' as per Linux convention. If not specified, and exactly one file is provided infiles, that file will be invoked. The default value is ''.args- An array of command-line arguments that will be passed tocommandwhen the proc is executed. The default value is an emptyList.options- Optional parameters.MAX_CONCURRENCY_PER_NODE: The maximum number of concurrent instances of the proc that will be executed per node. 0 allows unlimited concurrency. The default value is '0'.SET_ENVIRONMENT: A python environment to use when executing the proc. Must be an existing environment, else an error will be returned. The default value is ''.
Map.
-
-
Method Detail
-
getClassSchema
public static org.apache.avro.Schema getClassSchema()
This method supports the Avro framework and is not intended to be called directly by the user.- Returns:
- The schema for the class.
-
getProcName
public String getProcName()
Name of the proc to be created. Must not be the name of a currently existing proc.- Returns:
- The current value of
procName.
-
setProcName
public CreateProcRequest setProcName(String procName)
Name of the proc to be created. Must not be the name of a currently existing proc.- Parameters:
procName- The new value forprocName.- Returns:
thisto mimic the builder pattern.
-
getExecutionMode
public String getExecutionMode()
The execution mode of the proc. Supported values:DISTRIBUTED: Input table data will be divided into data segments that are distributed across all nodes in the cluster, and the proc command will be invoked once per data segment in parallel. Output table data from each invocation will be saved to the same node as the corresponding input data.NONDISTRIBUTED: The proc command will be invoked only once per execution, and will not have direct access to any tables named as input or output table parameters in the call toGPUdb.executeProc. It will, however, be able to access the database using native API calls.
DISTRIBUTED.- Returns:
- The current value of
executionMode.
-
setExecutionMode
public CreateProcRequest setExecutionMode(String executionMode)
The execution mode of the proc. Supported values:DISTRIBUTED: Input table data will be divided into data segments that are distributed across all nodes in the cluster, and the proc command will be invoked once per data segment in parallel. Output table data from each invocation will be saved to the same node as the corresponding input data.NONDISTRIBUTED: The proc command will be invoked only once per execution, and will not have direct access to any tables named as input or output table parameters in the call toGPUdb.executeProc. It will, however, be able to access the database using native API calls.
DISTRIBUTED.- Parameters:
executionMode- The new value forexecutionMode.- Returns:
thisto mimic the builder pattern.
-
getFiles
public Map<String,ByteBuffer> getFiles()
A map of the files that make up the proc. The keys of the map are file names, and the values are the binary contents of the files. The file names may include subdirectory names (e.g. 'subdir/file') but must not resolve to a directory above the root for the proc.Files may be loaded from existing files in KiFS. Those file names should be prefixed with the uri kifs:// and the values in the map should be empty. The default value is an empty
Map.- Returns:
- The current value of
files.
-
setFiles
public CreateProcRequest setFiles(Map<String,ByteBuffer> files)
A map of the files that make up the proc. The keys of the map are file names, and the values are the binary contents of the files. The file names may include subdirectory names (e.g. 'subdir/file') but must not resolve to a directory above the root for the proc.Files may be loaded from existing files in KiFS. Those file names should be prefixed with the uri kifs:// and the values in the map should be empty. The default value is an empty
Map.- Parameters:
files- The new value forfiles.- Returns:
thisto mimic the builder pattern.
-
getCommand
public String getCommand()
The command (excluding arguments) that will be invoked when the proc is executed. It will be invoked from the directory containing the procfilesand may be any command that can be resolved from that directory. It need not refer to a file actually in that directory; for example, it could be 'java' if the proc is a Java application; however, any necessary external programs must be preinstalled on every database node. If the command refers to a file in that directory, it must be preceded with './' as per Linux convention. If not specified, and exactly one file is provided infiles, that file will be invoked. The default value is ''.- Returns:
- The current value of
command.
-
setCommand
public CreateProcRequest setCommand(String command)
The command (excluding arguments) that will be invoked when the proc is executed. It will be invoked from the directory containing the procfilesand may be any command that can be resolved from that directory. It need not refer to a file actually in that directory; for example, it could be 'java' if the proc is a Java application; however, any necessary external programs must be preinstalled on every database node. If the command refers to a file in that directory, it must be preceded with './' as per Linux convention. If not specified, and exactly one file is provided infiles, that file will be invoked. The default value is ''.- Parameters:
command- The new value forcommand.- Returns:
thisto mimic the builder pattern.
-
getArgs
public List<String> getArgs()
An array of command-line arguments that will be passed tocommandwhen the proc is executed. The default value is an emptyList.- Returns:
- The current value of
args.
-
setArgs
public CreateProcRequest setArgs(List<String> args)
An array of command-line arguments that will be passed tocommandwhen the proc is executed. The default value is an emptyList.- Parameters:
args- The new value forargs.- Returns:
thisto mimic the builder pattern.
-
getOptions
public Map<String,String> getOptions()
Optional parameters.MAX_CONCURRENCY_PER_NODE: The maximum number of concurrent instances of the proc that will be executed per node. 0 allows unlimited concurrency. The default value is '0'.SET_ENVIRONMENT: A python environment to use when executing the proc. Must be an existing environment, else an error will be returned. The default value is ''.
Map.- Returns:
- The current value of
options.
-
setOptions
public CreateProcRequest setOptions(Map<String,String> options)
Optional parameters.MAX_CONCURRENCY_PER_NODE: The maximum number of concurrent instances of the proc that will be executed per node. 0 allows unlimited concurrency. The default value is '0'.SET_ENVIRONMENT: A python environment to use when executing the proc. Must be an existing environment, else an error will be returned. The default value is ''.
Map.- Parameters:
options- The new value foroptions.- Returns:
thisto mimic the builder pattern.
-
getSchema
public org.apache.avro.Schema getSchema()
This method supports the Avro framework and is not intended to be called directly by the user.- Specified by:
getSchemain interfaceorg.apache.avro.generic.GenericContainer- Returns:
- The schema object describing this class.
-
get
public Object get(int index)
This method supports the Avro framework and is not intended to be called directly by the user.- Specified by:
getin interfaceorg.apache.avro.generic.IndexedRecord- Parameters:
index- the position of the field to get- Returns:
- value of the field with the given index.
- Throws:
IndexOutOfBoundsException
-
put
public void put(int index, Object value)This method supports the Avro framework and is not intended to be called directly by the user.- Specified by:
putin interfaceorg.apache.avro.generic.IndexedRecord- Parameters:
index- the position of the field to setvalue- the value to set- Throws:
IndexOutOfBoundsException
-
-