public long countTickets(final Class<? extends Ticket> ticketType, final String prefix) {
        val keys = List.<DynamoDbQueryBuilder>of(
            DynamoDbQueryBuilder.builder()
                .key(ColumnNames.PREFIX.getColumnName())
                .attributeValue(List.of(AttributeValue.builder().s(prefix).build()))
                .operator(ComparisonOperator.EQ)
                .build());
        return ticketCatalog.findTicketDefinition(ticketType)
            .map(def -> DynamoDbTableUtils.scan(amazonDynamoDBClient, def.getProperties().getStorageName(), keys).count())
            .orElse(-1);
    }
Count tickets and return value.

@param ticketType the ticket type
@param prefix     the prefix
@return the long
support/cas-server-support-dynamodb-ticket-registry/src/main/java/org/apereo/cas/ticket/registry/DynamoDbTicketRegistryFacilitator.java