public class LocalMVSService extends java.lang.Object implements LocationService, MVSService
MVSService implementation used to communicate with a standalone instance of MVSuggest service.
The MVS location can be a path to the a whole MVS directory or only to a repository containing the layer templates.
An MVS repository has the following structure:
| Constructor and Description |
|---|
LocalMVSService() |
| Modifier and Type | Method and Description |
|---|---|
MVSQueryRequester |
createQueryRequester()
Creates an instance of
MVSQueryRequester used to send match requests |
void |
environmentCleanup(org.apache.hadoop.conf.Configuration conf)
Performs cleanning tasks like removing temporal file.
|
void |
environmentSetup(org.apache.hadoop.conf.Configuration conf)
Performs the necessary setup before running a job.
|
java.lang.String[] |
getLayers()
Gets the layers indexed by MVSuggest
|
MVSConfig |
getMVSConfig()
Gets the MVSuggest configuration bean
|
java.lang.String |
getTemplate(java.lang.String layer)
Gets the template content for a single layer
|
void |
init(org.apache.hadoop.conf.Configuration config)
Initializes a single instance per task.
|
protected void |
init(java.lang.String mvsLocation, LocalMVSConfig mvsConfig) |
void |
init(java.lang.String serviceDirLocation, java.lang.String[] matchLayers)
Initialize the service with the specified server URL.
|
protected java.util.List<GeoAreaInfo> |
query(oracle.maps.suggest.MGRequest request) |
java.util.List<GeoAreaInfo> |
searchResult(java.util.List<java.lang.String> datas)
Return the geometric area informations of the data strings.
|
GeoAreaInfo |
searchResult(java.lang.String data)
Return the geometric area information of the data string.
|
public void environmentSetup(org.apache.hadoop.conf.Configuration conf)
throws java.io.IOException
MVSServiceenvironmentSetup in interface MVSServiceconf - the job configurationjava.io.IOException
public void environmentCleanup(org.apache.hadoop.conf.Configuration conf)
throws java.io.IOException
MVSServiceenvironmentCleanup in interface MVSServiceconf - the job configurationjava.io.IOException
public void init(org.apache.hadoop.conf.Configuration config)
throws java.io.IOException
MVSServiceinit in interface MVSServiceconfig - the job configurationjava.io.IOExceptionpublic MVSQueryRequester createQueryRequester()
MVSServiceMVSQueryRequester used to send match requestscreateQueryRequester in interface MVSServicepublic MVSConfig getMVSConfig()
MVSServicegetMVSConfig in interface MVSService
public void init(java.lang.String serviceDirLocation,
java.lang.String[] matchLayers)
throws java.io.IOException
LocationServiceinit in interface LocationServiceserviceDirLocation - the server URLmatchLayers - optional - which layers should be used to searchjava.io.IOException - thrown if an IOException occurs.public java.lang.String[] getLayers()
MVSServicegetLayers in interface MVSServicepublic java.lang.String getTemplate(java.lang.String layer)
MVSServicegetTemplate in interface MVSServicelayer - the template content in JSON format
protected void init(java.lang.String mvsLocation,
LocalMVSConfig mvsConfig)
throws java.io.IOException
java.io.IOExceptionprotected java.util.List<GeoAreaInfo> query(oracle.maps.suggest.MGRequest request) throws java.io.IOException
java.io.IOExceptionpublic GeoAreaInfo searchResult(java.lang.String data) throws java.io.IOException
LocationServicesearchResult in interface LocationServicedata - data stringjava.io.IOException - thrown if an IOException occurs.public java.util.List<GeoAreaInfo> searchResult(java.util.List<java.lang.String> datas) throws java.io.IOException
LocationServicesearchResult in interface LocationServicedatas - data stringsjava.io.IOException - thrown if an IOException occurs.