Package org.voltdb.client
Class UpdateClasses
java.lang.Object
org.voltdb.client.UpdateClasses
Utility class, providing methods to load updated classes
into a VoltDB database.
Each such method is a convenience method that is equivalent to reading
a jarfile, containing classes to be added/updated, into a byte array,
then using the client API to execute a call to the @UpdateClasses
system procedure. Classes can be removed from the database by
giving their names in a separate argument.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ClientResponseSynchronously updates class definitions.static booleanupdate(Client client, ProcedureCallback callback, File jarPath, String classesToDelete) Asynchronously updates class definitions.static CompletableFuture<ClientResponse>updateAsync(Client2 client, File jarPath, String classesToDelete) Asynchronously updates class definitions via a "version 2" client.static ClientResponseupdateSync(Client2 client, File jarPath, String classesToDelete) Synchronously updates class definitions via a "version 2" client.
-
Constructor Details
-
UpdateClasses
public UpdateClasses()
-
-
Method Details
-
update
public static ClientResponse update(Client client, File jarPath, String classesToDelete) throws IOException, ProcCallException Synchronously updates class definitions. Blocks until a result is available. AProcCallExceptionis thrown if the response is anything other than success.- Parameters:
client- A connectedClient.jarPath- Path to the jar file containing new/updated classes.classesToDelete- comma-separated list of classes to delete.- Returns:
ClientResponseinstance of procedure call result.- Throws:
IOException- If the file cannot be serialized or if there is a Java network error.ProcCallException- on any VoltDB-specific failure.
-
update
public static boolean update(Client client, ProcedureCallback callback, File jarPath, String classesToDelete) throws IOException Asynchronously updates class definitions. Does not guarantee that the invocation was actually queued: check the return value to determine if queuing actually took place.- Parameters:
client- A connectedClient.callback- TheProcedureCallbackthat will be invoked with the result.jarPath- Path to the jar file containing new/updated classes.classesToDelete- comma-separated list of classes to delete.- Returns:
trueif the procedure was queued andfalseotherwise.- Throws:
IOException- If the file cannot be serialized or if there is a Java network error.
-
updateSync
public static ClientResponse updateSync(Client2 client, File jarPath, String classesToDelete) throws IOException, ProcCallException Synchronously updates class definitions via a "version 2" client. Blocks until a result is available. AProcCallExceptionis thrown if the response is anything other than success.- Parameters:
client- A connectedClient2.jarPath- Path to the jar file containing new/updated classes.classesToDelete- comma-separated list of classes to delete.- Returns:
ClientResponseinstance of procedure call result.- Throws:
IOException- If the file cannot be serialized or if there is a Java network error.ProcCallException- on any VoltDB-specific failure.
-
updateAsync
public static CompletableFuture<ClientResponse> updateAsync(Client2 client, File jarPath, String classesToDelete) throws IOException Asynchronously updates class definitions via a "version 2" client. Completion is communicated via a returnedCompletableFuture.- Parameters:
client- A connectedClient2.jarPath- Path to the jar file containing new/updated classes.classesToDelete- comma-separated list of classes to delete.- Returns:
- a
CompletableFuturethat completes when the procedure call completes. - Throws:
IOException- If the file cannot be serialized.
-