public static EPDeployment deploy(EPCompiled compiledStmt, EPRuntime runtime) { try { return runtime.getDeploymentService().deploy(compiledStmt); } catch (EPDeployException e) { throw new RuntimeException(e); } }
private EPDeployment tryDeploy(EPCompiled compiled) { try { return runtime.getDeploymentService().deploy(compiled); } catch (EPDeployException ex) { throw notExpected(ex); } }
public void destroy() { if (main != null) { try { EPRuntimeProvider.getRuntime(runtimeURI).getDeploymentService().undeployAll(); } catch (EPUndeployException e) { log.warn("Failed to undeploy: " + e.getMessage(), e); } } log.info("OHLCSample-example stopped."); } }
public RegressionEnvironment undeploy(String deploymentId) { try { runtime.getDeploymentService().undeploy(deploymentId); } catch (EPUndeployException ex) { throw notExpected(ex); } return this; }
public static Map<String, Integer> getScores(EPRuntime runtime) { EPStatement stmt = runtime.getDeploymentService().getStatement("trivia", "Score window"); Map<String, Integer> result = new LinkedHashMap<String, Integer>(); for (Iterator<EventBean> it = stmt.iterator(); it.hasNext(); ) { EventBean next = it.next(); String playerId = (String) next.get("playerId"); Integer score = (Integer) next.get("score"); result.put(playerId, score); } return result; }
public RegressionEnvironment deploy(EPCompiled compiled, DeploymentOptions options) { try { runtime.getDeploymentService().deploy(compiled, options); } catch (EPDeployException ex) { throw notExpected(ex); } return this; }
public static void deploy(EPRuntime runtime, EPCompiled compiled) { try { runtime.getDeploymentService().deploy(compiled, new DeploymentOptions().setDeploymentId("stockticker")); } catch (EPDeployException ex) { throw new RuntimeException(ex); } } }
public void update(EventBean[] newEvents, EventBean[] oldEvents, EPStatement statement, EPRuntime runtime) { try { runtime.getDeploymentService().undeploy(spikeLatencyAlert.getDeploymentId()); } catch (EPUndeployException e) { log.warn("Failed to undeploy: " + e.getMessage(), e); } } });
public static EPDeployment compileDeploy(String epl, EPRuntime runtime, Configuration configuration) { EPCompiled compiled = compile(epl, configuration, new RegressionPath()); try { return runtime.getDeploymentService().deploy(compiled); } catch (Throwable t) { throw new RuntimeException(t); } }
private static void assertRowsNamedWindow(RegressionEnvironment env, String deploymentId, String ident) { EPAssertionUtil.assertPropsPerRow(env.runtime().getDeploymentService().getStatement(deploymentId, "create").iterator(), "col1,myident".split(","), new Object[][]{{"E1", ident}, {"E2", ident}}); } }
public static void deployAddListener(EPCompiled compiledStmt, String stmtName, UpdateListener listener, EPRuntime runtime) { try { EPDeployment deployed = runtime.getDeploymentService().deploy(compiledStmt, new DeploymentOptions().setStatementNameRuntime(ctx -> stmtName)); if (deployed.getStatements().length != 1) { throw new UnsupportedOperationException("This method is designed for a single statement"); } deployed.getStatements()[0].addListener(listener); } catch (EPDeployException e) { throw new RuntimeException(e); } }
public String deployGetId(EPCompiled compiled) { try { return runtime().getDeploymentService().deploy(compiled).getDeploymentId(); } catch (EPDeployException ex) { throw notExpected(ex); } }
public static void tryInvalidDeploy(RegressionEnvironment env, EPCompiled unit, String expected) { try { env.runtime().getDeploymentService().deploy(unit); fail(); } catch (EPDeployException ex) { assertMessage(ex, expected); } }
public static void tryInvalidDeploy(RegressionEnvironment env, RegressionPath path, String epl, String expected) { EPCompiled compiled = env.compile(epl, path); try { env.runtime().getDeploymentService().deploy(compiled); fail(); } catch (EPDeployException ex) { assertMessage(ex, expected); } path.getCompileds().remove(compiled); }
private EPStatement compileDeploy(String expression, String statementName) { try { CompilerArguments args = new CompilerArguments(runtime.getRuntimePath()); EPCompiled compiled = EPCompilerProvider.getCompiler().compile(expression, args); DeploymentOptions options = new DeploymentOptions(); options.setStatementNameRuntime(env -> statementName); return runtime.getDeploymentService().deploy(compiled, options).getStatements()[0]; } catch (Exception ex) { throw new RuntimeException("Failed to compile and deploy: " + ex.getMessage(), ex); } } }
private static EPDeployment createStmt(EPRuntime runtime, String epl) { try { Configuration configuration = runtime.getConfigurationDeepCopy(); CompilerArguments args = new CompilerArguments(configuration); args.getPath().add(runtime.getRuntimePath()); EPCompiled compiled = EPCompilerProvider.getCompiler().compile(epl, args); return runtime.getDeploymentService().deploy(compiled); } catch (Exception ex) { throw new RuntimeException(ex); } } }
protected static EPStatement compileDeploy(String epl, EPRuntime runtime) { try { CompilerArguments args = new CompilerArguments(); args.getPath().add(runtime.getRuntimePath()); EPCompiled compiled = EPCompilerProvider.getCompiler().compile(epl, args); return runtime.getDeploymentService().deploy(compiled).getStatements()[0]; } catch (Exception ex) { throw new RuntimeException(ex); } }
public static EPDeployment compileDeploy(EPRuntime runtime, String epl) { try { Configuration configuration = runtime.getConfigurationDeepCopy(); CompilerArguments args = new CompilerArguments(configuration); args.getPath().add(runtime.getRuntimePath()); EPCompiled compiled = EPCompilerProvider.getCompiler().compile(epl, args); return runtime.getDeploymentService().deploy(compiled); } catch (Exception ex) { throw new RuntimeException(ex); } }
private static void tryInvalidUndeploy(RegressionEnvironment env, String statementName, String message) { try { env.runtime().getDeploymentService().undeploy(env.statement(statementName).getDeploymentId()); fail(); } catch (EPUndeployPreconditionException ex) { if (!message.equals("skip")) { SupportMessageAssertUtil.assertMessage(ex.getMessage(), message); } } catch (EPUndeployException ex) { fail(); } } }
private EPStatement compileDeploy(String epl) { try { CompilerArguments args = new CompilerArguments(); args.getPath().add(runtime.getRuntimePath()); args.getOptions().setAccessModifierEventType(env -> NameAccessModifier.PUBLIC); EPCompiled compiled = EPCompilerProvider.getCompiler().compile(epl, args); EPDeployment deployment = runtime.getDeploymentService().deploy(compiled); return deployment.getStatements()[0]; } catch (Exception ex) { throw new RuntimeException(ex); } } }