public final class InvocationGrid
extends com.scaleoutsoftware.soss.client.pmi.KeyedObject
NamedCache.setInvocationGrid(InvocationGrid)
. It also provides a way to unload the IG by calling
unload()
Modifier and Type | Method and Description |
---|---|
boolean |
getAllowClientCaching()
Returns whether client caching is allowed on workers.
|
boolean |
getAllowFastReads()
Returns whether "fast object reads" feature is supported.
|
int |
getClientCacheSize()
Returns the size of the client cache maintained by workers.
|
java.util.Map<java.lang.Integer,java.lang.Integer> |
getCoherencyIntervalPerAppId() |
java.util.List<Dependency> |
getDependencies()
Gets the invocation grid dependencies.
|
java.lang.String |
getGridName()
Gets the invocation grid name.
|
int |
getId()
Gets the IG id.
|
java.lang.String |
getLibraryPath()
Gets the name of the Hadoop distribution for hServer.
|
TimeSpan |
getLingerTime()
Gets the linger time for the invocation grid.
|
static java.util.Collection<InvocationGrid> |
getLoadedInvocationGrids()
Returns all invocation grids loaded by this client.
|
boolean |
getLockOnRead()
If
true , the objects are locked before they are read and passed to the
Invokable.eval(Object, java.io.Serializable, EvalArgs) method. |
int |
getMaxNumberOfCores()
Gets the maximum number of cores across the IG.
|
boolean |
getNewClassLoader()
Get the "use new class loader" property.
|
int |
getNumberOfThreads()
Gets the number of threads in the invocation workers which handle
evals and merges.
|
java.util.List<com.scaleoutsoftware.soss.client.pmi.GridAction> |
getStartupActions()
Returns the startup objects associated with this InvocationGrid
|
static InvocationGrid |
loadFromConfigurationFile(java.lang.String invocationGridName)
Loads a predeclared invocation grid from the configuration file.
|
static InvocationGrid |
loadFromConfigurationFile(java.lang.String invocationGridName,
boolean forceReload)
Loads a predeclared invocation grid from the configuration file.
|
static void |
stopInvocationGrid(java.lang.String invocationGridName) |
void |
unload()
Unloads the invocation grid from the StateServer store and stops all invocation workers.
|
static void |
unloadAll()
Unloads all invocation grids loaded by this client.
|
public int getClientCacheSize()
public boolean getAllowClientCaching()
true
if client caching is allowedpublic boolean getAllowFastReads()
true
if "fast reads" are allowed.public java.lang.String getGridName()
public TimeSpan getLingerTime()
public java.util.List<Dependency> getDependencies()
public java.util.List<com.scaleoutsoftware.soss.client.pmi.GridAction> getStartupActions()
public int getNumberOfThreads()
public boolean getLockOnRead()
true
, the objects are locked before they are read and passed to the
Invokable.eval(Object, java.io.Serializable, EvalArgs)
method.true
if the objects should be locked before evaluationpublic boolean getNewClassLoader()
true
if the new class loader should be used by IG workerpublic int getMaxNumberOfCores()
public void unload() throws NamedCacheException
NamedCacheException
- if there was error while unloading the invocation grid.public java.util.Map<java.lang.Integer,java.lang.Integer> getCoherencyIntervalPerAppId()
public int getId()
public java.lang.String getLibraryPath()
public static java.util.Collection<InvocationGrid> getLoadedInvocationGrids()
Set
of all loaded invocation gridspublic static void stopInvocationGrid(java.lang.String invocationGridName) throws NamedCacheException
NamedCacheException
public static void unloadAll() throws NamedCacheException
NamedCacheException
- thrown if the NamedCache
has experienced an internal error.public static InvocationGrid loadFromConfigurationFile(java.lang.String invocationGridName) throws NamedCacheException
Loads a predeclared invocation grid from the configuration file.
Invocation grids can be declared in the configuration file soss-java-ig-config.xml
which should be put in the classpath root. The invocation grids are declared in the
following format:
<?xml version="1.0" encoding="UTF-8" ?>
<invocationGrids>
<invocationGrid name="FirstGrid" >
<dependencies>
<dependency type="class">x.y.z.MyInvokable</dependency>
</dependencies>
</invocationGrid>
<invocationGrid name="SecondGrid" lingerTime="100">
<dependencies>
<dependency type="class">a.b.c.SomeInvokable</dependency>
<dependency type="jar">myjar.jar</dependency>
</dependencies>
</invocationGrid>
</invocationGrids>
invocationGridName
- name of the invocation gridInvocationGrid
object.NamedCacheException
- if invocation grid cannot be loadedpublic static InvocationGrid loadFromConfigurationFile(java.lang.String invocationGridName, boolean forceReload) throws NamedCacheException
invocationGridName
- name of the invocation gridforceReload
- this parameter controls the behaviour in case invocation grid is already loaded. If
true
, the method will not connect to existing invocation grid, instead
it will reload it from scratch.InvocationGrid
object.NamedCacheException
- if invocation grid cannot be loaded