[ 
https://issues.apache.org/jira/browse/CASSANDRA-9252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jeremy Hanna updated CASSANDRA-9252:
------------------------------------
    Labels: dtcs  (was: )

> for DateTieredCompactionStrategy, TIMESTAMP_RESOLUTION_KEY sets wrong 
> msxSSTableAge value if RESOLUTION is other than MILLISECONDS
> ----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-9252
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9252
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>         Environment: Linux/CentOS
>            Reporter: mike
>            Assignee: Marcus Eriksson
>              Labels: dtcs
>             Fix For: 2.0.15
>
>         Attachments: DateTieredCompactionStrategy.java, 
> DateTieredCompactionStrategyOptions.java
>
>
> I was trying to set 'timestamp_resolution' to MINUTES/HOURS/DAYS. it turned 
> out maxSSTableAge was set as wrong value. In the code,
> {code}
>     public DateTieredCompactionStrategyOptions(Map<String, String> options)
>     {
>         String optionValue = options.get(TIMESTAMP_RESOLUTION_KEY);
>         TimeUnit timestampResolution = optionValue == null ? 
> DEFAULT_TIMESTAMP_RESOLUTION : TimeUnit.valueOf(optionValue);
>         optionValue = options.get(MAX_SSTABLE_AGE_KEY);
>         double fractionalDays = optionValue == null ? 
> DEFAULT_MAX_SSTABLE_AGE_DAYS : Double.parseDouble(optionValue);
>         maxSSTableAge = Math.round(fractionalDays * 
> timestampResolution.convert(1, TimeUnit.DAYS));
>  ...   }{code}
> maxSSTableAge will be set as the value in "timestamp_resolution" unit, such 
> as , with the following settings,
>         'timestamp_resolution':'HOURS',
>         'max_sstable_age_days':'7',
>         'base_time_seconds':'3600'
> and I get: 
> maxSSTableAge=168,  baseTime=1
> while in the following routine, it expect maxSSTableAge as milliseconds
>     static Iterable<SSTableReader> filterOldSSTables(List<SSTableReader> 
> sstables, long maxSSTableAge, long now)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to