private class ImportWorker.ImportBundle extends java.lang.Object implements java.lang.Comparable<ImportWorker.ImportBundle>
Modifier and Type | Field and Description |
---|---|
private java.util.Set<ImportWorker.ImportBundle> |
dependents
Import bundles dependent upon this one to finish its import
|
private long |
fileLength
Length in bytes of the exported data file
|
private java.util.List<P2JIndex> |
indexes
List of all indexes to be created for the target table
|
private ImportWorker.SqlRecordLoader |
loader
Record loader object
|
private double |
rank
Import order sorting heuristic
|
private double |
weight
Load time heuristic
|
Constructor and Description |
---|
ImportBundle(ImportWorker.SqlRecordLoader loader,
java.util.List<P2JIndex> indexes)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
addDependent(ImportWorker.ImportBundle bundle)
Add to this bundle's set of import bundles which are dependent upon
it to load first.
|
(package private) void |
calculateRank()
Calculate this import bundle's rank, which is a heuristic intended
to rank the importance of loading this table sooner than other
tables.
|
(package private) void |
calculateWeight()
Calculate this import bundle's weight, which is a heuristic intended
to measure the relative time it will take to load this table.
|
int |
compareTo(ImportWorker.ImportBundle that)
Compare this object with another of the same type for sorting
purposes.
|
(package private) long |
getFileLength()
Get the number of bytes in the exported data file for this table.
|
(package private) java.util.List<P2JIndex> |
getIndexes()
Get the indexes to be created for the target table.
|
(package private) ImportWorker.SqlRecordLoader |
getLoader()
Get the record loader associated with this bundle.
|
(package private) double |
getRank()
Get this import bundle's rank, which is a heuristic intended to rank
the importance of loading this table sooner than other tables.
|
(package private) double |
getWeight()
Get this import bundle's weight, which is a heuristic intended to
measure the relative time it will take to load this table.
|
java.lang.String |
toString()
Produce a string representation of this object, primarily for debug
purposes.
|
private final ImportWorker.SqlRecordLoader loader
private final java.util.List<P2JIndex> indexes
private final long fileLength
private final java.util.Set<ImportWorker.ImportBundle> dependents
private double weight
private double rank
ImportBundle(ImportWorker.SqlRecordLoader loader, java.util.List<P2JIndex> indexes)
loader
- Record loader object.indexes
- List of all indexes to be created for the target table.public int compareTo(ImportWorker.ImportBundle that)
compareTo
in interface java.lang.Comparable<ImportWorker.ImportBundle>
that
- ImportBundle
with which to compare this
instance for sorting purposes.public java.lang.String toString()
toString
in class java.lang.Object
ImportWorker.SqlRecordLoader getLoader()
java.util.List<P2JIndex> getIndexes()
void addDependent(ImportWorker.ImportBundle bundle)
bundle
- An import bundle for a table which is dependent upon this
bundle's table loading first.double getWeight()
double getRank()
long getFileLength()
void calculateWeight()
calculateRank()
void calculateRank()
calculateWeight()