Skip to content

Commit

Permalink
Add cross-cluster rule configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
peacewong committed Oct 24, 2023
1 parent 59d430b commit 4d8e2e6
Show file tree
Hide file tree
Showing 58 changed files with 5,110 additions and 302 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* 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.linkis.configuration.conf;

public class AcrossClusterRuleKeys {

public static final String KEY_QUEUE_SUFFIX = "suffix";

public static final String KEY_ACROSS_CLUSTER_QUEUE_SUFFIX = "bdap2bdp";

public static final String KEY_START_TIME = "startTime";

public static final String KEY_END_TIME = "endTime";

public static final String KEY_CPU_THRESHOLD = "CPUThreshold";

public static final String KEY_MEMORY_THRESHOLD = "MemoryThreshold";

public static final String KEY_CPU_PERCENTAGE_THRESHOLD = "CPUPercentageThreshold";

public static final String KEY_MEMORY_PERCENTAGE_THRESHOLD = "MemoryPercentageThreshold";

public static final String KEY_QUEUE_RULE = "queueRule";

public static final String KEY_TIME_RULE = "timeRule";

public static final String KEY_THRESHOLD_RULE = "thresholdRule";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* 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.linkis.configuration.dao;

import org.apache.linkis.configuration.entity.AcrossClusterRule;

import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface AcrossClusterRuleMapper {

AcrossClusterRule getAcrossClusterRule(@Param("id") Long id);

void deleteAcrossClusterRule(
@Param("creator") String creator, @Param("username") String username);

void updateAcrossClusterRule(@Param("acrossClusterRule") AcrossClusterRule acrossClusterRule);

void insertAcrossClusterRule(@Param("acrossClusterRule") AcrossClusterRule acrossClusterRule);

List<AcrossClusterRule> queryAcrossClusterRuleList(
@Param("username") String username,
@Param("creator") String creator,
@Param("clusterName") String clusterName);

void validAcrossClusterRule(@Param("isValid") String isValid, @Param("id") Long id);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* 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.linkis.configuration.dao;

import org.apache.linkis.configuration.entity.ConfigKeyLimitForUser;
import org.apache.linkis.configuration.entity.ConfigKeyLimitVo;

import org.apache.ibatis.annotations.Param;

import java.util.List;

/** for table linkis_ps_configuration_key_limit_for_user @Description */
public interface ConfigKeyLimitForUserMapper {

int batchInsertList(List<ConfigKeyLimitForUser> list);

int updateByPrimaryKey(ConfigKeyLimitForUser configKeyLimitForUser);

int batchInsertOrUpdateList(List<ConfigKeyLimitForUser> list);

List<ConfigKeyLimitVo> selectByLabelAndKeyIds(
@Param("label") String label, @Param("keyIdList") List<Long> keyIdList);

ConfigKeyLimitVo selectByLabelAndKeyId(@Param("label") String label, @Param("keyId") Long keyId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,22 @@

package org.apache.linkis.configuration.dao;

import org.apache.linkis.configuration.entity.CategoryLabel;
import org.apache.linkis.configuration.entity.ConfigKey;
import org.apache.linkis.configuration.entity.ConfigKeyValue;
import org.apache.linkis.configuration.entity.ConfigValue;
import org.apache.linkis.configuration.entity.*;

import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ConfigMapper {

List<ConfigKeyValue> getConfigByEngineUserCreator(
@Param("engineType") String engineType,
@Param("creator") String creator,
@Param("userName") String userName);

List<ConfigKeyValue> getConfigKeyByLabelIds(@Param("ids") List<Integer> ids);

List<ConfigKeyValue> getConfigKeyValueByLabelId(@Param("labelId") Integer labelId);

Long selectAppIDByAppName(@Param("name") String appName);

void insertValue(ConfigValue configValue);

int batchInsertOrUpdateValueList(List<ConfigValue> list);

ConfigValue getConfigValueById(@Param("id") Long id);

ConfigValue getConfigValueByKeyAndLabel(ConfigValue configValue);
Expand All @@ -55,11 +47,16 @@ List<ConfigKeyValue> getConfigByEngineUserCreator(

ConfigKey selectKeyByKeyID(@Param("id") Long keyID);

List<ConfigKey> seleteKeyByKeyName(@Param("keyName") String keyName);
List<ConfigKey> selectKeyByKeyName(@Param("keyName") String keyName);

List<ConfigKey> listKeyByStringValue(@Param("stringValue") String stringValue);
List<ConfigKey> selectKeyByEngineType(@Param("engineType") String engineType);

List<ConfigKey> selectKeyByEngineTypeAndKeyList(
@Param("engineType") String engineType, @Param("keyList") List<String> keyList);

void insertCreator(String creator);
List<ConfigKey> selectKeyByKeyIdList(@Param("keyIdList") List<Long> keyList);

List<ConfigKey> listKeyByStringValue(@Param("stringValue") String stringValue);

List<CategoryLabel> getCategory();

Expand All @@ -72,4 +69,23 @@ List<ConfigKeyValue> getConfigByEngineUserCreator(
void updateCategory(CategoryLabel categoryLabel);

void insertKey(ConfigKey key);

List<ConfigKeyValue> getConfigEnKeyValueByLabelId(@Param("labelId") Integer labelId);

void deleteConfigKey(@Param("id") Integer id);

List<ConfigKey> getConfigBykey(@Param("engineType") String engineType, @Param("key") String key);

List<ConfigKey> getConfigEnBykey(
@Param("engineType") String engineType, @Param("key") String key);

List<ConfigUserValue> getUserConfigValue(
@Param("key") String key,
@Param("user") String user,
@Param("creator") String creator,
@Param("engineType") String engineType);

void insertKeyByBase(ConfigKey configKey);

void updateConfigKey(ConfigKey configKey);
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@ public interface LabelMapper {
ConfigLabel getLabelByKeyValue(
@Param("labelKey") String labelKey, @Param("stringValue") String stringValue);

// label key:combined_userCreator_engineType
List<ConfigLabel> selectUserCreatorEngineTypeLabelList(@Param("itemList") List<String> itemList);

void insertLabel(ConfigLabel label);

void batchInsertLabel(@Param("labelList") List<ConfigLabel> labelList);

void deleteLabel(@Param("ids") List<Integer> ids);

ConfigLabel getLabelById(@Param("id") Integer id);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* 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.linkis.configuration.dao;

import org.apache.linkis.configuration.entity.TemplateConfigKey;
import org.apache.linkis.configuration.entity.TemplateConfigKeyVO;

import org.apache.ibatis.annotations.Param;

import java.util.List;

/** The dao interface class of the linkis_ps_configuration_template_config_key table @Description */
public interface TemplateConfigKeyMapper {

int batchInsertList(List<TemplateConfigKey> list);

List<TemplateConfigKey> selectListByTemplateUuid(@Param("templateUuid") String templateUuid);

int deleteByTemplateUuidAndKeyIdList(
@Param("templateUuid") String templateUuid, @Param("keyIdList") List<Long> KeyIdList);

int batchInsertOrUpdateList(List<TemplateConfigKey> list);

List<TemplateConfigKey> selectListByTemplateUuidList(
@Param("templateUuidList") List<String> templateUuidList);

List<TemplateConfigKeyVO> selectInfoListByTemplateUuid(
@Param("templateUuid") String templateUuid);

List<TemplateConfigKeyVO> selectInfoListByTemplateName(
@Param("templateName") String templateName);

List<String> selectEngineTypeByTemplateUuid(@Param("templateUuid") String templateUuid);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* 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.linkis.configuration.dao;

import org.apache.linkis.configuration.entity.UserIpVo;

import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserIpMapper {

List<UserIpVo> queryUserIPList(@Param("user") String user, @Param("creator") String creator);

void deleteUserIP(Integer id);

void updateUserIP(UserIpVo userIpVo);

void createUserIP(UserIpVo userIpVo);

UserIpVo queryUserIP(@Param("user") String user, @Param("creator") String creator);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* 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.linkis.configuration.dao;

import org.apache.linkis.configuration.entity.TenantVo;

import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserTenantMapper {

List<TenantVo> queryTenantList(
@Param("user") String user,
@Param("creator") String creator,
@Param("tenant_value") String tenant);

void deleteTenant(@Param("id") Integer id);

void updateTenant(TenantVo tenantVo);

void createTenant(TenantVo tenantVo);

TenantVo queryTenant(@Param("user") String user, @Param("creator") String creator);
}
Loading

0 comments on commit 4d8e2e6

Please sign in to comment.