1 /** 2 * Copyright 2020 Huawei Technologies Co., Ltd 3 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 8 * http://www.apache.org/licenses/LICENSE-2.0 9 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 #ifndef MINDSPORE_CCSRC_MINDDATA_DATASET_ENGINE_CACHE_STUB_H_ 17 #define MINDSPORE_CCSRC_MINDDATA_DATASET_ENGINE_CACHE_STUB_H_ 18 19 #include <memory> 20 #include <string> 21 #include "proto/cache_grpc.pb.h" 22 #include "minddata/dataset/engine/cache/cache_common.h" 23 #include "minddata/dataset/engine/cache/cache_request.h" 24 #include "minddata/dataset/util/service.h" 25 26 namespace mindspore { 27 namespace dataset { 28 class CacheClientGreeter : public Service { 29 public: CacheClientGreeter(const std::string & hostname,int32_t port,int32_t num_workers)30 explicit CacheClientGreeter(const std::string &hostname, int32_t port, int32_t num_workers) {} ~CacheClientGreeter()31 ~CacheClientGreeter() override {} DoServiceStart()32 Status DoServiceStart() override { RETURN_STATUS_UNEXPECTED("Not supported"); } DoServiceStop()33 Status DoServiceStop() override { RETURN_STATUS_UNEXPECTED("Not supported"); } 34 SharedMemoryBaseAddr()35 void *SharedMemoryBaseAddr() { return nullptr; } HandleRequest(std::shared_ptr<BaseRequest> rq)36 Status HandleRequest(std::shared_ptr<BaseRequest> rq) { RETURN_STATUS_UNEXPECTED("Not supported"); } AttachToSharedMemory(bool * local_bypass)37 Status AttachToSharedMemory(bool *local_bypass) { RETURN_STATUS_UNEXPECTED("Not supported"); } GetHostname()38 std::string GetHostname() const { return "Not supported"; } GetPort()39 int32_t GetPort() const { return 0; } 40 }; 41 } // namespace dataset 42 } // namespace mindspore 43 44 #endif // MINDSPORE_CCSRC_MINDDATA_DATASET_ENGINE_CACHE_STUB_H_ 45