From d26d22808e5ab42cc8bf985cf2b276d35d153435 Mon Sep 17 00:00:00 2001 From: Yuya Ebihara Date: Mon, 1 Aug 2022 12:19:23 +0900 Subject: [PATCH] Remove unused classes from Delta Lake --- .../plugin/deltalake/FailingExecutor.java | 28 ---- .../FailingScheduledExecutorService.java | 59 -------- .../ForwardingScheduledExecutorService.java | 137 ------------------ 3 files changed, 224 deletions(-) delete mode 100644 plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/FailingExecutor.java delete mode 100644 plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/FailingScheduledExecutorService.java delete mode 100644 plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/ForwardingScheduledExecutorService.java diff --git a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/FailingExecutor.java b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/FailingExecutor.java deleted file mode 100644 index 6a86d3ccd4cb..000000000000 --- a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/FailingExecutor.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed 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 io.trino.plugin.deltalake; - -import java.util.concurrent.Executor; - -public enum FailingExecutor - implements Executor -{ - INSTANCE; - - @Override - public void execute(Runnable command) - { - throw new UnsupportedOperationException(); - } -} diff --git a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/FailingScheduledExecutorService.java b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/FailingScheduledExecutorService.java deleted file mode 100644 index c8d30645810a..000000000000 --- a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/FailingScheduledExecutorService.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed 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 io.trino.plugin.deltalake; - -import com.google.common.collect.ImmutableList; - -import java.util.List; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; - -public final class FailingScheduledExecutorService - extends ForwardingScheduledExecutorService -{ - public static final ScheduledExecutorService INSTANCE = new FailingScheduledExecutorService(); - - @Override - protected ScheduledExecutorService getDelegate() - { - throw new UnsupportedOperationException("This ScheduledExecutorService should not be used"); - } - - @Override - public void shutdown() {} - - @Override - public List shutdownNow() - { - return ImmutableList.of(); - } - - @Override - public boolean isShutdown() - { - return true; - } - - @Override - public boolean isTerminated() - { - return true; - } - - @Override - public boolean awaitTermination(long timeout, TimeUnit unit) - { - return true; - } -} diff --git a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/ForwardingScheduledExecutorService.java b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/ForwardingScheduledExecutorService.java deleted file mode 100644 index 8fd59e29bddf..000000000000 --- a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/ForwardingScheduledExecutorService.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Licensed 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 io.trino.plugin.deltalake; - -import java.util.Collection; -import java.util.List; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; - -abstract class ForwardingScheduledExecutorService - implements ScheduledExecutorService -{ - protected abstract ScheduledExecutorService getDelegate(); - - @Override - public ScheduledFuture schedule(Runnable command, long delay, TimeUnit unit) - { - return getDelegate().schedule(command, delay, unit); - } - - @Override - public ScheduledFuture schedule(Callable callable, long delay, TimeUnit unit) - { - return getDelegate().schedule(callable, delay, unit); - } - - @Override - public ScheduledFuture scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) - { - return getDelegate().scheduleAtFixedRate(command, initialDelay, period, unit); - } - - @Override - public ScheduledFuture scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) - { - return getDelegate().scheduleWithFixedDelay(command, initialDelay, delay, unit); - } - - @Override - public void shutdown() - { - getDelegate().shutdown(); - } - - @Override - public List shutdownNow() - { - return getDelegate().shutdownNow(); - } - - @Override - public boolean isShutdown() - { - return getDelegate().isShutdown(); - } - - @Override - public boolean isTerminated() - { - return getDelegate().isTerminated(); - } - - @Override - public boolean awaitTermination(long timeout, TimeUnit unit) - throws InterruptedException - { - return getDelegate().awaitTermination(timeout, unit); - } - - @Override - public Future submit(Callable task) - { - return getDelegate().submit(task); - } - - @Override - public Future submit(Runnable task, T result) - { - return getDelegate().submit(task, result); - } - - @Override - public Future submit(Runnable task) - { - return getDelegate().submit(task); - } - - @Override - public List> invokeAll(Collection> tasks) - throws InterruptedException - { - return getDelegate().invokeAll(tasks); - } - - @Override - public List> invokeAll(Collection> tasks, long timeout, TimeUnit unit) - throws InterruptedException - { - return getDelegate().invokeAll(tasks, timeout, unit); - } - - @Override - public T invokeAny(Collection> tasks) - throws InterruptedException, ExecutionException - { - return getDelegate().invokeAny(tasks); - } - - @Override - public T invokeAny(Collection> tasks, long timeout, TimeUnit unit) - throws InterruptedException, ExecutionException, TimeoutException - { - return getDelegate().invokeAny(tasks, timeout, unit); - } - - @Override - public void execute(Runnable command) - { - getDelegate().execute(command); - } -}