本文整理汇总了Java中org.voltdb.client.ClientImpl.callProcedure方法的典型用法代码示例。如果您正苦于以下问题:Java ClientImpl.callProcedure方法的具体用法?Java ClientImpl.callProcedure怎么用?Java ClientImpl.callProcedure使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.voltdb.client.ClientImpl
的用法示例。
在下文中一共展示了ClientImpl.callProcedure方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.voltdb.client.ClientImpl; //导入方法依赖的package包/类
/**
* Executes a procedure synchronously and returns the result to the caller. The method
* internally tracks execution performance.
*
* @param procedure
* the name of the procedure to call.
* @param parameters
* the list of parameters to pass to the procedure.
* @return the response sent back by the VoltDB cluster for the procedure execution.
* @throws IOException
* @throws NoConnectionsException
* @throws ProcCallException
*/
public ClientResponse execute(String procedure, long timeout, Object... parameters)
throws NoConnectionsException, IOException, ProcCallException {
ClientImpl currentClient = this.getClient();
try {
// If connections are lost try reconnecting.
ClientResponse response = currentClient.callProcedure(procedure, parameters);
if (trace.val) {
LOG.trace(String.format("JDBC client executed qury %s", procedure));
}
return response;
}
catch (ProcCallException pce) {
throw pce;
}
catch (NoConnectionsException e) {
this.dropClient(currentClient);
throw e;
}
}
示例2: executeAsync
import org.voltdb.client.ClientImpl; //导入方法依赖的package包/类
/**
* Executes a procedure asynchronously, returning a Future that can be used by the caller to
* wait upon completion before processing the server response.
*
* @param procedure
* the name of the procedure to call.
* @param parameters
* the list of parameters to pass to the procedure.
* @return the Future created to wrap around the asynchronous process.
*/
public Future<ClientResponse> executeAsync(String procedure, Object... parameters)
throws NoConnectionsException, IOException
{
ClientImpl currentClient = this.getClient();
final JDBC4ExecutionFuture future = new JDBC4ExecutionFuture(this.defaultAsyncTimeout);
try {
currentClient.callProcedure(new TrackingCallback(this, procedure, new ProcedureCallback() {
@SuppressWarnings("unused")
final JDBC4ExecutionFuture result;
{
this.result = future;
}
@Override
public void clientCallback(ClientResponse response) {
future.set(response);
}
}), procedure, parameters);
}
catch (NoConnectionsException e) {
this.dropClient(currentClient);
throw e;
}
return future;
}
示例3: executeAsync
import org.voltdb.client.ClientImpl; //导入方法依赖的package包/类
/**
* Executes a procedure asynchronously, returning a Future that can be used by the caller to
* wait upon completion before processing the server response.
*
* @param procedure
* the name of the procedure to call.
* @param parameters
* the list of parameters to pass to the procedure.
* @return the Future created to wrap around the asynchronous process.
*/
public Future<ClientResponse> executeAsync(String procedure, Object... parameters)
throws NoConnectionsException, IOException
{
ClientImpl currentClient = this.getClient();
final JDBC4ExecutionFuture future = new JDBC4ExecutionFuture(this.defaultAsyncTimeout);
try {
currentClient.callProcedure(new TrackingCallback(this, procedure, new ProcedureCallback() {
@SuppressWarnings("unused")
final JDBC4ExecutionFuture result;
{
this.result = future;
}
@Override
public void clientCallback(ClientResponse response) throws Exception {
future.set(response);
}
}), procedure, parameters);
}
catch (NoConnectionsException e) {
this.dropClient(currentClient);
throw e;
}
return future;
}