public class SpatialSite
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FilterClass
The class used to filter blocks before starting map tasks
|
static java.lang.String |
INDEXING_OVERHEAD
Configuration line name for replication overhead
|
static java.lang.String |
MaxBytesInOneRead
Maximum size in bytes that can be read in one read operation
|
static java.lang.String |
MaxShapesInOneRead
Maximum number of shapes to read in one read operation and return when
reading a file as array
|
static PathFilter |
NonHiddenFileFilter
A filter that selects visible files and filters out hidden files.
|
static java.lang.String |
OUTPUT_CELLS |
static java.lang.String |
OVERWRITE |
static java.lang.String |
RTREE_BUILD_MODE
Whether to build the RTree in fast mode or slow (memory saving) mode.
|
static long |
RTreeFileMarker
A marker put in the beginning of each block to indicate that this block
is stored as an RTree.
|
static byte[] |
RTreeFileMarkerB |
static java.lang.String |
SAMPLE_RATIO
Ratio of the sample to read from files to build a global R-tree
|
static java.lang.String |
SAMPLE_SIZE
Ratio of the sample to read from files to build a global R-tree
|
Modifier and Type | Method and Description |
---|---|
static void |
addClassToPath(Configuration conf,
java.lang.Class<?> klass)
Ensures that the given class is in the class path of running jobs.
|
static CellInfo[] |
cellsOf(FileSystem fs,
Path path)
Returns the cells (partitions) of a file.
|
static CellInfo[] |
cellsOf(GlobalIndex<Partition> gIndex)
Finds the partitioning info used in the given global index.
|
static Shape |
createStockShape(Configuration job)
Creates a stock shape according to the given configuration.
|
static CellInfo |
getCellInfo(GlobalIndex<Partition> gIndex,
int cellID) |
static CellInfo[] |
getCells(Configuration conf)
Retrieves cells that were stored earlier using
#setCells(JobConf, CellInfo[]) . |
static RandomShapeGenerator.DistributionType |
getDistributionType(Configuration job,
java.lang.String key,
RandomShapeGenerator.DistributionType defaultValue)
Retrieves the distribution type used for generating synthetic data
|
static GlobalIndex<Partition> |
getGlobalIndex(FileSystem fs,
Path dir)
Returns the global index (partitions) of a file that is indexed using
the index command.
|
static Rectangle |
getRectangle(Configuration conf,
java.lang.String name)
Retrieves a rectangle from configuration parameter.
|
static Shape |
getShape(Configuration conf,
java.lang.String param)
Deprecated.
|
static boolean |
isRTree(FileSystem fs,
Path path)
Checks whether a file is indexed using an R-tree or not.
|
static <S extends Shape> |
loadRTree(FileSystem fs,
Path file,
S shape) |
static void |
setCells(Configuration conf,
CellInfo[] cellsInfo)
Set an array of cells in the job configuration.
|
static void |
setClass(Configuration conf,
java.lang.String key,
java.lang.Class<?> klass,
java.lang.Class<?> xface)
Similar to
Configuration#setClass(String, Class, Class) , this
method sets the given key to the provided class in the configuration. |
static void |
setRectangle(Configuration conf,
java.lang.String name,
Rectangle rect)
Sets a rectangle in a job configuration.
|
static void |
setShape(Configuration conf,
java.lang.String param,
Shape shape)
Deprecated.
|
public static final PathFilter NonHiddenFileFilter
public static final java.lang.String FilterClass
public static final java.lang.String RTREE_BUILD_MODE
public static final java.lang.String INDEXING_OVERHEAD
public static final java.lang.String SAMPLE_RATIO
public static final java.lang.String SAMPLE_SIZE
public static final long RTreeFileMarker
public static final java.lang.String OUTPUT_CELLS
public static final java.lang.String OVERWRITE
public static final java.lang.String MaxShapesInOneRead
public static final java.lang.String MaxBytesInOneRead
public static byte[] RTreeFileMarkerB
public static void setClass(Configuration conf, java.lang.String key, java.lang.Class<?> klass, java.lang.Class<?> xface)
Configuration#setClass(String, Class, Class)
, this
method sets the given key to the provided class in the configuration.
In addition, it ensures that the jar file that contains that class is in
the class path of the provided configuration. This is ensured by copying
the jar file and adding it to the distributed cache using the method
DistributedCache#addArchiveToClassPath(Path, Configuration, Path)
.conf
- - Configuration to set the keykey
- - the key to setklass
- - the class to use as a valuexface
- - the interface that the provided class should implementpublic static void addClassToPath(Configuration conf, java.lang.Class<?> klass)
conf
- klass
- public static Shape createStockShape(Configuration job)
#getShapeClass(Configuration)
then
creates an instance of this shape using Class.newInstance()
.
This requires the shape class to have a default empty constructor.job
- public static void setShape(Configuration conf, java.lang.String param, Shape shape)
OperationsParams.setShape(Configuration,String,Shape)
insteadgetShape(Configuration, String)
.conf
- param
- shape
- @Deprecated public static Shape getShape(Configuration conf, java.lang.String param)
OperationsParams.getShape(Configuration, String)
OperationsParams.setShape(Configuration, String, Shape)
.
It reads the corresponding parameter and parses it to find the class name
and shape value. First, a default object is created using Class.newInstance()
then the value is parsed using TextSerializable.fromText(Text)
.conf
- param
- public static GlobalIndex<Partition> getGlobalIndex(FileSystem fs, Path dir)
GlobalIndex
where the generic
parameter is specified as Partition
.fs
- dir
- java.io.IOException
public static boolean isRTree(FileSystem fs, Path path) throws java.io.IOException
fs
- path
- java.io.IOException
public static CellInfo[] cellsOf(FileSystem fs, Path path) throws java.io.IOException
fs
- path
- java.io.IOException
public static void setCells(Configuration conf, CellInfo[] cellsInfo) throws java.io.IOException
#getCells(JobConf)
will open the corresponding file from
DistributedCache and parse cells from that file.conf
- cellsInfo
- java.io.IOException
public static CellInfo[] getCells(Configuration conf) throws java.io.IOException
#setCells(JobConf, CellInfo[])
. This function opens the corresponding
file from DistributedCache and parses jobs from it.conf
- java.io.IOException
public static void setRectangle(Configuration conf, java.lang.String name, Rectangle rect)
Rectangle.toText(Text)
.conf
- name
- rect
- public static Rectangle getRectangle(Configuration conf, java.lang.String name)
Rectangle.fromText(Text)
conf
- name
- public static RandomShapeGenerator.DistributionType getDistributionType(Configuration job, java.lang.String key, RandomShapeGenerator.DistributionType defaultValue)
job
- key
- defaultValue
- public static CellInfo[] cellsOf(GlobalIndex<Partition> gIndex)
gIndex
- public static <S extends Shape> RTree<S> loadRTree(FileSystem fs, Path file, S shape) throws java.io.IOException
java.io.IOException
public static CellInfo getCellInfo(GlobalIndex<Partition> gIndex, int cellID)