@ -22,10 +22,6 @@ import static java.util.Objects.requireNonNull;
import org.apache.dolphinscheduler.dao.entity.PluginDefine ;
import org.apache.dolphinscheduler.dao.entity.PluginDefine ;
import org.apache.dolphinscheduler.dao.mapper.PluginDefineMapper ;
import org.apache.dolphinscheduler.dao.mapper.PluginDefineMapper ;
import org.apache.commons.collections.CollectionUtils ;
import java.util.List ;
import org.springframework.beans.factory.annotation.Autowired ;
import org.springframework.beans.factory.annotation.Autowired ;
import org.springframework.stereotype.Component ;
import org.springframework.stereotype.Component ;
@ -63,14 +59,13 @@ public class PluginDao {
requireNonNull ( pluginDefine . getPluginName ( ) , "pluginName is null" ) ;
requireNonNull ( pluginDefine . getPluginName ( ) , "pluginName is null" ) ;
requireNonNull ( pluginDefine . getPluginType ( ) , "pluginType is null" ) ;
requireNonNull ( pluginDefine . getPluginType ( ) , "pluginType is null" ) ;
List < PluginDefine > pluginDefineList = pluginDefineMapper . queryByNameAndType ( pluginDefine . getPluginName ( ) , pluginDefine . getPluginType ( ) ) ;
PluginDefine currPluginDefine = pluginDefineMapper . queryByNameAndType ( pluginDefine . getPluginName ( ) , pluginDefine . getPluginType ( ) ) ;
if ( CollectionUtils . isEmpty ( pluginDefineList ) ) {
if ( currPluginDefine = = null ) {
if ( pluginDefineMapper . insert ( pluginDefine ) = = 1 & & pluginDefine . getId ( ) > 0 ) {
if ( pluginDefineMapper . insert ( pluginDefine ) = = 1 & & pluginDefine . getId ( ) > 0 ) {
return pluginDefine . getId ( ) ;
return pluginDefine . getId ( ) ;
}
}
throw new IllegalStateException ( "Failed to insert plugin definition" ) ;
throw new IllegalStateException ( "Failed to insert plugin definition" ) ;
}
}
PluginDefine currPluginDefine = pluginDefineList . get ( 0 ) ;
if ( ! currPluginDefine . getPluginParams ( ) . equals ( pluginDefine . getPluginParams ( ) ) ) {
if ( ! currPluginDefine . getPluginParams ( ) . equals ( pluginDefine . getPluginParams ( ) ) ) {
currPluginDefine . setUpdateTime ( pluginDefine . getUpdateTime ( ) ) ;
currPluginDefine . setUpdateTime ( pluginDefine . getUpdateTime ( ) ) ;
currPluginDefine . setPluginParams ( pluginDefine . getPluginParams ( ) ) ;
currPluginDefine . setPluginParams ( pluginDefine . getPluginParams ( ) ) ;