Groovy Documentation

org.linkedin.glu.commands.impl
[Groovy] Interface CommandStreamStorage


interface CommandStreamStorage

Authors:
yan@pongasoft.com


Method Summary
FutureTaskExecution asyncCaptureIO(Submitter submitter, groovy.lang.Closure closure)

Asynchronously executes the command.

java.io.InputStream findStorageInput(StreamType streamType)

java.io.InputStream findStorageInput(java.lang.Object args)

This method allows you to start streaming the results (stdout, stderr,...) while the command is still running.

java.lang.Object findStorageInputWithSize(StreamType streamType)

@return map with stream and size or null

java.lang.Object findStorageInputWithSize(StreamType streamType, java.lang.Object args)

Return the stream for the command.

java.io.OutputStream findStorageOutput(StreamType streamType)

java.lang.Object syncCaptureIO(groovy.lang.Closure closure)

Synchronously executes the command

java.lang.Object withOrWithoutStorageInput(StreamType streamType, groovy.lang.Closure c)

java.lang.Object withOrWithoutStorageInput(java.lang.Object args, groovy.lang.Closure closure)

Similar to findStorageInput but calls the closure with the stream or with null

java.lang.Object withOrWithoutStorageInputWithSize(StreamType streamType, java.lang.Object args, groovy.lang.Closure closure)

Same as findStorageInputWithSize but call the closure with the map (and make sure that the stream gets closed properly).

java.lang.Object withOrWithoutStorageOutput(StreamType streamType, groovy.lang.Closure c)

java.lang.Object withStorageInputWithSize(StreamType streamType, java.lang.Object args, groovy.lang.Closure closure)

Same as findStorageInputWithSize but call the closure with the map (and make sure that the stream gets closed properly).

 

Method Detail

asyncCaptureIO

FutureTaskExecution asyncCaptureIO(Submitter submitter, groovy.lang.Closure closure)
Asynchronously executes the command. Returns right away


findStorageInput

java.io.InputStream findStorageInput(StreamType streamType)


findStorageInput

java.io.InputStream findStorageInput(java.lang.Object args)
This method allows you to start streaming the results (stdout, stderr,...) while the command is still running. If you request more than 1 stream, you will get a MultiplexedInputStream.
Parameters:
args.exitValueStream - if you want the exit value to be part of the stream (boolean, optional, false by default)
args.exitValueStreamTimeout - how long to wait to get the exit value if the command is not completed yet (optional, in the event that exitValueStream is set to true and exitValueStreamTimeout is not provided, it will not block and return no exit value stream)
args.stdinStream - if you want stdin to be part of the stream (boolean, optional, false by default)
args.stdinOffset - where to start in the stdin stream (optional, int, 0 by default)
args.stdinLen - how many bytes to read maximum (optional, int, -1 by default which means read all)
args.stdoutStream - if you want stdout to be part of the stream (boolean, optional, false by default)
args.stdoutOffset - where to start in the stdout stream (optional, int, 0 by default)
args.stdoutLen - how many bytes to read maximum (optional, int, -1 by default which means read all)
args.stderrStream - if you want stdout to be part of the stream (boolean, optional, false by default)
args.stderrOffset - where to start in the stdout stream (optional, int, 0 by default)
args.stderrLen - how many bytes to read maximum (optional, int, -1 by default which means read all)
Returns:
a stream or null


findStorageInputWithSize

java.lang.Object findStorageInputWithSize(StreamType streamType)
Returns:
map with stream and size or null


findStorageInputWithSize

java.lang.Object findStorageInputWithSize(StreamType streamType, java.lang.Object args)
Return the stream for the command.
Parameters:
args.offset - where to start in the stream (optional, int, 0 by default)
args.len - how many bytes to read maximum (optional, int, -1 by default which means read all)
Returns:
a map with stream and size or null


findStorageOutput

java.io.OutputStream findStorageOutput(StreamType streamType)


syncCaptureIO

java.lang.Object syncCaptureIO(groovy.lang.Closure closure)
Synchronously executes the command
Returns:
the exitValue of the command execution


withOrWithoutStorageInput

java.lang.Object withOrWithoutStorageInput(StreamType streamType, groovy.lang.Closure c)


withOrWithoutStorageInput

java.lang.Object withOrWithoutStorageInput(java.lang.Object args, groovy.lang.Closure closure)
Similar to findStorageInput but calls the closure with the stream or with null
Returns:
whatever the closure returns


withOrWithoutStorageInputWithSize

java.lang.Object withOrWithoutStorageInputWithSize(StreamType streamType, java.lang.Object args, groovy.lang.Closure closure)
Same as findStorageInputWithSize but call the closure with the map (and make sure that the stream gets closed properly). This version always calls the closure, potentially with null
Parameters:
args.offset - where to start in the stream (optional, int, 0 by default)
args.len - how many bytes to read maximum (optional, int, -1 by default which means read all)
Returns:
whatever the closure returns


withOrWithoutStorageOutput

java.lang.Object withOrWithoutStorageOutput(StreamType streamType, groovy.lang.Closure c)


withStorageInputWithSize

java.lang.Object withStorageInputWithSize(StreamType streamType, java.lang.Object args, groovy.lang.Closure closure)
Same as findStorageInputWithSize but call the closure with the map (and make sure that the stream gets closed properly). This version does not call the closure if there is no such stream
Parameters:
args.offset - where to start in the stream (optional, int, 0 by default)
args.len - how many bytes to read maximum (optional, int, -1 by default which means read all)
Returns:
whatever the closure returns


 

Groovy Documentation