Skip to content

Commit

Permalink
Rename LogCompactor to Compactor.
Browse files Browse the repository at this point in the history
  • Loading branch information
kuujo committed May 31, 2015
1 parent 9006d9e commit 8298843
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Expand Up @@ -28,8 +28,8 @@
* *
* @author <a href="http://github.com/kuujo">Jordan Halterman</a> * @author <a href="http://github.com/kuujo">Jordan Halterman</a>
*/ */
public class LogCompactor implements Runnable, AutoCloseable { public class Compactor implements Runnable, AutoCloseable {
private static final Logger LOGGER = LoggerFactory.getLogger(LogCompactor.class); private static final Logger LOGGER = LoggerFactory.getLogger(Compactor.class);
private static final int DEFAULT_COMPACTION_FACTOR = 10; private static final int DEFAULT_COMPACTION_FACTOR = 10;
private static final long DEFAULT_COMPACTION_INTERVAL = TimeUnit.HOURS.toMillis(1); private static final long DEFAULT_COMPACTION_INTERVAL = TimeUnit.HOURS.toMillis(1);
private static final long COMPACT_INTERVAL = 60 * 1000; private static final long COMPACT_INTERVAL = 60 * 1000;
Expand All @@ -45,7 +45,7 @@ public class LogCompactor implements Runnable, AutoCloseable {
private long previousCompaction; private long previousCompaction;
private ScheduledFuture<?> future; private ScheduledFuture<?> future;


public LogCompactor(Log log, EntryFilter filter, ExecutionContext context) { public Compactor(Log log, EntryFilter filter, ExecutionContext context) {
this.log = log; this.log = log;
this.filter = filter; this.filter = filter;
this.context = context; this.context = context;
Expand Down Expand Up @@ -77,7 +77,7 @@ public int getCompactionFactor() {
* @param compactionFactor The compaction factor. * @param compactionFactor The compaction factor.
* @return The log compactor. * @return The log compactor.
*/ */
public LogCompactor withCompactionFactor(int compactionFactor) { public Compactor withCompactionFactor(int compactionFactor) {
setCompactionFactor(compactionFactor); setCompactionFactor(compactionFactor);
return this; return this;
} }
Expand Down Expand Up @@ -108,7 +108,7 @@ public long getCompactionInterval() {
* @param compactionInterval The interval at which major compaction is run. * @param compactionInterval The interval at which major compaction is run.
* @return The log compactor. * @return The log compactor.
*/ */
public LogCompactor withCompactionInterval(long compactionInterval) { public Compactor withCompactionInterval(long compactionInterval) {
setCompactionInterval(compactionInterval); setCompactionInterval(compactionInterval);
return this; return this;
} }
Expand Down
Expand Up @@ -22,8 +22,8 @@
import net.kuujo.copycat.raft.Command; import net.kuujo.copycat.raft.Command;
import net.kuujo.copycat.raft.Query; import net.kuujo.copycat.raft.Query;
import net.kuujo.copycat.raft.StateMachine; import net.kuujo.copycat.raft.StateMachine;
import net.kuujo.copycat.raft.log.Compactor;
import net.kuujo.copycat.raft.log.Log; import net.kuujo.copycat.raft.log.Log;
import net.kuujo.copycat.raft.log.LogCompactor;
import net.kuujo.copycat.raft.rpc.CommandRequest; import net.kuujo.copycat.raft.rpc.CommandRequest;
import net.kuujo.copycat.raft.rpc.QueryRequest; import net.kuujo.copycat.raft.rpc.QueryRequest;
import net.kuujo.copycat.raft.rpc.Response; import net.kuujo.copycat.raft.rpc.Response;
Expand Down Expand Up @@ -51,7 +51,7 @@ public class RaftContext implements Managed<RaftContext> {
private final Set<EventListener<Member>> electionListeners = new CopyOnWriteArraySet<>(); private final Set<EventListener<Member>> electionListeners = new CopyOnWriteArraySet<>();
private final RaftStateMachine stateMachine; private final RaftStateMachine stateMachine;
private final Log log; private final Log log;
private final LogCompactor compactor; private final Compactor compactor;
private final ManagedCluster cluster; private final ManagedCluster cluster;
private final String topic; private final String topic;
private final ExecutionContext context; private final ExecutionContext context;
Expand All @@ -76,7 +76,7 @@ public class RaftContext implements Managed<RaftContext> {
public RaftContext(Log log, StateMachine stateMachine, ManagedCluster cluster, String topic, ExecutionContext context) { public RaftContext(Log log, StateMachine stateMachine, ManagedCluster cluster, String topic, ExecutionContext context) {
this.log = log; this.log = log;
this.stateMachine = new RaftStateMachine(stateMachine); this.stateMachine = new RaftStateMachine(stateMachine);
this.compactor = new LogCompactor(log, this.stateMachine::filter, context); this.compactor = new Compactor(log, this.stateMachine::filter, context);
this.cluster = cluster; this.cluster = cluster;
this.topic = topic; this.topic = topic;
this.context = context; this.context = context;
Expand Down Expand Up @@ -530,7 +530,7 @@ public Log getLog() {
* *
* @return The log compactor. * @return The log compactor.
*/ */
public LogCompactor getCompactor() { public Compactor getCompactor() {
return compactor; return compactor;
} }


Expand Down

0 comments on commit 8298843

Please sign in to comment.