public static PeriodDuration analyzeDataCachePartitionDuration(Map<String, String> properties) throws AnalysisException {
        String text = properties.get(PROPERTIES_DATACACHE_PARTITION_DURATION);
        if (text == null) {
            return null;
        }
        properties.remove(PROPERTIES_DATACACHE_PARTITION_DURATION);
        try {
            return TimeUtils.parseHumanReadablePeriodOrDuration(text);
        } catch (DateTimeParseException ex) {
            throw new AnalysisException(ex.getMessage());
        }
    }
@Test
    public void testAnalyzeDataCachePartitionDuration() {
        Map<String, String> properties = new HashMap<>();
        properties.put(PropertyAnalyzer.PROPERTIES_DATACACHE_PARTITION_DURATION, "7 day");

        try {
            PropertyAnalyzer.analyzeDataCachePartitionDuration(properties);
        } catch (AnalysisException e) {
            Assert.assertTrue(false);
        }

        Assert.assertTrue(properties.size() == 0);
        properties.put(PropertyAnalyzer.PROPERTIES_DATACACHE_PARTITION_DURATION, "abcd");
        try {
            PropertyAnalyzer.analyzeDataCachePartitionDuration(properties);
            Assert.assertTrue(false);
        } catch (AnalysisException e) {
            Assert.assertEquals("Cannot parse text to Duration", e.getMessage());
        }
    }