public long countTicketsFor(final String tableName, final Service service) {
        val keys = List.<DynamoDbQueryBuilder>of(
            DynamoDbQueryBuilder.builder()
                .key(ColumnNames.SERVICE.getColumnName())
                .attributeValue(List.of(AttributeValue.builder().s(service.getId()).build()))
                .operator(ComparisonOperator.EQ)
                .build());
        return DynamoDbTableUtils.getRecordsByKeys(amazonDynamoDBClient,
                tableName, keys, DynamoDbTicketRegistryFacilitator::deserializeTicket)
            .filter(ticket -> !ticket.isExpired())
            .count();
    }
Count tickets for.

@param tableName the table name
@param service   the service
@return the long
support/cas-server-support-dynamodb-ticket-registry/src/main/java/org/apereo/cas/ticket/registry/DynamoDbTicketRegistryFacilitator.java