Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API to update cluster-level compaction configs #16803

Merged
merged 5 commits into from
Jul 27, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,12 @@ public void setup()
final String dataSource = DATA_SOURCE_PREFIX + i;
compactionConfigs.put(
dataSource,
new DataSourceCompactionConfig(
dataSource,
0,
inputSegmentSizeBytes,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
)
DataSourceCompactionConfig
.builder()
.forDataSource(dataSource)
.withTaskPriority(0)
.withInputSegmentSizeBytes(inputSegmentSizeBytes)
.build()
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,7 @@

package org.apache.druid.indexing.common.task;

import org.apache.druid.data.input.SplitHintSpec;
import org.apache.druid.indexer.partitions.PartitionsSpec;
import org.apache.druid.indexing.common.task.batch.parallel.ParallelIndexTuningConfig;
import org.apache.druid.segment.IndexSpec;
import org.apache.druid.segment.incremental.AppendableIndexSpec;
import org.apache.druid.segment.writeout.SegmentWriteOutMediumFactory;
import org.joda.time.Duration;

/**
* Builder utility for various task tuning configs.
Expand All @@ -35,242 +29,8 @@
* @see TuningConfigBuilder#forParallelIndexTask()
* @see TuningConfigBuilder#forCompactionTask()
*/
public abstract class TuningConfigBuilder<C>
public abstract class TuningConfigBuilder<C> extends org.apache.druid.segment.indexing.TuningConfigBuilder<C>
{
protected Integer targetPartitionSize;
protected Integer maxRowsPerSegment;
protected AppendableIndexSpec appendableIndexSpec;
protected Integer maxRowsInMemory;
protected Long maxBytesInMemory;
protected Boolean skipBytesInMemoryOverheadCheck;
protected Long maxTotalRows;
protected Integer numShards;
protected SplitHintSpec splitHintSpec;
protected PartitionsSpec partitionsSpec;
protected IndexSpec indexSpec;
protected IndexSpec indexSpecForIntermediatePersists;
protected Integer maxPendingPersists;
protected Boolean forceGuaranteedRollup;
protected Boolean reportParseExceptions;
protected Long publishTimeout;
protected Long pushTimeout;
protected SegmentWriteOutMediumFactory segmentWriteOutMediumFactory;
protected Integer maxNumSubTasks;
protected Integer maxNumConcurrentSubTasks;
protected Integer maxRetry;
protected Long taskStatusCheckPeriodMs;
protected Duration chatHandlerTimeout;
protected Integer chatHandlerNumRetries;
protected Integer maxNumSegmentsToMerge;
protected Integer totalNumMergeTasks;
protected Boolean logParseExceptions;
protected Integer maxParseExceptions;
protected Integer maxSavedParseExceptions;
protected Integer maxColumnsToMerge;
protected Long awaitSegmentAvailabilityTimeoutMillis;
protected Integer maxAllowedLockCount;
protected Integer numPersistThreads;

public TuningConfigBuilder<C> withTargetPartitionSize(Integer targetPartitionSize)
{
this.targetPartitionSize = targetPartitionSize;
return this;
}

public TuningConfigBuilder<C> withMaxRowsPerSegment(Integer maxRowsPerSegment)
{
this.maxRowsPerSegment = maxRowsPerSegment;
return this;
}

public TuningConfigBuilder<C> withAppendableIndexSpec(AppendableIndexSpec appendableIndexSpec)
{
this.appendableIndexSpec = appendableIndexSpec;
return this;
}

public TuningConfigBuilder<C> withMaxRowsInMemory(Integer maxRowsInMemory)
{
this.maxRowsInMemory = maxRowsInMemory;
return this;
}

public TuningConfigBuilder<C> withMaxBytesInMemory(Long maxBytesInMemory)
{
this.maxBytesInMemory = maxBytesInMemory;
return this;
}

public TuningConfigBuilder<C> withSkipBytesInMemoryOverheadCheck(Boolean skipBytesInMemoryOverheadCheck)
{
this.skipBytesInMemoryOverheadCheck = skipBytesInMemoryOverheadCheck;
return this;
}

public TuningConfigBuilder<C> withMaxTotalRows(Long maxTotalRows)
{
this.maxTotalRows = maxTotalRows;
return this;
}

public TuningConfigBuilder<C> withNumShards(Integer numShards)
{
this.numShards = numShards;
return this;
}

public TuningConfigBuilder<C> withSplitHintSpec(SplitHintSpec splitHintSpec)
{
this.splitHintSpec = splitHintSpec;
return this;
}

public TuningConfigBuilder<C> withPartitionsSpec(PartitionsSpec partitionsSpec)
{
this.partitionsSpec = partitionsSpec;
return this;
}

public TuningConfigBuilder<C> withIndexSpec(IndexSpec indexSpec)
{
this.indexSpec = indexSpec;
return this;
}

public TuningConfigBuilder<C> withIndexSpecForIntermediatePersists(IndexSpec indexSpecForIntermediatePersists)
{
this.indexSpecForIntermediatePersists = indexSpecForIntermediatePersists;
return this;
}

public TuningConfigBuilder<C> withMaxPendingPersists(Integer maxPendingPersists)
{
this.maxPendingPersists = maxPendingPersists;
return this;
}

public TuningConfigBuilder<C> withForceGuaranteedRollup(Boolean forceGuaranteedRollup)
{
this.forceGuaranteedRollup = forceGuaranteedRollup;
return this;
}

public TuningConfigBuilder<C> withReportParseExceptions(Boolean reportParseExceptions)
{
this.reportParseExceptions = reportParseExceptions;
return this;
}

public TuningConfigBuilder<C> withPushTimeout(Long pushTimeout)
{
this.pushTimeout = pushTimeout;
return this;
}

public TuningConfigBuilder<C> withPublishTimeout(Long publishTimeout)
{
this.publishTimeout = publishTimeout;
return this;
}

public TuningConfigBuilder<C> withSegmentWriteOutMediumFactory(SegmentWriteOutMediumFactory segmentWriteOutMediumFactory)
{
this.segmentWriteOutMediumFactory = segmentWriteOutMediumFactory;
return this;
}

public TuningConfigBuilder<C> withMaxNumSubTasks(Integer maxNumSubTasks)
{
this.maxNumSubTasks = maxNumSubTasks;
return this;
}

public TuningConfigBuilder<C> withMaxNumConcurrentSubTasks(Integer maxNumConcurrentSubTasks)
{
this.maxNumConcurrentSubTasks = maxNumConcurrentSubTasks;
return this;
}

public TuningConfigBuilder<C> withMaxRetry(Integer maxRetry)
{
this.maxRetry = maxRetry;
return this;
}

public TuningConfigBuilder<C> withTaskStatusCheckPeriodMs(Long taskStatusCheckPeriodMs)
{
this.taskStatusCheckPeriodMs = taskStatusCheckPeriodMs;
return this;
}

public TuningConfigBuilder<C> withChatHandlerTimeout(Duration chatHandlerTimeout)
{
this.chatHandlerTimeout = chatHandlerTimeout;
return this;
}

public TuningConfigBuilder<C> withChatHandlerNumRetries(Integer chatHandlerNumRetries)
{
this.chatHandlerNumRetries = chatHandlerNumRetries;
return this;
}

public TuningConfigBuilder<C> withMaxNumSegmentsToMerge(Integer maxNumSegmentsToMerge)
{
this.maxNumSegmentsToMerge = maxNumSegmentsToMerge;
return this;
}

public TuningConfigBuilder<C> withTotalNumMergeTasks(Integer totalNumMergeTasks)
{
this.totalNumMergeTasks = totalNumMergeTasks;
return this;
}

public TuningConfigBuilder<C> withLogParseExceptions(Boolean logParseExceptions)
{
this.logParseExceptions = logParseExceptions;
return this;
}

public TuningConfigBuilder<C> withMaxParseExceptions(Integer maxParseExceptions)
{
this.maxParseExceptions = maxParseExceptions;
return this;
}

public TuningConfigBuilder<C> withMaxSavedParseExceptions(Integer maxSavedParseExceptions)
{
this.maxSavedParseExceptions = maxSavedParseExceptions;
return this;
}

public TuningConfigBuilder<C> withMaxColumnsToMerge(Integer maxColumnsToMerge)
{
this.maxColumnsToMerge = maxColumnsToMerge;
return this;
}

public TuningConfigBuilder<C> withAwaitSegmentAvailabilityTimeoutMillis(Long awaitSegmentAvailabilityTimeoutMillis)
{
this.awaitSegmentAvailabilityTimeoutMillis = awaitSegmentAvailabilityTimeoutMillis;
return this;
}

public TuningConfigBuilder<C> withNumPersistThreads(Integer numPersistThreads)
{
this.numPersistThreads = numPersistThreads;
return this;
}

public TuningConfigBuilder<C> withMaxAllowedLockCount(Integer maxAllowedLockCount)
{
this.maxAllowedLockCount = maxAllowedLockCount;
return this;
}

public abstract C build();

/**
* Creates a new builder for {@link CompactionTask.CompactionTuningConfig}.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* 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.druid.audit;

import org.joda.time.Interval;

import java.util.List;

public class NoopAuditManager implements AuditManager
{
@Override
public void doAudit(AuditEntry event)
{
throw new UnsupportedOperationException();
}

@Override
public List<AuditEntry> fetchAuditHistory(String key, String type, Interval interval)
{
throw new UnsupportedOperationException();
}

@Override
public List<AuditEntry> fetchAuditHistory(String type, Interval interval)
{
throw new UnsupportedOperationException();
}

@Override
public List<AuditEntry> fetchAuditHistory(String key, String type, int limit)
{
throw new UnsupportedOperationException();
}

@Override
public List<AuditEntry> fetchAuditHistory(String type, int limit)
{
throw new UnsupportedOperationException();
}

@Override
public int removeAuditLogsOlderThan(long timestamp)
{
throw new UnsupportedOperationException();
}
}
Loading
Loading