Search in sources :

Example 1 with OrderedProperties

use of org.apache.hudi.common.config.OrderedProperties in project hudi by apache.

the class TestOrderedProperties method testPutAllPropertiesOrder.

@Test
void testPutAllPropertiesOrder() {
    Properties firstProp = new OrderedProperties();
    firstProp.put("key0", "true");
    firstProp.put("key1", "false");
    firstProp.put("key2", "true");
    OrderedProperties firstProperties = new OrderedProperties(firstProp);
    assertTypeProperties(firstProperties, 0);
    OrderedProperties secondProperties = new OrderedProperties();
    secondProperties.put("key3", "true");
    secondProperties.put("key4", "false");
    secondProperties.put("key5", "true");
    assertTypeProperties(secondProperties, 3);
    OrderedProperties thirdProperties = new OrderedProperties();
    thirdProperties.putAll(firstProp);
    thirdProperties.putAll(secondProperties);
    assertEquals(3, firstProp.stringPropertyNames().size());
    assertEquals(3, secondProperties.stringPropertyNames().size());
    assertEquals(6, thirdProperties.stringPropertyNames().size());
}
Also used : OrderedProperties(org.apache.hudi.common.config.OrderedProperties) Properties(java.util.Properties) OrderedProperties(org.apache.hudi.common.config.OrderedProperties) Test(org.junit.jupiter.api.Test)

Example 2 with OrderedProperties

use of org.apache.hudi.common.config.OrderedProperties in project hudi by apache.

the class HoodieTableConfig method getOrderedPropertiesWithTableChecksum.

private static Properties getOrderedPropertiesWithTableChecksum(Properties props) {
    Properties orderedProps = new OrderedProperties(props);
    orderedProps.put(TABLE_CHECKSUM.key(), String.valueOf(generateChecksum(props)));
    return orderedProps;
}
Also used : OrderedProperties(org.apache.hudi.common.config.OrderedProperties) Properties(java.util.Properties) TypedProperties(org.apache.hudi.common.config.TypedProperties) OrderedProperties(org.apache.hudi.common.config.OrderedProperties)

Example 3 with OrderedProperties

use of org.apache.hudi.common.config.OrderedProperties in project hudi by apache.

the class TestOrderedProperties method testPutPropertiesOrder.

@Test
public void testPutPropertiesOrder() {
    Properties properties = new OrderedProperties();
    properties.put("key0", "true");
    properties.put("key1", "false");
    properties.put("key2", "true");
    properties.put("key3", "false");
    properties.put("key4", "true");
    properties.put("key5", "true");
    properties.put("key6", "false");
    properties.put("key7", "true");
    properties.put("key8", "false");
    properties.put("key9", "true");
    OrderedProperties typedProperties = new OrderedProperties(properties);
    assertTypeProperties(typedProperties, 0);
}
Also used : OrderedProperties(org.apache.hudi.common.config.OrderedProperties) Properties(java.util.Properties) OrderedProperties(org.apache.hudi.common.config.OrderedProperties) Test(org.junit.jupiter.api.Test)

Aggregations

Properties (java.util.Properties)3 OrderedProperties (org.apache.hudi.common.config.OrderedProperties)3 Test (org.junit.jupiter.api.Test)2 TypedProperties (org.apache.hudi.common.config.TypedProperties)1