[
https://issues.apache.org/jira/browse/RATIS-272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16589056#comment-16589056
]
ASF GitHub Bot commented on RATIS-272:
--------------------------------------
Github user joshelser commented on a diff in the pull request:
https://github.com/apache/incubator-ratis/pull/4#discussion_r212010047
--- 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 --
If we go towards Vlad's suggestion of a FileSystem-like API, we would give
a `PathFilter` that would give the same kind of functionality. Having the
notion of directories actually gets infinitely easier to find just logs you
want too :)
> Design ideal API
> ----------------
>
> Key: RATIS-272
> URL: https://issues.apache.org/jira/browse/RATIS-272
> Project: Ratis
> Issue Type: Sub-task
> Components: LogService
> Reporter: Josh Elser
> Priority: Major
>
> With influence from Apache DistributedLog, Kafka, and BookKeeper, design an
> API that balances the ideal notion of what a distribute log system should
> look like, but also considers the needs of HBase to replace a WAL.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)