All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.debezium.connector.cassandra.Cassandra5CommitLogSegmentReader Maven / Gradle / Ivy

There is a newer version: 3.0.6.Final
Show newest version
/*
 * Copyright Debezium Authors.
 *
 * Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
 */
package io.debezium.connector.cassandra;

import java.io.File;
import java.io.IOException;

import org.apache.cassandra.db.commitlog.CommitLogPosition;
import org.apache.cassandra.db.commitlog.CommitLogReadHandler;
import org.apache.cassandra.db.commitlog.CommitLogReader;

public class Cassandra5CommitLogSegmentReader implements CommitLogSegmentReader {

    private final CommitLogReader commitLogReader;

    private final CommitLogReadHandler commitLogReadHandler;

    public Cassandra5CommitLogSegmentReader(CassandraConnectorContext context, CommitLogProcessorMetrics metrics) {
        this.commitLogReader = new CommitLogReader();
        this.commitLogReadHandler = new Cassandra5CommitLogReadHandlerImpl(context, metrics);
    }

    @Override
    public void readCommitLogSegment(File file, long segmentId, int position) throws IOException {
        commitLogReader.readCommitLogSegment(commitLogReadHandler, new org.apache.cassandra.io.util.File(file), new CommitLogPosition(segmentId, position),
                CommitLogReader.ALL_MUTATIONS, false);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy