View Source

{toc}

h1. Control queries

Many advanced features of OWLIM are controlled using special query vocabulary. Such queries use standard SPARQL syntax and appear to the cluster master node the same as any other 'normal' query. This presents a problem when the query initiates the creation of an index or sets a system parameter, because by default, the master node will choose a single worker node to execute the query.
Therefore, in order to ensure that control queries are propagated to all worker nodes, the following special pseudo-graph must be used: [http://www.ontotext.com/owlim/cluster/control-query]
When a master node receives a query with this graph name it will automatically pass the query to all attached worker nodes, e.g.
\\
{noformat}
PREFIX rank: <http://www.ontotext.com/owlim/RDFRank#>
ASK
FROM <http://www.ontotext.com/owlim/cluster/control-query>
WHERE { _:b1 rank:compute _:b2. }
{noformat}
which will force all worker nodes to compute their RDF Rank weights.

h1. Managing the cluster through the JMX interface


During initialisation, the OWLIM-Enterprise master node registers a JMX Bean component that provides methods to monitor and manage the running cluster. It is registered under "ReplicationCluster:name=ClusterInfo" signature and can be accessed through the standard Java instrumentation tools, e.g. JConsole. The rest of this section provides details about the attributes and operations available.


h2. Attributes

\\
|| Name | *AutoReplication* ||
|| Type | Boolean ||
|| Description | Indicates whether the cluster has auto-replication enabled. ||
|| Possible values | Any non-negative integer. ||
|| Interface method | public int getAutoReplication(); \\
public void setAutoReplication(boolean enabled); ||
\\
|| Name | *AverageReadTime* ||
|| Type | Integer ||
|| Description | Indicates the average time required across the whole cluster for processing a read request in milliseconds. ||
|| Possible values | Any non-negative integer. ||
|| Interface method | public int getAverageReadTime(); ||
\\
|| Name | *AverageTaskTimes* ||
|| Type | Integer array ||
|| Description | Indicates the average time required for each node for processing a read request in milliseconds. ||
|| Possible values | An array of non-negative integer. ||
|| Interface method | public int\[\] getAverageTaskTimes(); ||
\\
|| Name | *CompletedReads* ||
|| Type | Integer ||
|| Description | Indicates the total number of successfully processed read requests ||
|| Possible values | The value is not persistent and will be 0 after initialisation. ||
|| Interface method | public int getCompletedReads(); ||
\\
|| Name | *CompletedTasks* ||
|| Type | Integer array ||
|| Description | A list of values indicating the number of successful read requests for each node in the cluster, provided in the same order as NodeStatus. ||
|| Possible values | A list of non-negative integers ||
|| Interface method | public int\[\] getCompletedTasks(); ||
\\
|| Name | *CompletedWrites* ||
|| Type | Integer ||
|| Description | Indicates the total number of successful updates processed by the cluster. This value is not persistent and is set to 0 after each cluster initialization. ||
|| Possible values | Any non-negative integer value ||
|| Interface method | public int getCompletedWrites(); ||
\\
|| Name | *ConfiguredWritable* ||
|| Type | Boolean ||
|| Description | Indicates if the cluster is configured to process update requests. ||
|| Possible values | True or false ||
|| Interface method | public boolean getConfiguredWritable(); \\
public void setConfiguredWritable(boolean writable); ||
\\
|| Name | *FailedReads* ||
|| Type | Integer ||
|| Description | Indicates the total number of failed read requests for the cluster. The value is not persistent and will be 0 after initialisation. ||
|| Possible values | Any non-negative integer ||
|| Interface method | public int getFailedReads(); ||
\\
|| Name | *FailedTasks* ||
|| Type | Integer array ||
|| Description | Indicates the total number of failed read requests for each node in the cluster. ||
|| Possible values | A list of non-negative integers ||
|| Interface method | public int\[\] getFailedTasks(); ||
\\
|| Name | *FailedWrites* ||
|| Type | Integer ||
|| Description | Indicates the total number of failed updates. An update may fail if there is a problem with the control node on which the update is first probed. The value may also reflect the number of rejected updates, because some node is not available or needs replication. ||
|| Possible values | Any non-negative integer value ||
|| Interface method | public int getFailedWrites(); ||
\\
|| Name | *Fingerprints* ||
|| Type | String array ||
|| Description | Retrieve a list of values representing the fingerprints of the individual nodes in the cluster. ||
|| Possible values | Unspecified ||
|| Interface method | public String\[\] getFingerprints(); ||
\\
|| Name | *IsWritable* ||
|| Type | Boolean ||
|| Description | Indicates whether the current state of the cluster allows for the processing of update requests. ||
|| Possible values | True or false ||
|| Interface method | public boolean getIsWritable(); ||
\\
|| Name | *NodeStatus* ||
|| Type | String array ||
|| Description | Indicates the status of the registered nodes in the cluster as an array of strings, where values have the following format: \\
"\[<node status>\] <node URI>" ||
|| Possible values | \[OK\] - up to date and available for serving requests \\
\[NEEDS-UPDATE\] - the finger-print of the node is not the most recent - should be replicated but still be able to serve requests \\
\[MASTER\] - indicate that the node is a SERVER of an undergoing replication procedure and could not serve requests until is available again \\
\[SLAVE\] - indicate that the node is being replicated from a healthy node. Could not serve requests \\
\[DISABLED\] - the node do not respond on status requests - either not connected or not running at all ||
|| Interface method | public String\[\] getNodeStatus(); ||
\\
|| Name | *NumberOfExplicitTriples* ||
|| Type | Long ||
|| Description | Indicates the number of explicit triples asserted in the cluster. ||
|| Possible values | Any non-negative long integer value ||
|| Interface method | public long getNumberOfExplicitTriples(); ||
\\
|| Name | *NumberOfTriples* ||
|| Type | Long ||
|| Description | Indicates the total number of statements indexed with regard to the most recent update. ||
|| Possible values | Any non-negative long integer value ||
|| Interface method | public long getNumberOfTriples(); ||
\\
|| Name | *PendingWrites* ||
|| Type | Integer ||
|| Description | Indicates the number of updates in the queue waiting to be processed by the cluster. ||
|| Possible values | Any non-negative integer. ||
|| Interface method | public int getPendingWrites(); ||
\\
|| Name | *PendingWritesLimit* ||
|| Type | Integer ||
|| Description | Indicates the maximum number of updates that can be queued for processing by the cluster. ||
|| Possible values | Any non-negative integer. ||
|| Interface method | public int getPendingWritesLimit(); \\
public void setPendingWritesLimit(int limit); ||
\\
|| Name | *RunningReads* ||
|| Type | Integer array ||
|| Description | Indicates the total number of read requests currently being processed by the whole cluster. ||
|| Possible values | An array of any non-negative integers. ||
|| Interface method | public int getRunningReads(); ||
\\
|| Name | *RunningTasks* ||
|| Type | Integer array ||
|| Description | Indicates the number of read requests currently being processed by each node in the cluster. ||
|| Possible values | An array of any non-negative integers. ||
|| Interface method | public int getRunningTasks(); ||
\\
|| Name | *RunningWrites* ||
|| Type | Integer ||
|| Description | Indicates the number of updates currently being processed by the cluster. ||
|| Possible values | Currently only a single update could be processed at given point of time so the only possible values are 0 or 1. ||
|| Interface method | public int getRunningWrites(); ||
\\
|| Name | *Status* ||
|| Type | String ||
|| Description | Indicates the current status of the cluster. ||
|| Possible values | 0 - running, all nodes up to date and functioning; \\
1 - read only, all future updates are rejected until the registered nodes are up-to-date and running \\
2 - no available nodes for processing read requests ||
|| Interface method | public int getStatus(); ||
\\
|| Name | *Timeout* ||
|| Type | Integer ||
|| Description | The cluster timeout period used when executing update operations in milliseconds. ||
|| Possible values | Any non-negative integer value ||
|| Interface method | public long getTimeout(); \\
public void setTimeout(int timeout); ||
\\

h2. Management Operations

\\
|| Name | *addClusterNode* ||
|| Parameters | * *nodeURI*: String - A string holding the full URI of the Sesame end point of the new node, e.g. [http://58.181.33.153:8080/openrdf-sesame/repositories/worker1]
* *replicationPort*: int - The port number to use for replication activity.
* *remoteNotificationsPort*: int - The port number to use for emitting remote notifications, this can be left blank if it is not required, see [remote notifications|OWLIM-SE Experimental Features].
* *readable*: boolean - If set to false (the default is true), then this worker node will receive only updates and will not particpate in sharing the cluster's query load. ||
|| Description | Add a new worker node to the cluster. If the node is a duplicate of an existing one then no error is logged. The same will also happen if the node pointed by the argument is not available. ||
|| Interface method | public void addClusterNode(String nodeURI, int replicationPort); ||
\\
|| Name | *clearTransactionLog* ||
|| Parameters | none ||
|| Description | Clear the transaction log. ||
|| Interface method | public void clearTransactionLog(); ||
\\
|| Name | *removeClusterNode* ||
|| Parameters | * *nodeURI* : String - A string holding the full URI of the Sesame end point of the node to be removed. ||
|| Description | Removes a node from the cluster. Invoking this operation will neither generate an exception nor log an error message. ||
|| Interface method | public void removeClusterNode(String message); ||
\\
|| Name | *startReplication* ||
|| Parameters | none ||
|| Description | Manually initiate a replication procedure. A random node with the most recent state is selected to propagate its state to those that are in \[NEEDS-UPDATE\] state. During the operation the node that replicates its state is excluded from available nodes and does not process read requests until it is finished with the replication. ||
|| Interface method | public void startReplication(); ||

\\
|| Name | *changeSystemTransactionPassword* ||
|| Parameters | * *oldPassword* : String - The old password
* *newPassword* : String - The new password
* *newPasswordRetype* : String - The new password repeated ||
|| Description | Change the system transaction password. System transactions include a statement with a special predicate that instructs OWLIM to allow modifications to the imported, read-only schemas/ontologies. The replication cluster introduces a password for such transactions and this must appear in the object position of the 'special' statement, e.g.
{noformat}
_:b1 <http://www.ontotext.com/owlim/system#schemaTransaction> "the_password"
{noformat}
This operation is used to set/change the password.\\ ||
|| Interface method | public void changeSystemTransactionPassword(String oldPassword, String newPassword, String newPasswordRetype); ||
\\