
----
h1. Federated Query Processor 1.4 Administrators Guide
----
{cagrid-1.4-docs-nav:name=FQP|guidetype=Administrators}
{cagridtoc:exclude=Federated Query Processor 1.4 Administrators Guide}
h1. Prerequisites
----
The Federated Query Processor service does not require any software or special system configuration beyond the standard caGrid stack.
To use the [caGrid Transfer|transfer:] infrastructure for results retrieval, the transfer project is required, and the FQP service must be deployed to the *same* Tomcat container as the transfer service.
The performance of the FQP service may benefit from large amounts of RAM and multiple processor cores for handling concurrent query operations, but this is not strictly required to deploy the service.
h1. Obtaining the Service
----
The Federated Query Processor service is available in the caGrid release, and can be found in the directory $CAGRID_LOCATION/projects/fqp. If you have obtained a source release or checkout of caGrid, the FQP service must first be complied. From the directory $CAGRID_LOCATION, execute the command *ant all* to compile all of caGrid including the FQP service, or *ant build-project \-Dsingle.project.name=fqp* to build just the FQP service and the projects on which it depends.
h1. Installing the Software
----
Installation of the Federated Query Processor can be accomplished using the caGrid Installer, or manually.
h2. Install caGrid and a Container
In this step you will download and install the FQP service and a grid service container using the caGrid Installer. If you already have caGrid 1.4 installed on your machine, and a suitable container, you may proceed to the next section.
{tip}
Once you have installed caGrid, the FQP software can be found in the directory location where you installed caGrid, in the _caGrid/projects/fqp_ directory. This guide will refer to that location as *{_}FQP_HOME{_}*
{tip}
To install caGrid/FederatedQueryProcessor and set up a container, see the following sections.
{include:caGrid14:Install caGrid and Configure a Secure Container Using the caGrid 1.4 Installer}
h1. Configuring the Service
----
{tip}
To simply deploy the FQP service with the default configuration, all you need to edit is the service's standard ServiceMetadata, by following [these instructions|#Edit Service Metadata].
{tip}
h2. Edit Service Properties
The Federated Query Processor service may be configured by changing values specified in the service.properties file found in the root directory of the FQP distribution.
* *maxTargetServicesPerQuery*
** Default value: 12
** Type: Integer
** Controls the maximum number of target data services which may be included in any single DCQL query. If a client attempts to execute a query which specifies more than this number of target data services, an exception will be thrown and the query will not execute. If this value is set to zero (0), the number of services is unlimited.
* *maxRetryTimeout*
** Default value: 300
** Type: Integer
** Controls the maximum number of seconds a client may request the FQP service to wait between retrying queries to target data services which failed to respond correctly. If the client specifies a value greater than this, an exception will be thrown and the query will not execute. If this value is set to zero (0), the maximum timeout is unlimited.
* *maxRetries*
** Default value: 4
** Type: Integer
** Controls the maximum number of retries a client may request the FQP service to perform when retrying to execute queries to target data services which failed to respond correctly. If the client specifies a value greater than this, an exception will be thrown and the query will not execute. If this value is set to zero (0), the maximum number of retries is unlimited.
* *threadPoolSize*
** Default value: 10
** Type: Integer
** Controls the size of the thread pool used by the FQP service to perform DCQL and DCQL 2 queries and perform final query aggregation against target data services. Increasing this value may improve performance and responsiveness of the FQP service at the expense of potentially using more server resources.
* *initialResultLeaseInMinutes*
** Default value: 30
** Type: Integer
** Controls the initial time-to-live (lease time) of FederatedQueryResults resources. The value is specified in minutes. Unless the client explicitly requests a termination time for their results resource more distant in the future, after this time has elapsed, the resource will be destroyed. When the resource is destroyed, any remaining query execution tasks are terminated and any query results it may have contained are lost.
These properties may be configured at deployment time by the Introduce service deployment GUI, or by directly editing the service.properties file before deploying it.
h2. Edit Service Metadata
FQP provides service metadata to clients and other services that describes information about the service, operations supported by the service, and information on the organization hosting the service.
Edit the service metadata to reflect your organization as follows:
# Open the FQP service metadata file, *{_}FQP_HOME/etc/serviceMetadata.xml{_}*.
# In the *{_}hostingResearchCenter{_}* element near the bottom of the file, do the following.
## Supply your *ResearchCenter* infomation.
## Supply your *Address*. This is the address that is used when mapping your service on the caGrid Portal.
## Supply the *PointOfContact*. This is the person responsible for maintaining the service.
A completed example:
{code:XML}
<ns1:hostingResearchCenter>
<ns53:ResearchCenter displayName="Ohio State University" shortName="OSU" xmlns:ns53="gme://caGrid.caBIG/1.0/gov.nih.nci.cagrid.metadata.common">
<ns53:Address country="US" locality="Columbus" postalCode="43210" stateProvince="OH" street1="3190 Graves Hall" street2="333 W. 10th Ave."/>
<ns53:pointOfContactCollection>
<ns53:PointOfContact affiliation="OSU" email="John.Doe@osumc.edu" firstName="John" lastName="Doe" phoneNumber="(555) 555-5555" role="Maintainer"/>
</ns53:pointOfContactCollection>
</ns53:ResearchCenter>
</ns1:hostingResearchCenter>
{code}
{info:title=Note}By default, FQP registers with and publishes its service metadata to the Index Service. The default Index Service is configured as the Index Service of the target grid you selected when you installed Dorian. You can find configuration details on registering and publishing to the Index Service, including disabling registration and changing which Index Service to register with, on the [Registration and Discovery] page.{info}
h1. Starting FQP
----
{tip}
The Federated Query Processor service requires that the [caGrid Transfer Service|transfer14:Home] be deployed to the same Tomcat or JBoss container the FQP service will be deployed to. The Transfer service _must be deployed first_.