SteveYurongSu commented on code in PR #11639: URL: https://github.com/apache/iotdb/pull/11639#discussion_r1420904745
########## iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/plugin/builtin/extractor/schema/IoTDBSchemaExtractor.java: ########## @@ -0,0 +1,150 @@ +/* + * 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.iotdb.commons.pipe.plugin.builtin.extractor.schema; + +import org.apache.iotdb.commons.pipe.metric.PipeFakeEventCounter; +import org.apache.iotdb.commons.pipe.task.connection.UnboundedBlockingPendingQueue; +import org.apache.iotdb.pipe.api.PipeExtractor; +import org.apache.iotdb.pipe.api.customizer.configuration.PipeExtractorRuntimeConfiguration; +import org.apache.iotdb.pipe.api.customizer.parameter.PipeParameterValidator; +import org.apache.iotdb.pipe.api.customizer.parameter.PipeParameters; +import org.apache.iotdb.pipe.api.event.Event; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.atomic.AtomicBoolean; + +import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_INCLUSION_AUTHORITY_VALUE; +import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_INCLUSION_DATA_VALUE; +import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_INCLUSION_DEFAULT_VALUE; +import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_INCLUSION_FUNCTION_VALUE; +import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_INCLUSION_KEY; +import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_INCLUSION_MODEL_VALUE; +import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_INCLUSION_SCHEMA_VALUE; +import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_INCLUSION_TRIGGER_VALUE; +import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_INCLUSION_TTL_VALUE; +import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.SOURCE_INCLUSION_KEY; + +public class IoTDBSchemaExtractor implements PipeExtractor { + + private static final Logger LOGGER = LoggerFactory.getLogger(IoTDBSchemaExtractor.class); + + private final AtomicBoolean hasBeenStarted; + protected final UnboundedBlockingPendingQueue<Event> pendingQueue = + new UnboundedBlockingPendingQueue<>(new PipeFakeEventCounter()); + + private boolean enableSchemaSync = false; + private boolean enableTtlSync = false; + private boolean enableFunctionSync = false; + private boolean enableTriggerSync = false; + private boolean enableModelSync = false; + private boolean enableAuthoritySync = false; + private boolean atLeastOneEnable = false; + + public IoTDBSchemaExtractor() { Review Comment: 建议跟 IoTDBDataRegionExtractor 一样,做成 IoTDBSchemaRegionExtractor、IoTDBConfigRegionExtractor,然后分别放到 DN 和 CN 上。 IoTDBDataRegionExtractor、IoTDBSchemaRegionExtractor、IoTDBConfigRegionExtractor 需要分别验证 EXTRACTOR_INCLUSION_DATA_VALUE 等等参数(IoTDBDataRegionExtractor 可能会被 disable) ########## iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/plugin/builtin/extractor/schema/IoTDBSchemaExtractor.java: ########## @@ -0,0 +1,150 @@ +/* + * 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.iotdb.commons.pipe.plugin.builtin.extractor.schema; + +import org.apache.iotdb.commons.pipe.metric.PipeFakeEventCounter; +import org.apache.iotdb.commons.pipe.task.connection.UnboundedBlockingPendingQueue; +import org.apache.iotdb.pipe.api.PipeExtractor; +import org.apache.iotdb.pipe.api.customizer.configuration.PipeExtractorRuntimeConfiguration; +import org.apache.iotdb.pipe.api.customizer.parameter.PipeParameterValidator; +import org.apache.iotdb.pipe.api.customizer.parameter.PipeParameters; +import org.apache.iotdb.pipe.api.event.Event; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.atomic.AtomicBoolean; + +import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_INCLUSION_AUTHORITY_VALUE; +import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_INCLUSION_DATA_VALUE; +import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_INCLUSION_DEFAULT_VALUE; +import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_INCLUSION_FUNCTION_VALUE; +import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_INCLUSION_KEY; +import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_INCLUSION_MODEL_VALUE; +import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_INCLUSION_SCHEMA_VALUE; +import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_INCLUSION_TRIGGER_VALUE; +import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.EXTRACTOR_INCLUSION_TTL_VALUE; +import static org.apache.iotdb.commons.pipe.config.constant.PipeExtractorConstant.SOURCE_INCLUSION_KEY; + +public class IoTDBSchemaExtractor implements PipeExtractor { + + private static final Logger LOGGER = LoggerFactory.getLogger(IoTDBSchemaExtractor.class); + + private final AtomicBoolean hasBeenStarted; + protected final UnboundedBlockingPendingQueue<Event> pendingQueue = + new UnboundedBlockingPendingQueue<>(new PipeFakeEventCounter()); + + private boolean enableSchemaSync = false; + private boolean enableTtlSync = false; + private boolean enableFunctionSync = false; + private boolean enableTriggerSync = false; + private boolean enableModelSync = false; + private boolean enableAuthoritySync = false; + private boolean atLeastOneEnable = false; + + public IoTDBSchemaExtractor() { Review Comment: 建议跟 IoTDBDataRegionExtractor 一样,做成 IoTDBSchemaRegionExtractor、IoTDBConfigRegionExtractor,然后分别放到 DN 和 CN 上。 IoTDBDataRegionExtractor、IoTDBSchemaRegionExtractor、IoTDBConfigRegionExtractor 需要分别验证 EXTRACTOR_INCLUSION_DATA_VALUE 等等参数(IoTDBDataRegionExtractor 可能会被 disable) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
