public abstract class DAXWriter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
mDaxFile
The dax file that is being partitioned.
|
protected LogManager |
mLogger
The handle to the logging object.
|
protected java.lang.String |
mPartitionName
The name of the partition dax that are generated.
|
protected java.lang.String |
mPDAXDirectory
The directory in which the daxes corresponding to the partition are
generated.
|
protected java.io.PrintWriter |
mWriteHandle
The write handle to the xml file being written.
|
static java.lang.String |
PACKAGE_NAME
The name of the package in which the writers are implemented.
|
static java.lang.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(java.lang.String daxFile,
java.lang.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 java.lang.String |
constructPartitionName(java.lang.String daxName,
boolean addPrefix)
It constructs the partition name given the daxName.
|
java.lang.String |
getPartitionName()
It returns the name of the partitioned dax, that the object is
currently writing or initialized to write.
|
static java.lang.String |
getPDAXFilename(java.lang.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 java.lang.String |
getPDAXFilename(java.lang.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(java.lang.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,
java.lang.String daxFile,
java.lang.String directory)
The ends up loading the PDAXWriter.
|
static DAXWriter |
loadInstance(java.lang.String className,
PegasusProperties properties,
java.lang.String daxFile,
java.lang.String directory)
Loads the implementing PDAXWriter.
|
void |
setPartitionName(java.lang.String daxName)
It sets the name of the partition in the dax that is generated.
|
void |
writeln(java.lang.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 java.lang.String PARTITION_PREFIX
public static final java.lang.String PACKAGE_NAME
protected java.lang.String mDaxFile
protected java.lang.String mPDAXDirectory
protected java.lang.String mPartitionName
protected LogManager mLogger
protected java.io.PrintWriter mWriteHandle
protected DAXWriter()
protected DAXWriter(java.lang.String daxFile, java.lang.String directory)
daxFile
- the path to the dax file that is being partitioned.directory
- the directory in which the partitioned daxes are to be
generated.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, java.lang.String daxFile, java.lang.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(java.lang.String className, PegasusProperties properties, java.lang.String daxFile, java.lang.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 java.lang.String getPDAXFilename(java.lang.String daxName, int index)
daxName
- the name attribute in the adag element of the dax.index
- the partition number of the partition.public static java.lang.String getPDAXFilename(java.lang.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 java.lang.String constructPartitionName(java.lang.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(java.lang.String daxName)
daxName
- the name attribute in the adag element of the dax.public java.lang.String getPartitionName()
public void initializeWriteHandle(int index)
index
- the partition number of the partition.public void initializeWriteHandle(java.lang.String fileName)
fileName
- the name of the file that is to be written in the
directory.public void writeln(java.lang.String st)
public void close()