flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From StephanEwen <...@git.apache.org>
Subject [GitHub] flink pull request #2903: [FLINK-5074] [runtime] add a zookeeper based runni...
Date Thu, 15 Dec 2016 13:33:02 GMT
Github user StephanEwen commented on a diff in the pull request:

    --- Diff: flink-runtime/src/test/java/org/apache/flink/runtime/highavailability/ZooKeeperRegistryTest.java
    @@ -0,0 +1,87 @@
    + * 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.runtime.highavailability;
    +import org.apache.curator.test.TestingServer;
    +import org.apache.flink.api.common.JobID;
    +import org.apache.flink.configuration.Configuration;
    +import org.apache.flink.configuration.HighAvailabilityOptions;
    +import org.apache.flink.util.TestLogger;
    +import org.junit.After;
    +import org.junit.Before;
    +import org.junit.Test;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +import static org.junit.Assert.*;
    +public class ZooKeeperRegistryTest extends TestLogger {
    +	private TestingServer testingServer;
    +	private static Logger LOG = LoggerFactory.getLogger(ZooKeeperRegistryTest.class);
    +	@Before
    +	public void before() {
    +		try {
    +			testingServer = new TestingServer();
    +		} catch (Exception e) {
    --- End diff --
    I would just add `throws Exception` to the method signature here, rather than catching
and wrapping the exception. Makes error stack traces easier to read.
    As a general rule: I think one should never need to explicitly throw a `RuntimeException`.
    (I know Flink has a few places where it does it, but these are in my opinion errors from
the past, during the time when we were still learning)

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message