public APIResult addPartitionToFactTable(String fact, String storage, XPartition partition) { WebTarget target = getMetastoreWebTarget(); return translate(target.path("facts").path(fact) .path("storages").path(storage).path("partition") .queryParam("sessionid", this.connection.getSessionHandle()) .request(MediaType.APPLICATION_XML) .post(Entity.xml(new GenericEntity<JAXBElement<XPartition>>(objFact.createXPartition(partition)){}))); }
APIResult partAddResult = target().path("metastore/facts/").path(table).path("storages/S1/partition") .queryParam("sessionid", lensSessionId).request(mediaType) .post(Entity.entity(new GenericEntity<JAXBElement<XPartition>>(cubeObjectFactory.createXPartition(xp)) { }, mediaType), APIResult.class); assertSuccess(partAddResult); .post(Entity.entity(new GenericEntity<JAXBElement<XPartition>>(cubeObjectFactory.createXPartition(xp)) { }, mediaType), APIResult.class); assertEquals(partAddResult.getStatus(), Status.FAILED); APIResult partUpdateResult = target().path("metastore/facts/").path(table).path("storages/S1/partition") .queryParam("sessionid", lensSessionId).request(mediaType) .put(Entity.entity(new GenericEntity<JAXBElement<XPartition>>(cubeObjectFactory.createXPartition(xp)) { }, mediaType), APIResult.class); assertSuccess(partUpdateResult);
partAddResult = target().path("metastore/dimtables/").path(table).path("storages/test/partition") .queryParam("sessionid", lensSessionId).request(mediaType) .post(Entity.entity(new GenericEntity<JAXBElement<XPartition>>(cubeObjectFactory.createXPartition(xp)){}, mediaType), APIResult.class); assertSuccess(partAddResult); .post(Entity.entity(new GenericEntity<JAXBElement<XPartition>>(cubeObjectFactory.createXPartition(xp)){}, mediaType), APIResult.class); assertEquals(partAddResult.getStatus(), Status.FAILED); APIResult partUpdateResult = target().path("metastore/dimtables/").path(table).path("storages/test/partition") .queryParam("sessionid", lensSessionId).request(mediaType) .put(Entity.entity(new GenericEntity<JAXBElement<XPartition>>(cubeObjectFactory.createXPartition(xp)){}, mediaType), APIResult.class); assertSuccess(partUpdateResult); .post(Entity.entity(new GenericEntity<JAXBElement<XPartition>>(cubeObjectFactory.createXPartition(xp)){}, mediaType)); if (mediaType.equals(MediaType.APPLICATION_XML_TYPE)) {
public APIResult addPartitionToDimensionTable(String dimTblName, String storage, XPartition partition) { WebTarget target = getMetastoreWebTarget(); return translate(target.path("dimtables").path(dimTblName) .path("storages").path(storage).path("partition") .queryParam("sessionid", this.connection.getSessionHandle()) .request(MediaType.APPLICATION_XML) .post(Entity.xml(new GenericEntity<JAXBElement<XPartition>>(objFact.createXPartition(partition)){}))); }
Response response = target().path("metastore/facts/").path(table).path("storages/S2/partition") .queryParam("sessionid", lensSessionId).request(mediaType) .post(Entity.entity(new GenericEntity<JAXBElement<XPartition>>(cubeObjectFactory.createXPartition(xp2)){}, mediaType)); assertEquals(response.getStatus(), 400); partAddResult = target().path("metastore/facts/").path(table).path("storages/S2/partition") .queryParam("sessionid", lensSessionId).request(mediaType) .post(Entity.entity(new GenericEntity<JAXBElement<XPartition>>(cubeObjectFactory.createXPartition(xp)){}, mediaType), APIResult.class); assertSuccess(partAddResult); .post(Entity.entity(new GenericEntity<JAXBElement<XPartition>>(cubeObjectFactory.createXPartition(xp)){}, mediaType), APIResult.class); assertEquals(partAddResult.getStatus(), Status.FAILED); .queryParam("filter", "dt='" + HOURLY.format(partDate) + "'") .request(mediaType) .put(Entity.entity(new GenericEntity<JAXBElement<XPartition>>(cubeObjectFactory.createXPartition(xp)){}, mediaType), APIResult.class); assertSuccess(partUpdateResult); .post(Entity.entity(new GenericEntity<JAXBElement<XPartition>>(cubeObjectFactory.createXPartition(xp)){}, mediaType)); if (mediaType.equals(MediaType.APPLICATION_XML_TYPE)) { APIResult partAddResult1 = target().path("metastore/facts/").path(table).path("storages/S3/partition") .queryParam("sessionid", lensSessionId).request(mediaType) .post(Entity.entity(new GenericEntity<JAXBElement<XPartition>>(cubeObjectFactory.createXPartition(xp)) {
public APIResult addPartitionToFactTable(String fact, String storage, XPartition partition) { WebTarget target = getMetastoreWebTarget(); return translate(target.path("facts").path(fact) .path("storages").path(storage).path("partition") .queryParam("sessionid", this.connection.getSessionHandle()) .request(MediaType.APPLICATION_XML) .post(Entity.xml(new GenericEntity<JAXBElement<XPartition>>(objFact.createXPartition(partition)){}))); }
public APIResult addPartitionToDimensionTable(String dimTblName, String storage, XPartition partition) { WebTarget target = getMetastoreWebTarget(); return translate(target.path("dimtables").path(dimTblName) .path("storages").path(storage).path("partition") .queryParam("sessionid", this.connection.getSessionHandle()) .request(MediaType.APPLICATION_XML) .post(Entity.xml(new GenericEntity<JAXBElement<XPartition>>(objFact.createXPartition(partition)){}))); }
public APIResult updatePartitionOfFactTable(String fact, String storage, XPartition partition) { WebTarget target = getMetastoreWebTarget(); return translate(target.path("facts").path(fact) .path("storages").path(storage).path("partition") .queryParam("sessionid", this.connection.getSessionHandle()) .request(MediaType.APPLICATION_XML) .put(Entity.xml(new GenericEntity<JAXBElement<XPartition>>(objFact.createXPartition(partition)){}))); }
public APIResult updatePartitionOfDimensionTable(String dimTblName, String storage, XPartition partition) { WebTarget target = getMetastoreWebTarget(); return translate(target.path("dimtables").path(dimTblName) .path("storages").path(storage).path("partition") .queryParam("sessionid", this.connection.getSessionHandle()) .request(MediaType.APPLICATION_XML) .put(Entity.xml(new GenericEntity<JAXBElement<XPartition>>(objFact.createXPartition(partition)){}))); }
public APIResult updatePartitionOfFactTable(String fact, String storage, XPartition partition) { WebTarget target = getMetastoreWebTarget(); return translate(target.path("facts").path(fact) .path("storages").path(storage).path("partition") .queryParam("sessionid", this.connection.getSessionHandle()) .request(MediaType.APPLICATION_XML) .put(Entity.xml(new GenericEntity<JAXBElement<XPartition>>(objFact.createXPartition(partition)){}))); }
public APIResult updatePartitionOfDimensionTable(String dimTblName, String storage, XPartition partition) { WebTarget target = getMetastoreWebTarget(); return translate(target.path("dimtables").path(dimTblName) .path("storages").path(storage).path("partition") .queryParam("sessionid", this.connection.getSessionHandle()) .request(MediaType.APPLICATION_XML) .put(Entity.xml(new GenericEntity<JAXBElement<XPartition>>(objFact.createXPartition(partition)){}))); }
private XPartition createPartition(String cubeTableName, final List<XTimePartSpecElement> timePartSpecs, String updatePeriod) { XPartition xp = cubeObjectFactory.createXPartition(); xp.setLocation(new Path(new File("target").getAbsolutePath(), "part/test_part").toString()); xp.setFactOrDimensionTableName(cubeTableName); xp.setNonTimePartitionSpec(new XPartSpec()); xp.setTimePartitionSpec(new XTimePartSpec()); xp.setPartitionParameters(new XProperties()); xp.setSerdeParameters(new XProperties()); for (XTimePartSpecElement timePartSpec : timePartSpecs) { xp.getTimePartitionSpec().getPartSpecElement().add(timePartSpec); } if (updatePeriod==null) { xp.setUpdatePeriod(XUpdatePeriod.HOURLY); } else { XUpdatePeriod updatePeriod1=XUpdatePeriod.valueOf(updatePeriod.toUpperCase()); xp.setUpdatePeriod(updatePeriod1); } return xp; }
.path("storages/" + storages[0] + "/partition") .queryParam("sessionid", lensSessionId).request(mediaType) .post(Entity.entity(new GenericEntity<JAXBElement<XPartition>>(cubeObjectFactory.createXPartition(xp)){}, mediaType)); APIResult partAddResult = response.readEntity(APIResult.class);