public XTimePartSpecElement withKey(String value) { setKey(value); return this; }
public XTimePartSpecElement withValue(XMLGregorianCalendar value) { setValue(value); return this; }
/** * Create an instance of {@link XTimePartSpecElement } * */ public XTimePartSpecElement createXTimePartSpecElement() { return new XTimePartSpecElement(); }
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { { String theKey; theKey = this.getKey(); strategy.appendField(locator, this, "key", buffer, theKey); } { XMLGregorianCalendar theValue; theValue = this.getValue(); strategy.appendField(locator, this, "value", buffer, theValue); } return buffer; }
/** * Sets up query command instances and adds partitions to a table. * @throws Exception */ @BeforeClass public void setup() throws Exception { LensClient client = new LensClient(); LensCubeCommands command = new LensCubeCommands(); command.setClient(client); log.debug("Starting to test cube commands"); URL cubeSpec = TestLensQueryCommands.class.getClassLoader().getResource("schema/cubes/base/sample-cube.xml"); command.createCube(new File(cubeSpec.toURI())); TestLensDimensionCommands.createDimension(); TestLensDimensionTableCommands.addDim1Table("dim_table", "schema/dimtables/dim_table.xml", "local"); // Add partition URL dataDir = TestLensQueryCommands.class.getClassLoader().getResource("dim2-part"); XPartition xp = new XPartition(); xp.setFactOrDimensionTableName("dim_table"); xp.setLocation(new Path(dataDir.toURI()).toString()); xp.setUpdatePeriod(XUpdatePeriod.HOURLY); XTimePartSpec timePart = new XTimePartSpec(); XTimePartSpecElement partElement = new XTimePartSpecElement(); partElement.setKey("dt"); partElement.setValue(DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar())); timePart.getPartSpecElement().add(partElement); xp.setTimePartitionSpec(timePart); APIResult result = client.addPartitionToDim("dim_table", "local", xp); assertEquals(result.getStatus(), APIResult.Status.SUCCEEDED); }
private XTimePartSpecElement createTimePartSpecElement(Date partDate, String timeDimension) { XTimePartSpecElement timePart = cubeObjectFactory.createXTimePartSpecElement(); timePart.setKey(timeDimension); timePart.setValue(JAXBUtils.getXMLGregorianCalendar(HOURLY.truncate(partDate))); return timePart; }
public String toString() { final ToStringStrategy strategy = new YAMLToStringStrategy(); final StringBuilder buffer = new StringBuilder(); append(null, buffer, strategy); return buffer.toString(); }
for (Map.Entry<String, String> entry : partSpec.entrySet()) { if (timePartCols.contains(entry.getKey())) { XTimePartSpecElement timePartSpecElement = new XTimePartSpecElement(); timePartSpecElement.setKey(entry.getKey()); timePartSpecElement .setValue(getXMLGregorianCalendar(UpdatePeriod.valueOf(xp.getUpdatePeriod().name()).parse( entry.getValue()))); xp.getTimePartitionSpec().getPartSpecElement().add(timePartSpecElement);
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { { String theKey; theKey = this.getKey(); strategy.appendField(locator, this, "key", buffer, theKey); } { XMLGregorianCalendar theValue; theValue = this.getValue(); strategy.appendField(locator, this, "value", buffer, theValue); } return buffer; }
timePartSpecElement1.setKey(timeDimensionPresentInPartitionOfAllFacts); timePartSpecElement1.setValue(JAXBUtils.getXMLGregorianCalendar(currentDate)); timePartSpecElement2.setKey(timeDimOnlyPresentInPartitionOfFact1); timePartSpecElement2.setValue(JAXBUtils.getXMLGregorianCalendar(expectedLatestDate));
public String toString() { final ToStringStrategy strategy = new YAMLToStringStrategy(); final StringBuilder buffer = new StringBuilder(); append(null, buffer, strategy); return buffer.toString(); }
for (Map.Entry<String, String> entry : partSpec.entrySet()) { if (timePartCols.contains(entry.getKey())) { XTimePartSpecElement timePartSpecElement = new XTimePartSpecElement(); timePartSpecElement.setKey(entry.getKey()); timePartSpecElement .setValue(getXMLGregorianCalendar(UpdatePeriod.valueOf(xp.getUpdatePeriod().name()).parse( entry.getValue()))); xp.getTimePartitionSpec().getPartSpecElement().add(timePartSpecElement);
public static Map<String, Date> timePartSpecfromXTimePartSpec( XTimePartSpec xtimePartSpec) { Map<String, Date> timePartSpec = new HashMap<String, Date>(); if (xtimePartSpec != null && !xtimePartSpec.getPartSpecElement().isEmpty()) { for (XTimePartSpecElement xtimePart : xtimePartSpec.getPartSpecElement()) { timePartSpec.put(xtimePart.getKey(), getDateFromXML(xtimePart.getValue())); } } return timePartSpec; }
public XTimePartSpecElement withValue(XMLGregorianCalendar value) { setValue(value); return this; }
public XTimePartSpecElement withKey(String value) { setKey(value); return this; }
/** * Create an instance of {@link XTimePartSpecElement } * */ public XTimePartSpecElement createXTimePartSpecElement() { return new XTimePartSpecElement(); }
xp.setUpdatePeriod(XUpdatePeriod.HOURLY); XTimePartSpec timePart = new XTimePartSpec(); XTimePartSpecElement partElement = new XTimePartSpecElement(); partElement.setKey("dt"); partElement.setValue(DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar())); timePart.getPartSpecElement().add(partElement); xp.setTimePartitionSpec(timePart);
public static Map<String, Date> timePartSpecfromXTimePartSpec( XTimePartSpec xtimePartSpec) { Map<String, Date> timePartSpec = new HashMap<String, Date>(); if (xtimePartSpec != null && !xtimePartSpec.getPartSpecElement().isEmpty()) { for (XTimePartSpecElement xtimePart : xtimePartSpec.getPartSpecElement()) { timePartSpec.put(xtimePart.getKey(), getDateFromXML(xtimePart.getValue())); } } return timePartSpec; }
public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; { String theKey; theKey = this.getKey(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "key", theKey), currentHashCode, theKey); } { XMLGregorianCalendar theValue; theValue = this.getValue(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue); } return currentHashCode; }
public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; { String theKey; theKey = this.getKey(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "key", theKey), currentHashCode, theKey); } { XMLGregorianCalendar theValue; theValue = this.getValue(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue); } return currentHashCode; }