public abstract class DAXWriter extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
mDaxFile
The dax file that is being partitioned.
|
protected LogManager |
mLogger
The handle to the logging object.
|
protected String |
mPartitionName
The name of the partition dax that are generated.
|
protected String |
mPDAXDirectory
The directory in which the daxes corresponding to the partition are
generated.
|
protected PrintWriter |
mWriteHandle
The write handle to the xml file being written.
|
static String |
PACKAGE_NAME
The name of the package in which the writers are implemented.
|
static String |
PARTITION_PREFIX
The prefix added to the name of the dax to identify it is a partitioned
dax.
|
Modifier | Constructor and Description |
---|---|
protected |
DAXWriter()
The default constructor
|
protected |
DAXWriter(String daxFile,
String directory)
The overloaded constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the write handle to the file that is written.
|
private static String |
constructPartitionName(String daxName,
boolean addPrefix)
It constructs the partition name given the daxName.
|
String |
getPartitionName()
It returns the name of the partitioned dax, that the object is
currently writing or initialized to write.
|
static String |
getPDAXFilename(String daxName,
int index)
It constructs the name of the partitioned dax file that has to be written
corresponding to a partition of the dax.
|
static String |
getPDAXFilename(String daxName,
int index,
boolean addPrefix)
It constructs the name of the partitioned dax file that has to be written
corresponding to a partition of the dax.
|
void |
initializeWriteHandle(int index)
This initializes the write handle a file in directory specified
when creating the instance of this class.
|
void |
initializeWriteHandle(String fileName)
This initializes the write handle to the file in directory specified
when creating the instance of this class.
|
static DAXWriter |
loadInstance(PegasusProperties properties,
String daxFile,
String directory)
The ends up loading the PDAXWriter.
|
static DAXWriter |
loadInstance(String className,
PegasusProperties properties,
String daxFile,
String directory)
Loads the implementing PDAXWriter.
|
void |
setPartitionName(String daxName)
It sets the name of the partition in the dax that is generated.
|
void |
writeln(String st)
Writes out to the file.
|
boolean |
writePartitionDax(Partition partition)
It writes out a dax consisting of the jobs as specified in the partition.
|
abstract boolean |
writePartitionDax(Partition partition,
int index)
It writes out a dax consisting of the jobs as specified in the partition.
|
public static final String PARTITION_PREFIX
public static final String PACKAGE_NAME
protected String mDaxFile
protected String mPDAXDirectory
protected String mPartitionName
protected LogManager mLogger
protected PrintWriter mWriteHandle
public boolean writePartitionDax(Partition partition)
partition
- the partition object containing the relations and id's
of the jobs making up the partition.public abstract boolean writePartitionDax(Partition partition, int index)
partition
- the partition object containing the relations and id's
of the jobs making up the partition.index
- the index of the partition.public static DAXWriter loadInstance(PegasusProperties properties, String daxFile, String directory)
properties
- the handle to the properties visible to Pegasus.daxFile
- the path to the dax file that is being partitioned.directory
- the directory in which the partitioned daxes are to be
generated.public static DAXWriter loadInstance(String className, PegasusProperties properties, String daxFile, String directory) throws FactoryException
properties
- the handle to the properties visible to Pegasus.className
- the name of the class with or without the package name.daxFile
- the path to the dax file that is being partitioned.directory
- the directory in which the partitioned daxes are to be
generated.FactoryException
- that nests any error that
might occur during the instantiation of the implementation.public static String getPDAXFilename(String daxName, int index)
daxName
- the name attribute in the adag element of the dax.index
- the partition number of the partition.public static String getPDAXFilename(String daxName, int index, boolean addPrefix)
daxName
- the name attribute in the adag element of the dax.index
- the partition number of the partition.addPrefix
- whether you want to addPrefix or not.private static String constructPartitionName(String daxName, boolean addPrefix)
daxName
- the name attribute in the adag element of the dax.addPrefix
- whether to add prefix or not.public void setPartitionName(String daxName)
daxName
- the name attribute in the adag element of the dax.public String getPartitionName()
public void initializeWriteHandle(int index)
index
- the partition number of the partition.public void initializeWriteHandle(String fileName)
fileName
- the name of the file that is to be written in the
directory.public void writeln(String st)
public void close()
Copyright © 2011 The University of Southern California. All Rights Reserved.