All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ning.billing.usage.timeline.aggregator.TimelineAggregatorSqlDao.sql.stg Maven / Gradle / Ivy

group TimelineAggregatorDAO;

CHECK_TENANT() ::= "tenant_record_id = :tenantRecordId"
AND_CHECK_TENANT() ::= "AND "

getStreamingAggregationCandidates() ::= <<
  select
    chunk_id
  , source_id
  , metric_id
  , start_time
  , end_time
  , in_row_samples
  , blob_samples
  , sample_count
  , aggregation_level
  , not_valid
  , dont_aggregate
  from timeline_chunks
  where source_id != 0 and aggregation_level = :aggregationLevel and not_valid = 0
  
  order by source_id, metric_id, start_time
 >>

 getAggregationCandidatesForSourceIdAndMetricIds(metricIds) ::= <<
  select
    chunk_id
  , source_id
  , metric_id
  , start_time
  , end_time
  , in_row_samples
  , blob_samples
  , sample_count
  , aggregation_level
  , not_valid
  , dont_aggregate
  from timeline_chunks
  where source_id = :source_id
  and metric_id in ()
  
  ;
>>

getLastInsertedId() ::= <<
  select last_insert_id();
>>

makeTimelineChunkValid() ::= <<
  update timeline_chunks
  set not_valid = 0
  where chunk_id = :chunkId
  
  ;
>>

makeTimelineChunksInvalid(chunkIds) ::=<<
  update timeline_chunks
  set not_valid = 1
  where chunk_id in ()
  
  ;
>>

deleteTimelineChunks(chunkIds) ::=<<
  delete from timeline_chunks where chunk_id in () ;
>>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy