public XProperty withValue(String value) { setValue(value); return this; }
public XProperty withValue(String value) { setValue(value); return this; }
public static List<XProperty> xPropertyFromMap(Map<String, String> map) { List<XProperty> xpList = new ArrayList<XProperty>(); if (map != null && !map.isEmpty()) { for (Map.Entry<String, String> e : map.entrySet()) { XProperty property = new XProperty(); property.setName(e.getKey()); property.setValue(e.getValue()); xpList.add(property); } } return xpList; }
/** * Convert string map to XProperties */ public static List<XProperty> xPropertiesFromMap(Map<String, String> map) { List<XProperty> xpList = new ArrayList<XProperty>(); if (map != null && !map.isEmpty()) { for (Map.Entry<String, String> e : map.entrySet()) { XProperty property = XCF.createXProperty(); property.setName(e.getKey()); property.setValue(e.getValue()); xpList.add(property); } } return xpList; }
/** * Convert string map to XProperties */ public static List<XProperty> xPropertiesFromMap(Map<String, String> map) { List<XProperty> xpList = new ArrayList<XProperty>(); if (map != null && !map.isEmpty()) { for (Map.Entry<String, String> e : map.entrySet()) { XProperty property = XCF.createXProperty(); property.setName(e.getKey()); property.setValue(e.getValue()); xpList.add(property); } } return xpList; }
public static XProperties xPropertiesFromMap(Map<String, String> map) { ObjectFactory xCF = new ObjectFactory(); if (map != null && !map.isEmpty()) { XProperties xp = xCF.createXProperties(); List<XProperty> xpList = xp.getProperty(); for (Map.Entry<String, String> e : map.entrySet()) { XProperty property = xCF.createXProperty(); property.setName(e.getKey()); property.setValue(e.getValue()); xpList.add(property); } return xp; } return null; }
public static XProperties getXpropertiesFromSegment(Segment cseg) { XProperties xproperties = XCF.createXProperties(); for (String prop : cseg.getProperties().keySet()) { String segPrefix = MetastoreUtil.getSegmentPropertyKey(cseg.getName()); if (prop.startsWith(segPrefix)){ XProperty xprop = XCF.createXProperty(); xprop.setName(prop.replace(segPrefix, "")); xprop.setValue(cseg.getProperties().get(prop)); xproperties.getProperty().add(xprop); } } return xproperties; }
public static XProperties getXpropertiesFromSegment(Segment cseg) { XProperties xproperties = XCF.createXProperties(); for (String prop : cseg.getProperties().keySet()) { String segPrefix = MetastoreUtil.getSegmentPropertyKey(cseg.getName()); if (prop.startsWith(segPrefix)){ XProperty xprop = XCF.createXProperty(); xprop.setName(prop.replace(segPrefix, "")); xprop.setValue(cseg.getProperties().get(prop)); xproperties.getProperty().add(xprop); } } return xproperties; }
private void createStorage(String storageName, MediaType mediaType) throws Exception { WebTarget target = target().path("metastore").path("storages"); XStorage xs = new XStorage(); xs.setProperties(new XProperties()); xs.setName(storageName); xs.setClassname(HDFSStorage.class.getCanonicalName()); XProperty prop = cubeObjectFactory.createXProperty(); prop.setName("prop1.name"); prop.setValue("prop1.value"); xs.getProperties().getProperty().add(prop); APIResult result = target.queryParam("sessionid", lensSessionId).request(mediaType).post( Entity.entity(new GenericEntity<JAXBElement<XStorage>>(cubeObjectFactory.createXStorage(xs)) { }, mediaType), APIResult.class); assertNotNull(result); assertSuccess(result); }
prop.setValue("prop2.value"); store1.getProperties().getProperty().add(prop);
public static XCube createXCubeWithDummyMeasure(final String cubeName, final Optional<String> dateColName, final XDimAttributes xDimAttributes, final XMeasures xMeasures) { XBaseCube cube = new XBaseCube(); cube.setName(cubeName); cube.setDimAttributes(xDimAttributes); cube.setMeasures(xMeasures); if (dateColName.isPresent()) { XProperty xp = new XProperty(); xp.setName("cube."+cubeName+".timed.dimensions.list"); xp.setValue(dateColName.get()); XProperties xProperties = new XProperties(); xProperties.getProperty().add(xp); cube.setProperties(xProperties); } return cube; } public static XDimAttribute createXDimAttribute(final String name, final Optional<DateTime> startDate,
XProperty xp = new XProperty(); xp.setName(MetastoreConstants.CUBE_ALL_FIELDS_QUERIABLE); xp.setValue("false"); qcube.getProperties().getProperty().add(xp);
prop.setValue("dim.prop2.value"); testDim.getProperties().getProperty().add(prop);
XProperty propStartTime = cubeObjectFactory.createXProperty(); propStartTime.setName(MetastoreUtil.getStoragetableStartTimesKey()); propStartTime.setValue("now -10 days"); XProperty propEndTime = cubeObjectFactory.createXProperty(); propEndTime.setName(MetastoreUtil.getStoragetableEndTimesKey()); propEndTime.setValue("now +5 days"); props.getProperty().add(propStartTime); props.getProperty().add(propEndTime);
private XDerivedCube createDerivedCube(String cubeName, String parent, boolean addExtraFields) throws Exception { XDerivedCube cube = cubeObjectFactory.createXDerivedCube(); cube.setName(cubeName); cube.setDimAttrNames(new XDimAttrNames()); cube.setMeasureNames(new XMeasureNames()); cube.setProperties(new XProperties()); cube.getDimAttrNames().getAttrName().add("dim1"); cube.getMeasureNames().getMeasureName().add("msr1"); if (addExtraFields) { cube.getDimAttrNames().getAttrName().add("random_dim"); cube.getMeasureNames().getMeasureName().add("random_measure"); } XProperty xp1 = cubeObjectFactory.createXProperty(); xp1.setName("derived.foo"); xp1.setValue("derived.bar"); cube.getProperties().getProperty().add(xp1); cube.setParent(parent); return cube; }
xp1.setValue("dim.bar"); dimension.getProperties().getProperty().add(xp1); return dimension;
private XDimensionTable createDimTable(String dimName, String table) { XDimensionTable dt = cubeObjectFactory.createXDimensionTable(); dt.setDimensionName(dimName); dt.setTableName(table); dt.setWeight(15.0); dt.setColumns(new XColumns()); dt.setProperties(new XProperties()); dt.setStorageTables(new XStorageTables()); XColumn c1 = cubeObjectFactory.createXColumn(); c1.setName("col1"); c1.setType("STRING"); c1.setComment("Fisrt column"); dt.getColumns().getColumn().add(c1); XColumn c2 = cubeObjectFactory.createXColumn(); c2.setName("col2"); c2.setType("INT"); c2.setComment("Second column"); dt.getColumns().getColumn().add(c2); XProperty p1 = cubeObjectFactory.createXProperty(); p1.setName("foodim"); p1.setValue("bardim"); dt.getProperties().getProperty().add(p1); return dt; }
xp1.setValue("bar"); cube.getProperties().getProperty().add(xp1); return cube;