@Override public void reset() { ((AMutableDateTime) value).setValue(0); }
public JDateTime(long chrononTime) { super(new AMutableDateTime(chrononTime)); }
public long getValue() { return ((AMutableDateTime) value).getChrononTime(); }
@Override public void run() { try { int round = 0; while (round++ < 10000) { // Test parseDate. for (int index = 0; index < dates.length; ++index) { parseDateMethod.invoke(parser, dates[index], 0, dates[index].length, dos); AMutableDate aDate = (AMutableDate) aDateField.get(parser); Assert.assertTrue(aDate.equals(parsedDates[index])); } // Tests parseTime. for (int index = 0; index < times.length; ++index) { parseTimeMethod.invoke(parser, times[index], 0, times[index].length, dos); AMutableTime aTime = (AMutableTime) aTimeField.get(parser); Assert.assertTrue(aTime.equals(parsedTimes[index])); } // Tests parseDateTime. for (int index = 0; index < dateTimes.length; ++index) { parseDateTimeMethod.invoke(parser, dateTimes[index], 0, dateTimes[index].length, dos); AMutableDateTime aDateTime = (AMutableDateTime) aDateTimeField.get(parser); Assert.assertTrue(aDateTime.equals(parsedDateTimes[index])); } } } catch (Exception e) { errorCount.incrementAndGet(); e.printStackTrace(); } } });
public void setValue(long chrononTime) { ((AMutableDateTime) value).setValue(chrononTime); }
"6778-02-16T22:40:21.653Z", "2129-12-12T13:18:35.758Z", "8647-07-01T13:10:19.691Z" }); AMutableDateTime[] parsedDateTimes = new AMutableDateTime[] { new AMutableDateTime(-145452954464325L), new AMutableDateTime(67345192751902L), new AMutableDateTime(-45286270768513L), new AMutableDateTime(151729886421653L), new AMutableDateTime(5047449515758L), new AMutableDateTime(210721439419691L) };
protected void parseDateTime(char[] buffer, int begin, int len, DataOutput out) throws HyracksDataException { // +1 if it is negative (-) int timeOffset = (buffer[begin] == '-') ? 1 : 0; timeOffset = timeOffset + 8 + begin; if (buffer[timeOffset] != 'T') { timeOffset += 2; if (buffer[timeOffset] != 'T') { throw new ParseException(ErrorCode.PARSER_ADM_DATA_PARSER_INTERVAL_INVALID_DATETIME); } } long chrononTimeInMs = ADateParserFactory.parseDatePart(buffer, begin, timeOffset - begin); chrononTimeInMs += ATimeParserFactory.parseTimePart(buffer, timeOffset + 1, begin + len - timeOffset - 1); aDateTime.setValue(chrononTimeInMs); datetimeSerde.serialize(aDateTime, out); }
protected void parseDateTime(Value datetime, DataOutput out) throws HyracksDataException { aDateTime.setValue(datetime.getTimeVal().getTimeInMillis()); datetimeSerde.serialize(aDateTime, out); }
aDateTime.setValue(file.getLastModefiedTime().getTime()); dateTimeSerde.serialize(aDateTime, fieldValue.getDataOutput()); recordBuilder.addField(2, fieldValue);
aDateTime.setValue(externalFile.getLastModefiedTime().getTime()); dateTimeSerde.serialize(aDateTime, fieldValue.getDataOutput()); recordBuilder.addField(MetadataRecordTypes.EXTERNAL_FILE_ARECORD_FILE_MOD_DATE_FIELD_INDEX, fieldValue);
aDateTime.setValue(val.getLongVal() * 1000); datetimeSerde.serialize(aDateTime, out); } else if (checkType(ATypeTag.DURATION, fieldType)) { } else if (checkType(ATypeTag.DATETIME, fieldType)) { aDateTime.setValue(val.getLongVal() * 1000); datetimeSerde.serialize(aDateTime, out); } else if (checkType(ATypeTag.DURATION, fieldType)) {