gaborgsomogyi commented on code in PR #364: URL: https://github.com/apache/flink-kubernetes-operator/pull/364#discussion_r964436686
########## flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/fs/FsWatchService.java: ########## @@ -0,0 +1,90 @@ +/* + * 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.flink.kubernetes.operator.fs; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.file.FileSystems; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.WatchEvent; +import java.nio.file.WatchKey; +import java.nio.file.WatchService; + +import static java.nio.file.StandardWatchEventKinds.ENTRY_CREATE; +import static java.nio.file.StandardWatchEventKinds.ENTRY_DELETE; +import static java.nio.file.StandardWatchEventKinds.ENTRY_MODIFY; +import static java.nio.file.StandardWatchEventKinds.OVERFLOW; + +/** Service which is able to watch local filesystem directories. */ +public class FsWatchService extends Thread { + private static final Logger LOG = LoggerFactory.getLogger(FsWatchService.class); + + private final String directoryPath; + + public FsWatchService(String directoryPath) { + this.directoryPath = directoryPath; Review Comment: It blows up in a noisy way which is good because one can see that something is really bad: ``` java.nio.file.NoSuchFileException: /intentionally/missing/directory ``` Not starting it silently would give the user the feeling that everything is fine but it would be a lie, right? -- 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]
