/** * Get the dimension specified by name * * @param sessionid The sessionid in which user is working * @param dimName The dimension name * @return JAXB representation of {@link XDimension} */ @GET @Path("/dimensions/{dimName}") public JAXBElement<XDimension> getDimension(@QueryParam("sessionid") LensSessionHandle sessionid, @PathParam("dimName") String dimName) throws LensException { checkSessionId(sessionid); return X_CUBE_OBJECT_FACTORY.createXDimension(getSvc().getDimension(sessionid, dimName)); }
private XDimensionTable createDimTable(String dimTableName, MediaType mediaType) throws Exception { XDimension dimension = createDimension("testdim"); APIResult result = target().path("metastore").path("dimensions") .queryParam("sessionid", lensSessionId).request( mediaType).post(Entity.entity(new GenericEntity<JAXBElement<XDimension>>(cubeObjectFactory .createXDimension(dimension)) {}, mediaType), APIResult.class); assertSuccess(result); XDimensionTable dt = createDimTable("testdim", dimTableName); dt.getStorageTables().getStorageTable().add(createStorageTblElement("test", dimTableName, "HOURLY")); result = target() .path("metastore") .path("dimtables").queryParam("sessionid", lensSessionId) .request(mediaType) .post(Entity.entity( new GenericEntity<JAXBElement<XDimensionTable>>(cubeObjectFactory.createXDimensionTable(dt)) {}, mediaType), APIResult.class); assertSuccess(result); return dt; }
public APIResult createDimension(XDimension dimension) { WebTarget target = getMetastoreWebTarget(); return translate(target.path("dimensions") .queryParam("sessionid", this.connection.getSessionHandle()) .request(MediaType.APPLICATION_XML) .post(Entity.xml(new GenericEntity<JAXBElement<XDimension>>(objFact.createXDimension(dimension)){}))); }
public APIResult createDimension(XDimension dimension) { WebTarget target = getMetastoreWebTarget(); return translate(target.path("dimensions") .queryParam("sessionid", this.connection.getSessionHandle()) .request(MediaType.APPLICATION_XML) .post(Entity.xml(new GenericEntity<JAXBElement<XDimension>>(objFact.createXDimension(dimension)){}))); }
public APIResult updateDimension(String dimName, XDimension dimension) { WebTarget target = getMetastoreWebTarget(); return translate(target.path("dimensions").path(dimName) .queryParam("sessionid", this.connection.getSessionHandle()) .request(MediaType.APPLICATION_XML) .put(Entity.xml(new GenericEntity<JAXBElement<XDimension>>(objFact.createXDimension(dimension)){}))); }
public APIResult updateDimension(String dimName, XDimension dimension) { WebTarget target = getMetastoreWebTarget(); return translate(target.path("dimensions").path(dimName) .queryParam("sessionid", this.connection.getSessionHandle()) .request(MediaType.APPLICATION_XML) .put(Entity.xml(new GenericEntity<JAXBElement<XDimension>>(objFact.createXDimension(dimension)){}))); }
public static XDimension xdimensionFromDimension(Dimension dimension) { XDimension xd = XCF.createXDimension(); xd.setName(dimension.getName()); xd.setAttributes(new XDimAttributes()); xd.setExpressions(new XExpressions()); xd.setJoinChains(new XJoinChains()); xd.setProperties(new XProperties()); xd.getProperties().getProperty().addAll(xPropertiesFromMap(((AbstractCubeTable) dimension).getProperties())); for (CubeDimAttribute cd : dimension.getAttributes()) { xd.getAttributes().getDimAttribute().add(xDimAttrFromHiveDimAttr(cd, dimension)); } for (ExprColumn ec : dimension.getExpressions()) { xd.getExpressions().getExpression().add(xExprColumnFromHiveExprColumn(ec)); } for (JoinChain jc : dimension.getJoinChains()) { xd.getJoinChains().getJoinChain().add(getXJoinChainFromJoinChain(jc)); } return xd; }
public static XDimension xdimensionFromDimension(Dimension dimension) { XDimension xd = XCF.createXDimension(); xd.setName(dimension.getName()); xd.setAttributes(new XDimAttributes()); xd.setExpressions(new XExpressions()); xd.setJoinChains(new XJoinChains()); xd.setProperties(new XProperties()); xd.getProperties().getProperty().addAll(xPropertiesFromMap(((AbstractCubeTable) dimension).getProperties())); for (CubeDimAttribute cd : dimension.getAttributes()) { xd.getAttributes().getDimAttribute().add(xDimAttrFromHiveDimAttr(cd, dimension)); } for (ExprColumn ec : dimension.getExpressions()) { xd.getExpressions().getExpression().add(xExprColumnFromHiveExprColumn(ec)); } for (JoinChain jc : dimension.getJoinChains()) { xd.getJoinChains().getJoinChain().add(getXJoinChainFromJoinChain(jc)); } return xd; }
.queryParam("sessionid", lensSessionId) .request(mediaType).put(Entity.entity(new GenericEntity<JAXBElement<XDimension>>(cubeObjectFactory .createXDimension(testDim)){}, mediaType), APIResult.class); assertSuccess(result);
.createXDimension(dimension)){}, mediaType), APIResult.class); assertNotNull(result); assertSuccess(result); .createXDimension(dimension2)){}, mediaType), APIResult.class); assertNotNull(result); assertSuccess(result);
final XMLGregorianCalendar endDate = DatatypeFactory.newInstance().newXMLGregorianCalendar(c); XDimension dimension = cubeObjectFactory.createXDimension(); dimension.setName(dimName);