-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
160 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?xml version="1.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. | ||
--> | ||
|
||
<configuration> | ||
<statusListener class="ch.qos.logback.core.status.NopStatusListener" /> | ||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender"> | ||
<encoder> | ||
<pattern>[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %logger{36} - %msg%n</pattern> | ||
</encoder> | ||
</appender> | ||
<logger name="org.apache.shardingsphere" level="warn" additivity="false"> | ||
<appender-ref ref="console" /> | ||
</logger> | ||
|
||
<root> | ||
<level value="error" /> | ||
<appender-ref ref="console" /> | ||
</root> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 0 additions & 42 deletions
42
...n/java/org/apache/shardingsphere/data/pipeline/common/pojo/TableBasedPipelineJobInfo.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
...ache/shardingsphere/data/pipeline/core/job/service/PipelineJobIteErrorMessageManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* 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.data.pipeline.core.job.service; | ||
|
||
import org.apache.commons.lang3.exception.ExceptionUtils; | ||
import org.apache.shardingsphere.data.pipeline.common.metadata.node.PipelineMetaDataNode; | ||
import org.apache.shardingsphere.data.pipeline.common.registrycenter.repository.GovernanceRepositoryAPI; | ||
import org.apache.shardingsphere.data.pipeline.core.job.PipelineJobIdUtils; | ||
|
||
import java.util.Optional; | ||
|
||
/** | ||
* Pipeline job item error message manager. | ||
*/ | ||
public final class PipelineJobIteErrorMessageManager { | ||
|
||
private final String jobId; | ||
|
||
private final int shardingItem; | ||
|
||
private final GovernanceRepositoryAPI governanceRepositoryAPI; | ||
|
||
public PipelineJobIteErrorMessageManager(final String jobId, final int shardingItem) { | ||
this.jobId = jobId; | ||
this.shardingItem = shardingItem; | ||
governanceRepositoryAPI = PipelineAPIFactory.getGovernanceRepositoryAPI(PipelineJobIdUtils.parseContextKey(jobId)); | ||
} | ||
|
||
/** | ||
* Get job item error message. | ||
* | ||
* @return map, key is sharding item, value is error message | ||
*/ | ||
public String getErrorMessage() { | ||
return Optional.ofNullable(governanceRepositoryAPI.getJobItemErrorMessage(jobId, shardingItem)).orElse(""); | ||
} | ||
|
||
/** | ||
* Update job item error message. | ||
* | ||
* @param error error | ||
*/ | ||
public void updateErrorMessage(final Object error) { | ||
governanceRepositoryAPI.update(PipelineMetaDataNode.getJobItemErrorMessagePath(jobId, shardingItem), null == error ? "" : buildErrorMessage(error)); | ||
} | ||
|
||
private String buildErrorMessage(final Object error) { | ||
return error instanceof Throwable ? ExceptionUtils.getStackTrace((Throwable) error) : error.toString(); | ||
} | ||
|
||
/** | ||
* Clean job item error message. | ||
*/ | ||
public void cleanErrorMessage() { | ||
governanceRepositoryAPI.persist(PipelineMetaDataNode.getJobItemErrorMessagePath(jobId, shardingItem), ""); | ||
} | ||
} |
Oops, something went wrong.