当前位置: 首页>>代码示例>>Java>>正文


Java ClientImpl.callProcedure方法代码示例

本文整理汇总了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;
    }
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:33,代码来源:JDBC4ClientConnection.java

示例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;
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:36,代码来源:JDBC4ClientConnection.java

示例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;
}
 
开发者ID:anhnv-3991,项目名称:VoltDB,代码行数:36,代码来源:JDBC4ClientConnection.java


注:本文中的org.voltdb.client.ClientImpl.callProcedure方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。