@Override public void createSegmentation(LensSessionHandle sessionid, XSegmentation cubeSeg) throws LensException { try (SessionContext ignored = new SessionContext(sessionid)){ getClient(sessionid).createSegmentation(cubeSeg); log.info("Created segmentation " + cubeSeg.getName()); } }
/** * * @param baseCubeName The cube name ot which segmentation belong to * @param segmentationName The segmentation name * @param segments Participating cube segements * @param weight Weight of segmentation * @param properties Properties of segmentation * @throws LensException */ public void createSegmentation(String baseCubeName, String segmentationName, Set<Segment> segments, double weight, Map<String, String> properties) throws LensException { Segmentation cubeSeg = new Segmentation(baseCubeName, segmentationName, segments, weight, properties); createSegmentation(cubeSeg); // do a get to update cache getSegmentation(segmentationName); }
/** * * @param baseCubeName The cube name ot which segmentation belong to * @param segmentationName The segmentation name * @param segments Participating cube segements * @param weight Weight of segmentation * @param properties Properties of segmentation * @throws LensException */ public void createSegmentation(String baseCubeName, String segmentationName, Set<Segment> segments, double weight, Map<String, String> properties) throws LensException { Segmentation cubeSeg = new Segmentation(baseCubeName, segmentationName, segments, weight, properties); createSegmentation(cubeSeg); // do a get to update cache getSegmentation(segmentationName); }
public void alterSegmentation(String segName, Segmentation seg) throws HiveException, LensException { getTableWithTypeFailFast(segName, CubeTableType.SEGMENTATION); if (!(getSegmentation(segName) == seg)) { dropSegmentation(segName); createSegmentation(seg); updateSegmentationCache(segName); } }
public <T extends Equals & HashCode & ToString> void createEntity(T entity) throws LensException { if (entity instanceof XStorage) { createStorage((XStorage) entity); } else if (entity instanceof XCube) { createCube((XCube)entity); } else if (entity instanceof XDimension) { createDimension((XDimension) entity); } else if (entity instanceof XFact) { createFactTable((XFact) entity); } else if (entity instanceof XDimensionTable) { createCubeDimensionTable((XDimensionTable) entity); } else if (entity instanceof XSegmentation) { createSegmentation((XSegmentation) entity); } else { throw new LensException("Unable to create entity " + entity + " as it's unrecognizable: "+ entity.getClass()); } }
public void alterSegmentation(String segName, Segmentation seg) throws HiveException, LensException { getTableWithTypeFailFast(segName, CubeTableType.SEGMENTATION); checkIfAuthorized(); if (!(getSegmentation(segName) == seg)) { dropSegmentation(segName); createSegmentation(seg); updateSegmentationCache(segName); } }
public <T extends Equals & HashCode & ToString> void createEntity(T entity) throws LensException { if (entity instanceof XStorage) { createStorage((XStorage) entity); } else if (entity instanceof XCube) { createCube((XCube) entity); } else if (entity instanceof XDimension) { createDimension((XDimension) entity); } else if (entity instanceof XFact) { createFactTable((XFact) entity); } else if (entity instanceof XDimensionTable) { createCubeDimensionTable((XDimensionTable) entity); } else if (entity instanceof XSegmentation) { createSegmentation((XSegmentation) entity); } else { throw new LensException("Unable to create entity " + entity + " as it's unrecognizable: " + entity.getClass()); } }
public void createSegmentation(XSegmentation cubeSeg) throws LensException { createSegmentation( cubeSeg.getCubeName(), cubeSeg.getName(), JAXBUtils.segmentsFromXSegments(cubeSeg.getSegements()), cubeSeg.getWeight(), JAXBUtils.mapFromXProperties(cubeSeg.getProperties())); } public void createSegmentation(Segmentation cubeSeg)
public void createSegmentation(XSegmentation cubeSeg) throws LensException { createSegmentation( cubeSeg.getCubeName(), cubeSeg.getName(), JAXBUtils.segmentsFromXSegments(cubeSeg.getSegements()), cubeSeg.getWeight(), JAXBUtils.mapFromXProperties(cubeSeg.getProperties())); }
client.createSegmentation(CUBE_NAME, segmentName, cubeSegs, 0L, props); assertEquals(client.getSegmentation(segmentName).getSegments().size(), 3);