|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.hpi.fgis.dude.util.GlobalConfig
public class GlobalConfig
GlobalConfig
manages the configuration parameters of DuDe
.
Field Summary | |
---|---|
static String |
PARAM_NAME_DEFAULT_DIRECTORY
The name of DuDe's default directory. |
static String |
PARAM_NAME_DEFAULT_ENCODING
The name of DuDe's default encoding. |
static String |
PARAM_NAME_FORMATTED_JSON_OUTPUT
Name of the parameter for specifying if the formatted Json shall be printed. |
static String |
PARAM_NAME_MAXIMUM_MEMORY_USAGE
Name of the parameter for specifying the maximum memory usage. |
static String |
PARAM_NAME_MEMORY_CHECKER_STEP_SIZE
Name of the parameter for specifying how many records can be loaded into memory when using the MemoryChecker . |
static String |
PARAM_VALUE_DEFAULT_DIRECTORY
The default directory where all files are stored during file-based processing. |
static String |
PARAM_VALUE_DEFAULT_ENCODING
The default encoding that is used internally. |
static boolean |
PARAM_VALUE_FORMATTED_JSON_OUTPUT
The default setting of the parameter that specifies if the Json written to the file is formatted or not. |
static double |
PARAM_VALUE_MAXIMUM_MEMORY_USAGE
The default maximum memory usage for sorting the data in percent. |
static int |
PARAM_VALUE_MEMORY_CHECKER_STEP_SIZE
The default setting of the parameter that specifies how many records can be loaded into memory when using the MemoryChecker . |
Method Summary | |
---|---|
void |
deleteWorkingDirOnExit()
|
void |
disableFormattedJson()
Disables formatted Json. |
void |
enableFormattedJson()
Enables formatted Json. |
boolean |
formattedJsonIsEnabled()
Checks whether formatted Json is enabled. |
String |
getDefaultEncoding()
Returns the default encoding used by DuDe. |
int |
getInMemoryObjectThreshold()
Returns the maximum number of DuDeObject that will be stored in memory, if file-based processing is enabled. |
static GlobalConfig |
getInstance()
Returns the Singleton instance of GlobalConfig . |
double |
getMaximumMemoryUsage()
Returns the maximum relative memory used during the sorting phase. |
String |
getWorkingDirectory()
Returns the working directory path. |
boolean |
loadConfig(Properties properties)
Loads the configuration from the passed Properties . |
void |
saveConfig(OutputStream outputStream)
Persists the current configuration using the Properties format. |
void |
setCommandLineArguments(String[] args)
Sets the global configuration based on the command-line arguments. |
void |
setDefaultEncoding(String defaultEnc)
Sets DuDe's default encoding for file-based data-processing. |
void |
setInMemoryObjectThreshold(int value)
Sets the threshold for storing DuDeObject s in memory, if file-based processing is enabled. |
protected void |
setInMemoryObjectThreshold(String str)
Sets the in-memory object threshold based on the passed String. |
void |
setMaximumMemoryUsage(double value)
Sets the maximum relative memory that is used for sorting the data. |
protected void |
setMaximumMemoryUsage(String str)
Sets the maximum relative memory usage based on the passed String. |
void |
setWorkingDirectory(String workingDir)
Sets DuDe's default directory for file-based data-processing. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PARAM_VALUE_DEFAULT_ENCODING
public static final String PARAM_NAME_DEFAULT_ENCODING
public static final String PARAM_VALUE_DEFAULT_DIRECTORY
public static final String PARAM_NAME_DEFAULT_DIRECTORY
public static final int PARAM_VALUE_MEMORY_CHECKER_STEP_SIZE
MemoryChecker
.
MemoryChecker.enoughMemoryAvailable()
,
Constant Field Valuespublic static final String PARAM_NAME_MEMORY_CHECKER_STEP_SIZE
MemoryChecker
.
public static final double PARAM_VALUE_MAXIMUM_MEMORY_USAGE
public static final String PARAM_NAME_MAXIMUM_MEMORY_USAGE
public static final boolean PARAM_VALUE_FORMATTED_JSON_OUTPUT
public static final String PARAM_NAME_FORMATTED_JSON_OUTPUT
Method Detail |
---|
public static GlobalConfig getInstance()
GlobalConfig
.
public String getDefaultEncoding()
public void setDefaultEncoding(String defaultEnc)
defaultEnc
- The new default directory.public String getWorkingDirectory()
public void deleteWorkingDirOnExit()
public void setWorkingDirectory(String workingDir)
workingDir
- The new default directory.public int getInMemoryObjectThreshold()
DuDeObject
that will be stored in memory, if file-based processing is enabled.
MemoryChecker
public void setInMemoryObjectThreshold(int value)
DuDeObject
s in memory, if file-based processing is enabled.
value
- The new threshold.MemoryChecker
protected void setInMemoryObjectThreshold(String str) throws NumberFormatException
str
- The String that shall be converted in a valid threshold.
NumberFormatException
- If the passed String could not be converted into an Integer
value.public double getMaximumMemoryUsage()
public void setMaximumMemoryUsage(double value)
0
and
1
.
value
- The maximum relative memory usage.protected void setMaximumMemoryUsage(String str) throws NumberFormatException
str
- The String that shall be converted into a valid Double
value.
NumberFormatException
- If the passed String could not be converted into a Double
value.public boolean formattedJsonIsEnabled()
true
the Json code will be formatted within each generated Json
file. This makes the Json easier to read but let increase the file size.
true
, if formatted Json is enabled; otherwise false
.public void enableFormattedJson()
public void disableFormattedJson()
public boolean loadConfig(Properties properties)
Properties
.
properties
- The new parameters.
true
, if all parameters were set to the new values; otherwise false
.public void saveConfig(OutputStream outputStream) throws IOException
Properties
format.
outputStream
- The stream onto which the configuration will be written.
IOException
- If an error occurs during the writing process.public void setCommandLineArguments(String[] args) throws IllegalArgumentException
args
- The command-line arguments String array that was passed through the main
method parameters.
IllegalArgumentException
- If an error occurs while parsing the arguments.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |