use of edu.snu.mist.formats.avro.ClientToTaskMessage in project mist by snuspl.
the class MISTQueryControl method delete.
/**
* request task to delete the query.
* TODO[MIST-290]: Return a message to Client.
* @param queryId
* @param taskAddress
* @return It returns a result message of deletion.
* @throws IOException
*/
public static APIQueryControlResult delete(final String groupId, final String queryId, final IPAddress taskAddress) throws IOException {
final ClientToTaskMessage proxy = getProxy(taskAddress);
final QueryControlResult queryControlResult = proxy.deleteQueries(groupId, queryId);
final APIQueryControlResult apiQueryControlResult = new APIQueryControlResultImpl(queryControlResult.getQueryId(), taskAddress, queryControlResult.getMsg(), queryControlResult.getIsSuccess());
return apiQueryControlResult;
}
use of edu.snu.mist.formats.avro.ClientToTaskMessage in project mist by snuspl.
the class MISTQueryControl method getProxy.
private static ClientToTaskMessage getProxy(final IPAddress taskAddress) throws IOException {
ClientToTaskMessage proxyToTask = TASK_PROXY_MAP.get(taskAddress);
if (proxyToTask == null) {
final NettyTransceiver clientToTask = new NettyTransceiver(new InetSocketAddress(taskAddress.getHostAddress(), taskAddress.getPort()));
final ClientToTaskMessage proxy = SpecificRequestor.getClient(ClientToTaskMessage.class, clientToTask);
TASK_PROXY_MAP.putIfAbsent(taskAddress, proxy);
proxyToTask = TASK_PROXY_MAP.get(taskAddress);
}
return proxyToTask;
}
Aggregations