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
-
Method Summary
Modifier and TypeMethodDescriptionstatic ClientResponse
Synchronously updates class definitions.static boolean
update
(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 ClientResponse
updateSync
(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. AProcCallException
is 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:
ClientResponse
instance 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
- TheProcedureCallback
that 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:
true
if the procedure was queued andfalse
otherwise.- 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. AProcCallException
is 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:
ClientResponse
instance 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
CompletableFuture
that completes when the procedure call completes. - Throws:
IOException
- If the file cannot be serialized.
-