installAlgo()
Method and class:
Response installAlgo(String algoFileName, String algoInfoFileName, RequestConfig requestConfig)
Example: Install algorithm LPA and use leader to guarantee consistency. The config file lpa.yml and the installation package libplugin_lpa.so are placed under the 'classpath' of current project (under './src/main/resources')
public class Main {
public static void main(String[] args) {
// omit code of establishing server connection 'conn' with consistency as 'false'
RequestConfig requestConfig = new RequestConfig();
requestConfig.setUseMaster(true);
Response res = conn.installAlgo("algo/libplugin_lpa.so", "algo/lpa.yml", requestConfig);
}
}
uninstallAlgo()
Method and class:
Response uninstallAlgo(String algoName, RequestConfig requestConfig)
Example: Uninstall algorithm LPA (no extra request configurations required)
public class Main {
public static void main(String[] args) {
// omit code of establishing server connection 'conn'
Response res = conn.uninstallAlgo("lpa", null);
}
}