Refactor stateReference initialization in HiveSplitSource
@@ -94,7 +94,7 @@ class HiveSplitSource
private final AtomicInteger remainingInitialSplits;
private final HiveSplitLoader splitLoader;
- private final AtomicReference<State> stateReference;
+ private final AtomicReference<State> stateReference = new AtomicReference<>(State.initial());
private final AtomicLong estimatedSplitSizeInBytes = new AtomicLong();
@@ -110,7 +110,6 @@ class HiveSplitSource
int maxInitialSplits,
DataSize maxOutstandingSplitsSize,
HiveSplitLoader splitLoader,
- AtomicReference<State> stateReference,
CounterStat highMemorySplitSourceCounter)
{
requireNonNull(session, "session is null");
@@ -121,7 +120,6 @@ class HiveSplitSource
this.queues = requireNonNull(queues, "queues is null");
this.maxOutstandingSplitsBytes = toIntExact(maxOutstandingSplitsSize.toBytes());
this.splitLoader = requireNonNull(splitLoader, "splitLoader is null");
- this.stateReference = requireNonNull(stateReference, "stateReference is null");
this.highMemorySplitSourceCounter = requireNonNull(highMemorySplitSourceCounter, "highMemorySplitSourceCounter is null");
this.maxSplitSize = getMaxSplitSize(session);
@@ -142,7 +140,6 @@ class HiveSplitSource
Executor executor,
CounterStat highMemorySplitSourceCounter)
{
- AtomicReference<State> stateReference = new AtomicReference<>(State.initial());
return new HiveSplitSource(
session,
databaseName,
@@ -188,7 +185,6 @@ class HiveSplitSource
maxInitialSplits,
maxOutstandingSplitsSize,
splitLoader,
- stateReference,
highMemorySplitSourceCounter);
}
@@ -204,7 +200,6 @@ class HiveSplitSource
Executor executor,
CounterStat highMemorySplitSourceCounter)
{
- AtomicReference<State> stateReference = new AtomicReference<>(State.initial());
return new HiveSplitSource(
session,
databaseName,
@@ -270,7 +265,6 @@ class HiveSplitSource
maxInitialSplits,
maxOutstandingSplitsSize,
splitLoader,
- stateReference,
highMemorySplitSourceCounter);
}
@@ -285,7 +279,6 @@ class HiveSplitSource
Executor executor,
CounterStat highMemorySplitSourceCounter)
{
- AtomicReference<State> stateReference = new AtomicReference<>(State.initial());
return new HiveSplitSource(
session,
databaseName,
@@ -355,7 +348,6 @@ class HiveSplitSource
maxInitialSplits,
maxOutstandingSplitsSize,
splitLoader,
- stateReference,
highMemorySplitSourceCounter);
}
