NealSun96 commented on code in PR #2249: URL: https://github.com/apache/helix/pull/2249#discussion_r1010954559
########## meta-client/src/main/java/org/apache/helix/metaclient/impl/zk/ZkMetaClient.java: ########## @@ -0,0 +1,231 @@ +package org.apache.helix.metaclient.impl.zk; + +/* + * 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; +import java.util.concurrent.TimeUnit; + +import org.apache.helix.metaclient.api.AsyncCallback; +import org.apache.helix.metaclient.api.ConnectStateChangeListener; +import org.apache.helix.metaclient.api.DataChangeListener; +import org.apache.helix.metaclient.api.DataUpdater; +import org.apache.helix.metaclient.api.DirectChildrenChangeListener; +import org.apache.helix.metaclient.api.DirectEntrySubscribeResult; +import org.apache.helix.metaclient.api.MetaClientInterface; +import org.apache.helix.metaclient.api.OpResult; +import org.apache.helix.metaclient.api.PersistSubEntryChangeListener; +import org.apache.helix.zookeeper.api.client.RealmAwareZkClient; + + +public class ZkMetaClient implements MetaClientInterface { + + private RealmAwareZkClient _zkClient; + + public ZkMetaClient() { + + } + + @Override + public void create(String key, Object data, EntryMode mode) { + + } + + @Override + public void create(String key, Object data, EntryMode mode, long ttl) { + + } + + @Override + public void set(String key, Object data, int version) { + + } + + @Override + public Object update(String key, DataUpdater updater) { + return null; + } + + @Override + public Stat exists(String key) { + return null; + } + + @Override + public Object get(String key) { + return null; + } + + @Override + public List<String> getSubEntryKeys(String path) { + return null; + } + + @Override + public int countSubEntries(String path) { + return 0; + } + + @Override + public boolean delete(String path) { + return false; + } + + @Override + public boolean recursiveDelete(String path) { + return false; + } + + @Override + public void asyncCreate(String key, Object data, int version, long ttl, + AsyncCallback.VoidCallback cb) { + + } + + @Override + public void asyncSet(String key, Object data, int version, AsyncCallback.VoidCallback cb) { + + } + + @Override + public void asyncUpdate(String key, DataUpdater updater, AsyncCallback.VoidCallback cb) { + + } + + @Override + public void asyncGet(String key, AsyncCallback.DataCallback cb) { + + } + + @Override + public void asyncCountSubEntries(String path, AsyncCallback.DataCallback cb) { + + } + + @Override + public void asyncExist(String key, AsyncCallback.StatCallback cb) { + + } + + @Override + public void asyncDelete(String keys, AsyncCallback.VoidCallback cb) { + + } + + @Override + public void asyncTransaction(String keys, AsyncCallback.TransactionCallback cb) { + + } + + @Override + public ConnectState connect() { + return null; + } + + @Override + public void disconnect() { + + } + + @Override + public boolean subscribeDataChange(String key, DataChangeListener listener, + DataChangeListener.ChangeType eventType, boolean skipWatchingNonExistNode, + boolean persistListener) { + return false; + } + + @Override + public DirectEntrySubscribeResult subscribeDirectEntryChange(String key, + DirectChildrenChangeListener listener, boolean skipWatchingNonExistNode, Review Comment: Why is the naming here not consistent? Shouldn't it all be `DirectChildrenChange`? ########## meta-client/src/main/java/org/apache/helix/metaclient/factories/MetaClientConfig.java: ########## @@ -0,0 +1,115 @@ +package org.apache.helix.metaclient.factories; + +/* + * 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. + */ + +class MetaClientConfig { + + public enum StoreType { + ZOOKEEPER, ETCD + } + + private final String _connectionAddress; + private final long _connectionTimeout; + private final boolean _enableAuth; + private final StoreType _storeType; Review Comment: ZkClients has many more variables than this (operation timeout, serializer). How do they fit in this picture? ########## meta-client/src/main/java/org/apache/helix/metaclient/api/PersistSubEntryChangeListener.java: ########## @@ -0,0 +1,40 @@ +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. + */ + +/* + * Listener interface for children change events on a particular key. It includes new subentry + * creation, subentry deletion, subentry data change and when the listener is removed. + * This listener type can only be registered as a persist listener. + * For hierarchy key spaces like zookeeper, it refers to an entry's entire subtree. Review Comment: Question: the current `subscribeChildChanges` is only direct children if my understanding is right. Does that mean this listener will not be implemented as a part of ZkMetaClient? ########## meta-client/src/main/java/org/apache/helix/metaclient/api/MetaClientInterface.java: ########## @@ -20,27 +20,36 @@ */ import java.util.List; +import java.util.concurrent.TimeUnit; public interface MetaClientInterface<T> { enum EntryMode { //The node will be removed automatically when the session associated with the creation // of the node expires. - EPHEMERAL, - //The node will not be automatically deleted upon client's disconnect. + EPHEMERAL, //The node will not be automatically deleted upon client's disconnect. Review Comment: nit: is this intended? -- 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]
