|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.unh.sdb.datasource.DataCollection
edu.unh.sdb.datasource.DataSource
edu.unh.sdb.datasource.MRDataSource
public class MRDataSource
MRDataSource Serves as an interface to a MultiResolution hierarchy of DataSources representing the same data at different resolution levels. This implementation is a primitive one that uses file name and file directory structure conventions to define the hierarchy, rather than using complete metadata support for defining the hierarchy (as well as associated error datasources). For this version we'll encode the MR nature of the data in the xfdl file by prefixing the file name with with the "@" symbol. This will tell DataSource.create( ... ) that it should create an MRDataSource. FDL fileName format: @rootdir/level0DataFileName It is acceptable for the "rootdir" field to be '.'; it is acceptable for the "level0DataFileName" to be omitted; default is "data". The filename (with the "@" removed) from the .xfdl file should be the name of the root directory of the hierarchcy. This directory must have an entry named "data". root/data can be a plain file or it can be a directory that contains the data file. (This is especially intended for time series data sets that have many files, but could also be used for storing multiple attributes in separate files -- though there is no support for this yet.) If there is an error datasource associated with the data it should be in the file "error", or in a file (or series of files) in the directory called "error". Any lower resolution representations of this data must be stored in other directories. With time series data, there could be either a spatial wavelet or a time wavelet; eventually we want to support adaptive resolution representations for which there could be multiple versions for this data at different error tolerance levels. For the time being, this code supports the following conventions for the lower resolution data: 1. If there is just one subdirectory (other than "data" and "error"), we assume that it is the next lower resolution. 2. If the directory name begins with "space" or is "s", then it is a spatial wavelet directory (intended to be used for time series). 3. If the file name begins with "time" or is "t", then it is a time wavelet directory for a time series data source. Each lower resolution subdirectory must follow the same conventions as the root directory; i.e., it must contain a file or a directory named "data" and may contain a file or directory named "error" and a may contain a directory defining the next lower resolution of data. Each level of resolution must have its own xfdl file. It can be at the same level as the data/error file or directories or it can be in the data and error directories. One goal of this initial implementation is to allow a single .xfdl file to be used for an entire hierarchy. This may prove to be of marginal importance since new .xfdl files could be automatically generated by the wavelet program.
Field Summary |
---|
Fields inherited from class edu.unh.sdb.datasource.DataSource |
---|
fdlDescriptor, isActivated, name, wsName |
Fields inherited from class edu.unh.sdb.datasource.DataCollection |
---|
attributeOrder, axisOrdering, axisWeights, bounds, dataOrder, dimensionality, numAttributes, pointOrder, recordDesc |
Constructor Summary | |
---|---|
MRDataSource(java.lang.String aname,
FDLDescriptor fdld)
|
Method Summary | |
---|---|
void |
activate()
The DataSource will perform any initialization required in order to begin reading/processing data. |
protected void |
addToLevel(int level,
DataSource ds,
java.io.File file)
addToLevel( ds, level ) |
boolean |
changeResolution(int changeCode)
boolean changeResolution( int changeCode ) changeCode = 0 implies go to resolution level zero otherwise new resolution level = old level + changeCode changeCode < 0 implies make resolution finer by abs( changeCode ) levels changeCode > 0 implies make resolution coarser by changeCode levels |
protected boolean |
checkCoarser(int level)
void checkCoarser( int level ) Try to open next coarser data representation. |
boolean |
coarser()
boolean coarser( ) Move to next coarser data representation. |
void |
datum(Datum dtm,
IndexSpaceID did)
Given an IndexSpaceID, copy the values of the Datum at that position to the argument Datum. |
void |
datum(Datum dtm,
IndexSpaceID did,
FieldIDMapper mp)
Given an IndexSpaceID and FieldIDMapper, copy the values of the Datum at that position to the argument Datum. |
protected int |
findCoarser(java.io.File parent,
int level)
For a particular directory at the specified level find all the coarser representations for that directory. |
protected int |
findCoarser(int level)
int findCoarser( int level ) NOT YET IMPLEMENTED Try to find all next coarser data representations in file system for the next coarser level of resolution from that specified in the argument. |
boolean |
finer()
boolean finer( ) Move next finer data representation. |
java.io.File |
getDataFile()
getDataFile() |
protected java.io.File |
getDataFile(java.io.File root)
Find data file |
java.io.File |
getDataFile(int level)
getDataFile( int level ) |
java.io.File |
getDataFile(int level,
int which)
getDataFile( int level, int which ) |
DataSource |
getDataSource()
getDataSource() -- return current data source |
DataSource |
getDataSource(int level)
getDataSource( int level ) |
DataSource |
getDataSource(int level,
int which)
getDataSource( int level, int which ) |
int |
getLevel()
int getLevel() |
int |
getNumResolutionLevels()
int getNumResolutionLevels() |
static void |
main(java.lang.String[] args)
|
protected void |
openDS(int level)
Swap datasources. |
static void |
printData(java.lang.String header,
float[] data)
|
protected int |
setLevel(int newLevel)
boolean setLevel( int newLevel ) Set resolution level to specified level, but don't open the datasource If the desired level does not exist, returns the level that is closest to that level that does exist. |
void |
subblock(DataBlock theBlock,
ISBounds dstBounds,
ISBounds srcBounds)
Reads a subblock defined by srcBounds into the region of the Datablock argument defined by dstBounds. |
void |
subblock(DataBlock theBlock,
ISBounds dstBounds,
ISBounds srcBounds,
FieldIDMapper mp)
Reads a subblock defined by srcBounds into the region of the Datablock argument defined by dstBounds. |
protected void |
updateMembers()
upDateMembers copies the key information from the current DS to data members of the MRDS. |
Methods inherited from class edu.unh.sdb.datasource.DataSource |
---|
checkActivated, clearCache, copyBestID, create, create, create, createRemote, createRemote, createRemoteClient, createRemoteClient, createRemoteDataSource, createRemoteDataSource, createRemoteDataSourceUDP, createRemoteUDP, createRemoteUDP, deactivate, dumpData, equals, getName, getValues, isActivated, toString, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MRDataSource(java.lang.String aname, FDLDescriptor fdld)
aname
- fdld
- Method Detail |
---|
protected void updateMembers()
protected java.io.File getDataFile(java.io.File root)
protected void addToLevel(int level, DataSource ds, java.io.File file)
public DataSource getDataSource()
public DataSource getDataSource(int level)
public DataSource getDataSource(int level, int which)
public java.io.File getDataFile()
public java.io.File getDataFile(int level)
public java.io.File getDataFile(int level, int which)
public int getLevel()
public int getNumResolutionLevels()
protected int setLevel(int newLevel)
public boolean finer()
public boolean changeResolution(int changeCode)
public boolean coarser()
protected int findCoarser(int level)
protected int findCoarser(java.io.File parent, int level)
parent
- level
- protected boolean checkCoarser(int level)
protected void openDS(int level)
public void activate()
DataSource
activate
in class DataSource
DataSource.activate()
public void datum(Datum dtm, IndexSpaceID did)
DataCollection
datum
in interface Indexable
datum
in class DataCollection
DataCollection.datum(edu.unh.sdb.common.Datum, edu.unh.sdb.datasource.IndexSpaceID)
public void datum(Datum dtm, IndexSpaceID did, FieldIDMapper mp)
DataCollection
datum
in interface Indexable
datum
in class DataCollection
DataCollection.datum(edu.unh.sdb.common.Datum, edu.unh.sdb.datasource.IndexSpaceID, edu.unh.sdb.common.FieldIDMapper)
public void subblock(DataBlock theBlock, ISBounds dstBounds, ISBounds srcBounds)
DataCollection
subblock
in interface Indexable
subblock
in class DataCollection
DataCollection.subblock(edu.unh.sdb.datasource.DataBlock, edu.unh.sdb.datasource.ISBounds, edu.unh.sdb.datasource.ISBounds)
public void subblock(DataBlock theBlock, ISBounds dstBounds, ISBounds srcBounds, FieldIDMapper mp)
DataCollection
subblock
in interface Indexable
subblock
in class DataCollection
public static void main(java.lang.String[] args)
public static void printData(java.lang.String header, float[] data)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |