narendly commented on a change in pull request #788: Implement request forwarding for ZkRoutingDataWriter URL: https://github.com/apache/helix/pull/788#discussion_r384772213
########## File path: helix-rest/src/main/java/org/apache/helix/rest/server/resources/mock/MockMetadataStoreDirectoryAccessor.java ########## @@ -0,0 +1,118 @@ +package org.apache.helix.rest.server.resources.mock; + +/* + * 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 javax.ws.rs.Path; + +import org.apache.helix.msdcommon.datamodel.TrieRoutingData; +import org.apache.helix.msdcommon.exception.InvalidRoutingDataException; +import org.apache.helix.rest.metadatastore.MetadataStoreDirectory; +import org.apache.helix.rest.metadatastore.ZkMetadataStoreDirectory; +import org.apache.helix.rest.metadatastore.accessor.MetadataStoreRoutingDataReader; +import org.apache.helix.rest.metadatastore.accessor.MetadataStoreRoutingDataWriter; +import org.apache.helix.rest.metadatastore.accessor.ZkRoutingDataReader; +import org.apache.helix.rest.metadatastore.accessor.ZkRoutingDataWriter; +import org.apache.helix.rest.server.resources.metadatastore.MetadataStoreDirectoryAccessor; + + +/** + * An accessor that mocks the MetadataStoreDirectoryAccessor for testing purpose. + */ +@Path("/mock") +public class MockMetadataStoreDirectoryAccessor extends MetadataStoreDirectoryAccessor { + // A flag that will be modified if the underlying MockZkRoutingDataWriter makes an operation + // against ZooKeeper + public static boolean operatedOnZk = false; Review comment: I'm actually fine either way since this is just a global created for testing. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
