public class SpatialIndexUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static org.apache.hadoop.fs.Path |
SPATIAL_INDEX_METADATA_DIR_PATH
Default metadata directory path
|
Constructor and Description |
---|
SpatialIndexUtils() |
Modifier and Type | Method and Description |
---|---|
static SpatialIndexMetadata |
findSpatialIndexMetadata(java.lang.String indexName, org.apache.hadoop.fs.Path metadataDirPath, org.apache.hadoop.conf.Configuration conf)
Searches the metadata file for the given index name
|
static SpatialIndexMetadata |
getSpatialIndexMetadata(java.lang.String indexName, java.lang.String indexMetadataDir, org.apache.hadoop.conf.Configuration conf) |
static org.apache.hadoop.fs.Path |
getSpatialIndexPath(SpatialIndexMetadata sim) |
static boolean |
isValidIndexName(java.lang.String indexName)
Tells whether the given string is a valid index name
|
static java.util.List<org.apache.hadoop.fs.Path> |
listMetadataFiles(org.apache.hadoop.conf.Configuration conf)
Lists the paths to all the spatial index metadata files contained in the currently set metadata folder
|
static java.util.List<org.apache.hadoop.fs.Path> |
listMetadataFiles(org.apache.hadoop.fs.Path metadataDirPath, org.apache.hadoop.conf.Configuration conf)
Lists the paths to all the spatial index metadata files contained in the given metadata filder
|
static SpatialIndexMetadata |
readMetadata(java.io.InputStream in)
Reads a spatial index metadata from an input stream
|
static SpatialIndexMetadata |
readMetadata(org.apache.hadoop.fs.Path simPath, org.apache.hadoop.conf.Configuration conf) |
static void |
setMissingSpatialConfig(SpatialConfig spatialConfig, SpatialIndexMetadata sim) |
static java.lang.String |
toValidIndexName(java.lang.String indexName)
Converts an index name to a valid one
|
static void |
validateIndexName(java.lang.String indexName)
If the given index name is invalid, it will throw an
IllegalArgumentException , otherwise it will do nothing |
public static final org.apache.hadoop.fs.Path SPATIAL_INDEX_METADATA_DIR_PATH
public static SpatialIndexMetadata readMetadata(org.apache.hadoop.fs.Path simPath, org.apache.hadoop.conf.Configuration conf) throws java.lang.Exception
java.lang.Exception
public static SpatialIndexMetadata readMetadata(java.io.InputStream in) throws java.lang.Exception
in
-java.lang.Exception
public static java.util.List<org.apache.hadoop.fs.Path> listMetadataFiles(org.apache.hadoop.conf.Configuration conf) throws java.io.IOException
conf
- the job configurationjava.io.IOException
public static java.util.List<org.apache.hadoop.fs.Path> listMetadataFiles(org.apache.hadoop.fs.Path metadataDirPath, org.apache.hadoop.conf.Configuration conf) throws java.io.IOException
metadataDirPath
- a metadata directory pathconf
- the job configurationjava.io.IOException
public static SpatialIndexMetadata findSpatialIndexMetadata(java.lang.String indexName, org.apache.hadoop.fs.Path metadataDirPath, org.apache.hadoop.conf.Configuration conf) throws java.lang.Exception
indexName
- a spatial index namemetadataDirPath
- the metadata directoryconf
- the job configurationjava.lang.Exception
public static boolean isValidIndexName(java.lang.String indexName)
indexName
- an index name to be validatedpublic static void validateIndexName(java.lang.String indexName) throws java.lang.IllegalArgumentException
IllegalArgumentException
, otherwise it will do nothingindexName
- an index name to be validatedjava.lang.IllegalArgumentException
public static java.lang.String toValidIndexName(java.lang.String indexName)
indexName
- an index namepublic static SpatialIndexMetadata getSpatialIndexMetadata(java.lang.String indexName, java.lang.String indexMetadataDir, org.apache.hadoop.conf.Configuration conf) throws java.lang.Exception
java.lang.Exception
public static org.apache.hadoop.fs.Path getSpatialIndexPath(SpatialIndexMetadata sim)
public static void setMissingSpatialConfig(SpatialConfig spatialConfig, SpatialIndexMetadata sim)