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

Upgrade guava version to 31.1-jre #14767

Merged
merged 8 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from 7 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
3 changes: 0 additions & 3 deletions codestyle/guava16-forbidden-apis.txt

This file was deleted.

2 changes: 1 addition & 1 deletion extensions-contrib/cloudfiles-extensions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jclouds.version>2.0.0</jclouds.version>
<jclouds.version>2.5.0</jclouds.version>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import org.apache.druid.java.util.common.logger.Logger;
import org.jclouds.ContextBuilder;
import org.jclouds.logging.slf4j.config.SLF4JLoggingModule;
import org.jclouds.openstack.v2_0.config.InternalUrlModule;
import org.jclouds.openstack.keystone.catalog.config.InternalUrlModule;
import org.jclouds.osgi.ProviderRegistry;
import org.jclouds.rackspace.cloudfiles.uk.CloudFilesUKProviderMetadata;
import org.jclouds.rackspace.cloudfiles.us.CloudFilesUSProviderMetadata;
Expand Down
1 change: 0 additions & 1 deletion extensions-contrib/compressed-bigdecimal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>16.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
import static org.junit.Assert.assertTrue;

@RunWith(EasyMockRunner.class)
@SuppressWarnings("DoNotMock")
public class KubernetesTaskRunnerTest extends EasyMockSupport
{
private static final String ID = "id";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1057,12 +1057,13 @@ public void testIncrementalHandOffReadsThroughEndOffsets() throws Exception

final ListenableFuture<TaskStatus> normalReplicaFuture = runTask(normalReplica);
// Simulating one replica is slower than the other
final ListenableFuture<TaskStatus> staleReplicaFuture = Futures.transform(
final ListenableFuture<TaskStatus> staleReplicaFuture = Futures.transformAsync(
taskExec.submit(() -> {
Thread.sleep(1000);
return staleReplica;
}),
(AsyncFunction<Task, TaskStatus>) this::runTask
(AsyncFunction<Task, TaskStatus>) this::runTask,
MoreExecutors.directExecutor()
);

while (normalReplica.getRunner().getStatus() != Status.PAUSED) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2004,12 +2004,13 @@ public void testIncrementalHandOffReadsThroughEndOffsets() throws Exception
((TestableKinesisIndexTask) staleReplica).setLocalSupplier(recordSupplier2);
final ListenableFuture<TaskStatus> normalReplicaFuture = runTask(normalReplica);
// Simulating one replica is slower than the other
final ListenableFuture<TaskStatus> staleReplicaFuture = Futures.transform(
final ListenableFuture<TaskStatus> staleReplicaFuture = Futures.transformAsync(
taskExec.submit(() -> {
Thread.sleep(1000);
return staleReplica;
}),
(AsyncFunction<Task, TaskStatus>) this::runTask
(AsyncFunction<Task, TaskStatus>) this::runTask,
MoreExecutors.directExecutor()
);

waitUntil(normalReplica, this::isTaskPaused);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,7 @@ public void onFailure(Throwable t)
settableFuture.setException(t);
}
}
});
}, MoreExecutors.directExecutor());

taskFutures.add(settableFuture);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.common.util.concurrent.SettableFuture;
import org.apache.druid.frame.channel.ReadableByteChunksFrameChannel;
import org.apache.druid.frame.key.ClusterByPartitions;
Expand Down Expand Up @@ -158,7 +159,8 @@ public void onFailure(Throwable t)
{
retVal.setException(new MSQException(t, new WorkerRpcFailedFault(workerTaskId)));
}
}
},
MoreExecutors.directExecutor()
);

return retVal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.common.util.concurrent.SettableFuture;
import it.unimi.dsi.fastutil.bytes.ByteArrays;
import org.apache.druid.common.guava.FutureUtils;
Expand Down Expand Up @@ -1320,7 +1321,8 @@ public void onFailure(final Throwable t)
kernelHolder.getStageKernelMap().get(stageDef.getId()).fail(t)
);
}
}
},
MoreExecutors.directExecutor()
);
}

Expand Down Expand Up @@ -1612,7 +1614,7 @@ public OutputChannel openNilChannel(int expectedZero)
};

// Chain futures so we only sort one partition at a time.
nextFuture = Futures.transform(
nextFuture = Futures.transformAsync(
nextFuture,
(AsyncFunction<OutputChannel, OutputChannel>) ignored -> {
final SuperSorter sorter = new SuperSorter(
Expand All @@ -1639,7 +1641,8 @@ public OutputChannel openNilChannel(int expectedZero)
);

return FutureUtils.transform(sorter.run(), r -> Iterables.getOnlyElement(r.getAllChannels()));
}
},
MoreExecutors.directExecutor()
);

sortedChannelFutures.add(nextFuture);
Expand All @@ -1665,16 +1668,18 @@ public ListenableFuture<OutputChannels> build()
throw new ISE("Not initialized");
}

return Futures.transform(
return Futures.transformAsync(
pipelineFuture,
(AsyncFunction<ResultAndChannels<?>, OutputChannels>) resultAndChannels ->
Futures.transform(
resultAndChannels.getResultFuture(),
(Function<Object, OutputChannels>) input -> {
sanityCheckOutputChannels(resultAndChannels.getOutputChannels());
return resultAndChannels.getOutputChannels();
}
)
},
MoreExecutors.directExecutor()
),
MoreExecutors.directExecutor()
);
}

