public class CreateProcRequest extends Object implements org.apache.avro.generic.IndexedRecord
GPUdb.createProc(CreateProcRequest)
.
Creates an instance (proc) of the user-defined function (UDF) specified by the given command, options, and files, and makes it available for execution. For details on UDFs, see: User-Defined Functions
Modifier and Type | Class and Description |
---|---|
static class |
CreateProcRequest.ExecutionMode
The execution mode of the proc.
|
static class |
CreateProcRequest.Options
Optional parameters.
|
Constructor and 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.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Object |
get(int index)
This method supports the Avro framework and is not intended to be called
directly by the user.
|
List<String> |
getArgs() |
static org.apache.avro.Schema |
getClassSchema()
This method supports the Avro framework and is not intended to be called
directly by the user.
|
String |
getCommand() |
String |
getExecutionMode() |
Map<String,ByteBuffer> |
getFiles() |
Map<String,String> |
getOptions() |
String |
getProcName() |
org.apache.avro.Schema |
getSchema()
This method supports the Avro framework and is not intended to be called
directly by the user.
|
int |
hashCode() |
void |
put(int index,
Object value)
This method supports the Avro framework and is not intended to be called
directly by the user.
|
CreateProcRequest |
setArgs(List<String> args) |
CreateProcRequest |
setCommand(String command) |
CreateProcRequest |
setExecutionMode(String executionMode) |
CreateProcRequest |
setFiles(Map<String,ByteBuffer> files) |
CreateProcRequest |
setOptions(Map<String,String> options) |
CreateProcRequest |
setProcName(String procName) |
String |
toString() |
public CreateProcRequest()
public CreateProcRequest(String procName, String executionMode, Map<String,ByteBuffer> files, String command, List<String> args, Map<String,String> options)
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 access
to any input or output table data.
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. The default value
is an empty Map
.command
- The command (excluding arguments) that will be invoked
when the proc is executed. It will be invoked from the
directory containing the proc files
and 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 in files
, that file will be invoked. The default value is
''.args
- An array of command-line arguments that will be passed to
command
when the proc is executed. The default
value is an empty List
.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'.
Map
.public static org.apache.avro.Schema getClassSchema()
public String getProcName()
public CreateProcRequest setProcName(String procName)
procName
- Name of the proc to be created. Must not be the name of
a currently existing proc.this
to mimic the builder pattern.public String getExecutionMode()
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 access to any input or output table
data.
DISTRIBUTED
.public CreateProcRequest setExecutionMode(String executionMode)
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 access
to any input or output table data.
DISTRIBUTED
.this
to mimic the builder pattern.public Map<String,ByteBuffer> getFiles()
Map
.public CreateProcRequest setFiles(Map<String,ByteBuffer> files)
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. The default value
is an empty Map
.this
to mimic the builder pattern.public String getCommand()
files
and 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 in files
, that file will be
invoked. The default value is ''.public CreateProcRequest setCommand(String command)
command
- The command (excluding arguments) that will be invoked
when the proc is executed. It will be invoked from the
directory containing the proc files
and 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 in files
, that file will be invoked. The default value is
''.this
to mimic the builder pattern.public List<String> getArgs()
command
when the proc is executed. The default value is an
empty List
.public CreateProcRequest setArgs(List<String> args)
args
- An array of command-line arguments that will be passed to
command
when the proc is executed. The default
value is an empty List
.this
to mimic the builder pattern.public Map<String,String> getOptions()
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'.
Map
.public CreateProcRequest setOptions(Map<String,String> options)
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'.
Map
.this
to mimic the builder pattern.public org.apache.avro.Schema getSchema()
getSchema
in interface org.apache.avro.generic.GenericContainer
public Object get(int index)
get
in interface org.apache.avro.generic.IndexedRecord
index
- the position of the field to getIndexOutOfBoundsException
public void put(int index, Object value)
put
in interface org.apache.avro.generic.IndexedRecord
index
- the position of the field to setvalue
- the value to setIndexOutOfBoundsException
Copyright © 2020. All rights reserved.