public void put(final Stream<TicketPayload> toSave) {
        val queue = new HashMap<String, Collection<WriteRequest>>();
        val count = new AtomicLong(0);
        toSave.forEach(entry -> {
            val metadata = ticketCatalog.find(entry.getOriginalTicket());
            val entries = queue.getOrDefault(metadata.getProperties().getStorageName(), new ArrayList<>());
            entries.add(WriteRequest.builder().putRequest(buildPutRequest(entry)).build());
            count.getAndIncrement();

            queue.put(metadata.getProperties().getStorageName(), entries);
            if (count.get() >= BATCH_PUT_REQUEST_LIMIT) {
                val batchRequest = BatchWriteItemRequest.builder().requestItems(queue).build();
                amazonDynamoDBClient.batchWriteItem(batchRequest);
                queue.clear();
                count.set(0);
            }
        });
        if (!queue.isEmpty()) {
            val batchRequest = BatchWriteItemRequest.builder().requestItems(queue).build();
            amazonDynamoDBClient.batchWriteItem(batchRequest);
        }
    }
Put.

@param toSave the to save
support/cas-server-support-dynamodb-ticket-registry/src/main/java/org/apereo/cas/ticket/registry/DynamoDbTicketRegistryFacilitator.java