import io.atomix.storage.journal.JournalSerdes.EntrySerdes;
import java.io.IOException;
-final class LongSerdes implements EntrySerdes<Long> {
- @Override
- public Long read(final EntryInput input) throws IOException {
- return input.readLong();
- }
+enum LongEntrySerdes implements EntrySerdes<Long> {
+ LONG_ENTRY_SERDES {
+ @Override
+ public Long read(final EntryInput input) throws IOException {
+ return input.readLong();
+ }
- @Override
- public void write(final EntryOutput output, final Long entry) throws IOException {
- output.writeLong(entry);
+ @Override
+ public void write(final EntryOutput output, final Long entry) throws IOException {
+ output.writeLong(entry);
+ }
}
}
private static final Logger LOG = LoggerFactory.getLogger(SegmentedJournalActor.class);
private static final JournalSerdes DELETE_NAMESPACE = JournalSerdes.builder()
- .register(new LongSerdes(), Long.class)
+ .register(LongEntrySerdes.LONG_ENTRY_SERDES, Long.class)
.build();
private static final int DELETE_SEGMENT_SIZE = 64 * 1024;