public String createPartitionAndRowQuery ( final DateTime from , final DateTime to ) { final String parMin = TableQuery . generateFilterCondition ( "PartitionKey" , TableQuery . QueryComparisons . GREATER_THAN_OR_EQUAL , from . toLocalDate ( ) . toString ( ) ) ; final String rowMin = TableQuery . generateFilterCondition ( "RowKey" , TableQuery . QueryComparisons . GREATER_THAN_OR_EQUAL , LogLineTableEntity . toRowKey ( from , null ) ) ; if ( to == null || from . toLocalDate ( ) . equals ( to . toLocalDate ( ) ) || to . isAfterNow ( ) ) { // There's no upper bound (or the upper bound doesn't make sense to include in the query) return andFilters ( parMin , rowMin ) ; } else { // From and To required final String parMax = TableQuery . generateFilterCondition ( "PartitionKey" , TableQuery . QueryComparisons . LESS_THAN , to . toLocalDate ( ) . plusDays ( 1 ) . toString ( ) ) ; final String rowMax = TableQuery . generateFilterCondition ( "RowKey" , TableQuery . QueryComparisons . LESS_THAN , LogLineTableEntity . toRowKey ( to . plusSeconds ( 1 ) , null ) ) ; return andFilters ( parMin , parMax , rowMin , rowMax ) ; } }
Create a filter condition that returns log lines between two dates . Designed to be used in addition to other criteria