dev.responsive.kafka.internal.db.ColumnName Maven / Gradle / Ivy
The newest version!
/*
* Copyright 2024 Responsive Computing, Inc.
*
* This source code is licensed under the Responsive Business Source License Agreement v1.0
* available at:
*
* https://www.responsive.dev/legal/responsive-bsl-10
*
* This software requires a valid Commercial License Key for production use. Trial and commercial
* licenses can be obtained at https://www.responsive.dev
*/
package dev.responsive.kafka.internal.db;
import com.datastax.oss.driver.api.querybuilder.Literal;
import com.datastax.oss.driver.api.querybuilder.QueryBuilder;
import com.datastax.oss.driver.api.querybuilder.relation.ColumnRelationBuilder;
import com.datastax.oss.driver.api.querybuilder.relation.Relation;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.time.Instant;
import java.util.function.Function;
import org.apache.kafka.common.utils.Bytes;
public enum ColumnName {
// shared partition key column
PARTITION_KEY("partitionKey", "partitionkey"),
SEGMENT_START_TIMESTAMP("segmentStartTimestamp", "segmentstarttimestamp"),
// columns for the data tables
ROW_TYPE("type", "type"),
DATA_KEY("key", "datakey", b -> bytes((Bytes) b)),
DATA_VALUE("value", "value", b -> bytes((byte[]) b)),
OFFSET("offset", "offset"),
EPOCH("epoch", "epoch"),
STREAM_TIME("streamTime", "streamtime"),
WINDOW_START("windowStart", "windowstart", ts -> timestamp((long) ts)),
TIMESTAMP("ts", "ts", ts -> timestamp((long) ts)),
TTL_SECONDS("ttl", "ttl", ttl -> ttlSeconds((int) ttl));
static final Bytes METADATA_KEY
= Bytes.wrap("_metadata".getBytes(StandardCharsets.UTF_8));
static final long METADATA_TS = -1L;
private final String column;
private final String bind;
private final Function
© 2015 - 2024 Weber Informatics LLC | Privacy Policy