public boolean getBooleanProperty( String name ) { return getBooleanValue( properties, name ); }
public boolean getBooleanProperty( String name ) { return getBooleanValue( properties, name ); }
@JsonIgnore public boolean isPersistent() { return getBooleanValue( properties, MESSAGE_PERSISTENT ); }
@JsonIgnore public boolean isIndexed() { return getBooleanValue( properties, MESSAGE_INDEXED ); }
Map<String, Object> attributes = metadata.getAnnotationAttributes(Merge.class.getName()); if (!MapUtils.isEmpty(attributes)) { boolean isEarly = MapUtils.getBooleanValue(attributes,"early"); BeanDefinitionBuilder builder = BeanDefinitionBuilder .genericBeanDefinition(isEarly?EarlyStageMergeBeanPostProcessor.class:LateStageMergeBeanPostProcessor.class)
@Test public void testRemoveNamespaces() throws Exception { Map props = new HashMap(); props.put("blah.booleanProperty", "true"); props.put("blah.blah.doubleProperty", NumberFormat.getInstance().format(0.124)); props.put("blah.blah.Blah.intProperty", "14"); props.put("longProperty", "999999999"); props.put("3456.stringProperty", "string"); props = PropertiesUtils.removeNamespaces(props); assertTrue(getBooleanValue(props, "booleanProperty", false)); assertEquals(0.124, 0, getDoubleValue(props, "doubleProperty", 0)); assertEquals(14, getIntValue(props, "intProperty", 0)); assertEquals(999999999, 0, getLongValue(props, "longProperty", 0)); assertEquals("string", getString(props, "stringProperty", "")); }
/** * Loads {@link QuickAnalysisStrategy} from a {@link UserPreferences} * object. * * @param userPreferences * @return */ public static QuickAnalysisStrategy loadFromUserPreferences(final UserPreferences userPreferences) { final Map<String, String> properties = userPreferences.getAdditionalProperties(); final int columnsPerAnalyzer = MapUtils.getIntValue(properties, USER_PREFERENCES_NAMESPACE + ".columnsPerAnalyzer", 5); final boolean includeValueDistribution = MapUtils.getBooleanValue(properties, USER_PREFERENCES_NAMESPACE + ".includeValueDistribution", false); final boolean includePatternFinder = MapUtils.getBooleanValue(properties, USER_PREFERENCES_NAMESPACE + ".includePatternFinder", false); return new QuickAnalysisStrategy(columnsPerAnalyzer, includeValueDistribution, includePatternFinder); }
public SourceLocationManager getLocationManager( Table table, List<Partition> partitions, String eventId, Map<String, Object> copierOptions) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } HdfsSnapshotLocationManager hdfsSnapshotLocationManager = new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, partitions, snapshotsDisabled, sourceTableLocation, sourceCatalogListener); boolean ignoreMissingFolder = MapUtils.getBooleanValue(copierOptions, CopierOptions.IGNORE_MISSING_PARTITION_FOLDER_ERRORS, false); if (ignoreMissingFolder) { return new FilterMissingPartitionsLocationManager(hdfsSnapshotLocationManager, getHiveConf()); } return hdfsSnapshotLocationManager; }
public SourceLocationManager getLocationManager( Table table, List<Partition> partitions, String eventId, Map<String, Object> copierOptions) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } HdfsSnapshotLocationManager hdfsSnapshotLocationManager = new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, partitions, snapshotsDisabled, sourceTableLocation, sourceCatalogListener); boolean ignoreMissingFolder = MapUtils.getBooleanValue(copierOptions, CopierOptions.IGNORE_MISSING_PARTITION_FOLDER_ERRORS, false); if (ignoreMissingFolder) { return new FilterMissingPartitionsLocationManager(hdfsSnapshotLocationManager, getHiveConf()); } return hdfsSnapshotLocationManager; }
@Test public void testRemoveNamespaces() throws Exception { Map props = new HashMap(); props.put("blah.booleanProperty", "true"); props.put("blah.blah.doubleProperty", NumberFormat.getInstance().format(0.124)); props.put("blah.blah.Blah.intProperty", "14"); props.put("longProperty", "999999999"); props.put("3456.stringProperty", "string"); props = PropertiesUtils.removeNamespaces(props); assertTrue(getBooleanValue(props, "booleanProperty", false)); assertEquals(0.124, 0, getDoubleValue(props, "doubleProperty", 0)); assertEquals(14, getIntValue(props, "intProperty", 0)); assertEquals(999999999, 0, getLongValue(props, "longProperty", 0)); assertEquals("string", getString(props, "stringProperty", "")); }