示例#1
0
  protected void verifyBrokerProperties(Cluster cluster, HashMap<String, String> props) {
    Assert.assertEquals(
        props.get(WorkflowExecutionArgs.USER_BRKR_URL.getName()),
        ClusterHelper.getMessageBrokerUrl(cluster));
    Assert.assertEquals(
        props.get(WorkflowExecutionArgs.USER_BRKR_IMPL_CLASS.getName()),
        ClusterHelper.getMessageBrokerImplClass(cluster));

    String falconBrokerUrl =
        StartupProperties.get().getProperty("broker.url", "tcp://localhost:61616?daemon=true");
    Assert.assertEquals(props.get(WorkflowExecutionArgs.BRKR_URL.getName()), falconBrokerUrl);

    String falconBrokerImplClass =
        StartupProperties.get()
            .getProperty("broker.impl.class", ClusterHelper.DEFAULT_BROKER_IMPL_CLASS);
    Assert.assertEquals(
        props.get(WorkflowExecutionArgs.BRKR_IMPL_CLASS.getName()), falconBrokerImplClass);

    String jmsMessageTTL =
        StartupProperties.get().getProperty("broker.ttlInMins", String.valueOf(3 * 24 * 60L));
    Assert.assertEquals(props.get(WorkflowExecutionArgs.BRKR_TTL.getName()), jmsMessageTTL);
  }
  private static String[] getTestMessageArgs(
      EntityOperations operation,
      String wfName,
      String outputFeedNames,
      String feedInstancePaths,
      String falconInputPaths,
      String falconInputFeeds) {
    String cluster;
    if (EntityOperations.REPLICATE == operation) {
      cluster =
          BCP_CLUSTER_ENTITY_NAME
              + WorkflowExecutionContext.CLUSTER_NAME_SEPARATOR
              + CLUSTER_ENTITY_NAME;
    } else {
      cluster = CLUSTER_ENTITY_NAME;
    }

    return new String[] {
      "-" + WorkflowExecutionArgs.CLUSTER_NAME.getName(),
      cluster,
      "-" + WorkflowExecutionArgs.ENTITY_TYPE.getName(),
      ("process"),
      "-" + WorkflowExecutionArgs.ENTITY_NAME.getName(),
      PROCESS_ENTITY_NAME,
      "-" + WorkflowExecutionArgs.NOMINAL_TIME.getName(),
      NOMINAL_TIME,
      "-" + WorkflowExecutionArgs.OPERATION.getName(),
      operation.toString(),
      "-" + WorkflowExecutionArgs.INPUT_FEED_NAMES.getName(),
      (falconInputFeeds != null ? falconInputFeeds : INPUT_FEED_NAMES),
      "-" + WorkflowExecutionArgs.INPUT_FEED_PATHS.getName(),
      (falconInputPaths != null ? falconInputPaths : INPUT_INSTANCE_PATHS),
      "-" + WorkflowExecutionArgs.OUTPUT_FEED_NAMES.getName(),
      (outputFeedNames != null ? outputFeedNames : OUTPUT_FEED_NAMES),
      "-" + WorkflowExecutionArgs.OUTPUT_FEED_PATHS.getName(),
      (feedInstancePaths != null ? feedInstancePaths : OUTPUT_INSTANCE_PATHS),
      "-" + WorkflowExecutionArgs.WORKFLOW_ID.getName(),
      "workflow-01-00",
      "-" + WorkflowExecutionArgs.WORKFLOW_USER.getName(),
      FALCON_USER,
      "-" + WorkflowExecutionArgs.RUN_ID.getName(),
      "1",
      "-" + WorkflowExecutionArgs.STATUS.getName(),
      "SUCCEEDED",
      "-" + WorkflowExecutionArgs.TIMESTAMP.getName(),
      NOMINAL_TIME,
      "-" + WorkflowExecutionArgs.WF_ENGINE_URL.getName(),
      "http://*****:*****@wf-id",
      "-" + WorkflowExecutionArgs.USER_WORKFLOW_NAME.getName(),
      wfName,
      "-" + WorkflowExecutionArgs.USER_WORKFLOW_VERSION.getName(),
      WORKFLOW_VERSION,
      "-" + WorkflowExecutionArgs.USER_WORKFLOW_ENGINE.getName(),
      EngineType.PIG.name(),
      "-" + WorkflowExecutionArgs.BRKR_IMPL_CLASS.getName(),
      BROKER,
      "-" + WorkflowExecutionArgs.BRKR_URL.getName(),
      "tcp://localhost:61616?daemon=true",
      "-" + WorkflowExecutionArgs.USER_BRKR_IMPL_CLASS.getName(),
      BROKER,
      "-" + WorkflowExecutionArgs.USER_BRKR_URL.getName(),
      "tcp://localhost:61616?daemon=true",
      "-" + WorkflowExecutionArgs.BRKR_TTL.getName(),
      "1000",
      "-" + WorkflowExecutionArgs.LOG_DIR.getName(),
      LOGS_DIR,
    };
  }