@@ -118,4 +118,13 @@ public class SessionResource {
sessionManager.close(id);
return Response.noContent().build();
}
+
+ @Path("/{id}/interrupt")
+ @POST
+ @Timed
+ public Response interruptStatement(@PathParam("id") String id) throws SessionManager.SessionNotFound, Session.StatementNotFound {
+ Session session = sessionManager.get(id);
+ session.interrupt();
+ }
@@ -43,6 +43,8 @@ public interface Session {
public void close() throws IOException, InterruptedException, TimeoutException;
+ void interrupt() throws Exception;
public static class StatementNotFound extends Throwable {
@@ -157,6 +157,12 @@ public class SparkSession implements Session {
process.destroy();
+ @Override
+ public void interrupt() throws Exception {
+ // FIXME: is there a better way to do this?
+ throw new Exception("not implemented");
private void touchLastActivity() {
this.lastActivity = System.currentTimeMillis();