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

sunnianjun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere-elasticjob.git


The following commit(s) were added to refs/heads/master by this push:
     new bdd7637f8 Remove TracingStorageConverterNotFoundException (#2358)
bdd7637f8 is described below

commit bdd7637f8a48cc40c3ef1074f9f981d943c93be5
Author: Liang Zhang <[email protected]>
AuthorDate: Tue Oct 31 21:44:06 2023 +0800

    Remove TracingStorageConverterNotFoundException (#2358)
---
 .../tracing/config/TracingConfiguration.java       |  6 ++--
 .../TracingStorageConverterNotFoundException.java  | 32 ----------------------
 2 files changed, 3 insertions(+), 35 deletions(-)

diff --git 
a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/config/TracingConfiguration.java
 
b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/config/TracingConfiguration.java
index cd0590458..c700c470d 100644
--- 
a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/config/TracingConfiguration.java
+++ 
b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/config/TracingConfiguration.java
@@ -20,8 +20,8 @@ package 
org.apache.shardingsphere.elasticjob.kernel.tracing.config;
 import lombok.Getter;
 import lombok.RequiredArgsConstructor;
 import org.apache.shardingsphere.elasticjob.api.JobExtraConfiguration;
-import 
org.apache.shardingsphere.elasticjob.kernel.tracing.exception.TracingStorageConverterNotFoundException;
 import 
org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverterFactory;
+import 
org.apache.shardingsphere.infra.spi.exception.ServiceProviderNotFoundException;
 
 /**
  * Tracing configuration.
@@ -39,7 +39,7 @@ public final class TracingConfiguration<T> implements 
JobExtraConfiguration {
     @SuppressWarnings("unchecked")
     public TracingConfiguration(final String type, final T storage) {
         this.type = type;
-        this.tracingStorageConfiguration = 
TracingStorageConverterFactory.findConverter((Class<T>) storage.getClass())
-                .orElseThrow(() -> new 
TracingStorageConverterNotFoundException(storage.getClass())).convertToConfiguration(storage);
+        tracingStorageConfiguration = 
TracingStorageConverterFactory.findConverter((Class<T>) storage.getClass())
+                .orElseThrow(() -> new 
ServiceProviderNotFoundException(storage.getClass(), 
storage.getClass().getSimpleName())).convertToConfiguration(storage);
     }
 }
diff --git 
a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/exception/TracingStorageConverterNotFoundException.java
 
b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/exception/TracingStorageConverterNotFoundException.java
deleted file mode 100644
index a2661fb1d..000000000
--- 
a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/exception/TracingStorageConverterNotFoundException.java
+++ /dev/null
@@ -1,32 +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.shardingsphere.elasticjob.kernel.tracing.exception;
-
-import 
org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter;
-
-/**
- * {@link TracingStorageConverter} not found exception.
- */
-public final class TracingStorageConverterNotFoundException extends 
RuntimeException {
-    
-    private static final long serialVersionUID = -995858641205565452L;
-    
-    public TracingStorageConverterNotFoundException(final Class<?> 
storageType) {
-        super(String.format("No TracingConfigurationConverter found for [%s]", 
storageType.getName()));
-    }
-}

Reply via email to