Create a spatial index using the Spark API
post
/spatialviewer/api/v1/spark/createIndex
The index metadata directory is the directory spark_index_metadata contained in the SpatialViewer local working directory (see SpatialViewer configuration).
Request
Supported Media Types
- application/json
Query Parameters
- asynchronous
-
Type:
boolean
if true the index is created asynchronously.false
Body Parameter
Index details
Root Schema : SparkIndexInfo
Type:
object
- dataPath
-
Type:
string
Path of the file or files to index in HDFS.Example:/user/oracle/spatialviewer/tweetsJune.json
- indexName
-
Type:
string
The index name.Example:TweetsJune
- indexPath
-
Type:
string
New index path. This is the job output path.Example:/user/oracle/spatialviewer/TweetsJune
- inputFormatClass
-
Type:
string
The input format class. Optional. If the input format class is not specified then the SparkContext's textFile is used.Example:oracle.spatial.hadoop.vector.geojson.mapred.GeoJsonInputFormat
- jarWithNeededClasses
-
Type:
string
jar name with the user-defined classes like custom RecordInfoProvider or InputFormat. If the InputFormat class or the RecordInfoProvider class is not in the API, or in the hadoop API classes, then a jar with the user-defined classes must be provided. To be able to use this jar the user must add it in the /opt/oracle/oracle-spatial-graph/spatial/web-server/spatialviewer/WEB-INF/lib directory and restart the server. Optional property.Example:myjar.jar
- keyClass
-
Type:
string
Class of the input format keys. This property is required if an input format is defined.Example:org.apache.hadoop.io.LongWritable
- recordInfoProviderClass
-
Type:
string
The class that provides the spatial information.Example:oracle.spatial.spark.vector.recordinfoprovider.GeoJsonRecordInfoProvider
- srid
-
Type:
integer
(int32
)SRID of the geometries to be indexed.Example:8307
- tolerance
-
Type:
number
(double
)Double value that represents the tolerance used when performing spatial operations.Example:0.05
- valueClass
-
Type:
string
Class of the input format values. This property is required if an input format is defined.Example:org.apache.hadoop.io.Text
Response
Supported Media Types
- application/json
201 Response
successful index creation
Body
Root Schema : CreateSparkIndexJobResponse
Type:
object
- o:successCode
-
Type:
string
The success code.Example:SV-05006
- response
-
Type:
string
The response contains the location of the new created index.Example:hdfs://<namenode>:8020/user/oracle/spatialviewer/TweetsJune
- status
-
Type:
string
success or errorExample:success
- title
-
Type:
string
Service title.Example:Create Spark Index.
202 Response
accepted asynchronous index creation
Body
Root Schema : AsyncCreateSparkIndexJobResponse
Type:
object
- o:successCode
-
Type:
string
The success code.Example:SV-05006
- response
-
Type:
string
The response contains the location of the resource manager web application URL to track the job (see in the configuration the Hadoop parameter yarn.resourcemanager.webapp.address).Example:http://resource.mananger.webapp:8088
- status
-
Type:
string
success or errorExample:success
- title
-
Type:
string
Service title.Example:Create Spark Index.