kafka_neu-1778570057504.zip-extract/kafka-4.2.0-src/tests/kafkatest/services/kafka/config.py

Path
kafka_neu-1778570057504.zip-extract/kafka-4.2.0-src/tests/kafkatest/services/kafka/config.py
Status
scanned
Type
file
Name
config.py
Extension
.py
Programming language
Python
Mime type
text/x-script.python
File type
Python script, ASCII text executable
Tag

      
    
Rootfs path

      
    
Size
2112 (2.1 KB)
MD5
cb213cdcdd5f0b64af1be2a6b743bd3a
SHA1
213aeb84e713c60220c940eb00f02a2eaee45825
SHA256
db8c36129aa6cdd7d151cf9bfc783a5f9bd7e322a6ab58cf4b490e314b9cf1ed
SHA512

      
    
SHA1_git
8d919ce23c967c3e778e28c5ce54a7bf54d985b2
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
config.py | 2.1 KB |

# 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. from . import config_property class KafkaConfig(dict): """A dictionary-like container class which allows for definition of overridable default values, which is also capable of "rendering" itself as a useable server.properties file. """ DEFAULTS = { config_property.SOCKET_RECEIVE_BUFFER_BYTES: 65536, config_property.LOG_DIRS: "/mnt/kafka/kafka-data-logs-1,/mnt/kafka/kafka-data-logs-2", config_property.METADATA_LOG_DIR: "/mnt/kafka/kafka-metadata-logs", config_property.METADATA_LOG_SEGMENT_BYTES: str(9*1024*1024), # 9 MB config_property.METADATA_LOG_BYTES_BETWEEN_SNAPSHOTS: str(10*1024*1024), # 10 MB config_property.METADATA_LOG_RETENTION_BYTES: str(10*1024*1024), # 10 MB config_property.METADATA_LOG_SEGMENT_MS: str(1*60*1000), # one minute } def __init__(self, **kwargs): super(KafkaConfig, self).__init__(**kwargs) # Set defaults for key, val in self.DEFAULTS.items(): if key not in self: self[key] = val def render(self): """Render self as a series of lines key=val , and do so in a consistent order. """ keys = [k for k in self.keys()] keys.sort() s = "" for k in keys: s += "%s=%s " % (k, str(self[k])) return s
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
40.07
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-4bde3f57-78aa-4201-96bf-531cba09e7de apache-2.0 Apache-2.0
URL Start line End line
http://www.apache.org/licenses/LICENSE-2.0 8 8
Package URL License Primary language
pkg:pypi/kafkatest@4.2.0 apache-2.0 Python