This project aims to replicate the model of our Python estimator in Java. This allows us to port this model to ElaSQL.
- Java Development Kit 8+
- Maven
- All values except the following fields can be read as
Double
sTransaction ID
: LongIs Master
: BooleanIs Distributed
: BooleanStart Time
: Long
- All arrays store features of every server so that we can separate the features for each individual server from the arrays
> mvn package
This command generates a file called estimator-[version number]-jar-with-dependencies.jar
, which includes all the dependencies that this program needs and information for starting the program, in target
directory.
Run the following command to train a cost estimator and saves the corresponding models.
> java -jar [Jar File] train [Data Set Dir] [Model Save Dir]
[Jar File]
: the path to the built jar file. This is usuallytarget/estimator-[version number]-jar-with-dependencies.jar
[Data Set Dir]
: the path to the directory that holds the training data set[Model Save Dir]
: the path to the directory for saving the models
Note that this program also needs a configuration file. We assume the configuration file is called config.toml
and is placed in the working directory. If it is not the case, you can use the following command to specify the path to the file:
> java -jar [Jar File] train -c [Config File] [Data Set Dir] [Model Save Dir]
[Config File]
: the path to the configuration file. The default is./config.toml
.