You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2022/04/10 15:23:54 UTC

[GitHub] [bookkeeper] eolivelli commented on a diff in pull request #3197: BP-47 (task3): Define interface for entrylogger

eolivelli commented on code in PR #3197:
URL: https://github.com/apache/bookkeeper/pull/3197#discussion_r846795460


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/EntryLoggerIface.java:
##########
@@ -0,0 +1,129 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.bookkeeper.bookie.storage;
+
+import io.netty.buffer.ByteBuf;
+import java.io.IOException;
+import java.util.Collection;
+import org.apache.bookkeeper.bookie.AbstractLogCompactor;
+import org.apache.bookkeeper.bookie.Bookie.NoEntryException;
+import org.apache.bookkeeper.bookie.EntryLogMetadata;
+
+
+/**
+ * Entry logger. Sequentially writes entries for a large number of ledgers to
+ * a small number of log files, to avoid many random writes.
+ * When an entry is added, a location is returned, which consists of the ID of the
+ * log into which the entry was added, and the offset of that entry within the log.
+ * The location is a long, with 32 bits each for the log ID and the offset. This
+ * naturally limits the offset and thus the size of the log to Integer.MAX_VALUE.
+ */
+public interface EntryLoggerIface extends AutoCloseable {

Review Comment:
   Please name this EntryLogger



##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java:
##########
@@ -72,7 +80,7 @@
  * the actual ledger entry. The entry log files created by this class are
  * identified by a long.
  */
-public class EntryLogger {
+public class EntryLogger implements EntryLoggerIface {

Review Comment:
   Please rename this class to DefaultEntryLogger
   and name the interface 'EntryLogger' because EntryLoggerIFace does not sound good in Java



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org