1<?php 2 3/** 4 * Copyright 2017 DataStax, Inc. 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19namespace Cassandra\RetryPolicy; 20 21/** 22 * A retry policy that will downgrade the consistency of a request in 23 * an attempt to save a request in cases where there is any chance of success. A 24 * write request will succeed if there is at least a single copy persisted and a 25 * read request will succeed if there is some data available even if it increases 26 * the risk of reading stale data. This policy will retry in the same scenarios as 27 * the default policy, and it will also retry in the following case: 28 * 29 * * On a read timeout, if some replicas responded but is lower than 30 * required by the current consistency level then retry with a lower 31 * consistency level 32 * * On a write timeout, Retry unlogged batches at a lower consistency level 33 * if at least one replica responded. For single queries and batch if any 34 * replicas responded then consider the request successful and swallow the 35 * error. 36 * * On unavailable, retry at a lower consistency if at lease one replica 37 * responded. 38 * 39 * Important: This policy may attempt to retry requests with a lower 40 * consistency level. Using this policy can break consistency guarantees. 41 */ 42final class DowngradingConsistency implements \Cassandra\RetryPolicy { 43 44} 45