qqu0127 commented on code in PR #2234:
URL: https://github.com/apache/helix/pull/2234#discussion_r992877733


##########
meta-client/src/main/java/org/apache/helix/metaclient/api/MetaClientInterface.java:
##########
@@ -0,0 +1,91 @@
+package org.apache.helix.metaclient.api;
+
+/*
+ * 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.
+ */
+
+import java.util.List;
+
+
+public interface MetaClientInterface<T> {
+  enum EntryMode {
+    //The node will be deleted upon the client's disconnect.
+    EPHEMERAL,
+    //The node will not be automatically deleted upon client's disconnect.
+    PERSISTENT
+  }
+
+  /**
+   * Interface representing the metadata of an entry. It contains entry type 
and version number.
+   */
+  class Stat {
+    private int _version;
+    private EntryMode _entryMode;
+
+    public EntryMode getEntryType() {return _entryMode;}
+    public int getVersion() {return  _version;}
+  }
+
+  //synced CRUD API
+  void create(final String key, T data, final EntryMode mode);
+  void create(final String key, T data, final EntryMode mode, long ttl);
+  /**
+   * Set data for a given key.
+   */
+  void set(final String key, T data, int version);
+  /**
+   * Update existing data of a given key using an updater. This method will 
issue a read to get
+   * current data and apply updater upon the current data.
+   * return: the updated value.
+   */
+  T update(String key, DataUpdater<T> updater);
+  Stat exists(final String key);
+  T get(String key);

Review Comment:
   Styling suggestion, not urgent though, let's have an empty line between each 
two methods and before each comment block. Thanks.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to