Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package org.apache.zookeeper.server.persistence;

import java.io.Closeable;
import java.io.IOException;

import org.apache.jute.Record;
Expand All @@ -28,7 +29,7 @@
* Interface for reading transaction logs.
*
*/
public interface TxnLog {
public interface TxnLog extends Closeable {

/**
* Setter for ServerStats to monitor fsync threshold exceed
Expand Down Expand Up @@ -96,15 +97,11 @@ public interface TxnLog {
*/
long getTxnLogSyncElapsedTime();

/**
* close the transactions logs
*/
void close() throws IOException;
/**
* an iterating interface for reading
* transaction logs.
*/
public interface TxnIterator {
public interface TxnIterator extends Closeable {
/**
* return the transaction header.
* @return return the transaction header.
Expand All @@ -122,14 +119,7 @@ public interface TxnIterator {
* @throws IOException
*/
boolean next() throws IOException;

/**
* close files and release the
* resources
* @throws IOException
*/
void close() throws IOException;


/**
* Get an estimated storage space used to store transaction records
* that will return by this iterator
Expand Down