Skip to content

Commit

Permalink
Remove ConnectorSplitSource.getMinScheduleSplitBatchSize
Browse files Browse the repository at this point in the history
It's not used by anyone.
  • Loading branch information
findepi committed Mar 24, 2021
1 parent 37ddda2 commit 3414184
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 52 deletions.
Expand Up @@ -22,7 +22,6 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.util.concurrent.Futures.immediateFuture;
Expand Down Expand Up @@ -66,12 +65,6 @@ public boolean isFinished()
return source.isFinished();
}

@Override
public Optional<Integer> getMinScheduleSplitBatchSize()
{
return source.getMinScheduleSplitBatchSize();
}

private static class GetNextBatch
{
private final SplitSource splitSource;
Expand Down
Expand Up @@ -24,8 +24,6 @@
import io.trino.spi.connector.ConnectorSplitSource;
import io.trino.spi.connector.ConnectorSplitSource.ConnectorSplitBatch;

import java.util.Optional;

import static com.google.common.util.concurrent.MoreExecutors.directExecutor;
import static io.airlift.concurrent.MoreFutures.toListenableFuture;
import static java.util.Objects.requireNonNull;
Expand Down Expand Up @@ -73,12 +71,6 @@ public boolean isFinished()
return source.isFinished();
}

@Override
public Optional<Integer> getMinScheduleSplitBatchSize()
{
return source.getMinScheduleSplitBatchSize();
}

@Override
public String toString()
{
Expand Down
Expand Up @@ -21,7 +21,6 @@

import javax.annotation.Nullable;

import java.util.Optional;
import java.util.concurrent.ThreadLocalRandom;

import static com.google.common.collect.ImmutableList.toImmutableList;
Expand Down Expand Up @@ -69,10 +68,4 @@ public boolean isFinished()
{
return splitSource.isFinished();
}

@Override
public Optional<Integer> getMinScheduleSplitBatchSize()
{
return splitSource.getMinScheduleSplitBatchSize();
}
}
Expand Up @@ -34,7 +34,6 @@

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
import static java.lang.Math.min;
import static java.util.Objects.requireNonNull;

public class SplitManager
Expand Down Expand Up @@ -93,10 +92,6 @@ public SplitSource getSplits(Session session, TableHandle table, SplitScheduling
}

SplitSource splitSource = new ConnectorAwareSplitSource(catalogName, source);
int minScheduleSplitBatchSize = this.minScheduleSplitBatchSize;
if (splitSource.getMinScheduleSplitBatchSize().isPresent()) {
minScheduleSplitBatchSize = min(minScheduleSplitBatchSize, splitSource.getMinScheduleSplitBatchSize().get());
}
if (minScheduleSplitBatchSize > 1) {
splitSource = new BufferingSplitSource(splitSource, minScheduleSplitBatchSize);
}
Expand Down
3 changes: 0 additions & 3 deletions core/trino-main/src/main/java/io/trino/split/SplitSource.java
Expand Up @@ -21,7 +21,6 @@

import java.io.Closeable;
import java.util.List;
import java.util.Optional;

import static java.util.Objects.requireNonNull;

Expand Down Expand Up @@ -63,6 +62,4 @@ public boolean isLastBatch()
return lastBatch;
}
}

Optional<Integer> getMinScheduleSplitBatchSize();
}
Expand Up @@ -28,7 +28,6 @@

import java.util.Collections;
import java.util.List;
import java.util.Optional;

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
Expand Down Expand Up @@ -142,12 +141,6 @@ public boolean isFinished()
return splitsProduced == totalSplits && atSplitDepletion == FINISH;
}

@Override
public Optional<Integer> getMinScheduleSplitBatchSize()
{
return Optional.empty();
}

public int getNextBatchInvocationCount()
{
return nextBatchInvocationCount;
Expand Down
Expand Up @@ -15,7 +15,6 @@

import java.io.Closeable;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;

import static java.util.Objects.requireNonNull;
Expand Down Expand Up @@ -59,9 +58,4 @@ public boolean isNoMoreSplits()
return noMoreSplits;
}
}

default Optional<Integer> getMinScheduleSplitBatchSize()
{
return Optional.empty();
}
}
Expand Up @@ -19,7 +19,6 @@

import javax.inject.Inject;

import java.util.Optional;
import java.util.concurrent.CompletableFuture;

import static java.util.Objects.requireNonNull;
Expand Down Expand Up @@ -60,12 +59,4 @@ public boolean isFinished()
return delegate.isFinished();
}
}

@Override
public Optional<Integer> getMinScheduleSplitBatchSize()
{
try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(classLoader)) {
return delegate.getMinScheduleSplitBatchSize();
}
}
}

0 comments on commit 3414184

Please sign in to comment.