Search in sources :

Example 1 with LinkedNodeExpression

use of org.talend.hadoop.distribution.condition.LinkedNodeExpression in project tbd-studio-se by Talend.

the class DynamicHDPHiveOnSparkModuleGroup method init.

protected void init() {
    spark1Condition = new LinkedNodeExpression(SparkBatchConstant.SPARK_BATCH_SPARKCONFIGURATION_LINKEDPARAMETER, "SUPPORTED_SPARK_VERSION", EqualityOperator.EQ, // $NON-NLS-1$
    ESparkVersion.SPARK_1_6.getSparkVersion());
    spark2Condition = new LinkedNodeExpression(SparkBatchConstant.SPARK_BATCH_SPARKCONFIGURATION_LINKEDPARAMETER, "SUPPORTED_SPARK_VERSION", EqualityOperator.EQ, // $NON-NLS-1$
    ESparkVersion.SPARK_2_1.getSparkVersion());
}
Also used : LinkedNodeExpression(org.talend.hadoop.distribution.condition.LinkedNodeExpression)

Example 2 with LinkedNodeExpression

use of org.talend.hadoop.distribution.condition.LinkedNodeExpression in project tbd-studio-se by Talend.

the class DynamicSparkStreamingKafkaClientModuleGroup method init.

protected void init() {
    spark1Condition = new SimpleComponentCondition(new LinkedNodeExpression(// $NON-NLS-1$
    SparkStreamingConstant.KAFKA_SPARKCONFIGURATION_LINKEDPARAMETER, // $NON-NLS-1$
    "SUPPORTED_SPARK_VERSION", // $NON-NLS-1$
    EqualityOperator.EQ, ESparkVersion.SPARK_1_6.getSparkVersion()));
    spark2Condition = new MultiComponentCondition(new LinkedNodeExpression(SparkStreamingConstant.KAFKA_SPARKCONFIGURATION_LINKEDPARAMETER, // $NON-NLS-1$
    "SUPPORTED_SPARK_VERSION", // $NON-NLS-1$
    EqualityOperator.EQ, // $NON-NLS-1$
    ESparkVersion.SPARK_2_2.getSparkVersion()), BooleanOperator.OR, new LinkedNodeExpression(SparkStreamingConstant.KAFKA_SPARKCONFIGURATION_LINKEDPARAMETER, // $NON-NLS-1$
    "SUPPORTED_SPARK_VERSION", // $NON-NLS-1$
    EqualityOperator.EQ, // $NON-NLS-1$
    ESparkVersion.SPARK_2_4_X.getSparkVersion()));
}
Also used : SimpleComponentCondition(org.talend.hadoop.distribution.condition.SimpleComponentCondition) MultiComponentCondition(org.talend.hadoop.distribution.condition.MultiComponentCondition) LinkedNodeExpression(org.talend.hadoop.distribution.condition.LinkedNodeExpression)

Example 3 with LinkedNodeExpression

use of org.talend.hadoop.distribution.condition.LinkedNodeExpression in project tbd-studio-se by Talend.

the class DynamicSparkStreamingKafkaAssemblyModuleGroup method init.

protected void init() {
    spark1Condition = new SimpleComponentCondition(new LinkedNodeExpression(// $NON-NLS-1$
    SparkStreamingConstant.KAFKA_SPARKCONFIGURATION_LINKEDPARAMETER, // $NON-NLS-1$
    "SUPPORTED_SPARK_VERSION", // $NON-NLS-1$
    EqualityOperator.EQ, ESparkVersion.SPARK_1_6.getSparkVersion()));
    spark2Condition = new MultiComponentCondition(new LinkedNodeExpression(SparkStreamingConstant.KAFKA_SPARKCONFIGURATION_LINKEDPARAMETER, // $NON-NLS-1$
    "SUPPORTED_SPARK_VERSION", // $NON-NLS-1$
    EqualityOperator.EQ, // $NON-NLS-1$
    ESparkVersion.SPARK_2_2.getSparkVersion()), BooleanOperator.OR, new LinkedNodeExpression(SparkStreamingConstant.KAFKA_SPARKCONFIGURATION_LINKEDPARAMETER, // $NON-NLS-1$
    "SUPPORTED_SPARK_VERSION", // $NON-NLS-1$
    EqualityOperator.EQ, // $NON-NLS-1$
    ESparkVersion.SPARK_2_4_X.getSparkVersion()));
}
Also used : SimpleComponentCondition(org.talend.hadoop.distribution.condition.SimpleComponentCondition) MultiComponentCondition(org.talend.hadoop.distribution.condition.MultiComponentCondition) LinkedNodeExpression(org.talend.hadoop.distribution.condition.LinkedNodeExpression)

Example 4 with LinkedNodeExpression

use of org.talend.hadoop.distribution.condition.LinkedNodeExpression in project tbd-studio-se by Talend.

the class ExpressionTest method testGetExpressionString.

@Test
public void testGetExpressionString() throws Exception {
    Expression e1 = new BasicExpression(PARAM_1, VALUE_1, EqualityOperator.EQ);
    assertEquals(e1.getExpressionString(), LEFT_PAR + PARAM_1 + EQ + SINGLE_QUOTE + VALUE_1 + SINGLE_QUOTE + RIGHT_PAR);
    e1 = new BasicExpression(PARAM_1, VALUE_1, EqualityOperator.NOT_EQ);
    assertEquals(e1.getExpressionString(), LEFT_PAR + PARAM_1 + NEQ + SINGLE_QUOTE + VALUE_1 + SINGLE_QUOTE + RIGHT_PAR);
    e1 = new LinkedNodeExpression(SparkBatchConstant.SPARK_BATCH_SPARKCONFIGURATION_LINKEDPARAMETER, SparkBatchConstant.SPARK_BATCH_AZURE_SPARKCONFIGURATION_LINKEDPARAMETER, EqualityOperator.GE, ESparkVersion.SPARK_3_0.getSparkVersion());
    // $NON-NLS-1$
    assertEquals("(#LINK@NODE.SPARK_CONFIGURATION.STORAGE_CONFIGURATION ge 'SPARK_3_0_x')", e1.getExpressionString());
}
Also used : BasicExpression(org.talend.hadoop.distribution.condition.BasicExpression) BasicExpression(org.talend.hadoop.distribution.condition.BasicExpression) LinkedNodeExpression(org.talend.hadoop.distribution.condition.LinkedNodeExpression) Expression(org.talend.hadoop.distribution.condition.Expression) LinkedNodeExpression(org.talend.hadoop.distribution.condition.LinkedNodeExpression) Test(org.junit.Test)

Aggregations

LinkedNodeExpression (org.talend.hadoop.distribution.condition.LinkedNodeExpression)4 MultiComponentCondition (org.talend.hadoop.distribution.condition.MultiComponentCondition)2 SimpleComponentCondition (org.talend.hadoop.distribution.condition.SimpleComponentCondition)2 Test (org.junit.Test)1 BasicExpression (org.talend.hadoop.distribution.condition.BasicExpression)1 Expression (org.talend.hadoop.distribution.condition.Expression)1