|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.service.AbstractClient<T>
com.bigdata.service.AbstractScaleOutClient<T>
com.bigdata.service.jini.JiniClient<T>
T - The generic type of the client or service.public class JiniClient<T>
A client capable of connecting to a distributed bigdata federation using JINI.
Clients are configured using a Jini service configuration file. The name of
that file is passed to newInstance(String[]). The configuration
must be consistent with the configuration of the federation to which you
wish to connect.
| Nested Class Summary | |
|---|---|
static interface |
JiniClient.Options
Options understood by the JiniClient. |
| Nested classes/interfaces inherited from class com.bigdata.service.AbstractScaleOutClient |
|---|
AbstractScaleOutClient.MetadataIndexCachePolicy |
| Field Summary | |
|---|---|
JiniClientConfig |
jiniConfig
The JiniClient configuration. |
ZookeeperClientConfig |
zooConfig
The ZooKeeper client configuration. |
| Fields inherited from class com.bigdata.service.AbstractClient |
|---|
log |
| Constructor Summary | |
|---|---|
JiniClient(Class cls,
net.jini.config.Configuration config)
Configures a client. |
|
JiniClient(String[] args)
Configures a client. |
|
| Method Summary | |
|---|---|
JiniFederation<T> |
connect()
Connect to a bigdata federation. |
void |
disconnect(boolean immediateShutdown)
Note: Immediate shutdown can cause odd exceptions to be logged. |
net.jini.config.Configuration |
getConfiguration()
The Configuration object used to initialize this class. |
JiniFederation<T> |
getFederation()
Return the connected federation, |
JiniClientConfig |
getJiniClientConfig()
The JiniClient configuration. |
Properties |
getProperties()
An object wrapping the properties used to configure the client. |
protected static Properties |
getProperties(File propertyFile)
Read and return the content of the properties file. |
Properties |
getProperties(String component)
Return the Properties for the JiniClient merged with
those for the named component in the Configuration. |
static Properties |
getProperties(String className,
net.jini.config.Configuration config)
Read for the optional application or server class identified by [cls]. |
ZookeeperClientConfig |
getZookeeperClientConfig()
The ZooKeeper client configuration. |
boolean |
isConnected()
Return true iff the client is connected to a federation. |
static JiniClient |
newInstance(String[] args)
Installs a SecurityManager and returns a new client. |
protected static void |
setSecurityManager()
Conditionally install a suitable security manager if there is none in place. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final JiniClientConfig jiniConfig
JiniClient configuration.
public final ZookeeperClientConfig zooConfig
ZooKeeper client configuration.
| Constructor Detail |
|---|
public JiniClient(String[] args)
throws net.jini.config.ConfigurationException
args - The jini Configuration (you may specify either a file
or URL) and optional overrides for that Configuration.
net.jini.config.ConfigurationException
public JiniClient(Class cls,
net.jini.config.Configuration config)
throws net.jini.config.ConfigurationException
cls - The class of the client (optional) determines the component
whose configuration will be read in addition to that for the
JiniClient itself. Component specific values will
override those specified for the JiniClient in the
Configuration.config - The configuration object.
net.jini.config.ConfigurationException| Method Detail |
|---|
public boolean isConnected()
IBigdataClienttrue iff the client is connected to a federation.
public void disconnect(boolean immediateShutdown)
immediateShutdown - When true the shutdown is abrubt.
You can expect to see messages about interrupted IO such as
java.rmi.MarshalException: error marshalling arguments; nested exception is:
java.io.IOException: request I/O interrupted
at net.jini.jeri.BasicInvocationHandler.invokeRemoteMethodOnce(BasicInvocationHandler.java:785)
at net.jini.jeri.BasicInvocationHandler.invokeRemoteMethod(BasicInvocationHandler.java:659)
at net.jini.jeri.BasicInvocationHandler.invoke(BasicInvocationHandler.java:528)
at $Proxy5.notify(Ljava.lang.String;Ljava.util.UUID;Ljava.lang.String;[B)V(Unknown Source)
These messages may be safely ignored if they occur during immediate
shutdown.public JiniFederation<T> getFederation()
IBigdataClient
public JiniFederation<T> connect()
IBigdataClient
public JiniClientConfig getJiniClientConfig()
JiniClient configuration.
public final ZookeeperClientConfig getZookeeperClientConfig()
ZooKeeper client configuration.
public final net.jini.config.Configuration getConfiguration()
Configuration object used to initialize this class.
public Properties getProperties()
getProperties in interface IBigdataClient<T>getProperties in class AbstractClient<T>getProperties(String component)
public Properties getProperties(String component)
throws net.jini.config.ConfigurationException
Properties for the JiniClient merged with
those for the named component in the Configuration. Any
properties found for the JiniClient "component" will be read
first. Properties for the named component are next, and therefore will
override those given for the JiniClient. You can specify
properties for either the JiniClient or the component
using:
properties = NV[]{...};
in the appropriate section of the Configuration. For example:
// Jini client configuration
com.bigdata.service.jini.JiniClient {
// ...
// optional JiniClient properties.
properties = new NV[] {
new NV("foo","bar")
};
}
And overrides for a named component as:
com.bigdata.service.FooBaz {
properties = new NV[] {
new NV("foo","baz"),
new NV("goo","12"),
};
}
component - The name of the component.
net.jini.config.ConfigurationExceptiongetConfiguration()
public static Properties getProperties(String className,
net.jini.config.Configuration config)
throws net.jini.config.ConfigurationException
Note: Anything read for the specific class will overwrite any value for
the same properties specified for JiniClient.
className - The class name of the client or service (optional). When
specified, properties defined for that class in the
configuration will be used and will override those specified
for the .config - The Configuration.
net.jini.config.ConfigurationExceptionpublic static JiniClient newInstance(String[] args)
SecurityManager and returns a new client.
args - Either the command line arguments or the arguments from the
ServiceDescriptor. Either way they identify the jini
Configuration (you may specify either a file or URL)
and optional overrides for that Configuration.
RuntimeException - if there is a problem reading the jini configuration for the
client, reading the properties for the client, etc.protected static void setSecurityManager()
java.rmi.server.codebase property specified for the VM
running the service.
protected static Properties getProperties(File propertyFile)
throws IOException
propertyFile - The properties file.
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||