You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ch...@apache.org on 2018/08/31 15:30:14 UTC

[flink] branch master updated: [FLINK-10270][REST] Delete unused class LegacyRestHandlerAdapter.

This is an automated email from the ASF dual-hosted git repository.

chesnay pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/master by this push:
     new 0eb9a29  [FLINK-10270][REST] Delete unused class LegacyRestHandlerAdapter.
0eb9a29 is described below

commit 0eb9a29adc85286c083d1839eae5f78a17ab76d3
Author: gyao <ga...@data-artisans.com>
AuthorDate: Fri Aug 31 08:34:43 2018 +0200

    [FLINK-10270][REST] Delete unused class LegacyRestHandlerAdapter.
    
    - Delete class LegacyRestHandlerAdapter.
    - Delete class LegacyRestHandler.
---
 .../runtime/rest/handler/LegacyRestHandler.java    | 38 -------------
 .../rest/handler/LegacyRestHandlerAdapter.java     | 62 ----------------------
 2 files changed, 100 deletions(-)

diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/LegacyRestHandler.java b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/LegacyRestHandler.java
deleted file mode 100644
index 3e70575..0000000
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/LegacyRestHandler.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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.rest.handler;
-
-import org.apache.flink.runtime.rest.messages.EmptyRequestBody;
-import org.apache.flink.runtime.rest.messages.MessageParameters;
-import org.apache.flink.runtime.rest.messages.ResponseBody;
-import org.apache.flink.runtime.webmonitor.RestfulGateway;
-
-import java.util.concurrent.CompletableFuture;
-
-/**
- * Interface which Flink's legacy REST handler have to implement in order to be usable
- * via the {@link LegacyRestHandlerAdapter}.
- *
- * @param <T> type of the gateway
- * @param <R> type of the REST response
- */
-public interface LegacyRestHandler<T extends RestfulGateway, R extends ResponseBody, M extends MessageParameters> {
-
-	CompletableFuture<R> handleRequest(HandlerRequest<EmptyRequestBody, M> request, T gateway);
-}
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/LegacyRestHandlerAdapter.java b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/LegacyRestHandlerAdapter.java
deleted file mode 100644
index 7ff9d3a..0000000
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/LegacyRestHandlerAdapter.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * 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.rest.handler;
-
-import org.apache.flink.api.common.time.Time;
-import org.apache.flink.runtime.rest.messages.EmptyRequestBody;
-import org.apache.flink.runtime.rest.messages.MessageHeaders;
-import org.apache.flink.runtime.rest.messages.MessageParameters;
-import org.apache.flink.runtime.rest.messages.ResponseBody;
-import org.apache.flink.runtime.webmonitor.RestfulGateway;
-import org.apache.flink.runtime.webmonitor.retriever.GatewayRetriever;
-import org.apache.flink.util.Preconditions;
-
-import javax.annotation.Nonnull;
-
-import java.util.Map;
-import java.util.concurrent.CompletableFuture;
-
-/**
- * Adapter for Flink's legacy REST handlers.
- *
- * @param <T> type of the gateway
- * @param <R> type of the REST response
- * @param <M> type of the MessageParameters
- */
-public class LegacyRestHandlerAdapter<T extends RestfulGateway, R extends ResponseBody, M extends MessageParameters> extends AbstractRestHandler<T, EmptyRequestBody, R, M> {
-
-	private final LegacyRestHandler<T, R, M> legacyRestHandler;
-
-	public LegacyRestHandlerAdapter(
-			CompletableFuture<String> localRestAddress,
-			GatewayRetriever<T> leaderRetriever,
-			Time timeout,
-			Map<String, String> headers,
-			MessageHeaders<EmptyRequestBody, R, M> messageHeaders,
-			LegacyRestHandler<T, R, M> legacyRestHandler) {
-		super(localRestAddress, leaderRetriever, timeout, headers, messageHeaders);
-
-		this.legacyRestHandler = Preconditions.checkNotNull(legacyRestHandler);
-	}
-
-	@Override
-	protected CompletableFuture<R> handleRequest(@Nonnull HandlerRequest<EmptyRequestBody, M> request, @Nonnull T gateway) throws RestHandlerException {
-		return legacyRestHandler.handleRequest(request, gateway);
-	}
-}