public interface SBServerManager
SBServerManager
provides control and access to a StreamBase Engine.
Obtain one via ServerManagerFactory
.Modifier and Type | Method and Description |
---|---|
void |
drain()
Wait for processing to complete on all currently enqueued tuples.
|
Dequeuer |
getDequeuer(String path)
Get the Tuple dequeue object for a stream
|
Enqueuer |
getEnqueuer(String path)
Get the Tuple enqueue object for a stream
|
TableAccessor |
getTableAccessor(String tablePath)
Return a TableAccessor suitable for manipulating this table.
|
TableAccessor |
getTableAccessor(String tablePath,
CaptureTransformStrategy captureStrategy)
Return a TableAccessor suitable for manipulating this table.
|
TimeService |
getTimeService()
Return the current TimeService implementation used by the StreamBase Engine
|
StreamBaseURI |
getURI()
return the URI of the StreamBase Engine
|
void |
loadApp(String fullyQualifiedModuleName)
Load a module into the default container.
|
void |
loadApp(String fullyQualifiedModuleName,
String container)
Load a module into the specified container.
|
void |
loadAppString(String appString,
String container)
Load an application (from a String) into the specified container.
|
void |
loadDeploy(String deployFile)
Load the given StreamBase deployment file.
|
void |
setTimeService(TimeService timeService)
Set a TimeService for the StreamBase Server managed by this Manager.
|
void |
shutdownServer()
Shutdown the StreamBase Engine, blocking until the StreamBase Engine is finished shutting down
|
void |
startContainers()
Start all the containers for this StreamBase Engine.
|
void |
startContainers(Set<String> containersSuspendedOnStartup)
Start all but the specified containers for this StreamBase Engine.
|
void |
startContainers(Set<String> containersSuspendedOnStartup,
boolean deferSubscriptions)
Start all but the specified containers for this StreamBase Engine
|
void |
startServer()
Start the StreamBase Engine, blocking until the StreamBase Engine will accept connections
|
void |
stopContainers()
Stop all containers in this StreamBase Engine
|
void |
subscribe(String streamPath)
Subscribes to a stream.
|
void |
subscribeAll()
Subscribes to all streams
|
Enqueuer getEnqueuer(String path) throws StreamBaseException
path
- the path to the stream. If this is not a full dotted
path, assumes the stream has the given name and is in the
default container.StreamBaseException
- Error getting Tuple enqueue objectDequeuer getDequeuer(String path) throws StreamBaseException
path
- the path to the stream. If this is not a full dotted
path, assumes the stream has the given name and is in the
default container.StreamBaseException
- Error getting Tuple dequeue objectvoid startServer() throws InterruptedException, StreamBaseException
InterruptedException
- InterruptionStreamBaseException
- Error starting StreamBase Enginevoid shutdownServer() throws InterruptedException, StreamBaseException
InterruptedException
- InterruptionStreamBaseException
- Error stopping StreamBase Enginevoid loadApp(String fullyQualifiedModuleName) throws StreamBaseException
SBServerManager.startContainers()
(or similar methods) is made.
The module must specified as a fully qualified module name, for example com.tibco.sample.myModule. The module is resolved using the StreamBase Engine's class path.
fullyQualifiedModuleName
- A fully qualified module nameStreamBaseException
- Error loading moduleSBServerManager.startServer()
,
SBServerManager.startContainers()
void loadApp(String fullyQualifiedModuleName, String container) throws StreamBaseException
SBServerManager.startContainers()
(or similar methods) is made.
The module must specified as a fully qualified module name, for example com.tibco.sample.myModule. The module is resolved using the StreamBase Engine's class path.
fullyQualifiedModuleName
- A fully qualified module namecontainer
- The container nameStreamBaseException
- Error loading moduleSBServerManager.startServer()
,
SBServerManager.startContainers()
void loadAppString(String appString, String container) throws StreamBaseException
SBServerManager.startContainers()
(or similar methods) is made.appString
- A string which contains the text of an application (Eventflow or SSQL).container
- The container nameStreamBaseException
- on failure to load the given applicationSBServerManager.startServer()
,
SBServerManager.startContainers()
void loadDeploy(String deployFile) throws StreamBaseException
SBServerManager.startContainers()
(or similar methods)
is made.deployFile
- Deployment fileStreamBaseException
- Error loading deployment filevoid startContainers() throws StreamBaseException
SBServerManager.startContainers(Set, boolean)
with a false argument instead.StreamBaseException
- Error starting containerSBServerManager.startContainers(Set, boolean)
,
SBServerManager.subscribe(String)
void startContainers(Set<String> containersSuspendedOnStartup) throws StreamBaseException
containersSuspendedOnStartup
- The containers to leave suspended, if null all containers will be startedStreamBaseException
- Error starting containersSBServerManager.startContainers(Set, boolean)
void startContainers(Set<String> containersSuspendedOnStartup, boolean deferSubscriptions) throws StreamBaseException
containersSuspendedOnStartup
- The containers to leave suspended, if null all containers will be starteddeferSubscriptions
- when true, no output streams will be subscribed toStreamBaseException
- Error starting containersvoid subscribeAll() throws StreamBaseException
StreamBaseException
- Error subscribing to streamsvoid subscribe(String streamPath) throws StreamBaseException
streamPath
- the path to the stream. If this is not a full dotted
path, assumes the stream has the given name and is in the
default container.StreamBaseException
- Error subscribing to streamvoid stopContainers() throws StreamBaseException
StreamBaseException
- Error stopping containersvoid drain() throws StreamBaseException
A call to this method blocks until any tuples that were already
enqueued in the StreamBase Engine have run through to completion, to the best
effort of the StreamBase Engine. Upon return, any tuples that have reached output
streams will be available for dequeue from Dequeuer.dequeue(int)
.
Note that for applications containing concurrent modules or operators, this method makes attempts to ensure it returns once all processing has completed, but does not guarantee this behavior.
StreamBaseException
- if an error occurs while draining; no
guarantees are made about the state of pending tuples.StreamBaseURI getURI()
TableAccessor getTableAccessor(String tablePath) throws StreamBaseException
tablePath
- Path to the table.NotImplementedException
- if table accessors are not supported by this StreamBase Engine
implementation.StreamBaseException
- if there is no table at that path, or if the table is
inaccessible for any other reason.SemanticValidationException
- if the table is inaccessible because of a capture field
naming conflict. In that case, call with
CaptureTransformStrategy.NEST
TableAccessor getTableAccessor(String tablePath, CaptureTransformStrategy captureStrategy) throws StreamBaseException
tablePath
- Path to the table.captureStrategy
- Strategy for handling any capture fields in the table, either
FLATTEN or NEST.NotImplementedException
- if table accessors are not supported by this StreamBase Engine
implementation.StreamBaseException
- if there is no table at that path, or if the table is
inaccessible for any other reason.SemanticValidationException
- if the table is inaccessible because of a capture field
naming conflict. In that case, call with
CaptureTransformStrategy.NEST
void setTimeService(TimeService timeService)
Thread safety note: you can call this method from any thread but you should make sure that it is not called from more than one thread at the same time. Otherwise the result is unpredictable.
timeService
- a TimeService instance or null. If this is a valid TimeService instance
it will be set as the current time service for the entire StreamBase Engine
if this is null then StreamBase Engine will use the WallClockTimeService, which
is the default TimeService implementation
You should obtain a valid TimeService instance via TimeServiceFactory
UnsupportedOperationException
- if there was a problem setting the time serviceTimeService getTimeService() throws StreamBaseException
Thread safety note: you can call this method from any thread but you should make sure that it is not called from more than
one thread at the same time and while this method is called no other thread calls setTimeService
method.
Otherwise the result is unpredictable.
StreamBaseException
- if there was a problem retrieving the current time serviceCopyright © 2015–2019 Cloud Software Group, Inc.. All rights reserved.