Skip to content

Commit 26444e0

Browse files
authored
PHOENIX-7677 TTL_DELETE CDC event to use batch mutation (#2247)
1 parent 6e18120 commit 26444e0

File tree

7 files changed

+454
-207
lines changed

7 files changed

+454
-207
lines changed

phoenix-core-client/src/main/java/org/apache/phoenix/query/QueryServices.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,12 @@ public interface QueryServices extends SQLCloseable {
503503
// CDC TTL mutation retry configuration
504504
String CDC_TTL_MUTATION_MAX_RETRIES = "phoenix.cdc.ttl.mutation.max.retries";
505505

506+
// CDC TTL mutation batch size configuration
507+
String CDC_TTL_MUTATION_BATCH_SIZE = "phoenix.cdc.ttl.mutation.batch.size";
508+
509+
// CDC TTL shared cache expiration time in seconds
510+
String CDC_TTL_SHARED_CACHE_EXPIRY_SECONDS = "phoenix.cdc.ttl.shared.cache.expiry.seconds";
511+
506512
// This config is used to move (copy and delete) the child links from the SYSTEM.CATALOG to
507513
// SYSTEM.CHILD_LINK table.
508514
// As opposed to a copy and async (out of band) delete.

phoenix-core-client/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
import static org.apache.phoenix.query.QueryServices.AUTO_UPGRADE_ENABLED;
2525
import static org.apache.phoenix.query.QueryServices.CALL_QUEUE_PRODUCER_ATTRIB_NAME;
2626
import static org.apache.phoenix.query.QueryServices.CALL_QUEUE_ROUND_ROBIN_ATTRIB;
27+
import static org.apache.phoenix.query.QueryServices.CDC_TTL_MUTATION_BATCH_SIZE;
2728
import static org.apache.phoenix.query.QueryServices.CDC_TTL_MUTATION_MAX_RETRIES;
29+
import static org.apache.phoenix.query.QueryServices.CDC_TTL_SHARED_CACHE_EXPIRY_SECONDS;
2830
import static org.apache.phoenix.query.QueryServices.CLIENT_INDEX_ASYNC_THRESHOLD;
2931
import static org.apache.phoenix.query.QueryServices.CLIENT_METRICS_TAG;
3032
import static org.apache.phoenix.query.QueryServices.CLIENT_SPOOL_THRESHOLD_BYTES_ATTRIB;
@@ -493,6 +495,8 @@ public class QueryServicesOptions {
493495
public static final Boolean DEFAULT_CQSI_THREAD_POOL_ALLOW_CORE_THREAD_TIMEOUT = true;
494496
public static final Boolean DEFAULT_CQSI_THREAD_POOL_METRICS_ENABLED = false;
495497
public static final int DEFAULT_CDC_TTL_MUTATION_MAX_RETRIES = 5;
498+
public static final int DEFAULT_CDC_TTL_MUTATION_BATCH_SIZE = 50;
499+
public static final int DEFAULT_CDC_TTL_SHARED_CACHE_EXPIRY_SECONDS = 1200;
496500

497501
public static final long DEFAULT_PHOENIX_CDC_STREAM_PARTITION_EXPIRY_MIN_AGE_MS =
498502
30 * 60 * 60 * 1000; // 30 hours
@@ -613,7 +617,9 @@ public static QueryServicesOptions withDefaults() {
613617
.setIfUnset(CQSI_THREAD_POOL_ALLOW_CORE_THREAD_TIMEOUT,
614618
DEFAULT_CQSI_THREAD_POOL_ALLOW_CORE_THREAD_TIMEOUT)
615619
.setIfUnset(CQSI_THREAD_POOL_METRICS_ENABLED, DEFAULT_CQSI_THREAD_POOL_METRICS_ENABLED)
616-
.setIfUnset(CDC_TTL_MUTATION_MAX_RETRIES, DEFAULT_CDC_TTL_MUTATION_MAX_RETRIES);
620+
.setIfUnset(CDC_TTL_MUTATION_MAX_RETRIES, DEFAULT_CDC_TTL_MUTATION_MAX_RETRIES)
621+
.setIfUnset(CDC_TTL_MUTATION_BATCH_SIZE, DEFAULT_CDC_TTL_MUTATION_BATCH_SIZE)
622+
.setIfUnset(CDC_TTL_SHARED_CACHE_EXPIRY_SECONDS, DEFAULT_CDC_TTL_SHARED_CACHE_EXPIRY_SECONDS);
617623

618624
// HBase sets this to 1, so we reset it to something more appropriate.
619625
// Hopefully HBase will change this, because we can't know if a user set

0 commit comments

Comments
 (0)