Expand Down Expand Up @@ -1742,7 +1747,8 @@ public void onFailure(Throwable t)
}
);
}
}
},
MoreExecutors.directExecutor()
);

return new ResultAndChannels<>(
Expand Down Expand Up @@ -1772,7 +1778,7 @@ private void pushAsync(final ExceptionalFunction<ResultAndChannels<?>, Listenabl
}

pipelineFuture = FutureUtils.transform(
Futures.transform(
Futures.transformAsync(
pipelineFuture,
new AsyncFunction<ResultAndChannels<?>, ResultAndChannels<?>>()
{
Expand All @@ -1781,7 +1787,8 @@ public ListenableFuture<ResultAndChannels<?>> apply(ResultAndChannels<?> t) thro
{
return fn.apply(t);
}
}
},
MoreExecutors.directExecutor()
),
resultAndChannels -> new ResultAndChannels<>(
resultAndChannels.getResultFuture(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.common.util.concurrent.SettableFuture;
import org.apache.druid.common.guava.FutureUtils;
import org.apache.druid.java.util.common.ISE;
Expand Down Expand Up @@ -210,7 +211,7 @@ public void onFailure(Throwable t)
}

}
});
}, MoreExecutors.directExecutor());

FutureUtils.getUnchecked(kernelActionFuture, true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.common.util.concurrent.SettableFuture;
import com.google.errorprone.annotations.concurrent.GuardedBy;
import org.apache.druid.common.guava.FutureUtils;
Expand Down Expand Up @@ -268,7 +269,8 @@ public void onFailure(Throwable t)
{
retVal.setException(t);
}
}
},
MoreExecutors.directExecutor()
);

return retVal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import org.apache.druid.frame.channel.ReadableByteChunksFrameChannel;
import org.apache.druid.frame.channel.ReadableFrameChannel;
import org.apache.druid.java.util.common.StringUtils;
Expand Down Expand Up @@ -90,7 +91,8 @@ public void onFailure(Throwable t)
{
channel.setError(t);
}
}
},
MoreExecutors.directExecutor()
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import org.apache.druid.common.guava.FutureUtils;

import javax.annotation.Nullable;
Expand Down Expand Up @@ -61,7 +62,8 @@ public void onFailure(Throwable t)
inputFuture.cancel(true);
}
}
}
},
MoreExecutors.directExecutor()
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public void onFailure(Throwable t)
log.error(t, "error running worker task %s", task.getId());
statusMap.put(task.getId(), TaskStatus.failure(task.getId(), t.getMessage()));
}
});
}, MoreExecutors.directExecutor());

return task.getId();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,14 +370,14 @@ public void testParseNestedDataSchemaless() throws Exception
Assert.assertEquals(
ImmutableList.of(
"someOtherId",
"bar",
"someIntColumn",
"isValid",
"foo",
"description",
"someLongColumn",
"someFloatColumn",
"eventType",
"bar",
"id",
"someBytesColumn"
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import com.google.common.util.concurrent.AsyncFunction;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import org.apache.druid.data.input.Committer;
import org.apache.druid.data.input.Firehose;
import org.apache.druid.data.input.FirehoseFactory;
Expand Down Expand Up @@ -698,9 +699,10 @@ private void publishSegments(
committerSupplier.get(),
Collections.singletonList(sequenceName)
);
pendingHandoffs.add(Futures.transform(
pendingHandoffs.add(Futures.transformAsync(
publishFuture,
(AsyncFunction<SegmentsAndCommitMetadata, SegmentsAndCommitMetadata>) driver::registerHandoff
(AsyncFunction<SegmentsAndCommitMetadata, SegmentsAndCommitMetadata>) driver::registerHandoff,
MoreExecutors.directExecutor()
));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import org.apache.druid.indexer.TaskState;
import org.apache.druid.indexer.TaskStatusPlus;
import org.apache.druid.indexing.common.TaskToolbox;
Expand Down Expand Up @@ -262,7 +263,8 @@ public void onFailure(Throwable t)
LOG.error(t, "Error while running a task for spec[%s]", spec.getId());
taskCompleteEvents.offer(SubTaskCompleteEvent.fail(spec, t));
}
}
},
MoreExecutors.directExecutor()
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public boolean matches(char c)
if (inQuotes) {
return false;
}
return CharMatcher.BREAKING_WHITESPACE.matches(c);
return CharMatcher.breakingWhitespace().matches(c);
}
}
).omitEmptyStrings().split(string).iterator();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ public void onFailure(Throwable throwable)
waitingForMonitor.notifyAll();
}
}
}
},
MoreExecutors.directExecutor()
);
break;
case CHILD_UPDATED:
Expand Down Expand Up @@ -1308,7 +1309,8 @@ public void onFailure(Throwable t)
{
removedWorkerCleanups.remove(worker, cleanupTask);
}
}
},
MoreExecutors.directExecutor()
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package org.apache.druid.indexing.overlord;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.collect.ComparisonChain;
Expand Down Expand Up @@ -1560,10 +1561,10 @@ public int hashCode()
@Override
public String toString()
{
return Objects.toStringHelper(this)
.add("taskLock", taskLock)
.add("taskIds", taskIds)
.toString();
return MoreObjects.toStringHelper(this)
.add("taskLock", taskLock)
.add("taskIds", taskIds)
.toString();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,8 @@ public void onFailure(Throwable t)
{
removedWorkerCleanups.remove(workerHostAndPort, cleanupTask);
}
}
},
MoreExecutors.directExecutor()
);
}

Expand Down
Loading
Loading