/* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed 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. */ import React from "react"; import HeaderPanel from "components/HeaderPanel"; import FormItem from "components/FormItem"; import { ApplicationLogType } from "../CreatePipeline"; import TextInput from "components/TextInput"; import { useTranslation } from "react-i18next"; import SelectBuffer, { BufferType } from "./SelectBuffer"; import BufferKDS from "pages/comps/buffer/BufferKDS"; import BufferS3 from "pages/comps/buffer/BufferS3"; import { OptionType } from "components/AutoComplete/autoComplete"; interface IngestSettingProps { applicationLog: ApplicationLogType; changeIndexPrefix: (index: string) => void; changeShardNumber: (shardNum: string) => void; changeMaxShardNum: (shardNum: string) => void; changeEnableAS: (enable: string) => void; changeBufferType: (bufferType: string) => void; changeS3BufferBucket: (bucket: OptionType | null) => void; changeS3BufferPrefix: (prefix: string) => void; changeS3BufferBufferSize: (size: string) => void; changeS3BufferTimeout: (timeout: string) => void; changeS3CompressionType: (type: string) => void; changeS3StorageClass: (storage: string) => void; disableSelect?: boolean; indexEmptyError: boolean; indexFormatError: boolean; indexDuplicatedError: boolean; shardNumInvalidError?: boolean; maxShardNumInvalidError?: boolean; s3BucketEmptyError: boolean; s3PrefixError: boolean; bufferSizeError: boolean; bufferIntervalError: boolean; } const IngestSetting: React.FC = ( props: IngestSettingProps ) => { const { applicationLog, changeIndexPrefix, changeShardNumber, changeEnableAS, changeMaxShardNum, changeBufferType, changeS3BufferBucket, changeS3BufferPrefix, changeS3BufferBufferSize, changeS3BufferTimeout, changeS3CompressionType, changeS3StorageClass, indexEmptyError, indexFormatError, indexDuplicatedError, shardNumInvalidError, maxShardNumInvalidError, s3BucketEmptyError, s3PrefixError, bufferSizeError, bufferIntervalError, } = props; const { t } = useTranslation(); return (
{ changeIndexPrefix(event.target.value); }} placeholder="log-example" />
<> { changeBufferType(layer); }} /> {applicationLog.bufferType === BufferType.KDS && ( { changeShardNumber(number); }} changeEnableAS={(enable) => { changeEnableAS(enable); }} changeMaxShardNum={(number) => { changeMaxShardNum(number); }} /> )} {applicationLog.bufferType === BufferType.S3 && ( { changeS3BufferBucket(bucket); }} changeS3BufferPrefix={(prefix) => { changeS3BufferPrefix(prefix); }} changeS3BufferBufferSize={(size) => { changeS3BufferBufferSize(size); }} changeS3BufferTimeout={(timeout) => { changeS3BufferTimeout(timeout); }} changeS3CompressionType={(type) => { changeS3CompressionType(type); }} changeS3StorageClass={(storage) => { changeS3StorageClass(storage); }} /> )}
); }; export default IngestSetting;