Github user ss77892 commented on a diff in the pull request:

    https://github.com/apache/incubator-ratis/pull/4#discussion_r214160302
  
    --- Diff: 
ratis-logservice/src/main/java/org/apache/ratis/logservice/api/LogService.java 
---
    @@ -0,0 +1,53 @@
    +/**
    + * 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.ratis.logservice.api;
    +
    +import java.util.Iterator;
    +import java.util.concurrent.CompletableFuture;
    +
    +/**
    + * Entry point for interacting with the Ratis LogService.
    + */
    +public interface LogService {
    +
    +  /**
    +   * Creates a new {@link LogStream} identified by the given name. Throws
    +   * an exception if a {@link LogStream} with the given name already 
exists.
    +   *
    +   * @param name Unique name for this LogStream.
    +   */
    +  CompletableFuture<LogStream> createLog(LogName name);
    +
    +  /**
    +   * Fetches the {@link LogStream} identified by the given name.
    +   *
    +   * @param name The name of the LogStream
    +   */
    +  CompletableFuture<LogStream> getLog(LogName name);
    +
    +  /**
    +   * Lists all {@link LogStream} instances known by this LogService.
    +   */
    +  CompletableFuture<Iterator<LogStream>> listLogs();
    --- End diff --
    
    @VladRodionov I completely agree with you that it's possible to implement 
more than one log using a single state machine. I was talking about the current 
Ratis implementation which has a single log per state machine. The benefit we 
have is that the replication of this log is a part of the implementation and we 
shouldn't implement anything on our own. If I understand correctly you suggest 
implementing multiple logs separately. That would mean 1) double writes (still 
all that data will go to RatisLog)  2) Special handling for those records to 
write it to the correct log. From my point of view, the performance of the 
write path is more critical for us compared to the read path.  
    Just in case there is a concept of 'multi-raft' already implemented by a 
number of projects. We may get it implemented on Ratis level, but I'm not sure 
how it's suitable in the embedded library concept and how much efforts it would 
require. 



---

Reply via email to