From a364b081ae3ac9129aa9e667bb7d14266cd799a6 Mon Sep 17 00:00:00 2001 From: Greg Schohn Date: Thu, 3 Oct 2024 19:58:50 -0400 Subject: [PATCH] Another attempt - I want to see what these look like on github too Signed-off-by: Greg Schohn --- .../opensearch/migrations/CreateSnapshot.java | 12 +--- .../migrations/TestCreateSnapshot.java | 24 +++----- .../migrations/RfsMigrateDocuments.java | 20 ++----- .../migrations/bulkload/EndToEndTest.java | 14 +---- .../ParallelDocumentMigrationsTest.java | 16 +----- .../bulkload/PerformanceVerificationTest.java | 30 +++------- .../bulkload/ProcessLifecycleTest.java | 13 +---- .../migrations/bulkload/SourceTestBase.java | 11 ---- .../bulkload/SupportedTargetCluster.java | 6 -- .../opensearch/migrations/MetadataArgs.java | 2 - .../migrations/MetadataMigration.java | 7 +-- .../migrations/MigrateOrEvaluateArgs.java | 4 -- .../cli/ClusterReaderExtractor.java | 7 +-- .../opensearch/migrations/cli/Clusters.java | 5 -- .../org/opensearch/migrations/cli/Format.java | 2 - .../org/opensearch/migrations/cli/Items.java | 5 -- .../migrations/commands/Configure.java | 2 - .../migrations/commands/ConfigureResult.java | 4 -- .../migrations/commands/Evaluate.java | 4 -- .../migrations/commands/EvaluateArgs.java | 3 - .../migrations/commands/EvaluateResult.java | 4 -- .../migrations/commands/Migrate.java | 4 -- .../migrations/commands/MigrateArgs.java | 3 - .../migrations/commands/MigrateResult.java | 4 -- .../commands/MigrationItemResult.java | 3 - .../commands/MigratorEvaluatorBase.java | 4 -- .../opensearch/migrations/EndToEndTest.java | 24 +++----- .../migrations/MetadataMigrationTest.java | 12 ++-- .../cli/ClusterReaderExtractorTest.java | 25 ++++---- .../migrations/cli/ClustersTest.java | 13 ++--- .../opensearch/migrations/cli/ItemsTest.java | 13 ++--- .../migrations/commands/ConfigureTest.java | 9 +-- .../migrations/commands/EvaluateTest.java | 11 ++-- .../migrations/commands/MigrateTest.java | 11 ++-- .../commands/MigrationItemResultTest.java | 11 ++-- .../migrations/VersionConverter.java | 2 - .../bulkload/common/ByteArrayIndexInput.java | 3 - .../bulkload/common/DocumentReindexer.java | 12 ---- .../bulkload/common/FileSystemRepo.java | 4 -- .../common/FileSystemSnapshotCreator.java | 7 +-- .../bulkload/common/InvalidResponse.java | 10 +--- .../common/LuceneDocumentsReader.java | 18 ------ .../bulkload/common/MovementType.java | 3 - .../bulkload/common/OpenSearchClient.java | 15 +---- .../bulkload/common/PartSliceStream.java | 1 - .../bulkload/common/RestClient.java | 38 +++---------- .../bulkload/common/RfsLuceneDocument.java | 2 - .../migrations/bulkload/common/S3Repo.java | 17 ------ .../bulkload/common/S3SnapshotCreator.java | 7 +-- .../bulkload/common/SnapshotCreator.java | 13 +---- .../common/SnapshotShardUnpacker.java | 10 ---- .../bulkload/common/SourceRepo.java | 1 - .../bulkload/common/SourceRepoAccessor.java | 1 - .../migrations/bulkload/common/Uid.java | 3 - .../common/http/BasicAuthTransformer.java | 4 -- .../common/http/CompositeTransformer.java | 5 -- .../common/http/ConnectionContext.java | 12 +--- .../http/GzipPayloadRequestTransformer.java | 9 +-- .../bulkload/common/http/HttpResponse.java | 4 -- .../common/http/NoAuthTransformer.java | 4 -- .../common/http/RequestTransformer.java | 3 - .../common/http/SigV4AuthTransformer.java | 6 -- .../common/http/TransformedRequest.java | 4 -- .../bulkload/models/DataFilterArgs.java | 5 +- .../bulkload/models/GlobalMetadata.java | 16 ++---- .../bulkload/models/IndexMetadata.java | 13 +---- .../bulkload/models/ShardFileInfo.java | 2 - .../bulkload/models/ShardMetadata.java | 13 +---- .../bulkload/netty/ReadMeteringHandler.java | 9 +-- .../bulkload/netty/WriteMeteringHandler.java | 10 +--- .../bulkload/tracing/BaseRootRfsContext.java | 3 - .../bulkload/tracing/RfsContexts.java | 9 --- .../tracing/RootWorkCoordinationContext.java | 3 - .../tracing/WorkCoordinationContexts.java | 7 --- .../transformers/TransformFunctions.java | 5 -- .../Transformer_ES_6_8_to_OS_2_11.java | 8 +-- .../Transformer_ES_7_10_OS_2_11.java | 4 -- .../ElasticsearchConstants_ES_6_8.java | 6 -- .../GlobalMetadataData_ES_6_8.java | 3 - .../GlobalMetadataFactory_ES_6_8.java | 5 -- .../IndexMetadataData_ES_6_8.java | 5 -- .../IndexMetadataFactory_ES_6_8.java | 5 -- .../RemoteReaderClient_ES_6_8.java | 1 - .../ShardMetadataData_ES_6_8.java | 18 +----- .../ShardMetadataFactory_ES_6_8.java | 8 --- .../SnapshotRepoData_ES_6_8.java | 10 +--- .../SnapshotRepoProvider_ES_6_8.java | 1 - .../ElasticsearchConstants_ES_7_10.java | 6 -- .../GlobalMetadataData_ES_7_10.java | 3 - .../GlobalMetadataFactory_ES_7_10.java | 5 -- .../IndexMetadataData_ES_7_10.java | 4 -- .../IndexMetadataFactory_ES_7_10.java | 5 -- .../ShardMetadataData_ES_7_10.java | 19 +------ .../ShardMetadataFactory_ES_7_10.java | 9 --- .../SnapshotRepoData_ES_7_10.java | 16 +----- .../SnapshotRepoProvider_ES_7_10.java | 1 - .../GlobalMetadataCreator_OS_2_11.java | 8 +-- .../GlobalMetadataData_OS_2_11.java | 3 - .../version_os_2_11/IndexCreator_OS_2_11.java | 6 -- .../IndexMetadataData_OS_2_11.java | 3 - .../version_universal/RemoteDataProvider.java | 7 +-- .../RemoteIndexMetadata.java | 5 -- .../RemoteIndexMetadataFactory.java | 7 --- .../RemoteIndexSnapshotData.java | 4 -- .../version_universal/RemoteMetadata.java | 7 +-- .../RemoteMetadataFactory.java | 6 -- .../version_universal/RemoteReaderClient.java | 10 +--- .../CoordinateWorkHttpClient.java | 9 +-- .../workcoordination/IWorkCoordinator.java | 7 --- .../workcoordination/LeaseExpireTrigger.java | 5 +- .../OpenSearchWorkCoordinator.java | 12 +--- .../ScopedWorkCoordinator.java | 5 -- .../bulkload/worker/DocumentsRunner.java | 7 --- .../bulkload/worker/IndexAndShard.java | 4 -- .../bulkload/worker/IndexMetadataResults.java | 5 -- .../bulkload/worker/IndexRunner.java | 5 -- .../bulkload/worker/MetadataRunner.java | 4 -- .../bulkload/worker/ShardWorkPreparer.java | 6 -- .../bulkload/worker/SnapshotRunner.java | 3 - .../cluster/ClusterProviderRegistry.java | 5 -- .../GlobalMetadataCreatorResults.java | 4 -- .../tracing/MetadataMigrationContexts.java | 4 -- .../tracing/RootMetadataMigrationContext.java | 3 - .../parsing/BulkResponseParser.java | 15 +---- .../reindexer/FailedRequestsLogger.java | 4 -- .../tracing/DocumentMigrationContexts.java | 4 -- .../tracing/RootDocumentMigrationContext.java | 4 -- .../tracing/CreateSnapshotContext.java | 4 -- .../creation/tracing/RootSnapshotContext.java | 3 - .../common/ConnectionContextTest.java | 11 +--- .../common/DocumentReindexerTest.java | 30 +++------- .../bulkload/common/InvalidResponseTest.java | 12 ++-- .../common/LuceneDocumentsReaderTest.java | 42 +++----------- .../bulkload/common/OpenSearchClientTest.java | 57 +++++++------------ .../bulkload/common/RestClientTest.java | 11 +--- .../bulkload/common/S3RepoTest.java | 31 +++------- .../migrations/bulkload/common/S3UriTest.java | 9 +-- .../bulkload/common/TestResources.java | 3 - .../common/http/CompositeTransformerTest.java | 12 +--- .../GzipPayloadRequestTransformerTest.java | 19 ++----- .../common/http/SigV4AuthTransformerTest.java | 19 ++----- .../framework/SimpleRestoreFromSnapshot.java | 1 - .../SimpleRestoreFromSnapshot_ES_7_10.java | 6 -- .../integration/SnapshotStateTest.java | 35 +++++------- .../WorkerCompleteAfterErrorTest.java | 5 -- .../transformers/TransformFunctionsTest.java | 8 +-- .../Transformer_ES_7_10_OS_2_11Test.java | 8 +-- .../SnapshotRepoData_ES_7_10Test.java | 9 +-- .../IndexCreator_OS_2_11Test.java | 34 ++++------- .../OpenSearchWorkCoodinatorTest.java | 13 ----- ...CoordinatorErrantAcquisitonsRetryTest.java | 11 ---- .../workcoordination/WorkCoordinatorTest.java | 15 +---- .../parsing/BulkResponseParserTest.java | 17 ++---- .../JacksonParserVsReadObjectBenchmark.java | 27 +++------ .../reindexer/FailedRequestsLoggerTest.java | 13 ++--- .../http/ConnectionContextTestParams.java | 3 - .../PreloadedDataContainerOrchestrator.java | 38 +++---------- .../framework/SearchClusterContainer.java | 13 +---- .../tracing/TrackingTestContextCreator.java | 1 - .../tracing/TrackingTestContextFactory.java | 6 -- .../bulkload/http/BulkRequestGenerator.java | 3 - .../bulkload/http/ClusterOperations.java | 19 ++----- .../bulkload/http/SearchClusterRequests.java | 13 ++--- .../kafkaoffloader/KafkaCaptureFactory.java | 12 +--- .../tracing/KafkaRecordContext.java | 7 --- .../KafkaCaptureFactoryTest.java | 30 ++-------- .../TestRootKafkaOffloaderContext.java | 3 - ...CodedOutputStreamAndByteBufferWrapper.java | 7 +-- .../CodedOutputStreamHolder.java | 3 - .../CodedOutputStreamSizeUtil.java | 8 +-- .../FileConnectionCaptureFactory.java | 6 -- .../IChannelConnectionCaptureListener.java | 5 +- .../IConnectionCaptureFactory.java | 1 - ...eamChannelConnectionCaptureSerializer.java | 23 ++------ .../tracing/ConnectionContext.java | 6 -- .../CodedOutputStreamSizeUtilTest.java | 10 +--- ...hannelConnectionCaptureSerializerTest.java | 24 ++------ .../InMemoryConnectionCaptureFactory.java | 8 +-- ...nditionallyReliableLoggingHttpHandler.java | 13 +---- .../HeaderValueFilteringCapturePredicate.java | 5 +- .../netty/LoggingHttpHandler.java | 26 +-------- .../netty/PassThruHttpHeaders.java | 10 +--- .../netty/RequestCapturePredicate.java | 6 +- .../netty/RequestContextStateMachine.java | 4 -- .../netty/tracing/RootWireLoggingContext.java | 4 -- .../netty/tracing/WireCaptureContexts.java | 6 -- ...ionallyReliableLoggingHttpHandlerTest.java | 21 ++----- .../netty/RootWireLoggingContextTest.java | 18 ++---- .../trafficcapture/netty/TestRootContext.java | 4 -- .../netty/TestStreamManager.java | 8 +-- .../proxyserver/CaptureProxy.java | 50 +++++----------- .../proxyserver/RootCaptureContext.java | 4 -- .../netty/BacksideConnectionPool.java | 23 ++------ .../proxyserver/netty/BacksideHandler.java | 5 -- .../netty/ExpiringSubstitutableItemPool.java | 15 +---- .../proxyserver/netty/FrontsideHandler.java | 8 --- .../proxyserver/netty/HeaderAdderHandler.java | 9 +-- .../netty/HeaderRemoverHandler.java | 8 --- .../netty/NettyScanningHttpProxy.java | 9 --- .../netty/ProxyChannelInitializer.java | 15 +---- .../CaptureProxyConfigurationTest.java | 12 +--- .../proxyserver/CaptureProxySetupTest.java | 7 --- .../KafkaConfigurationCaptureProxyTest.java | 24 ++------ .../proxyserver/TestHeaderRewrites.java | 6 -- .../ExpiringSubstitutableItemPoolTest.java | 19 ++----- .../netty/HeaderAdderHandlerTest.java | 17 +----- .../netty/HeaderRemoverHandlerTest.java | 14 +---- .../netty/NettyScanningHttpProxyTest.java | 7 --- .../testcontainers/CaptureProxyContainer.java | 14 +---- .../HttpdContainerTestBase.java | 3 - .../KafkaContainerTestBase.java | 3 - .../testcontainers/TestContainerTestBase.java | 2 - .../ToxiproxyContainerTestBase.java | 10 +--- .../annotations/HttpdContainerTest.java | 3 - .../annotations/KafkaContainerTest.java | 3 - .../annotations/TestContainerTest.java | 4 -- .../annotations/ToxiproxyContainerTest.java | 3 - .../trafficcapture/JMeterLoadTest.java | 27 +-------- .../migrations/NettyFutureBinders.java | 9 +-- .../migrations/replay/AWSAuthService.java | 6 -- .../migrations/replay/Accumulation.java | 6 -- .../replay/AccumulationCallbacks.java | 4 -- .../replay/AggregatedRawResponse.java | 7 +-- .../replay/AggregatedRawResult.java | 10 +--- ...edTrafficToHttpTransactionAccumulator.java | 6 -- .../replay/ClientConnectionPool.java | 23 +------- .../replay/HttpByteBufFormatter.java | 44 ++++---------- .../replay/HttpMessageAndTimestamp.java | 14 +---- ...acketToTransformingHttpHandlerFactory.java | 3 - .../replay/ParsedHttpMessagesAsDicts.java | 17 ++---- .../migrations/replay/ReplayEngine.java | 7 +-- .../migrations/replay/ReplayUtils.java | 5 +- .../replay/RequestResponsePacketPair.java | 9 +-- .../replay/RequestSenderOrchestrator.java | 14 +---- .../replay/RequestTransformerAndSender.java | 9 +-- .../replay/ResultsToLogsConsumer.java | 13 +---- .../replay/SourceTargetCaptureTuple.java | 10 +--- .../migrations/replay/TimeShifter.java | 4 -- .../replay/TrafficCaptureSourceFactory.java | 4 -- .../migrations/replay/TrafficReplayer.java | 21 ++----- .../replay/TrafficReplayerCore.java | 8 --- .../replay/TrafficReplayerTopLevel.java | 17 +----- .../replay/TransformationLoader.java | 15 +---- ...ansformedTargetRequestAndResponseList.java | 4 -- .../replay/TupleParserChainConsumer.java | 3 - .../opensearch/migrations/replay/Utils.java | 8 +-- .../replay/datahandlers/IPacketConsumer.java | 4 -- .../replay/datahandlers/JsonAccumulator.java | 13 +---- .../replay/datahandlers/JsonEmitter.java | 31 +++------- .../NettyPacketToHttpConsumer.java | 43 ++++---------- .../PayloadAccessFaultingMap.java | 8 --- .../TransformedPacketReceiver.java | 3 - .../HttpJsonMessageWithFaultingPayload.java | 1 - .../http/HttpJsonTransformingConsumer.java | 13 +---- ...tKeyAdaptingCaseInsensitiveHeadersMap.java | 3 - ...dHttpRequestPreliminaryConvertHandler.java | 17 ++---- .../http/NettyJsonBodyAccumulateHandler.java | 17 +----- .../http/NettyJsonBodyConvertHandler.java | 6 -- .../http/NettyJsonBodySerializeHandler.java | 15 +---- .../http/NettyJsonContentAuthSigner.java | 12 +--- .../http/NettyJsonContentCompressor.java | 16 ++---- ...ettyJsonContentStreamToByteBufHandler.java | 11 +--- .../http/NettyJsonToByteBufHandler.java | 23 ++------ ...ttySendByteBufsToPacketHandlerHandler.java | 12 +--- .../http/RequestPipelineOrchestrator.java | 20 ++----- .../StrictCaseInsensitiveHttpHeadersMap.java | 3 - .../http/helpers/LastHttpContentListener.java | 4 -- .../http/helpers/ReadMeteringHandler.java | 9 +-- .../http/helpers/WriteMeteringHandler.java | 9 +-- .../replay/datatypes/ByteBufList.java | 13 +---- .../replay/datatypes/ChannelTask.java | 3 - .../datatypes/ConnectionReplaySession.java | 10 +--- .../replay/datatypes/FutureTransformer.java | 1 - .../HttpRequestTransformationStatus.java | 4 -- .../datatypes/ISourceTrafficChannelKey.java | 3 - .../replay/datatypes/ITrafficStreamKey.java | 3 - .../datatypes/IndexedChannelInteraction.java | 3 - .../datatypes/PojoTrafficStreamAndKey.java | 4 -- .../datatypes/PojoTrafficStreamKey.java | 3 - .../PojoTrafficStreamKeyAndContext.java | 6 -- .../TimeToResponseFulfillmentFutureMap.java | 1 - .../datatypes/UniqueReplayerRequestKey.java | 3 - .../datatypes/UniqueSourceRequestKey.java | 2 - .../replay/http/retries/DefaultRetry.java | 9 +-- .../http/retries/NoRetryEvaluatorFactory.java | 3 - .../http/retries/OpenSearchDefaultRetry.java | 24 ++------ .../http/retries/RequestRetryEvaluator.java | 6 +- .../RetryCollectingVisitorFactory.java | 1 - .../replay/kafka/KafkaBehavioralPolicy.java | 4 -- .../kafka/KafkaTrafficCaptureSource.java | 15 +---- .../replay/kafka/OffsetLifecycleTracker.java | 3 - .../kafka/PojoKafkaCommitOffsetData.java | 3 - .../replay/kafka/TrackingKafkaConsumer.java | 14 ----- .../TrafficStreamKeyWithKafkaRecordId.java | 5 -- .../netty/BacksideHttpWatcherHandler.java | 12 +--- .../replay/netty/BacksideSnifferHandler.java | 6 -- .../replay/tracing/ChannelContextManager.java | 4 -- .../replay/tracing/IReplayContexts.java | 7 +-- .../replay/tracing/KafkaConsumerContexts.java | 12 +--- .../replay/tracing/ReplayContexts.java | 19 +------ .../replay/tracing/RootReplayerContext.java | 4 -- .../replay/tracing/TrafficSourceContexts.java | 4 -- .../traffic/expiration/AccumulatorMap.java | 1 - .../traffic/expiration/BehavioralPolicy.java | 4 -- .../traffic/expiration/EpochMillis.java | 3 - .../traffic/expiration/ExpiringKeyQueue.java | 4 -- .../expiration/ExpiringTrafficStreamMap.java | 4 -- .../expiration/ScopedConnectionIdKey.java | 3 - .../traffic/source/BlockingTrafficSource.java | 12 +--- .../traffic/source/ITrafficCaptureSource.java | 1 - .../traffic/source/InputStreamOfTraffic.java | 5 -- .../traffic/source/TrafficStreamLimiter.java | 7 --- .../replay/util/ActiveContextMonitor.java | 8 --- .../migrations/replay/util/NettyUtils.java | 9 +-- .../replay/util/OnlineRadixSorter.java | 6 -- .../replay/util/OrderedWorkerTracker.java | 5 -- .../migrations/replay/util/RefSafeHolder.java | 6 +- .../replay/util/RefSafeStreamUtils.java | 8 +-- .../replay/util/TextTrackedFuture.java | 3 - .../migrations/replay/util/TrackedFuture.java | 5 -- .../util/TrackedFutureJsonFormatter.java | 8 +-- .../util/TrackedFutureStringFormatter.java | 4 -- .../protos/TrafficStreamUtils.java | 5 +- .../transform/IAuthTransformer.java | 1 - .../transform/IAuthTransformerFactory.java | 1 - .../SigV4AuthTransformerFactory.java | 4 -- .../migrations/PruferTreeGeneratorTest.java | 5 -- .../migrations/replay/AWSAuthServiceTest.java | 16 +----- .../replay/BlockingTrafficSourceTest.java | 9 +-- .../CompressedFileTrafficCaptureSource.java | 1 - ...afficToHttpTransactionAccumulatorTest.java | 9 --- ...xpiringTrafficStreamMapSequentialTest.java | 5 -- ...ExpiringTrafficStreamMapUnorderedTest.java | 5 -- .../replay/HeaderTransformerTest.java | 6 -- .../replay/HttpByteBufFormatterTest.java | 13 +---- .../replay/ParsedHttpMessagesAsDictsTest.java | 1 - .../replay/RequestSenderOrchestratorTest.java | 23 ++------ .../replay/ResultsToLogsConsumerTest.java | 20 +------ ...afficToHttpTransactionAccumulatorTest.java | 9 --- .../migrations/replay/TimeShifterTest.java | 5 -- .../replay/TrafficReplayerTest.java | 15 +---- .../replay/TransformationLoaderTest.java | 8 +-- .../migrations/replay/UtilsTest.java | 6 -- .../replay/V0_1TrafficCaptureSource.java | 1 - .../datahandlers/JsonAccumulatorTest.java | 10 +--- .../replay/datahandlers/JsonEmitterTest.java | 12 +--- .../NettyPacketToHttpConsumerTest.java | 32 +++-------- .../HttpJsonTransformingConsumerTest.java | 12 +--- ...AdaptingCaseInsensitiveHeadersMapTest.java | 5 -- .../NettyJsonBodySerializeHandlerTest.java | 18 ++---- .../http/NettyJsonToByteBufHandlerTest.java | 18 ++---- .../datatypes/PojoUniqueSourceRequestKey.java | 3 - ...imeToResponseFulfillmentFutureMapTest.java | 5 -- .../FullReplayerWithTracingChecksTest.java | 18 +----- .../e2etests/FullTrafficReplayerTest.java | 12 ---- .../KafkaRestartingTrafficReplayerTest.java | 21 +------ .../SentinelSensingTrafficSource.java | 4 -- ...ficStreamBecomesTwoTargetChannelsTest.java | 13 +---- .../e2etests/TrafficReplayerRunner.java | 10 +--- .../replay/http/retries/HttpRetryTest.java | 22 ++----- .../retries/OpenSearchDefaultRetryTest.java | 9 +-- .../replay/http/retries/RetryTestUtils.java | 4 -- .../KafkaCommitsWorkBetweenLongPollsTest.java | 14 ----- .../replay/kafka/KafkaKeepAliveTests.java | 15 ----- .../replay/kafka/KafkaTestUtils.java | 16 +----- ...KafkaTrafficCaptureSourceLongTermTest.java | 11 ---- .../kafka/KafkaTrafficCaptureSourceTest.java | 17 +----- .../replay/tracing/TracingTest.java | 12 +--- .../SigV4AuthTransformerFactoryTest.java | 12 +--- .../replay/util/ActiveContextMonitorTest.java | 7 --- .../replay/util/OnlineRadixSorterTest.java | 5 -- .../replay/util/RefSafeStreamUtilsTest.java | 13 ++--- .../replay/util/TextTrackedFutureTest.java | 6 -- .../replay/util/TrackedFutureTest.java | 5 -- .../migrations/PruferTreeGenerator.java | 5 -- .../GenerateRandomNestedJsonObject.java | 10 +--- .../replay/ReplayEngineFactory.java | 4 -- .../RootReplayerConstructorExtensions.java | 1 - .../TestCapturePacketToHttpHandler.java | 11 +--- .../replay/TestHttpServerContext.java | 4 -- .../migrations/replay/TestUtils.java | 32 +++-------- .../ExhaustiveTrafficStreamGenerator.java | 6 -- .../generator/ObservationDirective.java | 2 - .../generator/TrafficStreamGenerator.java | 9 +-- .../ArrayCursorTrafficCaptureSource.java | 4 -- .../ArrayCursorTrafficSourceContext.java | 4 -- .../source/TrafficStreamCursorKey.java | 5 -- .../OnlineRadixSorterForIntegratedKeys.java | 3 - .../tracing/InstrumentationTest.java | 3 - .../migrations/tracing/TestContext.java | 1 - .../transform/JsonJMESPathTransformer.java | 7 +-- .../JsonJMESPathTransformerProvider.java | 8 +-- .../replay/JsonTransformerTest.java | 14 +---- .../replay/MultipleJMESPathScriptsTest.java | 10 +--- .../transform/JsonJoltTransformBuilder.java | 10 +--- .../transform/JsonJoltTransformer.java | 5 +- .../replay/AddCompressionEncodingTest.java | 21 ++----- .../replay/JsonTransformerTest.java | 16 +----- .../replay/MultipleJoltScriptsTest.java | 9 +-- .../replay/PayloadRepackingTest.java | 17 +----- .../transform/IJsonTransformerProvider.java | 2 - .../transform/TypeMappingsExcisionTest.java | 14 +---- .../migrations/aws/SigV4Signer.java | 13 ----- .../aws/SigV4SigningTransformationTest.java | 15 +---- build.gradle | 8 +-- .../migrations/jcommander/NoSplitter.java | 5 +- .../migrations/tracing/BaseSpanContext.java | 13 +---- .../tracing/CommonMetricInstruments.java | 4 -- .../CommonScopedMetricInstruments.java | 13 +---- .../tracing/IInstrumentConstructor.java | 6 +- .../tracing/IInstrumentationAttributes.java | 11 +--- .../migrations/tracing/IRootOtelContext.java | 2 - .../IScopedInstrumentationAttributes.java | 15 +---- .../tracing/IWithStartTimeAndAttributes.java | 8 +-- .../tracing/NullableExemplarScope.java | 4 -- .../migrations/tracing/RootOtelContext.java | 28 ++------- .../commoncontexts/IConnectionContext.java | 4 -- .../IHttpTransactionContext.java | 4 -- .../migrations/utils/ProcessHelpers.java | 3 - .../SequentialSpanCompressingReducer.java | 2 - .../CommonScopedMetricInstrumentsTest.java | 5 +- .../IInstrumentationAttributesTest.java | 8 +-- .../tracing/BacktracingContextTracker.java | 4 -- .../InMemoryInstrumentationBundle.java | 33 +++-------- .../tracing/LoggingContextTracer.java | 2 - .../migrations/dashboards/Sanitizer.java | 8 +-- .../migrations/dashboards/SanitizerCli.java | 11 +--- .../converter/DashboardConverter.java | 16 ++---- .../dashboards/converter/QueryConverter.java | 1 - .../converter/SavedObjectConverter.java | 11 +--- .../dashboards/converter/SearchConverter.java | 1 - .../dashboards/converter/UrlConverter.java | 4 -- .../converter/VisualizationConverter.java | 6 +- .../dashboards/savedobjects/Dashboard.java | 13 +---- .../dashboards/savedobjects/Reference.java | 3 - .../dashboards/savedobjects/SavedObject.java | 15 +---- .../savedobjects/SavedObjectParser.java | 14 +---- .../migrations/dashboards/util/Stats.java | 10 +--- .../migrations/dashboards/SanitizerTest.java | 10 +--- .../converters/DashboardConverterTest.java | 15 +---- .../converters/IndexPatternConverterTest.java | 13 +---- .../converters/QueryConverterTest.java | 11 +--- .../converters/SavedObjectsBase.java | 10 +--- .../converters/SearchConverterTest.java | 9 +-- .../converters/UrlConverterTest.java | 11 +--- .../migrations/dashboards/util/StatsTest.java | 7 +-- .../utils/kafka/Base64Formatter.java | 4 -- .../NettyLeakCheckTestExtensionTest.java | 8 --- .../matchers/ContainsStringCount.java | 4 -- .../migrations/matchers/HasLineCount.java | 4 -- .../testutils/CloseableLogSetup.java | 11 +--- .../CountingNettyResourceLeakDetector.java | 11 +--- .../migrations/testutils/HeapDumper.java | 5 +- .../NettyLeakCheckTestExtension.java | 7 --- .../migrations/testutils/PortFinder.java | 3 - .../SelfSignedSSLContextBuilder.java | 9 --- .../testutils/SharedDockerImageNames.java | 2 - .../testutils/SimpleHttpClientForTesting.java | 19 ------- .../testutils/SimpleHttpResponse.java | 3 - .../testutils/SimpleHttpServer.java | 17 ++---- .../testutils/SimpleNettyHttpServer.java | 48 ++++------------ .../testutils/StreamInterleaver.java | 5 +- .../migrations/testutils/TestUtilities.java | 4 -- .../testutils/ToxiProxyWrapper.java | 10 +--- .../testutils/WrapWithNettyLeakDetection.java | 3 - .../org/opensearch/migrations/Flavor.java | 3 - .../org/opensearch/migrations/Version.java | 6 -- .../migrations/VersionMatchers.java | 3 - .../transformation/CanApplyResult.java | 3 - .../transformation/entity/Entity.java | 2 - .../rules/IndexMappingTypeRemoval.java | 6 +- .../migrations/VersionMatchersTest.java | 9 +-- .../opensearch/migrations/VersionTest.java | 7 +-- .../rules/IndexMappingTypeRemovalTest.java | 24 +++----- 474 files changed, 680 insertions(+), 3789 deletions(-) diff --git a/CreateSnapshot/src/main/java/org/opensearch/migrations/CreateSnapshot.java b/CreateSnapshot/src/main/java/org/opensearch/migrations/CreateSnapshot.java index 5f094e68f0..48f62e0a75 100644 --- a/CreateSnapshot/src/main/java/org/opensearch/migrations/CreateSnapshot.java +++ b/CreateSnapshot/src/main/java/org/opensearch/migrations/CreateSnapshot.java @@ -1,15 +1,13 @@ package org.opensearch.migrations; -import java.util.List; - import com.beust.jcommander.JCommander; import com.beust.jcommander.Parameter; import com.beust.jcommander.ParameterException; import com.beust.jcommander.ParametersDelegate; +import java.util.List; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.bulkload.common.FileSystemSnapshotCreator; import org.opensearch.migrations.bulkload.common.OpenSearchClient; import org.opensearch.migrations.bulkload.common.S3SnapshotCreator; @@ -24,14 +22,6 @@ import org.opensearch.migrations.tracing.RootOtelContext; import org.opensearch.migrations.utils.ProcessHelpers; -import com.beust.jcommander.JCommander; -import com.beust.jcommander.Parameter; -import com.beust.jcommander.ParameterException; -import com.beust.jcommander.ParametersDelegate; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.extern.slf4j.Slf4j; - @AllArgsConstructor @Slf4j public class CreateSnapshot { diff --git a/CreateSnapshot/src/test/java/org/opensearch/migrations/TestCreateSnapshot.java b/CreateSnapshot/src/test/java/org/opensearch/migrations/TestCreateSnapshot.java index 5a5ac85c71..c7622bf5b3 100644 --- a/CreateSnapshot/src/test/java/org/opensearch/migrations/TestCreateSnapshot.java +++ b/CreateSnapshot/src/test/java/org/opensearch/migrations/TestCreateSnapshot.java @@ -1,5 +1,12 @@ package org.opensearch.migrations; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.MatcherAssert.assertThat; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.netty.handler.codec.http.FullHttpRequest; +import io.netty.handler.codec.http.HttpMethod; import java.nio.charset.StandardCharsets; import java.time.Duration; import java.util.AbstractMap; @@ -7,15 +14,9 @@ import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicReference; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import io.netty.handler.codec.http.FullHttpRequest; -import io.netty.handler.codec.http.HttpMethod; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.bulkload.common.OpenSearchClient; import org.opensearch.migrations.bulkload.common.S3SnapshotCreator; import org.opensearch.migrations.bulkload.common.http.ConnectionContextTestParams; @@ -24,17 +25,6 @@ import org.opensearch.migrations.testutils.SimpleHttpResponse; import org.opensearch.migrations.testutils.SimpleNettyHttpServer; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import io.netty.handler.codec.http.FullHttpRequest; -import io.netty.handler.codec.http.HttpMethod; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.MatcherAssert.assertThat; - @Slf4j public class TestCreateSnapshot { final SnapshotTestContext snapshotContext = SnapshotTestContext.factory().noOtelTracking(); diff --git a/DocumentsFromSnapshotMigration/src/main/java/org/opensearch/migrations/RfsMigrateDocuments.java b/DocumentsFromSnapshotMigration/src/main/java/org/opensearch/migrations/RfsMigrateDocuments.java index 9bb17e96f3..55cc27748f 100644 --- a/DocumentsFromSnapshotMigration/src/main/java/org/opensearch/migrations/RfsMigrateDocuments.java +++ b/DocumentsFromSnapshotMigration/src/main/java/org/opensearch/migrations/RfsMigrateDocuments.java @@ -1,5 +1,10 @@ package org.opensearch.migrations; +import com.beust.jcommander.IStringConverter; +import com.beust.jcommander.JCommander; +import com.beust.jcommander.Parameter; +import com.beust.jcommander.ParameterException; +import com.beust.jcommander.ParametersDelegate; import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; @@ -7,15 +12,7 @@ import java.time.Duration; import java.util.List; import java.util.function.Function; - -import com.beust.jcommander.IStringConverter; -import com.beust.jcommander.JCommander; -import com.beust.jcommander.Parameter; -import com.beust.jcommander.ParameterException; -import com.beust.jcommander.ParametersDelegate; import lombok.extern.slf4j.Slf4j; -import org.slf4j.MDC; - import org.opensearch.migrations.bulkload.common.DefaultSourceRepoAccessor; import org.opensearch.migrations.bulkload.common.DocumentReindexer; import org.opensearch.migrations.bulkload.common.FileSystemRepo; @@ -42,13 +39,6 @@ import org.opensearch.migrations.tracing.CompositeContextTracker; import org.opensearch.migrations.tracing.RootOtelContext; import org.opensearch.migrations.utils.ProcessHelpers; - -import com.beust.jcommander.IStringConverter; -import com.beust.jcommander.JCommander; -import com.beust.jcommander.Parameter; -import com.beust.jcommander.ParameterException; -import com.beust.jcommander.ParametersDelegate; -import lombok.extern.slf4j.Slf4j; import org.slf4j.MDC; @Slf4j diff --git a/DocumentsFromSnapshotMigration/src/test/java/org/opensearch/migrations/bulkload/EndToEndTest.java b/DocumentsFromSnapshotMigration/src/test/java/org/opensearch/migrations/bulkload/EndToEndTest.java index e9f5c3ca21..25a1cf21c6 100644 --- a/DocumentsFromSnapshotMigration/src/test/java/org/opensearch/migrations/bulkload/EndToEndTest.java +++ b/DocumentsFromSnapshotMigration/src/test/java/org/opensearch/migrations/bulkload/EndToEndTest.java @@ -1,16 +1,17 @@ package org.opensearch.migrations.bulkload; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.MatcherAssert.assertThat; + import java.io.File; import java.util.List; import java.util.Random; import java.util.concurrent.CompletableFuture; - import lombok.SneakyThrows; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ArgumentsSource; - import org.opensearch.migrations.bulkload.common.FileSystemRepo; import org.opensearch.migrations.bulkload.common.FileSystemSnapshotCreator; import org.opensearch.migrations.bulkload.common.OpenSearchClient; @@ -22,15 +23,6 @@ import org.opensearch.migrations.reindexer.tracing.DocumentMigrationTestContext; import org.opensearch.migrations.snapshot.creation.tracing.SnapshotTestContext; -import lombok.SneakyThrows; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.io.TempDir; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.ArgumentsSource; - -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.MatcherAssert.assertThat; - @Tag("isolatedTest") public class EndToEndTest extends SourceTestBase { @TempDir diff --git a/DocumentsFromSnapshotMigration/src/test/java/org/opensearch/migrations/bulkload/ParallelDocumentMigrationsTest.java b/DocumentsFromSnapshotMigration/src/test/java/org/opensearch/migrations/bulkload/ParallelDocumentMigrationsTest.java index 3ef2fade0d..ae194f7f2d 100644 --- a/DocumentsFromSnapshotMigration/src/test/java/org/opensearch/migrations/bulkload/ParallelDocumentMigrationsTest.java +++ b/DocumentsFromSnapshotMigration/src/test/java/org/opensearch/migrations/bulkload/ParallelDocumentMigrationsTest.java @@ -1,5 +1,7 @@ package org.opensearch.migrations.bulkload; +import io.opentelemetry.sdk.metrics.data.LongPointData; +import io.opentelemetry.sdk.metrics.data.MetricData; import java.nio.file.Files; import java.util.ArrayList; import java.util.Collection; @@ -11,9 +13,6 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; import java.util.stream.Stream; - -import io.opentelemetry.sdk.metrics.data.LongPointData; -import io.opentelemetry.sdk.metrics.data.MetricData; import lombok.Lombok; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; @@ -21,7 +20,6 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; - import org.opensearch.migrations.CreateSnapshot; import org.opensearch.migrations.bulkload.common.FileSystemRepo; import org.opensearch.migrations.bulkload.framework.PreloadedSearchClusterContainer; @@ -29,16 +27,6 @@ import org.opensearch.migrations.reindexer.tracing.DocumentMigrationTestContext; import org.opensearch.migrations.snapshot.creation.tracing.SnapshotTestContext; -import io.opentelemetry.sdk.metrics.data.LongPointData; -import io.opentelemetry.sdk.metrics.data.MetricData; -import lombok.Lombok; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; -import org.junit.jupiter.params.provider.MethodSource; - @Tag("isolatedTest") @Slf4j public class ParallelDocumentMigrationsTest extends SourceTestBase { diff --git a/DocumentsFromSnapshotMigration/src/test/java/org/opensearch/migrations/bulkload/PerformanceVerificationTest.java b/DocumentsFromSnapshotMigration/src/test/java/org/opensearch/migrations/bulkload/PerformanceVerificationTest.java index 528025e689..d4164a9225 100644 --- a/DocumentsFromSnapshotMigration/src/test/java/org/opensearch/migrations/bulkload/PerformanceVerificationTest.java +++ b/DocumentsFromSnapshotMigration/src/test/java/org/opensearch/migrations/bulkload/PerformanceVerificationTest.java @@ -1,10 +1,16 @@ package org.opensearch.migrations.bulkload; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyList; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + import java.nio.file.Paths; import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicInteger; - import lombok.extern.slf4j.Slf4j; import org.apache.lucene.document.Document; import org.apache.lucene.document.StoredField; @@ -16,9 +22,6 @@ import org.apache.lucene.util.BytesRef; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; -import reactor.core.scheduler.Schedulers; - import org.opensearch.migrations.bulkload.common.DocumentReindexer; import org.opensearch.migrations.bulkload.common.LuceneDocumentsReader; import org.opensearch.migrations.bulkload.common.OpenSearchClient; @@ -26,28 +29,9 @@ import org.opensearch.migrations.bulkload.common.RfsLuceneDocument; import org.opensearch.migrations.bulkload.tracing.IRfsContexts; import org.opensearch.migrations.reindexer.tracing.IDocumentMigrationContexts; - -import lombok.extern.slf4j.Slf4j; -import org.apache.lucene.document.Document; -import org.apache.lucene.document.StoredField; -import org.apache.lucene.index.DirectoryReader; -import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.IndexWriter; -import org.apache.lucene.index.IndexWriterConfig; -import org.apache.lucene.store.ByteBuffersDirectory; -import org.apache.lucene.util.BytesRef; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; import reactor.core.scheduler.Schedulers; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyList; -import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - @Slf4j public class PerformanceVerificationTest { diff --git a/DocumentsFromSnapshotMigration/src/test/java/org/opensearch/migrations/bulkload/ProcessLifecycleTest.java b/DocumentsFromSnapshotMigration/src/test/java/org/opensearch/migrations/bulkload/ProcessLifecycleTest.java index 872af2e945..6c7907b6f0 100644 --- a/DocumentsFromSnapshotMigration/src/test/java/org/opensearch/migrations/bulkload/ProcessLifecycleTest.java +++ b/DocumentsFromSnapshotMigration/src/test/java/org/opensearch/migrations/bulkload/ProcessLifecycleTest.java @@ -1,5 +1,6 @@ package org.opensearch.migrations.bulkload; +import eu.rekawek.toxiproxy.model.ToxicDirection; import java.io.BufferedReader; import java.io.File; import java.io.IOException; @@ -10,30 +11,18 @@ import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; - -import eu.rekawek.toxiproxy.model.ToxicDirection; import lombok.extern.slf4j.Slf4j; import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Tag; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; -import org.testcontainers.containers.Network; - import org.opensearch.migrations.CreateSnapshot; import org.opensearch.migrations.bulkload.framework.PreloadedSearchClusterContainer; import org.opensearch.migrations.bulkload.framework.SearchClusterContainer; import org.opensearch.migrations.snapshot.creation.tracing.SnapshotTestContext; import org.opensearch.migrations.testutils.ToxiProxyWrapper; import org.opensearch.testcontainers.OpensearchContainer; - -import eu.rekawek.toxiproxy.model.ToxicDirection; -import lombok.extern.slf4j.Slf4j; -import org.jetbrains.annotations.NotNull; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.CsvSource; import org.testcontainers.containers.Network; /** diff --git a/DocumentsFromSnapshotMigration/src/test/java/org/opensearch/migrations/bulkload/SourceTestBase.java b/DocumentsFromSnapshotMigration/src/test/java/org/opensearch/migrations/bulkload/SourceTestBase.java index 282cdffd5c..8a59ea878c 100644 --- a/DocumentsFromSnapshotMigration/src/test/java/org/opensearch/migrations/bulkload/SourceTestBase.java +++ b/DocumentsFromSnapshotMigration/src/test/java/org/opensearch/migrations/bulkload/SourceTestBase.java @@ -14,7 +14,6 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; import java.util.function.UnaryOperator; - import lombok.AllArgsConstructor; import lombok.Lombok; import lombok.SneakyThrows; @@ -22,8 +21,6 @@ import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.jupiter.api.Assertions; -import reactor.core.publisher.Flux; - import org.opensearch.migrations.RfsMigrateDocuments; import org.opensearch.migrations.Version; import org.opensearch.migrations.bulkload.common.DefaultSourceRepoAccessor; @@ -44,14 +41,6 @@ import org.opensearch.migrations.bulkload.worker.DocumentsRunner; import org.opensearch.migrations.cluster.ClusterProviderRegistry; import org.opensearch.migrations.reindexer.tracing.DocumentMigrationTestContext; - -import lombok.AllArgsConstructor; -import lombok.Lombok; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; -import org.hamcrest.MatcherAssert; -import org.hamcrest.Matchers; -import org.junit.jupiter.api.Assertions; import reactor.core.publisher.Flux; @Slf4j diff --git a/DocumentsFromSnapshotMigration/src/test/java/org/opensearch/migrations/bulkload/SupportedTargetCluster.java b/DocumentsFromSnapshotMigration/src/test/java/org/opensearch/migrations/bulkload/SupportedTargetCluster.java index 6b87d8602a..5dff6d011a 100644 --- a/DocumentsFromSnapshotMigration/src/test/java/org/opensearch/migrations/bulkload/SupportedTargetCluster.java +++ b/DocumentsFromSnapshotMigration/src/test/java/org/opensearch/migrations/bulkload/SupportedTargetCluster.java @@ -1,17 +1,11 @@ package org.opensearch.migrations.bulkload; import java.util.stream.Stream; - import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.ArgumentsProvider; - import org.opensearch.migrations.bulkload.framework.SearchClusterContainer; -import org.junit.jupiter.api.extension.ExtensionContext; -import org.junit.jupiter.params.provider.Arguments; -import org.junit.jupiter.params.provider.ArgumentsProvider; - /** * Defines all supported target clusters */ diff --git a/MetadataMigration/src/main/java/org/opensearch/migrations/MetadataArgs.java b/MetadataMigration/src/main/java/org/opensearch/migrations/MetadataArgs.java index ef3dde6f54..9b05d988ed 100644 --- a/MetadataMigration/src/main/java/org/opensearch/migrations/MetadataArgs.java +++ b/MetadataMigration/src/main/java/org/opensearch/migrations/MetadataArgs.java @@ -2,8 +2,6 @@ import com.beust.jcommander.Parameter; -import com.beust.jcommander.Parameter; - public class MetadataArgs { @Parameter(names = {"--help", "-h"}, help = true, description = "Displays information about how to use this tool") public boolean help; diff --git a/MetadataMigration/src/main/java/org/opensearch/migrations/MetadataMigration.java b/MetadataMigration/src/main/java/org/opensearch/migrations/MetadataMigration.java index affcf48ee9..35ee1556ed 100644 --- a/MetadataMigration/src/main/java/org/opensearch/migrations/MetadataMigration.java +++ b/MetadataMigration/src/main/java/org/opensearch/migrations/MetadataMigration.java @@ -1,10 +1,8 @@ package org.opensearch.migrations; -import java.util.Optional; - import com.beust.jcommander.JCommander; +import java.util.Optional; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.commands.Configure; import org.opensearch.migrations.commands.Evaluate; import org.opensearch.migrations.commands.EvaluateArgs; @@ -18,9 +16,6 @@ import org.opensearch.migrations.tracing.RootOtelContext; import org.opensearch.migrations.utils.ProcessHelpers; -import com.beust.jcommander.JCommander; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class MetadataMigration { diff --git a/MetadataMigration/src/main/java/org/opensearch/migrations/MigrateOrEvaluateArgs.java b/MetadataMigration/src/main/java/org/opensearch/migrations/MigrateOrEvaluateArgs.java index 07f16a820a..681f3c4c6a 100644 --- a/MetadataMigration/src/main/java/org/opensearch/migrations/MigrateOrEvaluateArgs.java +++ b/MetadataMigration/src/main/java/org/opensearch/migrations/MigrateOrEvaluateArgs.java @@ -4,13 +4,9 @@ import com.beust.jcommander.Parameter; import com.beust.jcommander.ParametersDelegate; - import org.opensearch.migrations.bulkload.common.http.ConnectionContext; import org.opensearch.migrations.bulkload.models.DataFilterArgs; -import com.beust.jcommander.Parameter; -import com.beust.jcommander.ParametersDelegate; - public class MigrateOrEvaluateArgs { @Parameter(names = {"--help", "-h"}, help = true, description = "Displays information about how to use this tool") public boolean help; diff --git a/MetadataMigration/src/main/java/org/opensearch/migrations/cli/ClusterReaderExtractor.java b/MetadataMigration/src/main/java/org/opensearch/migrations/cli/ClusterReaderExtractor.java index 07f0580075..174bce8793 100644 --- a/MetadataMigration/src/main/java/org/opensearch/migrations/cli/ClusterReaderExtractor.java +++ b/MetadataMigration/src/main/java/org/opensearch/migrations/cli/ClusterReaderExtractor.java @@ -1,10 +1,8 @@ package org.opensearch.migrations.cli; -import java.nio.file.Path; - import com.beust.jcommander.ParameterException; +import java.nio.file.Path; import lombok.AllArgsConstructor; - import org.opensearch.migrations.MigrateOrEvaluateArgs; import org.opensearch.migrations.Version; import org.opensearch.migrations.bulkload.common.FileSystemRepo; @@ -15,9 +13,6 @@ import org.opensearch.migrations.cluster.ClusterProviderRegistry; import org.opensearch.migrations.cluster.ClusterReader; -import com.beust.jcommander.ParameterException; -import lombok.AllArgsConstructor; - @AllArgsConstructor public class ClusterReaderExtractor { private final MigrateOrEvaluateArgs arguments; diff --git a/MetadataMigration/src/main/java/org/opensearch/migrations/cli/Clusters.java b/MetadataMigration/src/main/java/org/opensearch/migrations/cli/Clusters.java index d824986c8e..bf04cd469e 100644 --- a/MetadataMigration/src/main/java/org/opensearch/migrations/cli/Clusters.java +++ b/MetadataMigration/src/main/java/org/opensearch/migrations/cli/Clusters.java @@ -3,14 +3,9 @@ import lombok.Builder; import lombok.Getter; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.cluster.ClusterReader; import org.opensearch.migrations.cluster.ClusterWriter; -import lombok.Builder; -import lombok.Getter; -import lombok.extern.slf4j.Slf4j; - @Slf4j @Getter @Builder diff --git a/MetadataMigration/src/main/java/org/opensearch/migrations/cli/Format.java b/MetadataMigration/src/main/java/org/opensearch/migrations/cli/Format.java index db6bad5462..b4eb989a61 100644 --- a/MetadataMigration/src/main/java/org/opensearch/migrations/cli/Format.java +++ b/MetadataMigration/src/main/java/org/opensearch/migrations/cli/Format.java @@ -2,8 +2,6 @@ import lombok.experimental.UtilityClass; -import lombok.experimental.UtilityClass; - /** Shared formatting for command line interface components */ @UtilityClass public class Format { diff --git a/MetadataMigration/src/main/java/org/opensearch/migrations/cli/Items.java b/MetadataMigration/src/main/java/org/opensearch/migrations/cli/Items.java index 4f0ec2fb1b..fab2153935 100644 --- a/MetadataMigration/src/main/java/org/opensearch/migrations/cli/Items.java +++ b/MetadataMigration/src/main/java/org/opensearch/migrations/cli/Items.java @@ -2,11 +2,6 @@ import java.util.List; import java.util.stream.Collectors; - -import lombok.Builder; -import lombok.Data; -import lombok.NonNull; - import lombok.Builder; import lombok.Data; import lombok.NonNull; diff --git a/MetadataMigration/src/main/java/org/opensearch/migrations/commands/Configure.java b/MetadataMigration/src/main/java/org/opensearch/migrations/commands/Configure.java index a7fd29b48b..b958c864e1 100644 --- a/MetadataMigration/src/main/java/org/opensearch/migrations/commands/Configure.java +++ b/MetadataMigration/src/main/java/org/opensearch/migrations/commands/Configure.java @@ -2,8 +2,6 @@ import lombok.extern.slf4j.Slf4j; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class Configure { diff --git a/MetadataMigration/src/main/java/org/opensearch/migrations/commands/ConfigureResult.java b/MetadataMigration/src/main/java/org/opensearch/migrations/commands/ConfigureResult.java index 15e9364b68..294f4bb9ac 100644 --- a/MetadataMigration/src/main/java/org/opensearch/migrations/commands/ConfigureResult.java +++ b/MetadataMigration/src/main/java/org/opensearch/migrations/commands/ConfigureResult.java @@ -4,10 +4,6 @@ import lombok.Getter; import lombok.ToString; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.ToString; - @AllArgsConstructor @ToString public class ConfigureResult implements Result { diff --git a/MetadataMigration/src/main/java/org/opensearch/migrations/commands/Evaluate.java b/MetadataMigration/src/main/java/org/opensearch/migrations/commands/Evaluate.java index 2f5b62e89e..d15432143a 100644 --- a/MetadataMigration/src/main/java/org/opensearch/migrations/commands/Evaluate.java +++ b/MetadataMigration/src/main/java/org/opensearch/migrations/commands/Evaluate.java @@ -2,14 +2,10 @@ import com.beust.jcommander.ParameterException; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.MigrateOrEvaluateArgs; import org.opensearch.migrations.MigrationMode; import org.opensearch.migrations.metadata.tracing.RootMetadataMigrationContext; -import com.beust.jcommander.ParameterException; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class Evaluate extends MigratorEvaluatorBase { diff --git a/MetadataMigration/src/main/java/org/opensearch/migrations/commands/EvaluateArgs.java b/MetadataMigration/src/main/java/org/opensearch/migrations/commands/EvaluateArgs.java index 3efc015ca4..b48c37703c 100644 --- a/MetadataMigration/src/main/java/org/opensearch/migrations/commands/EvaluateArgs.java +++ b/MetadataMigration/src/main/java/org/opensearch/migrations/commands/EvaluateArgs.java @@ -1,11 +1,8 @@ package org.opensearch.migrations.commands; import com.beust.jcommander.Parameters; - import org.opensearch.migrations.MigrateOrEvaluateArgs; -import com.beust.jcommander.Parameters; - @Parameters(commandNames = "evaluate", commandDescription = "Inspects items from a source to determine which can be placed on a target cluster") public class EvaluateArgs extends MigrateOrEvaluateArgs { } diff --git a/MetadataMigration/src/main/java/org/opensearch/migrations/commands/EvaluateResult.java b/MetadataMigration/src/main/java/org/opensearch/migrations/commands/EvaluateResult.java index d8c10c0f5b..8663a4516d 100644 --- a/MetadataMigration/src/main/java/org/opensearch/migrations/commands/EvaluateResult.java +++ b/MetadataMigration/src/main/java/org/opensearch/migrations/commands/EvaluateResult.java @@ -2,13 +2,9 @@ import lombok.Builder; import lombok.Getter; - import org.opensearch.migrations.cli.Clusters; import org.opensearch.migrations.cli.Items; -import lombok.Builder; -import lombok.Getter; - @Builder @Getter public class EvaluateResult implements MigrationItemResult { diff --git a/MetadataMigration/src/main/java/org/opensearch/migrations/commands/Migrate.java b/MetadataMigration/src/main/java/org/opensearch/migrations/commands/Migrate.java index e09dfa2c0a..4ea6c024e2 100644 --- a/MetadataMigration/src/main/java/org/opensearch/migrations/commands/Migrate.java +++ b/MetadataMigration/src/main/java/org/opensearch/migrations/commands/Migrate.java @@ -2,14 +2,10 @@ import com.beust.jcommander.ParameterException; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.MigrateOrEvaluateArgs; import org.opensearch.migrations.MigrationMode; import org.opensearch.migrations.metadata.tracing.RootMetadataMigrationContext; -import com.beust.jcommander.ParameterException; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class Migrate extends MigratorEvaluatorBase { diff --git a/MetadataMigration/src/main/java/org/opensearch/migrations/commands/MigrateArgs.java b/MetadataMigration/src/main/java/org/opensearch/migrations/commands/MigrateArgs.java index f0d768b788..212e68bfa7 100644 --- a/MetadataMigration/src/main/java/org/opensearch/migrations/commands/MigrateArgs.java +++ b/MetadataMigration/src/main/java/org/opensearch/migrations/commands/MigrateArgs.java @@ -1,11 +1,8 @@ package org.opensearch.migrations.commands; import com.beust.jcommander.Parameters; - import org.opensearch.migrations.MigrateOrEvaluateArgs; -import com.beust.jcommander.Parameters; - @Parameters(commandNames = "migrate", commandDescription = "Migrates items from a source and recreates them on the target cluster") public class MigrateArgs extends MigrateOrEvaluateArgs { } diff --git a/MetadataMigration/src/main/java/org/opensearch/migrations/commands/MigrateResult.java b/MetadataMigration/src/main/java/org/opensearch/migrations/commands/MigrateResult.java index 4e5e28791c..63c9473d73 100644 --- a/MetadataMigration/src/main/java/org/opensearch/migrations/commands/MigrateResult.java +++ b/MetadataMigration/src/main/java/org/opensearch/migrations/commands/MigrateResult.java @@ -2,13 +2,9 @@ import lombok.Builder; import lombok.Getter; - import org.opensearch.migrations.cli.Clusters; import org.opensearch.migrations.cli.Items; -import lombok.Builder; -import lombok.Getter; - @Builder @Getter public class MigrateResult implements MigrationItemResult { diff --git a/MetadataMigration/src/main/java/org/opensearch/migrations/commands/MigrationItemResult.java b/MetadataMigration/src/main/java/org/opensearch/migrations/commands/MigrationItemResult.java index 6fd0ef0d58..6188e3c1fb 100644 --- a/MetadataMigration/src/main/java/org/opensearch/migrations/commands/MigrationItemResult.java +++ b/MetadataMigration/src/main/java/org/opensearch/migrations/commands/MigrationItemResult.java @@ -1,13 +1,10 @@ package org.opensearch.migrations.commands; import org.apache.logging.log4j.util.Strings; - import org.opensearch.migrations.cli.Clusters; import org.opensearch.migrations.cli.Format; import org.opensearch.migrations.cli.Items; -import org.apache.logging.log4j.util.Strings; - /** All shared cli result information */ public interface MigrationItemResult extends Result { Clusters getClusters(); diff --git a/MetadataMigration/src/main/java/org/opensearch/migrations/commands/MigratorEvaluatorBase.java b/MetadataMigration/src/main/java/org/opensearch/migrations/commands/MigratorEvaluatorBase.java index 55a9a81409..e60cfca091 100644 --- a/MetadataMigration/src/main/java/org/opensearch/migrations/commands/MigratorEvaluatorBase.java +++ b/MetadataMigration/src/main/java/org/opensearch/migrations/commands/MigratorEvaluatorBase.java @@ -1,9 +1,7 @@ package org.opensearch.migrations.commands; import java.util.ArrayList; - import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.MigrateOrEvaluateArgs; import org.opensearch.migrations.MigrationMode; import org.opensearch.migrations.bulkload.transformers.TransformFunctions; @@ -18,8 +16,6 @@ import org.opensearch.migrations.metadata.GlobalMetadataCreatorResults; import org.opensearch.migrations.metadata.tracing.RootMetadataMigrationContext; -import lombok.extern.slf4j.Slf4j; - /** Shared functionality between migration and evaluation commands */ @Slf4j public abstract class MigratorEvaluatorBase { diff --git a/MetadataMigration/src/test/java/org/opensearch/migrations/EndToEndTest.java b/MetadataMigration/src/test/java/org/opensearch/migrations/EndToEndTest.java index a557497da9..d9aa8fc027 100644 --- a/MetadataMigration/src/test/java/org/opensearch/migrations/EndToEndTest.java +++ b/MetadataMigration/src/test/java/org/opensearch/migrations/EndToEndTest.java @@ -1,10 +1,16 @@ package org.opensearch.migrations; +import static org.hamcrest.CoreMatchers.allOf; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.containsInAnyOrder; + import java.io.File; import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.stream.Stream; - import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Tag; @@ -12,7 +18,6 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; - import org.opensearch.migrations.bulkload.common.FileSystemSnapshotCreator; import org.opensearch.migrations.bulkload.common.OpenSearchClient; import org.opensearch.migrations.bulkload.common.http.ConnectionContextTestParams; @@ -24,21 +29,6 @@ import org.opensearch.migrations.metadata.tracing.MetadataMigrationTestContext; import org.opensearch.migrations.snapshot.creation.tracing.SnapshotTestContext; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.io.TempDir; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; -import org.junit.jupiter.params.provider.MethodSource; - -import static org.hamcrest.CoreMatchers.allOf; -import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.not; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.containsInAnyOrder; - /** * Tests focused on setting up whole source clusters, performing a migration, and validation on the target cluster */ diff --git a/MetadataMigration/src/test/java/org/opensearch/migrations/MetadataMigrationTest.java b/MetadataMigration/src/test/java/org/opensearch/migrations/MetadataMigrationTest.java index e0d51220b4..f3b6869150 100644 --- a/MetadataMigration/src/test/java/org/opensearch/migrations/MetadataMigrationTest.java +++ b/MetadataMigration/src/test/java/org/opensearch/migrations/MetadataMigrationTest.java @@ -1,19 +1,15 @@ package org.opensearch.migrations; -import java.util.List; - -import org.junit.jupiter.api.Test; - -import org.opensearch.migrations.testutils.CloseableLogSetup; - -import org.junit.jupiter.api.Test; - import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.hasSize; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertThrows; +import java.util.List; +import org.junit.jupiter.api.Test; +import org.opensearch.migrations.testutils.CloseableLogSetup; + public class MetadataMigrationTest { @Test diff --git a/MetadataMigration/src/test/java/org/opensearch/migrations/cli/ClusterReaderExtractorTest.java b/MetadataMigration/src/test/java/org/opensearch/migrations/cli/ClusterReaderExtractorTest.java index 1441689115..87132c58ac 100644 --- a/MetadataMigration/src/test/java/org/opensearch/migrations/cli/ClusterReaderExtractorTest.java +++ b/MetadataMigration/src/test/java/org/opensearch/migrations/cli/ClusterReaderExtractorTest.java @@ -1,20 +1,5 @@ package org.opensearch.migrations.cli; -import com.beust.jcommander.ParameterException; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; - -import org.opensearch.migrations.MigrateOrEvaluateArgs; -import org.opensearch.migrations.Version; -import org.opensearch.migrations.bulkload.common.FileSystemRepo; -import org.opensearch.migrations.bulkload.common.S3Repo; -import org.opensearch.migrations.bulkload.common.http.ConnectionContext; -import org.opensearch.migrations.cluster.ClusterReader; - -import com.beust.jcommander.ParameterException; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; - import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -25,6 +10,16 @@ import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; +import com.beust.jcommander.ParameterException; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.opensearch.migrations.MigrateOrEvaluateArgs; +import org.opensearch.migrations.Version; +import org.opensearch.migrations.bulkload.common.FileSystemRepo; +import org.opensearch.migrations.bulkload.common.S3Repo; +import org.opensearch.migrations.bulkload.common.http.ConnectionContext; +import org.opensearch.migrations.cluster.ClusterReader; + public class ClusterReaderExtractorTest { @Test diff --git a/MetadataMigration/src/test/java/org/opensearch/migrations/cli/ClustersTest.java b/MetadataMigration/src/test/java/org/opensearch/migrations/cli/ClustersTest.java index 11b38e98a6..11059ea684 100644 --- a/MetadataMigration/src/test/java/org/opensearch/migrations/cli/ClustersTest.java +++ b/MetadataMigration/src/test/java/org/opensearch/migrations/cli/ClustersTest.java @@ -1,17 +1,14 @@ package org.opensearch.migrations.cli; -import org.junit.jupiter.api.Test; - -import org.opensearch.migrations.cluster.ClusterReader; -import org.opensearch.migrations.cluster.ClusterWriter; - -import org.junit.jupiter.api.Test; - -import static org.opensearch.migrations.matchers.HasLineCount.hasLineCount; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.mock; +import static org.opensearch.migrations.matchers.HasLineCount.hasLineCount; + +import org.junit.jupiter.api.Test; +import org.opensearch.migrations.cluster.ClusterReader; +import org.opensearch.migrations.cluster.ClusterWriter; public class ClustersTest { @Test diff --git a/MetadataMigration/src/test/java/org/opensearch/migrations/cli/ItemsTest.java b/MetadataMigration/src/test/java/org/opensearch/migrations/cli/ItemsTest.java index f65ee80387..dd632710f1 100644 --- a/MetadataMigration/src/test/java/org/opensearch/migrations/cli/ItemsTest.java +++ b/MetadataMigration/src/test/java/org/opensearch/migrations/cli/ItemsTest.java @@ -1,15 +1,12 @@ package org.opensearch.migrations.cli; -import java.util.List; - -import org.junit.jupiter.api.Test; - -import org.junit.jupiter.api.Test; - -import static org.opensearch.migrations.matchers.ContainsStringCount.containsStringCount; -import static org.opensearch.migrations.matchers.HasLineCount.hasLineCount; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.MatcherAssert.assertThat; +import static org.opensearch.migrations.matchers.ContainsStringCount.containsStringCount; +import static org.opensearch.migrations.matchers.HasLineCount.hasLineCount; + +import java.util.List; +import org.junit.jupiter.api.Test; public class ItemsTest { @Test diff --git a/MetadataMigration/src/test/java/org/opensearch/migrations/commands/ConfigureTest.java b/MetadataMigration/src/test/java/org/opensearch/migrations/commands/ConfigureTest.java index a171d8b9d0..b7661ecdc8 100644 --- a/MetadataMigration/src/test/java/org/opensearch/migrations/commands/ConfigureTest.java +++ b/MetadataMigration/src/test/java/org/opensearch/migrations/commands/ConfigureTest.java @@ -1,14 +1,11 @@ package org.opensearch.migrations.commands; -import org.junit.jupiter.api.Test; - -import org.opensearch.migrations.MetadataMigration; - -import org.junit.jupiter.api.Test; - import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; +import org.junit.jupiter.api.Test; +import org.opensearch.migrations.MetadataMigration; + class ConfigureTest { @Test diff --git a/MetadataMigration/src/test/java/org/opensearch/migrations/commands/EvaluateTest.java b/MetadataMigration/src/test/java/org/opensearch/migrations/commands/EvaluateTest.java index e6e3c28470..118fe40a1f 100644 --- a/MetadataMigration/src/test/java/org/opensearch/migrations/commands/EvaluateTest.java +++ b/MetadataMigration/src/test/java/org/opensearch/migrations/commands/EvaluateTest.java @@ -1,17 +1,14 @@ package org.opensearch.migrations.commands; -import org.junit.jupiter.api.Test; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.mockito.Mockito.mock; +import org.junit.jupiter.api.Test; import org.opensearch.migrations.MetadataMigration; import org.opensearch.migrations.Version; import org.opensearch.migrations.metadata.tracing.RootMetadataMigrationContext; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.mockito.Mockito.mock; - class EvaluateTest { @Test diff --git a/MetadataMigration/src/test/java/org/opensearch/migrations/commands/MigrateTest.java b/MetadataMigration/src/test/java/org/opensearch/migrations/commands/MigrateTest.java index 264cfa3866..ddedebda05 100644 --- a/MetadataMigration/src/test/java/org/opensearch/migrations/commands/MigrateTest.java +++ b/MetadataMigration/src/test/java/org/opensearch/migrations/commands/MigrateTest.java @@ -1,17 +1,14 @@ package org.opensearch.migrations.commands; -import org.junit.jupiter.api.Test; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.mockito.Mockito.mock; +import org.junit.jupiter.api.Test; import org.opensearch.migrations.MetadataMigration; import org.opensearch.migrations.Version; import org.opensearch.migrations.metadata.tracing.RootMetadataMigrationContext; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.mockito.Mockito.mock; - class MigrateTest { @Test diff --git a/MetadataMigration/src/test/java/org/opensearch/migrations/commands/MigrationItemResultTest.java b/MetadataMigration/src/test/java/org/opensearch/migrations/commands/MigrationItemResultTest.java index 9ddaacebc5..14b919c9be 100644 --- a/MetadataMigration/src/test/java/org/opensearch/migrations/commands/MigrationItemResultTest.java +++ b/MetadataMigration/src/test/java/org/opensearch/migrations/commands/MigrationItemResultTest.java @@ -1,18 +1,15 @@ package org.opensearch.migrations.commands; -import org.junit.jupiter.api.Test; - -import org.opensearch.migrations.cli.Clusters; -import org.opensearch.migrations.cli.Items; - -import org.junit.jupiter.api.Test; - import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; +import org.junit.jupiter.api.Test; +import org.opensearch.migrations.cli.Clusters; +import org.opensearch.migrations.cli.Items; + public class MigrationItemResultTest { @Test void testAsString_fullResults_withMessage() { diff --git a/RFS/src/main/java/org/opensearch/migrations/VersionConverter.java b/RFS/src/main/java/org/opensearch/migrations/VersionConverter.java index 433bd20c3a..e86282a0be 100644 --- a/RFS/src/main/java/org/opensearch/migrations/VersionConverter.java +++ b/RFS/src/main/java/org/opensearch/migrations/VersionConverter.java @@ -2,8 +2,6 @@ import com.beust.jcommander.IStringConverter; -import com.beust.jcommander.IStringConverter; - public class VersionConverter implements IStringConverter { public Version convert(String value) { return Version.fromString(value); diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/ByteArrayIndexInput.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/ByteArrayIndexInput.java index 93b0af4d74..f14bf7c4ce 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/ByteArrayIndexInput.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/ByteArrayIndexInput.java @@ -2,9 +2,6 @@ import java.io.EOFException; import java.io.IOException; - -import org.apache.lucene.store.IndexInput; - import org.apache.lucene.store.IndexInput; /** diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/DocumentReindexer.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/DocumentReindexer.java index 5e12a52690..319c4b5c6f 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/DocumentReindexer.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/DocumentReindexer.java @@ -4,24 +4,12 @@ import java.util.List; import java.util.UUID; import java.util.function.Predicate; - import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import reactor.core.scheduler.Scheduler; -import reactor.core.scheduler.Schedulers; - import org.opensearch.migrations.reindexer.tracing.IDocumentMigrationContexts.IDocumentReindexContext; - -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.RequiredArgsConstructor; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import reactor.core.scheduler.Scheduler; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/FileSystemRepo.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/FileSystemRepo.java index faeae997c7..0dc23a298b 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/FileSystemRepo.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/FileSystemRepo.java @@ -6,13 +6,9 @@ import java.nio.file.Path; import java.util.regex.Matcher; import java.util.regex.Pattern; - import lombok.ToString; - import org.opensearch.migrations.bulkload.models.ShardMetadata; -import lombok.ToString; - @ToString public class FileSystemRepo implements SourceRepo { private final Path repoRootDir; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/FileSystemSnapshotCreator.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/FileSystemSnapshotCreator.java index 45d7d4fb67..9708e61fef 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/FileSystemSnapshotCreator.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/FileSystemSnapshotCreator.java @@ -1,15 +1,10 @@ package org.opensearch.migrations.bulkload.common; -import java.util.List; - import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; - +import java.util.List; import org.opensearch.migrations.bulkload.tracing.IRfsContexts; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; - public class FileSystemSnapshotCreator extends SnapshotCreator { private static final ObjectMapper mapper = new ObjectMapper(); diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/InvalidResponse.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/InvalidResponse.java index b9ae0f3674..d893756543 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/InvalidResponse.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/InvalidResponse.java @@ -1,5 +1,7 @@ package org.opensearch.migrations.bulkload.common; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; import java.util.ArrayList; import java.util.Map; import java.util.Map.Entry; @@ -7,17 +9,9 @@ import java.util.Set; import java.util.regex.Pattern; import java.util.stream.Collectors; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.bulkload.common.http.HttpResponse; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class InvalidResponse extends RfsException { private static final Pattern UNKNOWN_SETTING = Pattern.compile("unknown setting \\[([a-zA-Z0-9_.-]+)\\].+"); diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/LuceneDocumentsReader.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/LuceneDocumentsReader.java index bf320d1074..6db07819fb 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/LuceneDocumentsReader.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/LuceneDocumentsReader.java @@ -5,7 +5,6 @@ import java.util.List; import java.util.concurrent.Callable; import java.util.function.Function; - import lombok.Lombok; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -17,24 +16,7 @@ import org.apache.lucene.index.SoftDeletesDirectoryReaderWrapper; import org.apache.lucene.store.FSDirectory; import org.apache.lucene.util.BytesRef; -import org.reactivestreams.Publisher; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import reactor.core.scheduler.Schedulers; - import org.opensearch.migrations.cluster.ClusterSnapshotReader; - -import lombok.Lombok; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.apache.lucene.document.Document; -import org.apache.lucene.index.DirectoryReader; -import org.apache.lucene.index.IndexCommit; -import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.SoftDeletesDirectoryReaderWrapper; -import org.apache.lucene.store.FSDirectory; -import org.apache.lucene.util.BytesRef; import org.reactivestreams.Publisher; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/MovementType.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/MovementType.java index 0ed0ab22d2..f3f1fb77af 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/MovementType.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/MovementType.java @@ -3,9 +3,6 @@ import com.beust.jcommander.IStringConverter; import com.beust.jcommander.ParameterException; -import com.beust.jcommander.IStringConverter; -import com.beust.jcommander.ParameterException; - /* * An enumerated type used to refer to the type of data movement operation being performed */ diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/OpenSearchClient.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/OpenSearchClient.java index 9ac577b7c9..a98d3017cf 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/OpenSearchClient.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/OpenSearchClient.java @@ -1,5 +1,8 @@ package org.opensearch.migrations.bulkload.common; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ObjectNode; import java.io.IOException; import java.net.HttpURLConnection; import java.time.Duration; @@ -10,14 +13,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; - -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; import lombok.extern.slf4j.Slf4j; -import reactor.core.publisher.Mono; -import reactor.util.retry.Retry; - import org.opensearch.migrations.Flavor; import org.opensearch.migrations.Version; import org.opensearch.migrations.bulkload.common.http.ConnectionContext; @@ -25,11 +21,6 @@ import org.opensearch.migrations.bulkload.tracing.IRfsContexts; import org.opensearch.migrations.parsing.BulkResponseParser; import org.opensearch.migrations.reindexer.FailedRequestsLogger; - -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; -import lombok.extern.slf4j.Slf4j; import reactor.core.publisher.Mono; import reactor.util.retry.Retry; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/PartSliceStream.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/PartSliceStream.java index d4f0eec877..2ecdb2e12e 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/PartSliceStream.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/PartSliceStream.java @@ -2,7 +2,6 @@ import java.io.IOException; import java.io.InputStream; - import org.opensearch.migrations.bulkload.models.ShardFileInfo; /** diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/RestClient.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/RestClient.java index 98500d28c4..075acddcec 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/RestClient.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/RestClient.java @@ -1,5 +1,14 @@ package org.opensearch.migrations.bulkload.common; +import io.netty.buffer.Unpooled; +import io.netty.channel.ChannelHandler; +import io.netty.channel.ChannelPipeline; +import io.netty.handler.codec.http.HttpHeaderNames; +import io.netty.handler.codec.http.HttpHeaders; +import io.netty.handler.codec.http.HttpMethod; +import io.netty.handler.ssl.SslContext; +import io.netty.handler.ssl.SslContextBuilder; +import io.netty.handler.ssl.util.InsecureTrustManagerFactory; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.HashMap; @@ -11,25 +20,7 @@ import javax.net.ssl.SSLEngine; import javax.net.ssl.SSLException; import javax.net.ssl.SSLParameters; - -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelPipeline; -import io.netty.handler.codec.http.HttpHeaderNames; -import io.netty.handler.codec.http.HttpHeaders; -import io.netty.handler.codec.http.HttpMethod; -import io.netty.handler.ssl.SslContext; -import io.netty.handler.ssl.SslContextBuilder; -import io.netty.handler.ssl.util.InsecureTrustManagerFactory; import lombok.extern.slf4j.Slf4j; -import reactor.core.publisher.Mono; -import reactor.netty.Connection; -import reactor.netty.http.client.HttpClient; -import reactor.netty.http.client.HttpClientRequest; -import reactor.netty.resources.ConnectionProvider; -import reactor.netty.tcp.SslProvider; -import reactor.util.annotation.Nullable; - import org.opensearch.migrations.bulkload.common.http.CompositeTransformer; import org.opensearch.migrations.bulkload.common.http.ConnectionContext; import org.opensearch.migrations.bulkload.common.http.GzipPayloadRequestTransformer; @@ -37,17 +28,6 @@ import org.opensearch.migrations.bulkload.netty.ReadMeteringHandler; import org.opensearch.migrations.bulkload.netty.WriteMeteringHandler; import org.opensearch.migrations.bulkload.tracing.IRfsContexts; - -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelPipeline; -import io.netty.handler.codec.http.HttpHeaderNames; -import io.netty.handler.codec.http.HttpHeaders; -import io.netty.handler.codec.http.HttpMethod; -import io.netty.handler.ssl.SslContext; -import io.netty.handler.ssl.SslContextBuilder; -import io.netty.handler.ssl.util.InsecureTrustManagerFactory; -import lombok.extern.slf4j.Slf4j; import reactor.core.publisher.Mono; import reactor.netty.Connection; import reactor.netty.http.client.HttpClient; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/RfsLuceneDocument.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/RfsLuceneDocument.java index 7124a24055..13278d1058 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/RfsLuceneDocument.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/RfsLuceneDocument.java @@ -2,8 +2,6 @@ import lombok.RequiredArgsConstructor; -import lombok.RequiredArgsConstructor; - @RequiredArgsConstructor public class RfsLuceneDocument { public final String id; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/S3Repo.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/S3Repo.java index 5835126617..60ff254d59 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/S3Repo.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/S3Repo.java @@ -5,26 +5,9 @@ import java.nio.file.Path; import java.util.Comparator; import java.util.Optional; - import lombok.ToString; import lombok.extern.slf4j.Slf4j; -import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider; -import software.amazon.awssdk.core.async.AsyncResponseTransformer; -import software.amazon.awssdk.regions.Region; -import software.amazon.awssdk.services.s3.S3AsyncClient; -import software.amazon.awssdk.services.s3.model.GetObjectRequest; -import software.amazon.awssdk.services.s3.model.ListObjectsV2Request; -import software.amazon.awssdk.services.s3.model.ListObjectsV2Response; -import software.amazon.awssdk.services.s3.model.S3Object; -import software.amazon.awssdk.transfer.s3.S3TransferManager; -import software.amazon.awssdk.transfer.s3.model.CompletedDirectoryDownload; -import software.amazon.awssdk.transfer.s3.model.DirectoryDownload; -import software.amazon.awssdk.transfer.s3.model.DownloadDirectoryRequest; - import org.opensearch.migrations.bulkload.models.ShardMetadata; - -import lombok.ToString; -import lombok.extern.slf4j.Slf4j; import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider; import software.amazon.awssdk.core.async.AsyncResponseTransformer; import software.amazon.awssdk.regions.Region; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/S3SnapshotCreator.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/S3SnapshotCreator.java index c3d699c475..836c281b47 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/S3SnapshotCreator.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/S3SnapshotCreator.java @@ -1,15 +1,10 @@ package org.opensearch.migrations.bulkload.common; -import java.util.List; - import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; - +import java.util.List; import org.opensearch.migrations.bulkload.tracing.IRfsContexts; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; - public class S3SnapshotCreator extends SnapshotCreator { private static final ObjectMapper mapper = new ObjectMapper(); diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/SnapshotCreator.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/SnapshotCreator.java index 8bef36266a..1fc4b07845 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/SnapshotCreator.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/SnapshotCreator.java @@ -1,24 +1,15 @@ package org.opensearch.migrations.bulkload.common; -import java.util.List; -import java.util.Optional; - import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Optional; import lombok.Getter; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.bulkload.tracing.IRfsContexts; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; -import lombok.Getter; -import lombok.extern.slf4j.Slf4j; - @Slf4j public abstract class SnapshotCreator { private static final ObjectMapper mapper = new ObjectMapper(); diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/SnapshotShardUnpacker.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/SnapshotShardUnpacker.java index c675035057..e12f2b0db2 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/SnapshotShardUnpacker.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/SnapshotShardUnpacker.java @@ -4,7 +4,6 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; - import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.lucene.store.FSDirectory; @@ -12,18 +11,9 @@ import org.apache.lucene.store.IndexOutput; import org.apache.lucene.store.NativeFSLockFactory; import org.apache.lucene.util.BytesRef; - import org.opensearch.migrations.bulkload.models.ShardFileInfo; import org.opensearch.migrations.bulkload.models.ShardMetadata; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.apache.lucene.store.FSDirectory; -import org.apache.lucene.store.IOContext; -import org.apache.lucene.store.IndexOutput; -import org.apache.lucene.store.NativeFSLockFactory; -import org.apache.lucene.util.BytesRef; - @RequiredArgsConstructor @Slf4j public class SnapshotShardUnpacker { diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/SourceRepo.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/SourceRepo.java index fb5976eec9..525e7a9a4e 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/SourceRepo.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/SourceRepo.java @@ -1,7 +1,6 @@ package org.opensearch.migrations.bulkload.common; import java.nio.file.Path; - import org.opensearch.migrations.bulkload.models.ShardMetadata; public interface SourceRepo { diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/SourceRepoAccessor.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/SourceRepoAccessor.java index a9f6fd1fbf..82ecc0120a 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/SourceRepoAccessor.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/SourceRepoAccessor.java @@ -2,7 +2,6 @@ import java.io.InputStream; import java.nio.file.Path; - import org.opensearch.migrations.bulkload.models.ShardMetadata; // TODO: find a better approach to this (see https://opensearch.atlassian.net/browse/MIGRATIONS-1786) diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/Uid.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/Uid.java index fdeee2cbc4..af67f4d450 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/Uid.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/Uid.java @@ -2,9 +2,6 @@ import java.util.Arrays; import java.util.Base64; - -import org.apache.lucene.util.BytesRef; - import org.apache.lucene.util.BytesRef; /** diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/BasicAuthTransformer.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/BasicAuthTransformer.java index d1f42917bf..c9a0831811 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/BasicAuthTransformer.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/BasicAuthTransformer.java @@ -5,10 +5,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; - -import lombok.AllArgsConstructor; -import reactor.core.publisher.Mono; - import lombok.AllArgsConstructor; import reactor.core.publisher.Mono; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/CompositeTransformer.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/CompositeTransformer.java index f4f8f356f1..35323ea8a3 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/CompositeTransformer.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/CompositeTransformer.java @@ -3,11 +3,6 @@ import java.nio.ByteBuffer; import java.util.List; import java.util.Map; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import reactor.core.publisher.Mono; - import lombok.AllArgsConstructor; import lombok.Getter; import reactor.core.publisher.Mono; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/ConnectionContext.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/ConnectionContext.java index a7a20eb27c..0bb7ca2625 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/ConnectionContext.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/ConnectionContext.java @@ -1,18 +1,10 @@ package org.opensearch.migrations.bulkload.common.http; +import com.beust.jcommander.Parameter; +import com.beust.jcommander.ParametersDelegate; import java.net.URI; import java.net.URISyntaxException; import java.time.Clock; - -import com.beust.jcommander.Parameter; -import com.beust.jcommander.ParametersDelegate; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.ToString; -import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider; - -import com.beust.jcommander.Parameter; -import com.beust.jcommander.ParametersDelegate; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.ToString; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/GzipPayloadRequestTransformer.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/GzipPayloadRequestTransformer.java index 01f640b549..9b10723598 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/GzipPayloadRequestTransformer.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/GzipPayloadRequestTransformer.java @@ -1,5 +1,6 @@ package org.opensearch.migrations.bulkload.common.http; +import io.netty.handler.codec.http.HttpHeaderNames; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; @@ -9,14 +10,6 @@ import java.util.Map; import java.util.zip.Deflater; import java.util.zip.GZIPOutputStream; - -import io.netty.handler.codec.http.HttpHeaderNames; -import lombok.AllArgsConstructor; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; -import reactor.core.publisher.Mono; - -import io.netty.handler.codec.http.HttpHeaderNames; import lombok.AllArgsConstructor; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/HttpResponse.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/HttpResponse.java index 4ce0888fe7..2d9233cfb5 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/HttpResponse.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/HttpResponse.java @@ -1,10 +1,6 @@ package org.opensearch.migrations.bulkload.common.http; import java.util.Map; - -import lombok.AllArgsConstructor; -import lombok.ToString; - import lombok.AllArgsConstructor; import lombok.ToString; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/NoAuthTransformer.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/NoAuthTransformer.java index 944f181084..4125e337a9 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/NoAuthTransformer.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/NoAuthTransformer.java @@ -4,10 +4,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; - -import lombok.AllArgsConstructor; -import reactor.core.publisher.Mono; - import lombok.AllArgsConstructor; import reactor.core.publisher.Mono; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/RequestTransformer.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/RequestTransformer.java index da5d222af3..f6e3444d01 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/RequestTransformer.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/RequestTransformer.java @@ -3,9 +3,6 @@ import java.nio.ByteBuffer; import java.util.List; import java.util.Map; - -import reactor.core.publisher.Mono; - import reactor.core.publisher.Mono; public interface RequestTransformer { diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/SigV4AuthTransformer.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/SigV4AuthTransformer.java index d48638a75c..8fd8098ca2 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/SigV4AuthTransformer.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/SigV4AuthTransformer.java @@ -6,15 +6,9 @@ import java.util.List; import java.util.Map; import java.util.function.Supplier; - import lombok.AllArgsConstructor; -import reactor.core.publisher.Mono; -import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; - import org.opensearch.migrations.IHttpMessage; import org.opensearch.migrations.aws.SigV4Signer; - -import lombok.AllArgsConstructor; import reactor.core.publisher.Mono; import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/TransformedRequest.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/TransformedRequest.java index b95041f94a..d484aa7c76 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/TransformedRequest.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/http/TransformedRequest.java @@ -3,10 +3,6 @@ import java.nio.ByteBuffer; import java.util.List; import java.util.Map; - -import lombok.Value; -import reactor.core.publisher.Mono; - import lombok.Value; import reactor.core.publisher.Mono; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/models/DataFilterArgs.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/models/DataFilterArgs.java index 5107229113..2a0a839cd9 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/models/DataFilterArgs.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/models/DataFilterArgs.java @@ -1,10 +1,7 @@ package org.opensearch.migrations.bulkload.models; -import java.util.List; - -import com.beust.jcommander.Parameter; - import com.beust.jcommander.Parameter; +import java.util.List; public class DataFilterArgs { @Parameter(names = { "--index-allowlist" }, description = ("Optional. List of index names to migrate" diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/models/GlobalMetadata.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/models/GlobalMetadata.java index 83993c9f73..acaf256c79 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/models/GlobalMetadata.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/models/GlobalMetadata.java @@ -1,26 +1,18 @@ package org.opensearch.migrations.bulkload.models; -import java.io.ByteArrayInputStream; -import java.io.FileInputStream; -import java.io.InputStream; -import java.nio.file.Path; - import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.dataformat.smile.SmileFactory; +import java.io.ByteArrayInputStream; +import java.io.FileInputStream; +import java.io.InputStream; +import java.nio.file.Path; import org.apache.lucene.codecs.CodecUtil; - import org.opensearch.migrations.bulkload.common.ByteArrayIndexInput; import org.opensearch.migrations.bulkload.common.RfsException; import org.opensearch.migrations.bulkload.common.SnapshotRepo; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.fasterxml.jackson.dataformat.smile.SmileFactory; -import org.apache.lucene.codecs.CodecUtil; - public interface GlobalMetadata { /** * Defines the behavior expected of an object that will surface the global metadata of a snapshot diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/models/IndexMetadata.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/models/IndexMetadata.java index 5d43e50706..5c41cd13ea 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/models/IndexMetadata.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/models/IndexMetadata.java @@ -1,25 +1,18 @@ package org.opensearch.migrations.bulkload.models; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.dataformat.smile.SmileFactory; import java.io.ByteArrayInputStream; import java.io.FileInputStream; import java.io.InputStream; import java.nio.file.Path; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.dataformat.smile.SmileFactory; import org.apache.lucene.codecs.CodecUtil; - import org.opensearch.migrations.bulkload.common.ByteArrayIndexInput; import org.opensearch.migrations.bulkload.common.RfsException; import org.opensearch.migrations.bulkload.common.SnapshotRepo; import org.opensearch.migrations.transformation.entity.Index; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.dataformat.smile.SmileFactory; -import org.apache.lucene.codecs.CodecUtil; - public interface IndexMetadata extends Index { /* diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/models/ShardFileInfo.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/models/ShardFileInfo.java index 74f1f1cc3b..9e4f2d80de 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/models/ShardFileInfo.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/models/ShardFileInfo.java @@ -2,8 +2,6 @@ import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.BytesRef; - /** * Defines the behavior expected of an object that will surface the metadata of an file stored in a snapshot * See: https://github.com/elastic/elasticsearch/blob/7.10/server/src/main/java/org/elasticsearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshot.java#L277 diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/models/ShardMetadata.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/models/ShardMetadata.java index 44ab4d126c..5f2e061515 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/models/ShardMetadata.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/models/ShardMetadata.java @@ -1,25 +1,18 @@ package org.opensearch.migrations.bulkload.models; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.dataformat.smile.SmileFactory; import java.io.ByteArrayInputStream; import java.io.FileInputStream; import java.io.InputStream; import java.nio.file.Path; import java.util.List; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.dataformat.smile.SmileFactory; import org.apache.lucene.codecs.CodecUtil; - import org.opensearch.migrations.bulkload.common.ByteArrayIndexInput; import org.opensearch.migrations.bulkload.common.RfsException; import org.opensearch.migrations.bulkload.common.SnapshotRepo; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.dataformat.smile.SmileFactory; -import org.apache.lucene.codecs.CodecUtil; - /** * Defines the behavior expected of an object that will surface the metadata of an shard stored in a snapshot * See: https://github.com/elastic/elasticsearch/blob/7.10/server/src/main/java/org/elasticsearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshot.java#L510 diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/netty/ReadMeteringHandler.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/netty/ReadMeteringHandler.java index e4b8974e5e..f997f250b9 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/netty/ReadMeteringHandler.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/netty/ReadMeteringHandler.java @@ -1,17 +1,10 @@ package org.opensearch.migrations.bulkload.netty; -import java.util.function.IntConsumer; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; -import io.netty.handler.codec.http.HttpContent; -import lombok.AllArgsConstructor; - import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.handler.codec.http.HttpContent; +import java.util.function.IntConsumer; import lombok.AllArgsConstructor; /** diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/netty/WriteMeteringHandler.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/netty/WriteMeteringHandler.java index e75960c711..16ef66a98c 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/netty/WriteMeteringHandler.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/netty/WriteMeteringHandler.java @@ -1,19 +1,11 @@ package org.opensearch.migrations.bulkload.netty; -import java.util.function.IntConsumer; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelOutboundHandlerAdapter; -import io.netty.channel.ChannelPromise; -import io.netty.handler.codec.http.HttpContent; -import lombok.AllArgsConstructor; - import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelOutboundHandlerAdapter; import io.netty.channel.ChannelPromise; import io.netty.handler.codec.http.HttpContent; +import java.util.function.IntConsumer; import lombok.AllArgsConstructor; /** diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/tracing/BaseRootRfsContext.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/tracing/BaseRootRfsContext.java index b12300f211..c586bbdb53 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/tracing/BaseRootRfsContext.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/tracing/BaseRootRfsContext.java @@ -1,12 +1,9 @@ package org.opensearch.migrations.bulkload.tracing; import io.opentelemetry.api.OpenTelemetry; - import org.opensearch.migrations.tracing.IContextTracker; import org.opensearch.migrations.tracing.RootOtelContext; -import io.opentelemetry.api.OpenTelemetry; - public class BaseRootRfsContext extends RootOtelContext { public final RfsContexts.GenericRequestContext.MetricInstruments genericRequestInstruments; public final RfsContexts.CheckedIdempotentPutRequestContext.MetricInstruments getTwoStepIdempotentRequestInstruments; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/tracing/RfsContexts.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/tracing/RfsContexts.java index d11e3dc1fb..02e81129cb 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/tracing/RfsContexts.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/tracing/RfsContexts.java @@ -7,19 +7,10 @@ import io.opentelemetry.api.metrics.Meter; import lombok.Getter; import lombok.NonNull; - import org.opensearch.migrations.tracing.BaseSpanContext; import org.opensearch.migrations.tracing.CommonScopedMetricInstruments; import org.opensearch.migrations.tracing.IScopedInstrumentationAttributes; -import io.opentelemetry.api.common.AttributeKey; -import io.opentelemetry.api.common.Attributes; -import io.opentelemetry.api.common.AttributesBuilder; -import io.opentelemetry.api.metrics.LongCounter; -import io.opentelemetry.api.metrics.Meter; -import lombok.Getter; -import lombok.NonNull; - public interface RfsContexts extends IRfsContexts { String COUNT_UNITS = "count"; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/tracing/RootWorkCoordinationContext.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/tracing/RootWorkCoordinationContext.java index 430886c2cc..861118b4f2 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/tracing/RootWorkCoordinationContext.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/tracing/RootWorkCoordinationContext.java @@ -1,13 +1,10 @@ package org.opensearch.migrations.bulkload.tracing; import io.opentelemetry.api.OpenTelemetry; - import org.opensearch.migrations.tracing.IContextTracker; import org.opensearch.migrations.tracing.IScopedInstrumentationAttributes; import org.opensearch.migrations.tracing.RootOtelContext; -import io.opentelemetry.api.OpenTelemetry; - public class RootWorkCoordinationContext extends RootOtelContext { private static final String SCOPE_NAME = "workCoordination"; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/tracing/WorkCoordinationContexts.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/tracing/WorkCoordinationContexts.java index 2a6f348347..5fc98f69d6 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/tracing/WorkCoordinationContexts.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/tracing/WorkCoordinationContexts.java @@ -5,18 +5,11 @@ import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NonNull; - import org.opensearch.migrations.bulkload.workcoordination.OpenSearchWorkCoordinator; import org.opensearch.migrations.tracing.BaseSpanContext; import org.opensearch.migrations.tracing.CommonScopedMetricInstruments; import org.opensearch.migrations.tracing.IScopedInstrumentationAttributes; -import io.opentelemetry.api.metrics.LongCounter; -import io.opentelemetry.api.metrics.Meter; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NonNull; - public interface WorkCoordinationContexts extends IWorkCoordinationContexts { @AllArgsConstructor class RetryLabels { diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/transformers/TransformFunctions.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/transformers/TransformFunctions.java index 454b92c11d..1ea9ca7e5d 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/transformers/TransformFunctions.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/transformers/TransformFunctions.java @@ -3,14 +3,9 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; - import org.opensearch.migrations.Version; import org.opensearch.migrations.VersionMatchers; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; - public class TransformFunctions { private static final ObjectMapper mapper = new ObjectMapper(); public static final String MAPPINGS_KEY_STR = "mappings"; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/transformers/Transformer_ES_6_8_to_OS_2_11.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/transformers/Transformer_ES_6_8_to_OS_2_11.java index 83b07beb0d..b7d18ccc7a 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/transformers/Transformer_ES_6_8_to_OS_2_11.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/transformers/Transformer_ES_6_8_to_OS_2_11.java @@ -1,11 +1,9 @@ package org.opensearch.migrations.bulkload.transformers; -import java.util.List; - import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.bulkload.models.GlobalMetadata; import org.opensearch.migrations.bulkload.models.IndexMetadata; import org.opensearch.migrations.bulkload.version_os_2_11.GlobalMetadataData_OS_2_11; @@ -14,10 +12,6 @@ import org.opensearch.migrations.transformation.entity.Index; import org.opensearch.migrations.transformation.rules.IndexMappingTypeRemoval; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class Transformer_ES_6_8_to_OS_2_11 implements Transformer { private static final ObjectMapper mapper = new ObjectMapper(); diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/transformers/Transformer_ES_7_10_OS_2_11.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/transformers/Transformer_ES_7_10_OS_2_11.java index 56c9bc5cae..a5df9fb35c 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/transformers/Transformer_ES_7_10_OS_2_11.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/transformers/Transformer_ES_7_10_OS_2_11.java @@ -2,14 +2,10 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.bulkload.models.GlobalMetadata; import org.opensearch.migrations.bulkload.models.IndexMetadata; import org.opensearch.migrations.bulkload.version_os_2_11.GlobalMetadataData_OS_2_11; -import com.fasterxml.jackson.databind.node.ObjectNode; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class Transformer_ES_7_10_OS_2_11 implements Transformer { public static final String INDEX_TEMPLATE_KEY_STR = "index_template"; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/ElasticsearchConstants_ES_6_8.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/ElasticsearchConstants_ES_6_8.java index f2a2a62803..7e8b957674 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/ElasticsearchConstants_ES_6_8.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/ElasticsearchConstants_ES_6_8.java @@ -6,12 +6,6 @@ import com.fasterxml.jackson.dataformat.smile.SmileFactory; import com.fasterxml.jackson.dataformat.smile.SmileGenerator; -import com.fasterxml.jackson.core.JsonFactory; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.dataformat.smile.SmileFactory; -import com.fasterxml.jackson.dataformat.smile.SmileGenerator; - public class ElasticsearchConstants_ES_6_8 { private ElasticsearchConstants_ES_6_8() {} diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/GlobalMetadataData_ES_6_8.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/GlobalMetadataData_ES_6_8.java index e961a3d837..83d66d7a74 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/GlobalMetadataData_ES_6_8.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/GlobalMetadataData_ES_6_8.java @@ -1,11 +1,8 @@ package org.opensearch.migrations.bulkload.version_es_6_8; import com.fasterxml.jackson.databind.node.ObjectNode; - import org.opensearch.migrations.bulkload.models.GlobalMetadata; -import com.fasterxml.jackson.databind.node.ObjectNode; - public class GlobalMetadataData_ES_6_8 implements GlobalMetadata { private final ObjectNode root; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/GlobalMetadataFactory_ES_6_8.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/GlobalMetadataFactory_ES_6_8.java index 5281bbd025..87be90438f 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/GlobalMetadataFactory_ES_6_8.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/GlobalMetadataFactory_ES_6_8.java @@ -3,14 +3,9 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.dataformat.smile.SmileFactory; - import org.opensearch.migrations.bulkload.common.SnapshotRepo; import org.opensearch.migrations.bulkload.models.GlobalMetadata; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.fasterxml.jackson.dataformat.smile.SmileFactory; - public class GlobalMetadataFactory_ES_6_8 implements GlobalMetadata.Factory { private final SnapshotRepo.Provider repoDataProvider; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/IndexMetadataData_ES_6_8.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/IndexMetadataData_ES_6_8.java index 91b95cea75..4b8f5c37ff 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/IndexMetadataData_ES_6_8.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/IndexMetadataData_ES_6_8.java @@ -3,14 +3,9 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; import lombok.Getter; - import org.opensearch.migrations.bulkload.models.IndexMetadata; import org.opensearch.migrations.bulkload.transformers.TransformFunctions; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import lombok.Getter; - public class IndexMetadataData_ES_6_8 implements IndexMetadata { @Getter private final ObjectNode rawJson; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/IndexMetadataFactory_ES_6_8.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/IndexMetadataFactory_ES_6_8.java index 3007b1e41f..19f9e8b69b 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/IndexMetadataFactory_ES_6_8.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/IndexMetadataFactory_ES_6_8.java @@ -3,14 +3,9 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.dataformat.smile.SmileFactory; - import org.opensearch.migrations.bulkload.common.SnapshotRepo; import org.opensearch.migrations.bulkload.models.IndexMetadata; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.fasterxml.jackson.dataformat.smile.SmileFactory; - public class IndexMetadataFactory_ES_6_8 implements IndexMetadata.Factory { private final SnapshotRepo.Provider repoDataProvider; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/RemoteReaderClient_ES_6_8.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/RemoteReaderClient_ES_6_8.java index 4e234774b8..8b39906203 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/RemoteReaderClient_ES_6_8.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/RemoteReaderClient_ES_6_8.java @@ -1,7 +1,6 @@ package org.opensearch.migrations.bulkload.version_es_6_8; import java.util.Map; - import org.opensearch.migrations.bulkload.common.http.ConnectionContext; import org.opensearch.migrations.bulkload.version_universal.RemoteReaderClient; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/ShardMetadataData_ES_6_8.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/ShardMetadataData_ES_6_8.java index 6373d349a3..7e6bc47688 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/ShardMetadataData_ES_6_8.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/ShardMetadataData_ES_6_8.java @@ -1,9 +1,5 @@ package org.opensearch.migrations.bulkload.version_es_6_8; -import java.io.IOException; -import java.util.Collections; -import java.util.List; - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonParser; @@ -11,22 +7,14 @@ import com.fasterxml.jackson.databind.JsonDeserializer; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.IOException; +import java.util.Collections; +import java.util.List; import lombok.Getter; import org.apache.lucene.util.BytesRef; - import org.opensearch.migrations.bulkload.models.ShardFileInfo; import org.opensearch.migrations.bulkload.models.ShardMetadata; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import lombok.Getter; -import org.apache.lucene.util.BytesRef; - @Getter public class ShardMetadataData_ES_6_8 implements ShardMetadata { private static final ObjectMapper objectMapper = new ObjectMapper(); diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/ShardMetadataFactory_ES_6_8.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/ShardMetadataFactory_ES_6_8.java index 16e3b54c6a..f967562725 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/ShardMetadataFactory_ES_6_8.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/ShardMetadataFactory_ES_6_8.java @@ -6,17 +6,9 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.dataformat.smile.SmileFactory; import lombok.RequiredArgsConstructor; - import org.opensearch.migrations.bulkload.common.SnapshotRepo; import org.opensearch.migrations.bulkload.models.ShardMetadata; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.module.SimpleModule; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.fasterxml.jackson.dataformat.smile.SmileFactory; -import lombok.RequiredArgsConstructor; - @RequiredArgsConstructor public class ShardMetadataFactory_ES_6_8 implements ShardMetadata.Factory { protected final SnapshotRepo.Provider repoDataProvider; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/SnapshotRepoData_ES_6_8.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/SnapshotRepoData_ES_6_8.java index 3a2c1f0858..1c1321369f 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/SnapshotRepoData_ES_6_8.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/SnapshotRepoData_ES_6_8.java @@ -1,27 +1,19 @@ package org.opensearch.migrations.bulkload.version_es_6_8; +import com.fasterxml.jackson.databind.ObjectMapper; import java.io.File; import java.io.IOException; import java.nio.file.Path; import java.util.List; import java.util.Map; - -import com.fasterxml.jackson.databind.ObjectMapper; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.RequiredArgsConstructor; - import org.opensearch.migrations.bulkload.common.SnapshotRepo; import org.opensearch.migrations.bulkload.common.SnapshotRepo.CantParseRepoFile; import org.opensearch.migrations.bulkload.common.SourceRepo; -import com.fasterxml.jackson.databind.ObjectMapper; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.RequiredArgsConstructor; - public class SnapshotRepoData_ES_6_8 { public static SnapshotRepoData_ES_6_8 fromRepoFile(Path filePath) { diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/SnapshotRepoProvider_ES_6_8.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/SnapshotRepoProvider_ES_6_8.java index 25262fb72c..a16a853421 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/SnapshotRepoProvider_ES_6_8.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_6_8/SnapshotRepoProvider_ES_6_8.java @@ -3,7 +3,6 @@ import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; - import org.opensearch.migrations.bulkload.common.SnapshotRepo; import org.opensearch.migrations.bulkload.common.SourceRepo; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/ElasticsearchConstants_ES_7_10.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/ElasticsearchConstants_ES_7_10.java index 4c2bcee442..476942125a 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/ElasticsearchConstants_ES_7_10.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/ElasticsearchConstants_ES_7_10.java @@ -6,12 +6,6 @@ import com.fasterxml.jackson.dataformat.smile.SmileFactory; import com.fasterxml.jackson.dataformat.smile.SmileGenerator; -import com.fasterxml.jackson.core.JsonFactory; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.dataformat.smile.SmileFactory; -import com.fasterxml.jackson.dataformat.smile.SmileGenerator; - public class ElasticsearchConstants_ES_7_10 { private ElasticsearchConstants_ES_7_10() {} diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/GlobalMetadataData_ES_7_10.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/GlobalMetadataData_ES_7_10.java index 885da68195..fe40aa63b1 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/GlobalMetadataData_ES_7_10.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/GlobalMetadataData_ES_7_10.java @@ -1,11 +1,8 @@ package org.opensearch.migrations.bulkload.version_es_7_10; import com.fasterxml.jackson.databind.node.ObjectNode; - import org.opensearch.migrations.bulkload.models.GlobalMetadata; -import com.fasterxml.jackson.databind.node.ObjectNode; - public class GlobalMetadataData_ES_7_10 implements GlobalMetadata { private final ObjectNode root; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/GlobalMetadataFactory_ES_7_10.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/GlobalMetadataFactory_ES_7_10.java index 63dfacc5a6..1147927703 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/GlobalMetadataFactory_ES_7_10.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/GlobalMetadataFactory_ES_7_10.java @@ -3,14 +3,9 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.dataformat.smile.SmileFactory; - import org.opensearch.migrations.bulkload.common.SnapshotRepo; import org.opensearch.migrations.bulkload.models.GlobalMetadata; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.fasterxml.jackson.dataformat.smile.SmileFactory; - public class GlobalMetadataFactory_ES_7_10 implements GlobalMetadata.Factory { private final SnapshotRepo.Provider repoDataProvider; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/IndexMetadataData_ES_7_10.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/IndexMetadataData_ES_7_10.java index 5da61954fc..083d13b3a9 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/IndexMetadataData_ES_7_10.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/IndexMetadataData_ES_7_10.java @@ -2,13 +2,9 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import lombok.Getter; - import org.opensearch.migrations.bulkload.models.IndexMetadata; import org.opensearch.migrations.bulkload.transformers.TransformFunctions; -import com.fasterxml.jackson.databind.node.ObjectNode; -import lombok.Getter; - public class IndexMetadataData_ES_7_10 implements IndexMetadata { @Getter private final ObjectNode rawJson; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/IndexMetadataFactory_ES_7_10.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/IndexMetadataFactory_ES_7_10.java index a8cf0762dc..1c808fb6d4 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/IndexMetadataFactory_ES_7_10.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/IndexMetadataFactory_ES_7_10.java @@ -3,14 +3,9 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.dataformat.smile.SmileFactory; - import org.opensearch.migrations.bulkload.common.SnapshotRepo; import org.opensearch.migrations.bulkload.models.IndexMetadata; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.fasterxml.jackson.dataformat.smile.SmileFactory; - public class IndexMetadataFactory_ES_7_10 implements IndexMetadata.Factory { private final SnapshotRepo.Provider repoDataProvider; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/ShardMetadataData_ES_7_10.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/ShardMetadataData_ES_7_10.java index 6af7d78e5c..97b93063a3 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/ShardMetadataData_ES_7_10.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/ShardMetadataData_ES_7_10.java @@ -1,9 +1,5 @@ package org.opensearch.migrations.bulkload.version_es_7_10; -import java.io.IOException; -import java.util.Collections; -import java.util.List; - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonParser; @@ -12,23 +8,14 @@ import com.fasterxml.jackson.databind.JsonDeserializer; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.IOException; +import java.util.Collections; +import java.util.List; import lombok.Getter; import org.apache.lucene.util.BytesRef; - import org.opensearch.migrations.bulkload.models.ShardFileInfo; import org.opensearch.migrations.bulkload.models.ShardMetadata; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import lombok.Getter; -import org.apache.lucene.util.BytesRef; - @Getter public class ShardMetadataData_ES_7_10 implements ShardMetadata { private static final ObjectMapper objectMapper = new ObjectMapper(); diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/ShardMetadataFactory_ES_7_10.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/ShardMetadataFactory_ES_7_10.java index e1e3601a29..32d040c9ca 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/ShardMetadataFactory_ES_7_10.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/ShardMetadataFactory_ES_7_10.java @@ -7,18 +7,9 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.dataformat.smile.SmileFactory; import lombok.RequiredArgsConstructor; - import org.opensearch.migrations.bulkload.common.SnapshotRepo; import org.opensearch.migrations.bulkload.models.ShardMetadata; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.module.SimpleModule; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.fasterxml.jackson.dataformat.smile.SmileFactory; -import lombok.RequiredArgsConstructor; - @RequiredArgsConstructor public class ShardMetadataFactory_ES_7_10 implements ShardMetadata.Factory { protected final SnapshotRepo.Provider repoDataProvider; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/SnapshotRepoData_ES_7_10.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/SnapshotRepoData_ES_7_10.java index 62d98d14d9..0ff8780de1 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/SnapshotRepoData_ES_7_10.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/SnapshotRepoData_ES_7_10.java @@ -1,31 +1,21 @@ package org.opensearch.migrations.bulkload.version_es_7_10; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; import java.io.File; import java.io.IOException; import java.nio.file.Path; import java.util.List; import java.util.Map; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.RequiredArgsConstructor; - import org.opensearch.migrations.bulkload.common.SnapshotRepo; import org.opensearch.migrations.bulkload.common.SnapshotRepo.CantParseRepoFile; import org.opensearch.migrations.bulkload.common.SourceRepo; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.RequiredArgsConstructor; - @Getter public class SnapshotRepoData_ES_7_10 { public static SnapshotRepoData_ES_7_10 fromRepoFile(Path filePath) { diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/SnapshotRepoProvider_ES_7_10.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/SnapshotRepoProvider_ES_7_10.java index adac501392..7c222658dd 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/SnapshotRepoProvider_ES_7_10.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_es_7_10/SnapshotRepoProvider_ES_7_10.java @@ -3,7 +3,6 @@ import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; - import org.opensearch.migrations.bulkload.common.SnapshotRepo; import org.opensearch.migrations.bulkload.common.SourceRepo; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_os_2_11/GlobalMetadataCreator_OS_2_11.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_os_2_11/GlobalMetadataCreator_OS_2_11.java index dd5d069c13..dbff15cd6c 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_os_2_11/GlobalMetadataCreator_OS_2_11.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_os_2_11/GlobalMetadataCreator_OS_2_11.java @@ -1,15 +1,13 @@ package org.opensearch.migrations.bulkload.version_os_2_11; +import com.fasterxml.jackson.databind.node.ObjectNode; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; - -import com.fasterxml.jackson.databind.node.ObjectNode; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.MigrationMode; import org.opensearch.migrations.bulkload.common.OpenSearchClient; import org.opensearch.migrations.bulkload.models.GlobalMetadata; @@ -17,10 +15,6 @@ import org.opensearch.migrations.metadata.GlobalMetadataCreatorResults; import org.opensearch.migrations.metadata.tracing.IMetadataMigrationContexts.IClusterMetadataContext; -import com.fasterxml.jackson.databind.node.ObjectNode; -import lombok.AllArgsConstructor; -import lombok.extern.slf4j.Slf4j; - @AllArgsConstructor @Slf4j public class GlobalMetadataCreator_OS_2_11 implements GlobalMetadataCreator { diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_os_2_11/GlobalMetadataData_OS_2_11.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_os_2_11/GlobalMetadataData_OS_2_11.java index 136b1f6355..5b89fe8487 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_os_2_11/GlobalMetadataData_OS_2_11.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_os_2_11/GlobalMetadataData_OS_2_11.java @@ -1,11 +1,8 @@ package org.opensearch.migrations.bulkload.version_os_2_11; import com.fasterxml.jackson.databind.node.ObjectNode; - import org.opensearch.migrations.bulkload.models.GlobalMetadata; -import com.fasterxml.jackson.databind.node.ObjectNode; - public class GlobalMetadataData_OS_2_11 implements GlobalMetadata { private final ObjectNode root; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_os_2_11/IndexCreator_OS_2_11.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_os_2_11/IndexCreator_OS_2_11.java index 3ae85308c7..730fe3d408 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_os_2_11/IndexCreator_OS_2_11.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_os_2_11/IndexCreator_OS_2_11.java @@ -4,7 +4,6 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.MigrationMode; import org.opensearch.migrations.bulkload.common.InvalidResponse; import org.opensearch.migrations.bulkload.common.OpenSearchClient; @@ -12,11 +11,6 @@ import org.opensearch.migrations.metadata.IndexCreator; import org.opensearch.migrations.metadata.tracing.IMetadataMigrationContexts.ICreateIndexContext; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; -import lombok.AllArgsConstructor; -import lombok.extern.slf4j.Slf4j; - @Slf4j @AllArgsConstructor public class IndexCreator_OS_2_11 implements IndexCreator { diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_os_2_11/IndexMetadataData_OS_2_11.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_os_2_11/IndexMetadataData_OS_2_11.java index 1957fa0330..8cb628557a 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_os_2_11/IndexMetadataData_OS_2_11.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_os_2_11/IndexMetadataData_OS_2_11.java @@ -1,11 +1,8 @@ package org.opensearch.migrations.bulkload.version_os_2_11; import com.fasterxml.jackson.databind.node.ObjectNode; - import org.opensearch.migrations.bulkload.models.IndexMetadata; -import com.fasterxml.jackson.databind.node.ObjectNode; - public class IndexMetadataData_OS_2_11 implements IndexMetadata { private ObjectNode root; private String indexId; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_universal/RemoteDataProvider.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_universal/RemoteDataProvider.java index 278d029552..582deb6d43 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_universal/RemoteDataProvider.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_universal/RemoteDataProvider.java @@ -1,19 +1,14 @@ package org.opensearch.migrations.bulkload.version_universal; +import com.fasterxml.jackson.databind.node.ObjectNode; import java.util.ArrayList; import java.util.List; - -import com.fasterxml.jackson.databind.node.ObjectNode; import lombok.AllArgsConstructor; - import org.opensearch.migrations.bulkload.common.SnapshotRepo.Index; import org.opensearch.migrations.bulkload.common.SnapshotRepo.Provider; import org.opensearch.migrations.bulkload.common.SnapshotRepo.Snapshot; import org.opensearch.migrations.bulkload.common.SourceRepo; -import com.fasterxml.jackson.databind.node.ObjectNode; -import lombok.AllArgsConstructor; - @AllArgsConstructor final class RemoteSnapshotDataProvider implements Provider { private final ObjectNode indexData; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_universal/RemoteIndexMetadata.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_universal/RemoteIndexMetadata.java index 41735b331e..dc04ec0ffc 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_universal/RemoteIndexMetadata.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_universal/RemoteIndexMetadata.java @@ -3,13 +3,8 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; import lombok.AllArgsConstructor; - import org.opensearch.migrations.bulkload.models.IndexMetadata; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import lombok.AllArgsConstructor; - @AllArgsConstructor public class RemoteIndexMetadata implements IndexMetadata { diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_universal/RemoteIndexMetadataFactory.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_universal/RemoteIndexMetadataFactory.java index 85a5442911..4a4bafc610 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_universal/RemoteIndexMetadataFactory.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_universal/RemoteIndexMetadataFactory.java @@ -5,16 +5,9 @@ import com.fasterxml.jackson.dataformat.smile.SmileFactory; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.bulkload.common.SnapshotRepo.Provider; import org.opensearch.migrations.bulkload.models.IndexMetadata; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.fasterxml.jackson.dataformat.smile.SmileFactory; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; - @RequiredArgsConstructor @Slf4j public class RemoteIndexMetadataFactory implements IndexMetadata.Factory { diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_universal/RemoteIndexSnapshotData.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_universal/RemoteIndexSnapshotData.java index d5c2632615..62b9db4ea9 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_universal/RemoteIndexSnapshotData.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_universal/RemoteIndexSnapshotData.java @@ -1,13 +1,9 @@ package org.opensearch.migrations.bulkload.version_universal; import java.util.List; - import lombok.AllArgsConstructor; - import org.opensearch.migrations.bulkload.common.SnapshotRepo.Index; -import lombok.AllArgsConstructor; - @AllArgsConstructor final class RemoteIndexSnapshotData implements Index { private final String indexName; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_universal/RemoteMetadata.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_universal/RemoteMetadata.java index 6cc82490bf..346cd589dd 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_universal/RemoteMetadata.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_universal/RemoteMetadata.java @@ -1,15 +1,10 @@ package org.opensearch.migrations.bulkload.version_universal; -import java.util.Optional; - import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.Optional; import lombok.AllArgsConstructor; - import org.opensearch.migrations.bulkload.models.GlobalMetadata; -import com.fasterxml.jackson.databind.node.ObjectNode; -import lombok.AllArgsConstructor; - @AllArgsConstructor public class RemoteMetadata implements GlobalMetadata { diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_universal/RemoteMetadataFactory.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_universal/RemoteMetadataFactory.java index 6acec7fe02..76df78d5e9 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_universal/RemoteMetadataFactory.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_universal/RemoteMetadataFactory.java @@ -4,15 +4,9 @@ import com.fasterxml.jackson.dataformat.smile.SmileFactory; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.bulkload.common.SnapshotRepo.Provider; import org.opensearch.migrations.bulkload.models.GlobalMetadata; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.dataformat.smile.SmileFactory; -import lombok.AllArgsConstructor; -import lombok.extern.slf4j.Slf4j; - @AllArgsConstructor @Slf4j public class RemoteMetadataFactory implements GlobalMetadata.Factory { diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_universal/RemoteReaderClient.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_universal/RemoteReaderClient.java index 569f9c6f48..01448b1a33 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/version_universal/RemoteReaderClient.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/version_universal/RemoteReaderClient.java @@ -1,22 +1,14 @@ package org.opensearch.migrations.bulkload.version_universal; +import com.fasterxml.jackson.databind.node.ObjectNode; import java.util.List; import java.util.Map; import java.util.Map.Entry; - -import com.fasterxml.jackson.databind.node.ObjectNode; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - import org.opensearch.migrations.bulkload.common.OpenSearchClient; import org.opensearch.migrations.bulkload.common.http.ConnectionContext; import org.opensearch.migrations.bulkload.common.http.HttpResponse; - -import com.fasterxml.jackson.databind.node.ObjectNode; -import lombok.NonNull; -import lombok.extern.slf4j.Slf4j; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/workcoordination/CoordinateWorkHttpClient.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/workcoordination/CoordinateWorkHttpClient.java index 22a1abc1c0..84c5eef581 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/workcoordination/CoordinateWorkHttpClient.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/workcoordination/CoordinateWorkHttpClient.java @@ -1,24 +1,17 @@ package org.opensearch.migrations.bulkload.workcoordination; +import io.netty.handler.codec.http.HttpMethod; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.stream.Stream; - -import io.netty.handler.codec.http.HttpMethod; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.bulkload.common.RestClient; import org.opensearch.migrations.bulkload.common.http.ConnectionContext; -import io.netty.handler.codec.http.HttpMethod; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class CoordinateWorkHttpClient implements AbstractedHttpClient { diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/workcoordination/IWorkCoordinator.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/workcoordination/IWorkCoordinator.java index 759c2fdd06..b38b44bf99 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/workcoordination/IWorkCoordinator.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/workcoordination/IWorkCoordinator.java @@ -5,19 +5,12 @@ import java.time.Duration; import java.time.Instant; import java.util.function.Supplier; - import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NonNull; import lombok.ToString; - import org.opensearch.migrations.bulkload.tracing.IWorkCoordinationContexts; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NonNull; -import lombok.ToString; - /** * Multiple workers can create an instance of this class to coordinate what work each of them * should be handling. Implementations of this class must be thread-safe, even when the threads diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/workcoordination/LeaseExpireTrigger.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/workcoordination/LeaseExpireTrigger.java index 622895f096..5ac6d0b6c0 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/workcoordination/LeaseExpireTrigger.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/workcoordination/LeaseExpireTrigger.java @@ -1,5 +1,6 @@ package org.opensearch.migrations.bulkload.workcoordination; +import io.netty.util.concurrent.DefaultThreadFactory; import java.time.Clock; import java.time.Duration; import java.time.Instant; @@ -9,10 +10,6 @@ import java.util.concurrent.TimeUnit; import java.util.function.Consumer; -import io.netty.util.concurrent.DefaultThreadFactory; - -import io.netty.util.concurrent.DefaultThreadFactory; - /** * This class takes an expiration time and guarantees that the process will NOT run past that expiration * time unless the work is marked as complete before that expiration. This class may, but does not need to, diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/workcoordination/OpenSearchWorkCoordinator.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/workcoordination/OpenSearchWorkCoordinator.java index e545623283..ee7055cc5a 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/workcoordination/OpenSearchWorkCoordinator.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/workcoordination/OpenSearchWorkCoordinator.java @@ -1,5 +1,6 @@ package org.opensearch.migrations.bulkload.workcoordination; +import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.time.Clock; @@ -10,25 +11,14 @@ import java.util.function.Function; import java.util.function.Supplier; import java.util.stream.Collectors; - -import com.fasterxml.jackson.databind.ObjectMapper; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.Lombok; import lombok.NonNull; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.bulkload.tracing.IWorkCoordinationContexts; -import com.fasterxml.jackson.databind.ObjectMapper; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.Lombok; -import lombok.NonNull; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class OpenSearchWorkCoordinator implements IWorkCoordinator { public static final String INDEX_NAME = ".migrations_working_state"; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/workcoordination/ScopedWorkCoordinator.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/workcoordination/ScopedWorkCoordinator.java index 9487525d77..a1321af700 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/workcoordination/ScopedWorkCoordinator.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/workcoordination/ScopedWorkCoordinator.java @@ -2,15 +2,10 @@ import java.io.IOException; import java.util.function.Supplier; - import lombok.NonNull; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.bulkload.tracing.IWorkCoordinationContexts; -import lombok.NonNull; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class ScopedWorkCoordinator { diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/worker/DocumentsRunner.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/worker/DocumentsRunner.java index fe417cb9ce..1a45fe4b4d 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/worker/DocumentsRunner.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/worker/DocumentsRunner.java @@ -6,12 +6,9 @@ import java.util.function.BiFunction; import java.util.function.Function; import java.util.function.Supplier; - import lombok.AllArgsConstructor; import lombok.Lombok; import lombok.extern.slf4j.Slf4j; -import reactor.core.publisher.Flux; - import org.opensearch.migrations.bulkload.common.DocumentReindexer; import org.opensearch.migrations.bulkload.common.LuceneDocumentsReader; import org.opensearch.migrations.bulkload.common.RfsException; @@ -21,10 +18,6 @@ import org.opensearch.migrations.bulkload.workcoordination.IWorkCoordinator; import org.opensearch.migrations.bulkload.workcoordination.ScopedWorkCoordinator; import org.opensearch.migrations.reindexer.tracing.IDocumentMigrationContexts; - -import lombok.AllArgsConstructor; -import lombok.Lombok; -import lombok.extern.slf4j.Slf4j; import reactor.core.publisher.Flux; @Slf4j diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/worker/IndexAndShard.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/worker/IndexAndShard.java index dfddf134e7..f075505f90 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/worker/IndexAndShard.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/worker/IndexAndShard.java @@ -4,10 +4,6 @@ import lombok.Getter; import lombok.ToString; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.ToString; - @AllArgsConstructor @Getter @ToString diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/worker/IndexMetadataResults.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/worker/IndexMetadataResults.java index 8555eb28cc..8bff6f5fc6 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/worker/IndexMetadataResults.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/worker/IndexMetadataResults.java @@ -1,11 +1,6 @@ package org.opensearch.migrations.bulkload.worker; import java.util.List; - -import lombok.Builder; -import lombok.Data; -import lombok.Singular; - import lombok.Builder; import lombok.Data; import lombok.Singular; diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/worker/IndexRunner.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/worker/IndexRunner.java index ffe2396896..4239182631 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/worker/IndexRunner.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/worker/IndexRunner.java @@ -2,10 +2,8 @@ import java.util.List; import java.util.function.BiConsumer; - import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.MigrationMode; import org.opensearch.migrations.bulkload.common.FilterScheme; import org.opensearch.migrations.bulkload.common.SnapshotRepo; @@ -14,9 +12,6 @@ import org.opensearch.migrations.metadata.IndexCreator; import org.opensearch.migrations.metadata.tracing.IMetadataMigrationContexts.ICreateIndexContext; -import lombok.AllArgsConstructor; -import lombok.extern.slf4j.Slf4j; - @Slf4j @AllArgsConstructor public class IndexRunner { diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/worker/MetadataRunner.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/worker/MetadataRunner.java index d2efcd4c88..1533fc519f 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/worker/MetadataRunner.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/worker/MetadataRunner.java @@ -2,7 +2,6 @@ import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.MigrationMode; import org.opensearch.migrations.bulkload.models.GlobalMetadata; import org.opensearch.migrations.bulkload.transformers.Transformer; @@ -10,9 +9,6 @@ import org.opensearch.migrations.metadata.GlobalMetadataCreatorResults; import org.opensearch.migrations.metadata.tracing.IMetadataMigrationContexts.IClusterMetadataContext; -import lombok.AllArgsConstructor; -import lombok.extern.slf4j.Slf4j; - @Slf4j @AllArgsConstructor public class MetadataRunner { diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/worker/ShardWorkPreparer.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/worker/ShardWorkPreparer.java index 8c5180e3b6..66f5b7e592 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/worker/ShardWorkPreparer.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/worker/ShardWorkPreparer.java @@ -5,11 +5,9 @@ import java.util.List; import java.util.function.BiConsumer; import java.util.stream.IntStream; - import lombok.Lombok; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.bulkload.common.FilterScheme; import org.opensearch.migrations.bulkload.common.SnapshotRepo; import org.opensearch.migrations.bulkload.models.IndexMetadata; @@ -18,10 +16,6 @@ import org.opensearch.migrations.reindexer.tracing.IDocumentMigrationContexts; import org.opensearch.migrations.reindexer.tracing.IRootDocumentMigrationContext; -import lombok.Lombok; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; - /** * This class adds workitemes (leasable mutexes) via the WorkCoordinator so that future * runs of the DocumentsRunner can pick one of those items and migrate the documents for diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/worker/SnapshotRunner.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/worker/SnapshotRunner.java index 5ef077a81b..915b69aab2 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/worker/SnapshotRunner.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/worker/SnapshotRunner.java @@ -1,11 +1,8 @@ package org.opensearch.migrations.bulkload.worker; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.bulkload.common.SnapshotCreator; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class SnapshotRunner { private SnapshotRunner() {} diff --git a/RFS/src/main/java/org/opensearch/migrations/cluster/ClusterProviderRegistry.java b/RFS/src/main/java/org/opensearch/migrations/cluster/ClusterProviderRegistry.java index f160d0d7ed..17f8c284f0 100644 --- a/RFS/src/main/java/org/opensearch/migrations/cluster/ClusterProviderRegistry.java +++ b/RFS/src/main/java/org/opensearch/migrations/cluster/ClusterProviderRegistry.java @@ -2,10 +2,8 @@ import java.util.List; import java.util.stream.Stream; - import lombok.experimental.UtilityClass; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.Version; import org.opensearch.migrations.bulkload.common.OpenSearchClient; import org.opensearch.migrations.bulkload.common.SourceRepo; @@ -16,9 +14,6 @@ import org.opensearch.migrations.bulkload.version_os_2_11.RemoteWriter_OS_2_11; import org.opensearch.migrations.bulkload.version_universal.RemoteReader; -import lombok.experimental.UtilityClass; -import lombok.extern.slf4j.Slf4j; - @Slf4j @UtilityClass public class ClusterProviderRegistry { diff --git a/RFS/src/main/java/org/opensearch/migrations/metadata/GlobalMetadataCreatorResults.java b/RFS/src/main/java/org/opensearch/migrations/metadata/GlobalMetadataCreatorResults.java index ff50810a76..cc6dd822bc 100644 --- a/RFS/src/main/java/org/opensearch/migrations/metadata/GlobalMetadataCreatorResults.java +++ b/RFS/src/main/java/org/opensearch/migrations/metadata/GlobalMetadataCreatorResults.java @@ -1,10 +1,6 @@ package org.opensearch.migrations.metadata; import java.util.List; - -import lombok.Builder; -import lombok.Data; - import lombok.Builder; import lombok.Data; diff --git a/RFS/src/main/java/org/opensearch/migrations/metadata/tracing/MetadataMigrationContexts.java b/RFS/src/main/java/org/opensearch/migrations/metadata/tracing/MetadataMigrationContexts.java index 36492260b1..87840a725e 100644 --- a/RFS/src/main/java/org/opensearch/migrations/metadata/tracing/MetadataMigrationContexts.java +++ b/RFS/src/main/java/org/opensearch/migrations/metadata/tracing/MetadataMigrationContexts.java @@ -2,7 +2,6 @@ import io.opentelemetry.api.metrics.Meter; import lombok.NonNull; - import org.opensearch.migrations.bulkload.tracing.IRfsContexts; import org.opensearch.migrations.bulkload.tracing.RfsContexts; import org.opensearch.migrations.tracing.BaseNestedSpanContext; @@ -10,9 +9,6 @@ import org.opensearch.migrations.tracing.CommonScopedMetricInstruments; import org.opensearch.migrations.tracing.IScopedInstrumentationAttributes; -import io.opentelemetry.api.metrics.Meter; -import lombok.NonNull; - public interface MetadataMigrationContexts { class ClusterMetadataContext extends BaseSpanContext implements diff --git a/RFS/src/main/java/org/opensearch/migrations/metadata/tracing/RootMetadataMigrationContext.java b/RFS/src/main/java/org/opensearch/migrations/metadata/tracing/RootMetadataMigrationContext.java index d27bba5105..f994f9c399 100644 --- a/RFS/src/main/java/org/opensearch/migrations/metadata/tracing/RootMetadataMigrationContext.java +++ b/RFS/src/main/java/org/opensearch/migrations/metadata/tracing/RootMetadataMigrationContext.java @@ -1,12 +1,9 @@ package org.opensearch.migrations.metadata.tracing; import io.opentelemetry.api.OpenTelemetry; - import org.opensearch.migrations.bulkload.tracing.BaseRootRfsContext; import org.opensearch.migrations.tracing.IContextTracker; -import io.opentelemetry.api.OpenTelemetry; - public class RootMetadataMigrationContext extends BaseRootRfsContext { public static final String SCOPE_NAME = "metadataMigration"; diff --git a/RFS/src/main/java/org/opensearch/migrations/parsing/BulkResponseParser.java b/RFS/src/main/java/org/opensearch/migrations/parsing/BulkResponseParser.java index 1774ca94ef..732eec39bb 100644 --- a/RFS/src/main/java/org/opensearch/migrations/parsing/BulkResponseParser.java +++ b/RFS/src/main/java/org/opensearch/migrations/parsing/BulkResponseParser.java @@ -1,20 +1,11 @@ package org.opensearch.migrations.parsing; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import com.fasterxml.jackson.core.JsonFactory; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonToken; -import lombok.Builder; -import lombok.Getter; -import lombok.experimental.UtilityClass; -import lombok.extern.slf4j.Slf4j; - import com.fasterxml.jackson.core.JsonFactory; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; import lombok.Builder; import lombok.Getter; import lombok.experimental.UtilityClass; diff --git a/RFS/src/main/java/org/opensearch/migrations/reindexer/FailedRequestsLogger.java b/RFS/src/main/java/org/opensearch/migrations/reindexer/FailedRequestsLogger.java index 9e8c3a6ffc..65c84e60ff 100644 --- a/RFS/src/main/java/org/opensearch/migrations/reindexer/FailedRequestsLogger.java +++ b/RFS/src/main/java/org/opensearch/migrations/reindexer/FailedRequestsLogger.java @@ -3,13 +3,9 @@ import java.util.Optional; import java.util.function.IntSupplier; import java.util.function.Supplier; - import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.bulkload.common.OpenSearchClient.OperationFailed; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class FailedRequestsLogger { diff --git a/RFS/src/main/java/org/opensearch/migrations/reindexer/tracing/DocumentMigrationContexts.java b/RFS/src/main/java/org/opensearch/migrations/reindexer/tracing/DocumentMigrationContexts.java index c925fc9d1d..c143baa777 100644 --- a/RFS/src/main/java/org/opensearch/migrations/reindexer/tracing/DocumentMigrationContexts.java +++ b/RFS/src/main/java/org/opensearch/migrations/reindexer/tracing/DocumentMigrationContexts.java @@ -2,7 +2,6 @@ import io.opentelemetry.api.metrics.Meter; import lombok.NonNull; - import org.opensearch.migrations.bulkload.tracing.IRfsContexts; import org.opensearch.migrations.bulkload.tracing.IWorkCoordinationContexts; import org.opensearch.migrations.bulkload.tracing.RfsContexts; @@ -12,9 +11,6 @@ import org.opensearch.migrations.tracing.CommonScopedMetricInstruments; import org.opensearch.migrations.tracing.IScopedInstrumentationAttributes; -import io.opentelemetry.api.metrics.Meter; -import lombok.NonNull; - public interface DocumentMigrationContexts extends IDocumentMigrationContexts { abstract class BaseDocumentMigrationContext extends BaseSpanContext { diff --git a/RFS/src/main/java/org/opensearch/migrations/reindexer/tracing/RootDocumentMigrationContext.java b/RFS/src/main/java/org/opensearch/migrations/reindexer/tracing/RootDocumentMigrationContext.java index c379140274..e5c0518fb0 100644 --- a/RFS/src/main/java/org/opensearch/migrations/reindexer/tracing/RootDocumentMigrationContext.java +++ b/RFS/src/main/java/org/opensearch/migrations/reindexer/tracing/RootDocumentMigrationContext.java @@ -2,14 +2,10 @@ import io.opentelemetry.api.OpenTelemetry; import lombok.Getter; - import org.opensearch.migrations.bulkload.tracing.BaseRootRfsContext; import org.opensearch.migrations.bulkload.tracing.RootWorkCoordinationContext; import org.opensearch.migrations.tracing.IContextTracker; -import io.opentelemetry.api.OpenTelemetry; -import lombok.Getter; - public class RootDocumentMigrationContext extends BaseRootRfsContext implements IRootDocumentMigrationContext { public static final String SCOPE_NAME = "documentMigration"; diff --git a/RFS/src/main/java/org/opensearch/migrations/snapshot/creation/tracing/CreateSnapshotContext.java b/RFS/src/main/java/org/opensearch/migrations/snapshot/creation/tracing/CreateSnapshotContext.java index d9c5cfa146..1744c1852d 100644 --- a/RFS/src/main/java/org/opensearch/migrations/snapshot/creation/tracing/CreateSnapshotContext.java +++ b/RFS/src/main/java/org/opensearch/migrations/snapshot/creation/tracing/CreateSnapshotContext.java @@ -2,16 +2,12 @@ import io.opentelemetry.api.metrics.Meter; import lombok.NonNull; - import org.opensearch.migrations.bulkload.tracing.IRfsContexts; import org.opensearch.migrations.bulkload.tracing.RfsContexts; import org.opensearch.migrations.tracing.BaseSpanContext; import org.opensearch.migrations.tracing.CommonScopedMetricInstruments; import org.opensearch.migrations.tracing.IScopedInstrumentationAttributes; -import io.opentelemetry.api.metrics.Meter; -import lombok.NonNull; - public class CreateSnapshotContext extends BaseSpanContext implements IRfsContexts.ICreateSnapshotContext { diff --git a/RFS/src/main/java/org/opensearch/migrations/snapshot/creation/tracing/RootSnapshotContext.java b/RFS/src/main/java/org/opensearch/migrations/snapshot/creation/tracing/RootSnapshotContext.java index 7016a6a59f..1cd2f240cb 100644 --- a/RFS/src/main/java/org/opensearch/migrations/snapshot/creation/tracing/RootSnapshotContext.java +++ b/RFS/src/main/java/org/opensearch/migrations/snapshot/creation/tracing/RootSnapshotContext.java @@ -1,13 +1,10 @@ package org.opensearch.migrations.snapshot.creation.tracing; import io.opentelemetry.api.OpenTelemetry; - import org.opensearch.migrations.bulkload.tracing.BaseRootRfsContext; import org.opensearch.migrations.bulkload.tracing.IRfsContexts; import org.opensearch.migrations.tracing.IContextTracker; -import io.opentelemetry.api.OpenTelemetry; - public class RootSnapshotContext extends BaseRootRfsContext implements IRootSnapshotContext { public static final String SCOPE_NAME = "snapshotCreation"; public final CreateSnapshotContext.MetricInstruments snapshotInstruments; diff --git a/RFS/src/test/java/org/opensearch/migrations/bulkload/common/ConnectionContextTest.java b/RFS/src/test/java/org/opensearch/migrations/bulkload/common/ConnectionContextTest.java index 0c01f60b39..32d76ba2e4 100644 --- a/RFS/src/test/java/org/opensearch/migrations/bulkload/common/ConnectionContextTest.java +++ b/RFS/src/test/java/org/opensearch/migrations/bulkload/common/ConnectionContextTest.java @@ -1,24 +1,17 @@ package org.opensearch.migrations.bulkload.common; -import java.util.stream.Stream; +import static org.junit.jupiter.api.Assertions.*; +import java.util.stream.Stream; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; - import org.opensearch.migrations.bulkload.common.http.BasicAuthTransformer; import org.opensearch.migrations.bulkload.common.http.ConnectionContext; import org.opensearch.migrations.bulkload.common.http.ConnectionContextTestParams; import org.opensearch.migrations.bulkload.common.http.NoAuthTransformer; import org.opensearch.migrations.bulkload.common.http.SigV4AuthTransformer; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; -import org.junit.jupiter.params.provider.MethodSource; - -import static org.junit.jupiter.api.Assertions.*; - class ConnectionContextTest { @ParameterizedTest diff --git a/RFS/src/test/java/org/opensearch/migrations/bulkload/common/DocumentReindexerTest.java b/RFS/src/test/java/org/opensearch/migrations/bulkload/common/DocumentReindexerTest.java index a362d50808..6cddb59f43 100644 --- a/RFS/src/test/java/org/opensearch/migrations/bulkload/common/DocumentReindexerTest.java +++ b/RFS/src/test/java/org/opensearch/migrations/bulkload/common/DocumentReindexerTest.java @@ -1,42 +1,30 @@ package org.opensearch.migrations.bulkload.common; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + import java.nio.charset.StandardCharsets; import java.time.Duration; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; - import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import reactor.test.StepVerifier; - import org.opensearch.migrations.bulkload.tracing.IRfsContexts; import org.opensearch.migrations.reindexer.tracing.IDocumentMigrationContexts; - -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - @Slf4j class DocumentReindexerTest { diff --git a/RFS/src/test/java/org/opensearch/migrations/bulkload/common/InvalidResponseTest.java b/RFS/src/test/java/org/opensearch/migrations/bulkload/common/InvalidResponseTest.java index 2d1986eb33..17620bf48b 100644 --- a/RFS/src/test/java/org/opensearch/migrations/bulkload/common/InvalidResponseTest.java +++ b/RFS/src/test/java/org/opensearch/migrations/bulkload/common/InvalidResponseTest.java @@ -1,17 +1,13 @@ package org.opensearch.migrations.bulkload.common; -import java.util.Map; - -import org.junit.jupiter.api.Test; - -import org.opensearch.migrations.bulkload.common.http.HttpResponse; - -import org.junit.jupiter.api.Test; - import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.empty; +import java.util.Map; +import org.junit.jupiter.api.Test; +import org.opensearch.migrations.bulkload.common.http.HttpResponse; + class InvalidResponseTest { @Test diff --git a/RFS/src/test/java/org/opensearch/migrations/bulkload/common/LuceneDocumentsReaderTest.java b/RFS/src/test/java/org/opensearch/migrations/bulkload/common/LuceneDocumentsReaderTest.java index 89fe7384d1..d5444667fe 100644 --- a/RFS/src/test/java/org/opensearch/migrations/bulkload/common/LuceneDocumentsReaderTest.java +++ b/RFS/src/test/java/org/opensearch/migrations/bulkload/common/LuceneDocumentsReaderTest.java @@ -1,5 +1,14 @@ package org.opensearch.migrations.bulkload.common; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; @@ -12,10 +21,6 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Stream; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; import lombok.extern.slf4j.Slf4j; import org.apache.lucene.document.BinaryDocValuesField; import org.apache.lucene.document.Document; @@ -31,42 +36,13 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import reactor.core.publisher.Flux; -import reactor.core.scheduler.Schedulers; -import reactor.test.StepVerifier; - import org.opensearch.migrations.Version; import org.opensearch.migrations.bulkload.models.ShardMetadata; import org.opensearch.migrations.cluster.ClusterProviderRegistry; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import lombok.extern.slf4j.Slf4j; -import org.apache.lucene.document.BinaryDocValuesField; -import org.apache.lucene.document.Document; -import org.apache.lucene.document.StoredField; -import org.apache.lucene.index.DirectoryReader; -import org.apache.lucene.index.LeafReader; -import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.util.BytesRef; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; -import org.junit.jupiter.params.provider.MethodSource; import reactor.core.publisher.Flux; import reactor.core.scheduler.Schedulers; import reactor.test.StepVerifier; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.mockito.ArgumentMatchers.anyInt; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - @Slf4j public class LuceneDocumentsReaderTest { private static final ObjectMapper objectMapper = new ObjectMapper(); diff --git a/RFS/src/test/java/org/opensearch/migrations/bulkload/common/OpenSearchClientTest.java b/RFS/src/test/java/org/opensearch/migrations/bulkload/common/OpenSearchClientTest.java index afb384155d..1c97b92972 100644 --- a/RFS/src/test/java/org/opensearch/migrations/bulkload/common/OpenSearchClientTest.java +++ b/RFS/src/test/java/org/opensearch/migrations/bulkload/common/OpenSearchClientTest.java @@ -1,21 +1,36 @@ package org.opensearch.migrations.bulkload.common; -import java.time.Duration; -import java.util.List; -import java.util.Map; -import java.util.Optional; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoInteractions; +import static org.mockito.Mockito.verifyNoMoreInteractions; +import static org.mockito.Mockito.when; +import static org.opensearch.migrations.bulkload.http.BulkRequestGenerator.itemEntry; +import static org.opensearch.migrations.bulkload.http.BulkRequestGenerator.itemEntryFailure; import com.fasterxml.jackson.core.StreamReadFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.databind.node.ObjectNode; +import java.time.Duration; +import java.util.List; +import java.util.Map; +import java.util.Optional; import lombok.SneakyThrows; import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; -import reactor.core.publisher.Mono; -import reactor.util.retry.Retry; - import org.opensearch.migrations.Version; import org.opensearch.migrations.bulkload.common.DocumentReindexer.BulkDocSection; import org.opensearch.migrations.bulkload.common.http.HttpResponse; @@ -24,37 +39,9 @@ import org.opensearch.migrations.bulkload.tracing.IRfsContexts; import org.opensearch.migrations.bulkload.tracing.IRfsContexts.ICheckedIdempotentPutRequestContext; import org.opensearch.migrations.reindexer.FailedRequestsLogger; - -import com.fasterxml.jackson.core.StreamReadFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.json.JsonMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; -import lombok.SneakyThrows; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; import reactor.core.publisher.Mono; import reactor.util.retry.Retry; -import static org.opensearch.migrations.bulkload.http.BulkRequestGenerator.itemEntry; -import static org.opensearch.migrations.bulkload.http.BulkRequestGenerator.itemEntryFailure; -import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.not; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyNoInteractions; -import static org.mockito.Mockito.verifyNoMoreInteractions; -import static org.mockito.Mockito.when; - class OpenSearchClientTest { private static final ObjectMapper OBJECT_MAPPER = JsonMapper.builder() .enable(StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION) diff --git a/RFS/src/test/java/org/opensearch/migrations/bulkload/common/RestClientTest.java b/RFS/src/test/java/org/opensearch/migrations/bulkload/common/RestClientTest.java index c0e3beb1b6..3d7905d4c1 100644 --- a/RFS/src/test/java/org/opensearch/migrations/bulkload/common/RestClientTest.java +++ b/RFS/src/test/java/org/opensearch/migrations/bulkload/common/RestClientTest.java @@ -1,29 +1,20 @@ package org.opensearch.migrations.bulkload.common; +import io.opentelemetry.sdk.trace.data.SpanData; import java.nio.charset.StandardCharsets; import java.util.Comparator; import java.util.List; import java.util.Map; import java.util.stream.Collectors; - -import io.opentelemetry.sdk.trace.data.SpanData; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; -import reactor.netty.http.client.HttpClient; -import reactor.netty.resources.ConnectionProvider; - import org.opensearch.migrations.bulkload.common.http.ConnectionContextTestParams; import org.opensearch.migrations.bulkload.tracing.RfsContexts; import org.opensearch.migrations.snapshot.creation.tracing.SnapshotTestContext; import org.opensearch.migrations.testutils.HttpRequest; import org.opensearch.migrations.testutils.SimpleHttpResponse; import org.opensearch.migrations.testutils.SimpleNettyHttpServer; - -import io.opentelemetry.sdk.trace.data.SpanData; -import org.hamcrest.MatcherAssert; -import org.hamcrest.Matchers; -import org.junit.jupiter.api.Test; import reactor.netty.http.client.HttpClient; import reactor.netty.resources.ConnectionProvider; diff --git a/RFS/src/test/java/org/opensearch/migrations/bulkload/common/S3RepoTest.java b/RFS/src/test/java/org/opensearch/migrations/bulkload/common/S3RepoTest.java index 34a9bc1f48..f025925551 100644 --- a/RFS/src/test/java/org/opensearch/migrations/bulkload/common/S3RepoTest.java +++ b/RFS/src/test/java/org/opensearch/migrations/bulkload/common/S3RepoTest.java @@ -1,32 +1,25 @@ package org.opensearch.migrations.bulkload.common; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.*; + import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; import java.util.concurrent.CompletableFuture; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.junit.jupiter.MockitoExtension; -import software.amazon.awssdk.core.async.AsyncResponseTransformer; -import software.amazon.awssdk.services.s3.S3AsyncClient; -import software.amazon.awssdk.services.s3.model.GetObjectRequest; -import software.amazon.awssdk.services.s3.model.GetObjectResponse; -import software.amazon.awssdk.services.s3.model.ListObjectsV2Request; -import software.amazon.awssdk.services.s3.model.ListObjectsV2Response; - import org.opensearch.migrations.bulkload.common.S3Repo.CannotFindSnapshotRepoRoot; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.junit.jupiter.MockitoExtension; import software.amazon.awssdk.core.async.AsyncResponseTransformer; import software.amazon.awssdk.services.s3.S3AsyncClient; import software.amazon.awssdk.services.s3.model.GetObjectRequest; @@ -34,14 +27,6 @@ import software.amazon.awssdk.services.s3.model.ListObjectsV2Request; import software.amazon.awssdk.services.s3.model.ListObjectsV2Response; -import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.*; - @ExtendWith(MockitoExtension.class) public class S3RepoTest { @Mock diff --git a/RFS/src/test/java/org/opensearch/migrations/bulkload/common/S3UriTest.java b/RFS/src/test/java/org/opensearch/migrations/bulkload/common/S3UriTest.java index 61121e14e6..07479e6b5f 100644 --- a/RFS/src/test/java/org/opensearch/migrations/bulkload/common/S3UriTest.java +++ b/RFS/src/test/java/org/opensearch/migrations/bulkload/common/S3UriTest.java @@ -1,17 +1,12 @@ package org.opensearch.migrations.bulkload.common; -import java.util.stream.Stream; - -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; -import org.junit.jupiter.params.provider.MethodSource; +import static org.junit.jupiter.api.Assertions.assertEquals; +import java.util.stream.Stream; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import static org.junit.jupiter.api.Assertions.assertEquals; - public class S3UriTest { static Stream provideUris() { return Stream.of( diff --git a/RFS/src/test/java/org/opensearch/migrations/bulkload/common/TestResources.java b/RFS/src/test/java/org/opensearch/migrations/bulkload/common/TestResources.java index 5a3f9852a9..9d56141923 100644 --- a/RFS/src/test/java/org/opensearch/migrations/bulkload/common/TestResources.java +++ b/RFS/src/test/java/org/opensearch/migrations/bulkload/common/TestResources.java @@ -2,9 +2,6 @@ import java.nio.file.Path; import java.nio.file.Paths; - -import lombok.RequiredArgsConstructor; - import lombok.RequiredArgsConstructor; public class TestResources { diff --git a/RFS/src/test/java/org/opensearch/migrations/bulkload/common/http/CompositeTransformerTest.java b/RFS/src/test/java/org/opensearch/migrations/bulkload/common/http/CompositeTransformerTest.java index 7f0019fc78..ef41efc658 100644 --- a/RFS/src/test/java/org/opensearch/migrations/bulkload/common/http/CompositeTransformerTest.java +++ b/RFS/src/test/java/org/opensearch/migrations/bulkload/common/http/CompositeTransformerTest.java @@ -1,21 +1,15 @@ package org.opensearch.migrations.bulkload.common.http; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; + import java.nio.ByteBuffer; import java.util.Collections; - -import org.junit.jupiter.api.Test; -import org.mockito.Mockito; -import reactor.core.publisher.Mono; -import reactor.test.StepVerifier; - import org.junit.jupiter.api.Test; import org.mockito.Mockito; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.when; - public class CompositeTransformerTest { @Test diff --git a/RFS/src/test/java/org/opensearch/migrations/bulkload/common/http/GzipPayloadRequestTransformerTest.java b/RFS/src/test/java/org/opensearch/migrations/bulkload/common/http/GzipPayloadRequestTransformerTest.java index fbb1c19ea7..28496ac257 100644 --- a/RFS/src/test/java/org/opensearch/migrations/bulkload/common/http/GzipPayloadRequestTransformerTest.java +++ b/RFS/src/test/java/org/opensearch/migrations/bulkload/common/http/GzipPayloadRequestTransformerTest.java @@ -1,5 +1,11 @@ package org.opensearch.migrations.bulkload.common.http; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.nio.ByteBuffer; @@ -9,25 +15,12 @@ import java.util.Random; import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; import reactor.core.publisher.Mono; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.ValueSource; -import reactor.core.publisher.Mono; - -import static org.junit.jupiter.api.Assertions.assertArrayEquals; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertTrue; - class GzipPayloadRequestTransformerTest { private static final int RANDOM_SEED = 42; // Fixed seed for reproducibility diff --git a/RFS/src/test/java/org/opensearch/migrations/bulkload/common/http/SigV4AuthTransformerTest.java b/RFS/src/test/java/org/opensearch/migrations/bulkload/common/http/SigV4AuthTransformerTest.java index 97b333ed2d..3a3d9b255e 100644 --- a/RFS/src/test/java/org/opensearch/migrations/bulkload/common/http/SigV4AuthTransformerTest.java +++ b/RFS/src/test/java/org/opensearch/migrations/bulkload/common/http/SigV4AuthTransformerTest.java @@ -1,5 +1,10 @@ package org.opensearch.migrations.bulkload.common.http; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.security.MessageDigest; @@ -9,7 +14,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; - import lombok.SneakyThrows; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -18,19 +22,6 @@ import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; -import lombok.SneakyThrows; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; -import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; -import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; -import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertTrue; - public class SigV4AuthTransformerTest { private SigV4AuthTransformer transformer; diff --git a/RFS/src/test/java/org/opensearch/migrations/bulkload/framework/SimpleRestoreFromSnapshot.java b/RFS/src/test/java/org/opensearch/migrations/bulkload/framework/SimpleRestoreFromSnapshot.java index 2d3867465d..201e4c5244 100644 --- a/RFS/src/test/java/org/opensearch/migrations/bulkload/framework/SimpleRestoreFromSnapshot.java +++ b/RFS/src/test/java/org/opensearch/migrations/bulkload/framework/SimpleRestoreFromSnapshot.java @@ -2,7 +2,6 @@ import java.nio.file.Path; import java.util.List; - import org.opensearch.migrations.bulkload.common.OpenSearchClient; import org.opensearch.migrations.bulkload.common.http.ConnectionContextTestParams; import org.opensearch.migrations.bulkload.models.IndexMetadata; diff --git a/RFS/src/test/java/org/opensearch/migrations/bulkload/framework/SimpleRestoreFromSnapshot_ES_7_10.java b/RFS/src/test/java/org/opensearch/migrations/bulkload/framework/SimpleRestoreFromSnapshot_ES_7_10.java index ce10bce867..31bcddd3b1 100644 --- a/RFS/src/test/java/org/opensearch/migrations/bulkload/framework/SimpleRestoreFromSnapshot_ES_7_10.java +++ b/RFS/src/test/java/org/opensearch/migrations/bulkload/framework/SimpleRestoreFromSnapshot_ES_7_10.java @@ -3,11 +3,9 @@ import java.nio.file.Path; import java.util.List; import java.util.stream.Collectors; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.lucene.util.IOUtils; - import org.opensearch.migrations.bulkload.common.DefaultSourceRepoAccessor; import org.opensearch.migrations.bulkload.common.DocumentReindexer; import org.opensearch.migrations.bulkload.common.FileSystemRepo; @@ -22,10 +20,6 @@ import org.opensearch.migrations.bulkload.version_es_7_10.SnapshotRepoProvider_ES_7_10; import org.opensearch.migrations.reindexer.tracing.IDocumentMigrationContexts; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.apache.lucene.util.IOUtils; - /** * Simplified version of RFS for use in testing - ES 7.10 version. */ diff --git a/RFS/src/test/java/org/opensearch/migrations/bulkload/integration/SnapshotStateTest.java b/RFS/src/test/java/org/opensearch/migrations/bulkload/integration/SnapshotStateTest.java index 545504e0b0..c2b314e7cc 100644 --- a/RFS/src/test/java/org/opensearch/migrations/bulkload/integration/SnapshotStateTest.java +++ b/RFS/src/test/java/org/opensearch/migrations/bulkload/integration/SnapshotStateTest.java @@ -1,43 +1,34 @@ package org.opensearch.migrations.bulkload.integration; +import static org.hamcrest.CoreMatchers.allOf; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoMoreInteractions; +import static org.mockito.Mockito.when; + import java.io.File; import java.nio.file.Path; import java.util.List; - import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.mockito.ArgumentCaptor; -import reactor.core.publisher.Mono; - import org.opensearch.migrations.bulkload.common.DocumentReindexer.BulkDocSection; import org.opensearch.migrations.bulkload.common.OpenSearchClient; import org.opensearch.migrations.bulkload.framework.SearchClusterContainer; import org.opensearch.migrations.bulkload.framework.SimpleRestoreFromSnapshot_ES_7_10; import org.opensearch.migrations.bulkload.http.ClusterOperations; import org.opensearch.migrations.reindexer.tracing.DocumentMigrationTestContext; - -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; -import org.mockito.ArgumentCaptor; import reactor.core.publisher.Mono; -import static org.hamcrest.CoreMatchers.allOf; -import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.not; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyNoMoreInteractions; -import static org.mockito.Mockito.when; - /** * Tests focused on setting up different snapshot states and then verifying the behavior of RFS towards the target cluster * This should move to the CreateSnapshot project diff --git a/RFS/src/test/java/org/opensearch/migrations/bulkload/integration/WorkerCompleteAfterErrorTest.java b/RFS/src/test/java/org/opensearch/migrations/bulkload/integration/WorkerCompleteAfterErrorTest.java index 51697371e2..c7141cf6dd 100644 --- a/RFS/src/test/java/org/opensearch/migrations/bulkload/integration/WorkerCompleteAfterErrorTest.java +++ b/RFS/src/test/java/org/opensearch/migrations/bulkload/integration/WorkerCompleteAfterErrorTest.java @@ -5,11 +5,6 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; - /** * Test case to verify worker will not deadlock and complete all work given failures * during critical migration workflows. diff --git a/RFS/src/test/java/org/opensearch/migrations/bulkload/transformers/TransformFunctionsTest.java b/RFS/src/test/java/org/opensearch/migrations/bulkload/transformers/TransformFunctionsTest.java index 95c2cf93a5..fca1101eb8 100644 --- a/RFS/src/test/java/org/opensearch/migrations/bulkload/transformers/TransformFunctionsTest.java +++ b/RFS/src/test/java/org/opensearch/migrations/bulkload/transformers/TransformFunctionsTest.java @@ -1,10 +1,6 @@ package org.opensearch.migrations.bulkload.transformers; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ArrayNode; @@ -12,8 +8,6 @@ import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; - @Slf4j public class TransformFunctionsTest { diff --git a/RFS/src/test/java/org/opensearch/migrations/bulkload/transformers/Transformer_ES_7_10_OS_2_11Test.java b/RFS/src/test/java/org/opensearch/migrations/bulkload/transformers/Transformer_ES_7_10_OS_2_11Test.java index 94e287914e..0f59d2aa7f 100644 --- a/RFS/src/test/java/org/opensearch/migrations/bulkload/transformers/Transformer_ES_7_10_OS_2_11Test.java +++ b/RFS/src/test/java/org/opensearch/migrations/bulkload/transformers/Transformer_ES_7_10_OS_2_11Test.java @@ -1,9 +1,10 @@ package org.opensearch.migrations.bulkload.transformers; +import static org.junit.jupiter.api.Assertions.assertEquals; + import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.Version; import org.opensearch.migrations.bulkload.common.FileSystemRepo; import org.opensearch.migrations.bulkload.common.TestResources; @@ -13,11 +14,6 @@ import org.opensearch.migrations.bulkload.version_os_2_11.IndexMetadataData_OS_2_11; import org.opensearch.migrations.cluster.ClusterProviderRegistry; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertEquals; - @Slf4j public class Transformer_ES_7_10_OS_2_11Test { @Test diff --git a/RFS/src/test/java/org/opensearch/migrations/bulkload/version_es_7_10/SnapshotRepoData_ES_7_10Test.java b/RFS/src/test/java/org/opensearch/migrations/bulkload/version_es_7_10/SnapshotRepoData_ES_7_10Test.java index c7bd7df66d..fa7e873092 100644 --- a/RFS/src/test/java/org/opensearch/migrations/bulkload/version_es_7_10/SnapshotRepoData_ES_7_10Test.java +++ b/RFS/src/test/java/org/opensearch/migrations/bulkload/version_es_7_10/SnapshotRepoData_ES_7_10Test.java @@ -1,17 +1,14 @@ package org.opensearch.migrations.bulkload.version_es_7_10; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.MatcherAssert.assertThat; + import java.io.File; import java.io.FileOutputStream; import java.io.PrintWriter; import java.nio.file.Path; - import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.MatcherAssert.assertThat; - public class SnapshotRepoData_ES_7_10Test { private final String basicSnapshotJson = " {\n" + // diff --git a/RFS/src/test/java/org/opensearch/migrations/bulkload/version_os_2_11/IndexCreator_OS_2_11Test.java b/RFS/src/test/java/org/opensearch/migrations/bulkload/version_os_2_11/IndexCreator_OS_2_11Test.java index ac271ea817..8dabf55bcd 100644 --- a/RFS/src/test/java/org/opensearch/migrations/bulkload/version_os_2_11/IndexCreator_OS_2_11Test.java +++ b/RFS/src/test/java/org/opensearch/migrations/bulkload/version_os_2_11/IndexCreator_OS_2_11Test.java @@ -1,40 +1,30 @@ package org.opensearch.migrations.bulkload.version_os_2_11; -import java.util.Optional; -import java.util.Set; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; import com.fasterxml.jackson.core.StreamReadFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.Optional; +import java.util.Set; import lombok.SneakyThrows; import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; - import org.opensearch.migrations.MigrationMode; import org.opensearch.migrations.bulkload.common.InvalidResponse; import org.opensearch.migrations.bulkload.common.OpenSearchClient; import org.opensearch.migrations.metadata.tracing.IMetadataMigrationContexts.ICreateIndexContext; -import com.fasterxml.jackson.core.StreamReadFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.json.JsonMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; -import lombok.SneakyThrows; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; - -import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.not; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - class IndexCreator_OS_2_11Test { private static final ObjectMapper OBJECT_MAPPER = JsonMapper.builder() .enable(StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION) diff --git a/RFS/src/test/java/org/opensearch/migrations/bulkload/workcoordination/OpenSearchWorkCoodinatorTest.java b/RFS/src/test/java/org/opensearch/migrations/bulkload/workcoordination/OpenSearchWorkCoodinatorTest.java index c98ec2f8f8..27ff6e13d0 100644 --- a/RFS/src/test/java/org/opensearch/migrations/bulkload/workcoordination/OpenSearchWorkCoodinatorTest.java +++ b/RFS/src/test/java/org/opensearch/migrations/bulkload/workcoordination/OpenSearchWorkCoodinatorTest.java @@ -7,7 +7,6 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; import java.util.stream.Stream; - import lombok.AllArgsConstructor; import lombok.Getter; import lombok.extern.slf4j.Slf4j; @@ -16,20 +15,8 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import org.testcontainers.shaded.com.fasterxml.jackson.core.JsonProcessingException; -import org.testcontainers.shaded.com.fasterxml.jackson.databind.ObjectMapper; - import org.opensearch.migrations.bulkload.workcoordination.OpenSearchWorkCoordinator.DocumentModificationResult; import org.opensearch.migrations.testutils.CloseableLogSetup; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; -import org.junit.jupiter.params.provider.MethodSource; import org.testcontainers.shaded.com.fasterxml.jackson.core.JsonProcessingException; import org.testcontainers.shaded.com.fasterxml.jackson.databind.ObjectMapper; diff --git a/RFS/src/test/java/org/opensearch/migrations/bulkload/workcoordination/WorkCoordinatorErrantAcquisitonsRetryTest.java b/RFS/src/test/java/org/opensearch/migrations/bulkload/workcoordination/WorkCoordinatorErrantAcquisitonsRetryTest.java index c0af99e8ea..f3e2baabb7 100644 --- a/RFS/src/test/java/org/opensearch/migrations/bulkload/workcoordination/WorkCoordinatorErrantAcquisitonsRetryTest.java +++ b/RFS/src/test/java/org/opensearch/migrations/bulkload/workcoordination/WorkCoordinatorErrantAcquisitonsRetryTest.java @@ -5,7 +5,6 @@ import java.util.Map; import java.util.function.Function; import java.util.stream.Stream; - import lombok.NonNull; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; @@ -13,22 +12,12 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import org.slf4j.MDC; - import org.opensearch.migrations.bulkload.common.http.ConnectionContextTestParams; import org.opensearch.migrations.testutils.HttpRequest; import org.opensearch.migrations.testutils.SimpleHttpResponse; import org.opensearch.migrations.testutils.SimpleNettyHttpServer; import org.opensearch.migrations.tracing.InMemoryInstrumentationBundle; import org.opensearch.migrations.workcoordination.tracing.WorkCoordinationTestContext; - -import lombok.NonNull; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; -import org.junit.jupiter.params.provider.MethodSource; import org.slf4j.MDC; public class WorkCoordinatorErrantAcquisitonsRetryTest { diff --git a/RFS/src/test/java/org/opensearch/migrations/bulkload/workcoordination/WorkCoordinatorTest.java b/RFS/src/test/java/org/opensearch/migrations/bulkload/workcoordination/WorkCoordinatorTest.java index 373b04c5f5..c1e43263b7 100644 --- a/RFS/src/test/java/org/opensearch/migrations/bulkload/workcoordination/WorkCoordinatorTest.java +++ b/RFS/src/test/java/org/opensearch/migrations/bulkload/workcoordination/WorkCoordinatorTest.java @@ -1,5 +1,7 @@ package org.opensearch.migrations.bulkload.workcoordination; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; import java.time.Duration; import java.util.ArrayList; @@ -8,30 +10,17 @@ import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Supplier; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.bulkload.common.http.ConnectionContextTestParams; import org.opensearch.migrations.bulkload.framework.SearchClusterContainer; import org.opensearch.migrations.tracing.InMemoryInstrumentationBundle; import org.opensearch.migrations.workcoordination.tracing.WorkCoordinationTestContext; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; - /** * The contract here is that the first request in will acquire a lease for the duration that was requested. * diff --git a/RFS/src/test/java/org/opensearch/migrations/parsing/BulkResponseParserTest.java b/RFS/src/test/java/org/opensearch/migrations/parsing/BulkResponseParserTest.java index d174802204..447eb68333 100644 --- a/RFS/src/test/java/org/opensearch/migrations/parsing/BulkResponseParserTest.java +++ b/RFS/src/test/java/org/opensearch/migrations/parsing/BulkResponseParserTest.java @@ -1,23 +1,18 @@ package org.opensearch.migrations.parsing; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.empty; +import static org.opensearch.migrations.bulkload.http.BulkRequestGenerator.itemEntry; +import static org.opensearch.migrations.bulkload.http.BulkRequestGenerator.itemEntryFailure; + import java.io.IOException; import java.util.List; import java.util.stream.Collectors; - import org.junit.jupiter.api.Test; -import org.testcontainers.shaded.com.google.common.collect.Streams; - import org.opensearch.migrations.bulkload.http.BulkRequestGenerator; - -import org.junit.jupiter.api.Test; import org.testcontainers.shaded.com.google.common.collect.Streams; -import static org.opensearch.migrations.bulkload.http.BulkRequestGenerator.itemEntry; -import static org.opensearch.migrations.bulkload.http.BulkRequestGenerator.itemEntryFailure; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.empty; - class BulkResponseParserTest { @Test diff --git a/RFS/src/test/java/org/opensearch/migrations/parsing/JacksonParserVsReadObjectBenchmark.java b/RFS/src/test/java/org/opensearch/migrations/parsing/JacksonParserVsReadObjectBenchmark.java index 970e7e74c1..0b0f0f4a22 100644 --- a/RFS/src/test/java/org/opensearch/migrations/parsing/JacksonParserVsReadObjectBenchmark.java +++ b/RFS/src/test/java/org/opensearch/migrations/parsing/JacksonParserVsReadObjectBenchmark.java @@ -1,40 +1,27 @@ package org.opensearch.migrations.parsing; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.hasSize; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.StreamReadFeature; +import com.fasterxml.jackson.databind.json.JsonMapper; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Random; import java.util.UUID; import java.util.stream.Collectors; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.StreamReadFeature; -import com.fasterxml.jackson.databind.json.JsonMapper; import org.junit.jupiter.api.Test; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Measurement; import org.openjdk.jmh.annotations.Mode; import org.openjdk.jmh.annotations.Warmup; - import org.opensearch.migrations.bulkload.http.BulkRequestGenerator; import org.opensearch.migrations.bulkload.http.BulkRequestGenerator.BulkItemResponseEntry; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.core.StreamReadFeature; -import com.fasterxml.jackson.databind.json.JsonMapper; -import org.junit.jupiter.api.Test; -import org.openjdk.jmh.annotations.Benchmark; -import org.openjdk.jmh.annotations.BenchmarkMode; -import org.openjdk.jmh.annotations.Measurement; -import org.openjdk.jmh.annotations.Mode; -import org.openjdk.jmh.annotations.Warmup; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.hasSize; - public class JacksonParserVsReadObjectBenchmark { private static final String bulkResponse; diff --git a/RFS/src/test/java/org/opensearch/migrations/reindexer/FailedRequestsLoggerTest.java b/RFS/src/test/java/org/opensearch/migrations/reindexer/FailedRequestsLoggerTest.java index 03d983906d..98c0e6b78d 100644 --- a/RFS/src/test/java/org/opensearch/migrations/reindexer/FailedRequestsLoggerTest.java +++ b/RFS/src/test/java/org/opensearch/migrations/reindexer/FailedRequestsLoggerTest.java @@ -1,19 +1,16 @@ package org.opensearch.migrations.reindexer; -import org.junit.jupiter.api.Test; - -import org.opensearch.migrations.bulkload.common.OpenSearchClient.OperationFailed; -import org.opensearch.migrations.bulkload.common.http.HttpResponse; -import org.opensearch.migrations.testutils.CloseableLogSetup; - -import org.junit.jupiter.api.Test; - import static org.hamcrest.CoreMatchers.allOf; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.hasItem; import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.MatcherAssert.assertThat; +import org.junit.jupiter.api.Test; +import org.opensearch.migrations.bulkload.common.OpenSearchClient.OperationFailed; +import org.opensearch.migrations.bulkload.common.http.HttpResponse; +import org.opensearch.migrations.testutils.CloseableLogSetup; + class FailedRequestsLoggerTest { @Test void testLogBulkFailure_withNoBody() { diff --git a/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/common/http/ConnectionContextTestParams.java b/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/common/http/ConnectionContextTestParams.java index 31e5247928..62f00c6f60 100644 --- a/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/common/http/ConnectionContextTestParams.java +++ b/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/common/http/ConnectionContextTestParams.java @@ -3,9 +3,6 @@ import lombok.Builder; import lombok.Getter; -import lombok.Builder; -import lombok.Getter; - @Builder @Getter public class ConnectionContextTestParams implements ConnectionContext.IParams { diff --git a/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/framework/PreloadedDataContainerOrchestrator.java b/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/framework/PreloadedDataContainerOrchestrator.java index 58905f7a44..7a6dd0c40f 100644 --- a/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/framework/PreloadedDataContainerOrchestrator.java +++ b/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/framework/PreloadedDataContainerOrchestrator.java @@ -1,5 +1,14 @@ package org.opensearch.migrations.bulkload.framework; +import com.github.dockerjava.api.DockerClient; +import com.github.dockerjava.api.command.PullImageResultCallback; +import com.github.dockerjava.api.command.WaitContainerResultCallback; +import com.github.dockerjava.api.model.Image; +import com.github.dockerjava.core.DefaultDockerClientConfig; +import com.github.dockerjava.core.DockerClientImpl; +import com.github.dockerjava.core.command.ExecStartResultCallback; +import com.github.dockerjava.httpclient5.ApacheDockerHttpClient; +import com.google.common.collect.Streams; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.time.Duration; @@ -10,35 +19,6 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import java.util.stream.Stream; - -import com.github.dockerjava.api.DockerClient; -import com.github.dockerjava.api.command.PullImageResultCallback; -import com.github.dockerjava.api.command.WaitContainerResultCallback; -import com.github.dockerjava.api.model.Image; -import com.github.dockerjava.core.DefaultDockerClientConfig; -import com.github.dockerjava.core.DockerClientImpl; -import com.github.dockerjava.core.command.ExecStartResultCallback; -import com.github.dockerjava.httpclient5.ApacheDockerHttpClient; -import com.google.common.collect.Streams; -import lombok.AllArgsConstructor; -import lombok.EqualsAndHashCode; -import lombok.extern.slf4j.Slf4j; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.HttpClients; -import org.jetbrains.annotations.NotNull; -import org.testcontainers.containers.GenericContainer; -import org.testcontainers.containers.Network; - -import com.github.dockerjava.api.DockerClient; -import com.github.dockerjava.api.command.PullImageResultCallback; -import com.github.dockerjava.api.command.WaitContainerResultCallback; -import com.github.dockerjava.api.model.Image; -import com.github.dockerjava.core.DefaultDockerClientConfig; -import com.github.dockerjava.core.DockerClientImpl; -import com.github.dockerjava.core.command.ExecStartResultCallback; -import com.github.dockerjava.httpclient5.ApacheDockerHttpClient; -import com.google.common.collect.Streams; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.extern.slf4j.Slf4j; diff --git a/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/framework/SearchClusterContainer.java b/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/framework/SearchClusterContainer.java index e8b0733654..a180d5816b 100644 --- a/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/framework/SearchClusterContainer.java +++ b/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/framework/SearchClusterContainer.java @@ -1,25 +1,14 @@ package org.opensearch.migrations.bulkload.framework; +import com.google.common.collect.ImmutableMap; import java.io.File; import java.time.Duration; import java.util.Map; - -import com.google.common.collect.ImmutableMap; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.ToString; import lombok.extern.slf4j.Slf4j; -import org.testcontainers.containers.GenericContainer; -import org.testcontainers.containers.wait.strategy.Wait; -import org.testcontainers.utility.DockerImageName; - import org.opensearch.migrations.Version; - -import com.google.common.collect.ImmutableMap; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.ToString; -import lombok.extern.slf4j.Slf4j; import org.testcontainers.containers.GenericContainer; import org.testcontainers.containers.wait.strategy.Wait; import org.testcontainers.utility.DockerImageName; diff --git a/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/framework/tracing/TrackingTestContextCreator.java b/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/framework/tracing/TrackingTestContextCreator.java index 27b7e9deaf..069e26bbff 100644 --- a/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/framework/tracing/TrackingTestContextCreator.java +++ b/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/framework/tracing/TrackingTestContextCreator.java @@ -1,7 +1,6 @@ package org.opensearch.migrations.bulkload.framework.tracing; import java.util.function.BiFunction; - import org.opensearch.migrations.tracing.BacktracingContextTracker; import org.opensearch.migrations.tracing.CompositeContextTracker; import org.opensearch.migrations.tracing.IContextTracker; diff --git a/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/framework/tracing/TrackingTestContextFactory.java b/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/framework/tracing/TrackingTestContextFactory.java index 7a23857d1e..c77f415020 100644 --- a/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/framework/tracing/TrackingTestContextFactory.java +++ b/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/framework/tracing/TrackingTestContextFactory.java @@ -1,18 +1,12 @@ package org.opensearch.migrations.bulkload.framework.tracing; import java.util.function.BiFunction; - import lombok.AllArgsConstructor; import lombok.Lombok; import lombok.SneakyThrows; - import org.opensearch.migrations.tracing.IContextTracker; import org.opensearch.migrations.tracing.InMemoryInstrumentationBundle; -import lombok.AllArgsConstructor; -import lombok.Lombok; -import lombok.SneakyThrows; - @AllArgsConstructor public class TrackingTestContextFactory extends TrackingTestContextCreator { diff --git a/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/http/BulkRequestGenerator.java b/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/http/BulkRequestGenerator.java index e51c653acc..59805d8858 100644 --- a/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/http/BulkRequestGenerator.java +++ b/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/http/BulkRequestGenerator.java @@ -2,9 +2,6 @@ import java.util.List; import java.util.stream.Collectors; - -import lombok.Builder; - import lombok.Builder; public class BulkRequestGenerator { diff --git a/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/http/ClusterOperations.java b/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/http/ClusterOperations.java index d1f9ba7e11..c2c0c802df 100644 --- a/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/http/ClusterOperations.java +++ b/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/http/ClusterOperations.java @@ -1,9 +1,12 @@ package org.opensearch.migrations.bulkload.http; +import static org.hamcrest.CoreMatchers.anyOf; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.MatcherAssert.assertThat; + import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.Map; - import lombok.SneakyThrows; import org.apache.hc.client5.http.classic.methods.HttpDelete; import org.apache.hc.client5.http.classic.methods.HttpGet; @@ -14,20 +17,6 @@ import org.apache.hc.core5.http.io.entity.EntityUtils; import org.apache.hc.core5.http.io.entity.StringEntity; -import lombok.SneakyThrows; -import org.apache.hc.client5.http.classic.methods.HttpDelete; -import org.apache.hc.client5.http.classic.methods.HttpGet; -import org.apache.hc.client5.http.classic.methods.HttpPost; -import org.apache.hc.client5.http.classic.methods.HttpPut; -import org.apache.hc.client5.http.impl.classic.CloseableHttpClient; -import org.apache.hc.client5.http.impl.classic.HttpClients; -import org.apache.hc.core5.http.io.entity.EntityUtils; -import org.apache.hc.core5.http.io.entity.StringEntity; - -import static org.hamcrest.CoreMatchers.anyOf; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.MatcherAssert.assertThat; - /** * Operations to perform on a cluster with basic builtin success validation */ diff --git a/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/http/SearchClusterRequests.java b/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/http/SearchClusterRequests.java index ee0ad27169..82f1a59765 100644 --- a/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/http/SearchClusterRequests.java +++ b/RFS/src/testFixtures/java/org/opensearch/migrations/bulkload/http/SearchClusterRequests.java @@ -1,22 +1,17 @@ package org.opensearch.migrations.bulkload.http; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.equalTo; + +import com.fasterxml.jackson.databind.ObjectMapper; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.stream.Collectors; - -import com.fasterxml.jackson.databind.ObjectMapper; import lombok.SneakyThrows; - import org.opensearch.migrations.bulkload.common.RestClient; import org.opensearch.migrations.reindexer.tracing.DocumentMigrationTestContext; -import com.fasterxml.jackson.databind.ObjectMapper; -import lombok.SneakyThrows; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.equalTo; - public class SearchClusterRequests { private final ObjectMapper mapper = new ObjectMapper(); diff --git a/TrafficCapture/captureKafkaOffloader/src/main/java/org/opensearch/migrations/trafficcapture/kafkaoffloader/KafkaCaptureFactory.java b/TrafficCapture/captureKafkaOffloader/src/main/java/org/opensearch/migrations/trafficcapture/kafkaoffloader/KafkaCaptureFactory.java index af8a364a01..ee1875bb24 100644 --- a/TrafficCapture/captureKafkaOffloader/src/main/java/org/opensearch/migrations/trafficcapture/kafkaoffloader/KafkaCaptureFactory.java +++ b/TrafficCapture/captureKafkaOffloader/src/main/java/org/opensearch/migrations/trafficcapture/kafkaoffloader/KafkaCaptureFactory.java @@ -1,19 +1,17 @@ package org.opensearch.migrations.trafficcapture.kafkaoffloader; +import com.google.protobuf.CodedOutputStream; import java.nio.ByteBuffer; import java.time.Instant; import java.util.Arrays; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ForkJoinPool; - -import com.google.protobuf.CodedOutputStream; import lombok.AllArgsConstructor; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; import org.apache.kafka.clients.producer.Producer; import org.apache.kafka.clients.producer.ProducerRecord; import org.apache.kafka.clients.producer.RecordMetadata; - import org.opensearch.migrations.tracing.commoncontexts.IConnectionContext; import org.opensearch.migrations.trafficcapture.CodedOutputStreamHolder; import org.opensearch.migrations.trafficcapture.IChannelConnectionCaptureSerializer; @@ -22,14 +20,6 @@ import org.opensearch.migrations.trafficcapture.StreamChannelConnectionCaptureSerializer; import org.opensearch.migrations.trafficcapture.kafkaoffloader.tracing.IRootKafkaOffloaderContext; -import com.google.protobuf.CodedOutputStream; -import lombok.AllArgsConstructor; -import lombok.NonNull; -import lombok.extern.slf4j.Slf4j; -import org.apache.kafka.clients.producer.Producer; -import org.apache.kafka.clients.producer.ProducerRecord; -import org.apache.kafka.clients.producer.RecordMetadata; - @Slf4j public class KafkaCaptureFactory implements IConnectionCaptureFactory { diff --git a/TrafficCapture/captureKafkaOffloader/src/main/java/org/opensearch/migrations/trafficcapture/kafkaoffloader/tracing/KafkaRecordContext.java b/TrafficCapture/captureKafkaOffloader/src/main/java/org/opensearch/migrations/trafficcapture/kafkaoffloader/tracing/KafkaRecordContext.java index 6fd957922b..16ed17954c 100644 --- a/TrafficCapture/captureKafkaOffloader/src/main/java/org/opensearch/migrations/trafficcapture/kafkaoffloader/tracing/KafkaRecordContext.java +++ b/TrafficCapture/captureKafkaOffloader/src/main/java/org/opensearch/migrations/trafficcapture/kafkaoffloader/tracing/KafkaRecordContext.java @@ -5,18 +5,11 @@ import io.opentelemetry.api.metrics.Meter; import lombok.Getter; import lombok.NonNull; - import org.opensearch.migrations.tracing.BaseNestedSpanContext; import org.opensearch.migrations.tracing.CommonScopedMetricInstruments; import org.opensearch.migrations.tracing.IScopedInstrumentationAttributes; import org.opensearch.migrations.tracing.commoncontexts.IConnectionContext; -import io.opentelemetry.api.common.AttributeKey; -import io.opentelemetry.api.common.AttributesBuilder; -import io.opentelemetry.api.metrics.Meter; -import lombok.Getter; -import lombok.NonNull; - public class KafkaRecordContext extends BaseNestedSpanContext implements IScopedInstrumentationAttributes { diff --git a/TrafficCapture/captureKafkaOffloader/src/test/java/org/opensearch/migrations/trafficcapture/kafkaoffloader/KafkaCaptureFactoryTest.java b/TrafficCapture/captureKafkaOffloader/src/test/java/org/opensearch/migrations/trafficcapture/kafkaoffloader/KafkaCaptureFactoryTest.java index e9569af664..7e9387f0da 100644 --- a/TrafficCapture/captureKafkaOffloader/src/test/java/org/opensearch/migrations/trafficcapture/kafkaoffloader/KafkaCaptureFactoryTest.java +++ b/TrafficCapture/captureKafkaOffloader/src/test/java/org/opensearch/migrations/trafficcapture/kafkaoffloader/KafkaCaptureFactoryTest.java @@ -1,5 +1,9 @@ package org.opensearch.migrations.trafficcapture.kafkaoffloader; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; + +import io.netty.buffer.Unpooled; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.time.Clock; @@ -13,8 +17,6 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.locks.ReentrantLock; - -import io.netty.buffer.Unpooled; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.apache.kafka.clients.ApiVersions; @@ -33,33 +35,9 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; - import org.opensearch.migrations.trafficcapture.kafkaoffloader.tracing.TestRootKafkaOffloaderContext; import org.opensearch.migrations.trafficcapture.tracing.ConnectionContext; -import io.netty.buffer.Unpooled; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; -import org.apache.kafka.clients.ApiVersions; -import org.apache.kafka.clients.producer.Callback; -import org.apache.kafka.clients.producer.MockProducer; -import org.apache.kafka.clients.producer.Producer; -import org.apache.kafka.clients.producer.ProducerRecord; -import org.apache.kafka.clients.producer.RecordMetadata; -import org.apache.kafka.common.TopicPartition; -import org.apache.kafka.common.record.AbstractRecords; -import org.apache.kafka.common.record.CompressionType; -import org.apache.kafka.common.serialization.ByteArraySerializer; -import org.apache.kafka.common.serialization.StringSerializer; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.when; - @Slf4j @ExtendWith(MockitoExtension.class) public class KafkaCaptureFactoryTest { diff --git a/TrafficCapture/captureKafkaOffloader/src/test/java/org/opensearch/migrations/trafficcapture/kafkaoffloader/tracing/TestRootKafkaOffloaderContext.java b/TrafficCapture/captureKafkaOffloader/src/test/java/org/opensearch/migrations/trafficcapture/kafkaoffloader/tracing/TestRootKafkaOffloaderContext.java index 111ccd673e..b0aa25ac05 100644 --- a/TrafficCapture/captureKafkaOffloader/src/test/java/org/opensearch/migrations/trafficcapture/kafkaoffloader/tracing/TestRootKafkaOffloaderContext.java +++ b/TrafficCapture/captureKafkaOffloader/src/test/java/org/opensearch/migrations/trafficcapture/kafkaoffloader/tracing/TestRootKafkaOffloaderContext.java @@ -1,14 +1,11 @@ package org.opensearch.migrations.trafficcapture.kafkaoffloader.tracing; import lombok.Getter; - import org.opensearch.migrations.tracing.InMemoryInstrumentationBundle; import org.opensearch.migrations.tracing.RootOtelContext; import org.opensearch.migrations.trafficcapture.tracing.ConnectionContext; import org.opensearch.migrations.trafficcapture.tracing.IRootOffloaderContext; -import lombok.Getter; - public class TestRootKafkaOffloaderContext extends RootOtelContext implements IRootOffloaderContext, diff --git a/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/CodedOutputStreamAndByteBufferWrapper.java b/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/CodedOutputStreamAndByteBufferWrapper.java index 9a952c5f08..2ce95b6b41 100644 --- a/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/CodedOutputStreamAndByteBufferWrapper.java +++ b/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/CodedOutputStreamAndByteBufferWrapper.java @@ -1,12 +1,7 @@ package org.opensearch.migrations.trafficcapture; -import java.nio.ByteBuffer; - -import com.google.protobuf.CodedOutputStream; -import lombok.Getter; -import lombok.NonNull; - import com.google.protobuf.CodedOutputStream; +import java.nio.ByteBuffer; import lombok.Getter; import lombok.NonNull; diff --git a/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/CodedOutputStreamHolder.java b/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/CodedOutputStreamHolder.java index 141ce9da3e..28d7e096d8 100644 --- a/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/CodedOutputStreamHolder.java +++ b/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/CodedOutputStreamHolder.java @@ -3,9 +3,6 @@ import com.google.protobuf.CodedOutputStream; import lombok.NonNull; -import com.google.protobuf.CodedOutputStream; -import lombok.NonNull; - public interface CodedOutputStreamHolder { /** diff --git a/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/CodedOutputStreamSizeUtil.java b/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/CodedOutputStreamSizeUtil.java index 8ee5276480..4e746a81c8 100644 --- a/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/CodedOutputStreamSizeUtil.java +++ b/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/CodedOutputStreamSizeUtil.java @@ -1,18 +1,12 @@ package org.opensearch.migrations.trafficcapture; -import java.time.Instant; - import com.google.protobuf.CodedOutputStream; import com.google.protobuf.Timestamp; import io.netty.buffer.ByteBuf; - +import java.time.Instant; import org.opensearch.migrations.trafficcapture.protos.TrafficObservation; import org.opensearch.migrations.trafficcapture.protos.TrafficStream; -import com.google.protobuf.CodedOutputStream; -import com.google.protobuf.Timestamp; -import io.netty.buffer.ByteBuf; - /** * Utility functions for computing sizes of fields to be added to a CodedOutputStream */ diff --git a/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/FileConnectionCaptureFactory.java b/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/FileConnectionCaptureFactory.java index 8b6ae49416..d7724d1676 100644 --- a/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/FileConnectionCaptureFactory.java +++ b/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/FileConnectionCaptureFactory.java @@ -8,17 +8,11 @@ import java.util.Arrays; import java.util.concurrent.CompletableFuture; import java.util.function.BiFunction; - import lombok.AllArgsConstructor; import lombok.Lombok; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.tracing.commoncontexts.IConnectionContext; -import lombok.AllArgsConstructor; -import lombok.Lombok; -import lombok.extern.slf4j.Slf4j; - /** * Reference implementation of a TrafficStream protobuf-encoded sink. * TrafficStreams are dumped to individual files that are named according to the TrafficStream id. diff --git a/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/IChannelConnectionCaptureListener.java b/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/IChannelConnectionCaptureListener.java index c04574a05d..0d6733ca47 100644 --- a/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/IChannelConnectionCaptureListener.java +++ b/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/IChannelConnectionCaptureListener.java @@ -1,14 +1,11 @@ package org.opensearch.migrations.trafficcapture; +import io.netty.buffer.ByteBuf; import java.io.IOException; import java.net.SocketAddress; import java.time.Instant; import java.util.concurrent.CompletableFuture; -import io.netty.buffer.ByteBuf; - -import io.netty.buffer.ByteBuf; - public interface IChannelConnectionCaptureListener { default void addBindEvent(Instant timestamp, SocketAddress addr) throws IOException {} diff --git a/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/IConnectionCaptureFactory.java b/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/IConnectionCaptureFactory.java index 6338a046d9..27170dd1e3 100644 --- a/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/IConnectionCaptureFactory.java +++ b/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/IConnectionCaptureFactory.java @@ -1,7 +1,6 @@ package org.opensearch.migrations.trafficcapture; import java.io.IOException; - import org.opensearch.migrations.tracing.commoncontexts.IConnectionContext; public interface IConnectionCaptureFactory { diff --git a/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/StreamChannelConnectionCaptureSerializer.java b/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/StreamChannelConnectionCaptureSerializer.java index fc59fbcac5..8dc0853aff 100644 --- a/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/StreamChannelConnectionCaptureSerializer.java +++ b/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/StreamChannelConnectionCaptureSerializer.java @@ -1,5 +1,11 @@ package org.opensearch.migrations.trafficcapture; +import com.google.protobuf.ByteOutput; +import com.google.protobuf.CodedOutputStream; +import com.google.protobuf.Descriptors; +import com.google.protobuf.Timestamp; +import com.google.protobuf.WireFormat; +import io.netty.buffer.ByteBuf; import java.io.IOException; import java.io.UncheckedIOException; import java.net.SocketAddress; @@ -8,16 +14,8 @@ import java.time.Instant; import java.util.concurrent.CompletableFuture; import java.util.stream.IntStream; - -import com.google.protobuf.ByteOutput; -import com.google.protobuf.CodedOutputStream; -import com.google.protobuf.Descriptors; -import com.google.protobuf.Timestamp; -import com.google.protobuf.WireFormat; -import io.netty.buffer.ByteBuf; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.trafficcapture.protos.CloseObservation; import org.opensearch.migrations.trafficcapture.protos.ConnectionExceptionObservation; import org.opensearch.migrations.trafficcapture.protos.EndOfMessageIndication; @@ -30,15 +28,6 @@ import org.opensearch.migrations.trafficcapture.protos.WriteObservation; import org.opensearch.migrations.trafficcapture.protos.WriteSegmentObservation; -import com.google.protobuf.ByteOutput; -import com.google.protobuf.CodedOutputStream; -import com.google.protobuf.Descriptors; -import com.google.protobuf.Timestamp; -import com.google.protobuf.WireFormat; -import io.netty.buffer.ByteBuf; -import lombok.NonNull; -import lombok.extern.slf4j.Slf4j; - /** * This class serves as a generic serializer. Its primary function is to take ByteBuffer data, * serialize it into the Protobuf format as defined by diff --git a/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/tracing/ConnectionContext.java b/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/tracing/ConnectionContext.java index 83048a6d0e..853404414a 100644 --- a/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/tracing/ConnectionContext.java +++ b/TrafficCapture/captureOffloader/src/main/java/org/opensearch/migrations/trafficcapture/tracing/ConnectionContext.java @@ -4,17 +4,11 @@ import io.opentelemetry.api.metrics.Meter; import lombok.Getter; import lombok.NonNull; - import org.opensearch.migrations.tracing.BaseSpanContext; import org.opensearch.migrations.tracing.CommonScopedMetricInstruments; import org.opensearch.migrations.tracing.IHasRootInstrumentationScope; import org.opensearch.migrations.tracing.commoncontexts.IConnectionContext; -import io.opentelemetry.api.metrics.LongUpDownCounter; -import io.opentelemetry.api.metrics.Meter; -import lombok.Getter; -import lombok.NonNull; - public class ConnectionContext extends BaseSpanContext implements IConnectionContext, diff --git a/TrafficCapture/captureOffloader/src/test/java/org/opensearch/migrations/trafficcapture/CodedOutputStreamSizeUtilTest.java b/TrafficCapture/captureOffloader/src/test/java/org/opensearch/migrations/trafficcapture/CodedOutputStreamSizeUtilTest.java index b4112fff14..d96e756c1b 100644 --- a/TrafficCapture/captureOffloader/src/test/java/org/opensearch/migrations/trafficcapture/CodedOutputStreamSizeUtilTest.java +++ b/TrafficCapture/captureOffloader/src/test/java/org/opensearch/migrations/trafficcapture/CodedOutputStreamSizeUtilTest.java @@ -1,15 +1,9 @@ package org.opensearch.migrations.trafficcapture; -import java.nio.charset.StandardCharsets; -import java.time.Instant; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; +import java.nio.charset.StandardCharsets; +import java.time.Instant; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/TrafficCapture/captureOffloader/src/test/java/org/opensearch/migrations/trafficcapture/StreamChannelConnectionCaptureSerializerTest.java b/TrafficCapture/captureOffloader/src/test/java/org/opensearch/migrations/trafficcapture/StreamChannelConnectionCaptureSerializerTest.java index fd88e52bd2..67c5800a2e 100644 --- a/TrafficCapture/captureOffloader/src/test/java/org/opensearch/migrations/trafficcapture/StreamChannelConnectionCaptureSerializerTest.java +++ b/TrafficCapture/captureOffloader/src/test/java/org/opensearch/migrations/trafficcapture/StreamChannelConnectionCaptureSerializerTest.java @@ -1,5 +1,9 @@ package org.opensearch.migrations.trafficcapture; +import com.google.protobuf.ByteString; +import com.google.protobuf.CodedOutputStream; +import com.google.protobuf.Timestamp; +import io.netty.buffer.Unpooled; import java.io.IOException; import java.io.OutputStream; import java.nio.ByteBuffer; @@ -12,11 +16,6 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.ExecutionException; - -import com.google.protobuf.ByteString; -import com.google.protobuf.CodedOutputStream; -import com.google.protobuf.Timestamp; -import io.netty.buffer.Unpooled; import lombok.AllArgsConstructor; import lombok.Lombok; import lombok.NonNull; @@ -26,7 +25,6 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; import org.junit.jupiter.params.provider.ValueSource; - import org.opensearch.migrations.testutils.WrapWithNettyLeakDetection; import org.opensearch.migrations.trafficcapture.StreamChannelConnectionCaptureSerializerTest.StreamManager.NullStreamManager; import org.opensearch.migrations.trafficcapture.protos.CloseObservation; @@ -39,20 +37,6 @@ import org.opensearch.migrations.trafficcapture.protos.WriteObservation; import org.opensearch.migrations.trafficcapture.protos.WriteSegmentObservation; -import com.google.protobuf.ByteString; -import com.google.protobuf.CodedOutputStream; -import com.google.protobuf.Timestamp; -import io.netty.buffer.Unpooled; -import lombok.AllArgsConstructor; -import lombok.Lombok; -import lombok.NonNull; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.CsvSource; -import org.junit.jupiter.params.provider.ValueSource; - @Slf4j @WrapWithNettyLeakDetection(repetitions = 4) class StreamChannelConnectionCaptureSerializerTest { diff --git a/TrafficCapture/captureOffloader/src/testFixtures/java/org/opensearch/migrations/trafficcapture/InMemoryConnectionCaptureFactory.java b/TrafficCapture/captureOffloader/src/testFixtures/java/org/opensearch/migrations/trafficcapture/InMemoryConnectionCaptureFactory.java index b8e5b522b9..425f6c61e6 100644 --- a/TrafficCapture/captureOffloader/src/testFixtures/java/org/opensearch/migrations/trafficcapture/InMemoryConnectionCaptureFactory.java +++ b/TrafficCapture/captureOffloader/src/testFixtures/java/org/opensearch/migrations/trafficcapture/InMemoryConnectionCaptureFactory.java @@ -1,22 +1,16 @@ package org.opensearch.migrations.trafficcapture; +import com.google.protobuf.InvalidProtocolBufferException; import java.io.IOException; import java.util.Arrays; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.stream.Stream; - -import com.google.protobuf.InvalidProtocolBufferException; import lombok.AllArgsConstructor; import lombok.Getter; - import org.opensearch.migrations.tracing.commoncontexts.IConnectionContext; import org.opensearch.migrations.trafficcapture.protos.TrafficStream; -import com.google.protobuf.InvalidProtocolBufferException; -import lombok.AllArgsConstructor; -import lombok.Getter; - public class InMemoryConnectionCaptureFactory implements IConnectionCaptureFactory { private final int bufferSize; diff --git a/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/ConditionallyReliableLoggingHttpHandler.java b/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/ConditionallyReliableLoggingHttpHandler.java index 86033e023c..78ad23f62c 100644 --- a/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/ConditionallyReliableLoggingHttpHandler.java +++ b/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/ConditionallyReliableLoggingHttpHandler.java @@ -1,26 +1,17 @@ package org.opensearch.migrations.trafficcapture.netty; -import java.io.IOException; -import java.util.function.Predicate; - import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.http.HttpRequest; import io.netty.util.ReferenceCountUtil; +import java.io.IOException; +import java.util.function.Predicate; import lombok.Lombok; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.trafficcapture.IConnectionCaptureFactory; import org.opensearch.migrations.trafficcapture.netty.tracing.IRootWireLoggingContext; import org.opensearch.migrations.trafficcapture.netty.tracing.IWireCaptureContexts; -import io.netty.channel.ChannelHandlerContext; -import io.netty.handler.codec.http.HttpRequest; -import io.netty.util.ReferenceCountUtil; -import lombok.Lombok; -import lombok.NonNull; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class ConditionallyReliableLoggingHttpHandler extends LoggingHttpHandler { private final Predicate shouldBlockPredicate; diff --git a/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/HeaderValueFilteringCapturePredicate.java b/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/HeaderValueFilteringCapturePredicate.java index 53efffe84b..feea65976c 100644 --- a/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/HeaderValueFilteringCapturePredicate.java +++ b/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/HeaderValueFilteringCapturePredicate.java @@ -1,14 +1,11 @@ package org.opensearch.migrations.trafficcapture.netty; +import io.netty.handler.codec.http.HttpRequest; import java.util.Map; import java.util.Optional; import java.util.regex.Pattern; import java.util.stream.Collectors; -import io.netty.handler.codec.http.HttpRequest; - -import io.netty.handler.codec.http.HttpRequest; - public class HeaderValueFilteringCapturePredicate extends RequestCapturePredicate { private final Map headerToPredicateRegexMap; diff --git a/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/LoggingHttpHandler.java b/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/LoggingHttpHandler.java index 92dc1dc26d..8dcab3a244 100644 --- a/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/LoggingHttpHandler.java +++ b/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/LoggingHttpHandler.java @@ -1,8 +1,5 @@ package org.opensearch.migrations.trafficcapture.netty; -import java.io.IOException; -import java.time.Instant; - import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelDuplexHandler; import io.netty.channel.ChannelHandlerContext; @@ -18,36 +15,17 @@ import io.netty.handler.codec.http.HttpRequestDecoder; import io.netty.handler.codec.http.HttpVersion; import io.netty.handler.codec.http.LastHttpContent; +import java.io.IOException; +import java.time.Instant; import lombok.Getter; import lombok.Lombok; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.trafficcapture.IChannelConnectionCaptureSerializer; import org.opensearch.migrations.trafficcapture.IConnectionCaptureFactory; import org.opensearch.migrations.trafficcapture.netty.tracing.IRootWireLoggingContext; import org.opensearch.migrations.trafficcapture.netty.tracing.IWireCaptureContexts; -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelDuplexHandler; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; -import io.netty.channel.ChannelPromise; -import io.netty.channel.embedded.EmbeddedChannel; -import io.netty.handler.codec.http.DefaultHttpRequest; -import io.netty.handler.codec.http.HttpContent; -import io.netty.handler.codec.http.HttpMessage; -import io.netty.handler.codec.http.HttpMessageDecoderResult; -import io.netty.handler.codec.http.HttpMethod; -import io.netty.handler.codec.http.HttpRequest; -import io.netty.handler.codec.http.HttpRequestDecoder; -import io.netty.handler.codec.http.HttpVersion; -import io.netty.handler.codec.http.LastHttpContent; -import lombok.Getter; -import lombok.Lombok; -import lombok.NonNull; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class LoggingHttpHandler extends ChannelDuplexHandler { diff --git a/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/PassThruHttpHeaders.java b/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/PassThruHttpHeaders.java index 166994b684..ad0811ff30 100644 --- a/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/PassThruHttpHeaders.java +++ b/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/PassThruHttpHeaders.java @@ -1,16 +1,10 @@ package org.opensearch.migrations.trafficcapture.netty; -import java.util.Arrays; -import java.util.stream.Stream; - -import io.netty.handler.codec.http.DefaultHttpHeaders; -import io.netty.handler.codec.http.HttpHeaderNames; -import io.netty.handler.codec.http.HttpHeaders; -import lombok.NonNull; - import io.netty.handler.codec.http.DefaultHttpHeaders; import io.netty.handler.codec.http.HttpHeaderNames; import io.netty.handler.codec.http.HttpHeaders; +import java.util.Arrays; +import java.util.stream.Stream; import lombok.NonNull; public class PassThruHttpHeaders extends DefaultHttpHeaders { diff --git a/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/RequestCapturePredicate.java b/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/RequestCapturePredicate.java index d6ac465b0e..03203aae28 100644 --- a/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/RequestCapturePredicate.java +++ b/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/RequestCapturePredicate.java @@ -1,11 +1,7 @@ package org.opensearch.migrations.trafficcapture.netty; -import java.util.function.Function; - -import io.netty.handler.codec.http.HttpRequest; -import lombok.Getter; - import io.netty.handler.codec.http.HttpRequest; +import java.util.function.Function; import lombok.Getter; public class RequestCapturePredicate implements Function { diff --git a/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/RequestContextStateMachine.java b/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/RequestContextStateMachine.java index e5b42578d0..b022722080 100644 --- a/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/RequestContextStateMachine.java +++ b/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/RequestContextStateMachine.java @@ -2,13 +2,9 @@ import lombok.Getter; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.trafficcapture.netty.tracing.WireCaptureContexts; import org.opensearch.migrations.trafficcapture.tracing.ConnectionContext; -import lombok.Getter; -import lombok.extern.slf4j.Slf4j; - /** * This is a helper class so that we can emit metrics and traces for when we're * accumulating a request vs waiting for the next response, then repeating indefinitely. diff --git a/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/tracing/RootWireLoggingContext.java b/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/tracing/RootWireLoggingContext.java index f4038efa40..2d7acc751a 100644 --- a/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/tracing/RootWireLoggingContext.java +++ b/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/tracing/RootWireLoggingContext.java @@ -2,13 +2,9 @@ import io.opentelemetry.api.OpenTelemetry; import lombok.Getter; - import org.opensearch.migrations.tracing.IContextTracker; import org.opensearch.migrations.tracing.RootOtelContext; -import io.opentelemetry.api.OpenTelemetry; -import lombok.Getter; - @Getter public class RootWireLoggingContext extends RootOtelContext implements IRootWireLoggingContext { public static final String SCOPE_NAME = "NettyCapture"; diff --git a/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/tracing/WireCaptureContexts.java b/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/tracing/WireCaptureContexts.java index 5ac18fdedc..643ec88840 100644 --- a/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/tracing/WireCaptureContexts.java +++ b/TrafficCapture/nettyWireLogging/src/main/java/org/opensearch/migrations/trafficcapture/netty/tracing/WireCaptureContexts.java @@ -4,16 +4,10 @@ import io.opentelemetry.api.metrics.Meter; import lombok.Getter; import lombok.NonNull; - import org.opensearch.migrations.tracing.BaseNestedSpanContext; import org.opensearch.migrations.tracing.CommonScopedMetricInstruments; import org.opensearch.migrations.tracing.commoncontexts.IConnectionContext; -import io.opentelemetry.api.metrics.LongCounter; -import io.opentelemetry.api.metrics.Meter; -import lombok.Getter; -import lombok.NonNull; - public interface WireCaptureContexts extends IWireCaptureContexts { String COUNT_UNITS = "count"; String BYTES_UNIT = "bytes"; diff --git a/TrafficCapture/nettyWireLogging/src/test/java/org/opensearch/migrations/trafficcapture/netty/ConditionallyReliableLoggingHttpHandlerTest.java b/TrafficCapture/nettyWireLogging/src/test/java/org/opensearch/migrations/trafficcapture/netty/ConditionallyReliableLoggingHttpHandlerTest.java index 8e31c8305d..4386a8c6dc 100644 --- a/TrafficCapture/nettyWireLogging/src/test/java/org/opensearch/migrations/trafficcapture/netty/ConditionallyReliableLoggingHttpHandlerTest.java +++ b/TrafficCapture/nettyWireLogging/src/test/java/org/opensearch/migrations/trafficcapture/netty/ConditionallyReliableLoggingHttpHandlerTest.java @@ -1,5 +1,9 @@ package org.opensearch.migrations.trafficcapture.netty; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufInputStream; +import io.netty.buffer.Unpooled; +import io.netty.channel.embedded.EmbeddedChannel; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.SequenceInputStream; @@ -12,35 +16,18 @@ import java.util.function.Consumer; import java.util.stream.Collectors; import java.util.stream.Stream; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.Unpooled; -import io.netty.channel.embedded.EmbeddedChannel; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; - import org.opensearch.migrations.testutils.TestUtilities; import org.opensearch.migrations.testutils.WrapWithNettyLeakDetection; import org.opensearch.migrations.trafficcapture.StreamChannelConnectionCaptureSerializer; import org.opensearch.migrations.trafficcapture.protos.TrafficObservation; import org.opensearch.migrations.trafficcapture.protos.TrafficStream; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.Unpooled; -import io.netty.channel.embedded.EmbeddedChannel; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.ValueSource; - @Slf4j @WrapWithNettyLeakDetection public class ConditionallyReliableLoggingHttpHandlerTest { diff --git a/TrafficCapture/nettyWireLogging/src/test/java/org/opensearch/migrations/trafficcapture/netty/RootWireLoggingContextTest.java b/TrafficCapture/nettyWireLogging/src/test/java/org/opensearch/migrations/trafficcapture/netty/RootWireLoggingContextTest.java index 84d55741eb..f9ed99159f 100644 --- a/TrafficCapture/nettyWireLogging/src/test/java/org/opensearch/migrations/trafficcapture/netty/RootWireLoggingContextTest.java +++ b/TrafficCapture/nettyWireLogging/src/test/java/org/opensearch/migrations/trafficcapture/netty/RootWireLoggingContextTest.java @@ -1,5 +1,9 @@ package org.opensearch.migrations.trafficcapture.netty; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufInputStream; +import io.netty.channel.embedded.EmbeddedChannel; +import io.opentelemetry.sdk.trace.data.SpanData; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.SequenceInputStream; @@ -8,28 +12,14 @@ import java.util.Set; import java.util.function.Consumer; import java.util.stream.Collectors; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufInputStream; -import io.netty.channel.embedded.EmbeddedChannel; -import io.opentelemetry.sdk.trace.data.SpanData; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.testutils.TestUtilities; import org.opensearch.migrations.trafficcapture.StreamChannelConnectionCaptureSerializer; import org.opensearch.migrations.trafficcapture.protos.TrafficObservation; import org.opensearch.migrations.trafficcapture.protos.TrafficStream; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufInputStream; -import io.netty.channel.embedded.EmbeddedChannel; -import io.opentelemetry.sdk.trace.data.SpanData; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - @Slf4j public class RootWireLoggingContextTest { diff --git a/TrafficCapture/nettyWireLogging/src/test/java/org/opensearch/migrations/trafficcapture/netty/TestRootContext.java b/TrafficCapture/nettyWireLogging/src/test/java/org/opensearch/migrations/trafficcapture/netty/TestRootContext.java index e582ba088f..a268531d10 100644 --- a/TrafficCapture/nettyWireLogging/src/test/java/org/opensearch/migrations/trafficcapture/netty/TestRootContext.java +++ b/TrafficCapture/nettyWireLogging/src/test/java/org/opensearch/migrations/trafficcapture/netty/TestRootContext.java @@ -2,14 +2,10 @@ import lombok.Getter; import lombok.NonNull; - import org.opensearch.migrations.tracing.IContextTracker; import org.opensearch.migrations.tracing.InMemoryInstrumentationBundle; import org.opensearch.migrations.trafficcapture.netty.tracing.RootWireLoggingContext; -import lombok.Getter; -import lombok.NonNull; - public class TestRootContext extends RootWireLoggingContext implements AutoCloseable { @Getter InMemoryInstrumentationBundle instrumentationBundle; diff --git a/TrafficCapture/nettyWireLogging/src/test/java/org/opensearch/migrations/trafficcapture/netty/TestStreamManager.java b/TrafficCapture/nettyWireLogging/src/test/java/org/opensearch/migrations/trafficcapture/netty/TestStreamManager.java index 0dcf79c36b..324ae9a158 100644 --- a/TrafficCapture/nettyWireLogging/src/test/java/org/opensearch/migrations/trafficcapture/netty/TestStreamManager.java +++ b/TrafficCapture/nettyWireLogging/src/test/java/org/opensearch/migrations/trafficcapture/netty/TestStreamManager.java @@ -1,22 +1,16 @@ package org.opensearch.migrations.trafficcapture.netty; +import com.google.protobuf.CodedOutputStream; import java.nio.ByteBuffer; import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; - -import com.google.protobuf.CodedOutputStream; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.trafficcapture.CodedOutputStreamAndByteBufferWrapper; import org.opensearch.migrations.trafficcapture.CodedOutputStreamHolder; import org.opensearch.migrations.trafficcapture.OrderedStreamLifecyleManager; -import com.google.protobuf.CodedOutputStream; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; - @Slf4j class TestStreamManager extends OrderedStreamLifecyleManager implements AutoCloseable { AtomicReference byteBufferAtomicReference = new AtomicReference<>(); diff --git a/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/CaptureProxy.java b/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/CaptureProxy.java index 3eb01100ae..46a113b9c2 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/CaptureProxy.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/CaptureProxy.java @@ -1,5 +1,18 @@ package org.opensearch.migrations.trafficcapture.proxyserver; +import com.beust.jcommander.JCommander; +import com.beust.jcommander.Parameter; +import com.beust.jcommander.ParameterException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; +import com.google.protobuf.CodedOutputStream; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import io.netty.channel.socket.SocketChannel; +import io.netty.handler.ssl.SslContext; +import io.netty.handler.ssl.SslContextBuilder; +import io.netty.handler.ssl.util.InsecureTrustManagerFactory; import java.io.File; import java.io.FileReader; import java.io.IOException; @@ -22,20 +35,6 @@ import java.util.stream.Stream; import javax.net.ssl.SSLEngine; import javax.net.ssl.SSLException; - -import com.beust.jcommander.JCommander; -import com.beust.jcommander.Parameter; -import com.beust.jcommander.ParameterException; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; -import com.google.protobuf.CodedOutputStream; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.channel.socket.SocketChannel; -import io.netty.handler.ssl.SslContext; -import io.netty.handler.ssl.SslContextBuilder; -import io.netty.handler.ssl.util.InsecureTrustManagerFactory; import lombok.Lombok; import lombok.NonNull; import lombok.SneakyThrows; @@ -44,7 +43,6 @@ import org.apache.kafka.clients.producer.KafkaProducer; import org.apache.kafka.clients.producer.ProducerConfig; import org.apache.kafka.common.config.SaslConfigs; - import org.opensearch.common.settings.Settings; import org.opensearch.migrations.jcommander.NoSplitter; import org.opensearch.migrations.tracing.ActiveContextTracker; @@ -68,28 +66,6 @@ import org.opensearch.security.ssl.DefaultSecurityKeyStore; import org.opensearch.security.ssl.util.SSLConfigConstants; -import com.beust.jcommander.JCommander; -import com.beust.jcommander.Parameter; -import com.beust.jcommander.ParameterException; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; -import com.google.protobuf.CodedOutputStream; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.channel.socket.SocketChannel; -import io.netty.handler.ssl.SslContext; -import io.netty.handler.ssl.SslContextBuilder; -import io.netty.handler.ssl.util.InsecureTrustManagerFactory; -import lombok.Lombok; -import lombok.NonNull; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; -import org.apache.kafka.clients.CommonClientConfigs; -import org.apache.kafka.clients.producer.KafkaProducer; -import org.apache.kafka.clients.producer.ProducerConfig; -import org.apache.kafka.common.config.SaslConfigs; - @Slf4j public class CaptureProxy { diff --git a/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/RootCaptureContext.java b/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/RootCaptureContext.java index 0c64620cd5..7149e3d209 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/RootCaptureContext.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/RootCaptureContext.java @@ -2,15 +2,11 @@ import io.opentelemetry.api.OpenTelemetry; import lombok.Getter; - import org.opensearch.migrations.tracing.IContextTracker; import org.opensearch.migrations.trafficcapture.kafkaoffloader.tracing.IRootKafkaOffloaderContext; import org.opensearch.migrations.trafficcapture.kafkaoffloader.tracing.KafkaRecordContext; import org.opensearch.migrations.trafficcapture.netty.tracing.RootWireLoggingContext; -import io.opentelemetry.api.OpenTelemetry; -import lombok.Getter; - public class RootCaptureContext extends RootWireLoggingContext implements IRootKafkaOffloaderContext { public static final String SCOPE_NAME = "captureProxy"; diff --git a/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/BacksideConnectionPool.java b/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/BacksideConnectionPool.java index fe6375502b..5d60dc064f 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/BacksideConnectionPool.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/BacksideConnectionPool.java @@ -1,24 +1,5 @@ package org.opensearch.migrations.trafficcapture.proxyserver.netty; -import java.net.URI; -import java.time.Duration; -import java.util.concurrent.TimeUnit; -import javax.net.ssl.SSLEngine; - -import io.netty.bootstrap.Bootstrap; -import io.netty.channel.ChannelDuplexHandler; -import io.netty.channel.ChannelFuture; -import io.netty.channel.ChannelFutureListener; -import io.netty.channel.ChannelOption; -import io.netty.channel.DefaultChannelPromise; -import io.netty.channel.EventLoop; -import io.netty.channel.socket.nio.NioSocketChannel; -import io.netty.handler.ssl.SslContext; -import io.netty.handler.ssl.SslHandler; -import io.netty.util.concurrent.FastThreadLocal; -import lombok.extern.slf4j.Slf4j; -import org.slf4j.event.Level; - import io.netty.bootstrap.Bootstrap; import io.netty.channel.ChannelDuplexHandler; import io.netty.channel.ChannelFuture; @@ -30,6 +11,10 @@ import io.netty.handler.ssl.SslContext; import io.netty.handler.ssl.SslHandler; import io.netty.util.concurrent.FastThreadLocal; +import java.net.URI; +import java.time.Duration; +import java.util.concurrent.TimeUnit; +import javax.net.ssl.SSLEngine; import lombok.extern.slf4j.Slf4j; import org.slf4j.event.Level; diff --git a/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/BacksideHandler.java b/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/BacksideHandler.java index 1e38876b82..eec1436034 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/BacksideHandler.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/BacksideHandler.java @@ -5,11 +5,6 @@ import io.netty.channel.ChannelInboundHandlerAdapter; import lombok.extern.slf4j.Slf4j; -import io.netty.channel.Channel; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class BacksideHandler extends ChannelInboundHandlerAdapter { diff --git a/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/ExpiringSubstitutableItemPool.java b/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/ExpiringSubstitutableItemPool.java index 7d36dd305a..868b8b519b 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/ExpiringSubstitutableItemPool.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/ExpiringSubstitutableItemPool.java @@ -1,5 +1,8 @@ package org.opensearch.migrations.trafficcapture.proxyserver.netty; +import io.netty.channel.EventLoop; +import io.netty.util.concurrent.Future; +import io.netty.util.concurrent.GenericFutureListener; import java.time.Duration; import java.time.Instant; import java.util.ArrayDeque; @@ -10,18 +13,6 @@ import java.util.function.BiFunction; import java.util.function.Consumer; import java.util.function.Supplier; - -import io.netty.channel.EventLoop; -import io.netty.util.concurrent.Future; -import io.netty.util.concurrent.GenericFutureListener; -import lombok.Getter; -import lombok.NonNull; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; - -import io.netty.channel.EventLoop; -import io.netty.util.concurrent.Future; -import io.netty.util.concurrent.GenericFutureListener; import lombok.Getter; import lombok.NonNull; import lombok.SneakyThrows; diff --git a/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/FrontsideHandler.java b/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/FrontsideHandler.java index eb653e77ef..eaa3581e83 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/FrontsideHandler.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/FrontsideHandler.java @@ -8,14 +8,6 @@ import io.netty.util.ReferenceCountUtil; import lombok.extern.slf4j.Slf4j; -import io.netty.buffer.Unpooled; -import io.netty.channel.Channel; -import io.netty.channel.ChannelFutureListener; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; -import io.netty.util.ReferenceCountUtil; -import lombok.extern.slf4j.Slf4j; - /** * TODO - this should be renamed ForwardingHandler. It's the last handler of the front, * but since it isn't the front of the frontside handlers, this name seems misleading. diff --git a/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/HeaderAdderHandler.java b/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/HeaderAdderHandler.java index eb9efac926..d59171d2d2 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/HeaderAdderHandler.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/HeaderAdderHandler.java @@ -1,18 +1,11 @@ package org.opensearch.migrations.trafficcapture.proxyserver.netty; -import java.nio.charset.StandardCharsets; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; -import io.netty.util.ReferenceCountUtil; - import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.util.ReferenceCountUtil; +import java.nio.charset.StandardCharsets; public class HeaderAdderHandler extends ChannelInboundHandlerAdapter { private static final ByteBuf CRLF_BYTE_BUF = diff --git a/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/HeaderRemoverHandler.java b/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/HeaderRemoverHandler.java index 2c2077f452..ec981cce13 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/HeaderRemoverHandler.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/HeaderRemoverHandler.java @@ -8,14 +8,6 @@ import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.CompositeByteBuf; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; -import io.netty.util.ReferenceCountUtil; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class HeaderRemoverHandler extends ChannelInboundHandlerAdapter { final String headerToRemove; diff --git a/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/NettyScanningHttpProxy.java b/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/NettyScanningHttpProxy.java index bb122b4e38..1dbdb00dc3 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/NettyScanningHttpProxy.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/NettyScanningHttpProxy.java @@ -2,15 +2,6 @@ -import io.netty.bootstrap.ServerBootstrap; -import io.netty.channel.Channel; -import io.netty.channel.ChannelOption; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.nio.NioEventLoopGroup; -import io.netty.channel.socket.nio.NioServerSocketChannel; -import io.netty.util.concurrent.DefaultThreadFactory; -import lombok.Getter; - import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.Channel; import io.netty.channel.ChannelOption; diff --git a/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/ProxyChannelInitializer.java b/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/ProxyChannelInitializer.java index 2e1970699b..5a0e01e919 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/ProxyChannelInitializer.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/ProxyChannelInitializer.java @@ -1,28 +1,19 @@ package org.opensearch.migrations.trafficcapture.proxyserver.netty; -import java.io.IOException; -import java.util.function.Supplier; -import javax.net.ssl.SSLEngine; - import io.netty.channel.ChannelInitializer; import io.netty.channel.socket.SocketChannel; import io.netty.handler.codec.http.HttpMethod; import io.netty.handler.codec.http.HttpRequest; import io.netty.handler.ssl.SslHandler; +import java.io.IOException; +import java.util.function.Supplier; +import javax.net.ssl.SSLEngine; import lombok.NonNull; - import org.opensearch.migrations.trafficcapture.IConnectionCaptureFactory; import org.opensearch.migrations.trafficcapture.netty.ConditionallyReliableLoggingHttpHandler; import org.opensearch.migrations.trafficcapture.netty.RequestCapturePredicate; import org.opensearch.migrations.trafficcapture.netty.tracing.IRootWireLoggingContext; -import io.netty.channel.ChannelInitializer; -import io.netty.channel.socket.SocketChannel; -import io.netty.handler.codec.http.HttpMethod; -import io.netty.handler.codec.http.HttpRequest; -import io.netty.handler.ssl.SslHandler; -import lombok.NonNull; - public class ProxyChannelInitializer extends ChannelInitializer { protected static final String CAPTURE_HANDLER_NAME = "CaptureHandler"; diff --git a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/CaptureProxyConfigurationTest.java b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/CaptureProxyConfigurationTest.java index 9cc1c9e629..0605137a3e 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/CaptureProxyConfigurationTest.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/CaptureProxyConfigurationTest.java @@ -1,30 +1,22 @@ package org.opensearch.migrations.trafficcapture.proxyserver; +import static org.junit.jupiter.api.Assertions.assertEquals; + import java.io.IOException; import java.net.URI; import java.time.Duration; import java.util.stream.IntStream; import java.util.stream.Stream; - import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.testutils.SimpleHttpClientForTesting; import org.opensearch.migrations.trafficcapture.proxyserver.testcontainers.CaptureProxyContainer; import org.opensearch.migrations.trafficcapture.proxyserver.testcontainers.HttpdContainerTestBase; import org.opensearch.migrations.trafficcapture.proxyserver.testcontainers.annotations.HttpdContainerTest; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertEquals; - @Slf4j @HttpdContainerTest public class CaptureProxyConfigurationTest { diff --git a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/CaptureProxySetupTest.java b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/CaptureProxySetupTest.java index 6159b4faaf..bb6292cb2a 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/CaptureProxySetupTest.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/CaptureProxySetupTest.java @@ -5,13 +5,6 @@ import java.util.List; import java.util.Map; import java.util.Properties; - -import org.apache.kafka.clients.CommonClientConfigs; -import org.apache.kafka.clients.producer.ProducerConfig; -import org.apache.kafka.common.config.SaslConfigs; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - import org.apache.kafka.clients.CommonClientConfigs; import org.apache.kafka.clients.producer.ProducerConfig; import org.apache.kafka.common.config.SaslConfigs; diff --git a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/KafkaConfigurationCaptureProxyTest.java b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/KafkaConfigurationCaptureProxyTest.java index efda60b93c..412bf99b4e 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/KafkaConfigurationCaptureProxyTest.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/KafkaConfigurationCaptureProxyTest.java @@ -1,13 +1,14 @@ package org.opensearch.migrations.trafficcapture.proxyserver; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import eu.rekawek.toxiproxy.Proxy; +import eu.rekawek.toxiproxy.model.ToxicDirection; import java.io.IOException; import java.net.URI; import java.time.Duration; import java.util.stream.IntStream; import java.util.stream.Stream; - -import eu.rekawek.toxiproxy.Proxy; -import eu.rekawek.toxiproxy.model.ToxicDirection; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterEach; @@ -19,7 +20,6 @@ import org.junit.jupiter.api.function.ThrowingConsumer; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; - import org.opensearch.migrations.testutils.SimpleHttpClientForTesting; import org.opensearch.migrations.trafficcapture.proxyserver.testcontainers.CaptureProxyContainer; import org.opensearch.migrations.trafficcapture.proxyserver.testcontainers.HttpdContainerTestBase; @@ -29,22 +29,6 @@ import org.opensearch.migrations.trafficcapture.proxyserver.testcontainers.annotations.KafkaContainerTest; import org.opensearch.migrations.trafficcapture.proxyserver.testcontainers.annotations.ToxiproxyContainerTest; -import eu.rekawek.toxiproxy.Proxy; -import eu.rekawek.toxiproxy.model.ToxicDirection; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.function.ThrowingConsumer; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; - -import static org.junit.jupiter.api.Assertions.assertEquals; - @Slf4j @Tag("isolatedTest") @KafkaContainerTest diff --git a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/TestHeaderRewrites.java b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/TestHeaderRewrites.java index 9a6bcb4525..ca31fd90f6 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/TestHeaderRewrites.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/TestHeaderRewrites.java @@ -9,21 +9,15 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; - import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.testutils.HttpRequest; import org.opensearch.migrations.testutils.SimpleHttpClientForTesting; import org.opensearch.migrations.testutils.SimpleHttpResponse; import org.opensearch.migrations.testutils.SimpleNettyHttpServer; import org.opensearch.migrations.trafficcapture.proxyserver.testcontainers.CaptureProxyContainer; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - @Slf4j public class TestHeaderRewrites { diff --git a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/ExpiringSubstitutableItemPoolTest.java b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/ExpiringSubstitutableItemPoolTest.java index 5e887c3dbf..226a624807 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/ExpiringSubstitutableItemPoolTest.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/ExpiringSubstitutableItemPoolTest.java @@ -1,5 +1,9 @@ package org.opensearch.migrations.trafficcapture.proxyserver.netty; +import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.util.concurrent.DefaultPromise; +import io.netty.util.concurrent.DefaultThreadFactory; +import io.netty.util.concurrent.Future; import java.time.Duration; import java.time.Instant; import java.util.ArrayList; @@ -11,21 +15,6 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; import java.util.stream.IntStream; - -import io.netty.channel.nio.NioEventLoopGroup; -import io.netty.util.concurrent.DefaultPromise; -import io.netty.util.concurrent.DefaultThreadFactory; -import io.netty.util.concurrent.Future; -import lombok.Lombok; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; - -import io.netty.channel.nio.NioEventLoopGroup; -import io.netty.util.concurrent.DefaultPromise; -import io.netty.util.concurrent.DefaultThreadFactory; -import io.netty.util.concurrent.Future; import lombok.Lombok; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; diff --git a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/HeaderAdderHandlerTest.java b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/HeaderAdderHandlerTest.java index 1ebca964e2..0a1937a521 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/HeaderAdderHandlerTest.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/HeaderAdderHandlerTest.java @@ -1,32 +1,21 @@ package org.opensearch.migrations.trafficcapture.proxyserver.netty; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import io.netty.channel.embedded.EmbeddedChannel; import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.Objects; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Supplier; import java.util.stream.IntStream; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.channel.embedded.EmbeddedChannel; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; - import org.opensearch.migrations.testutils.WrapWithNettyLeakDetection; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.channel.embedded.EmbeddedChannel; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.ValueSource; - @WrapWithNettyLeakDetection() @Slf4j class HeaderAdderHandlerTest { diff --git a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/HeaderRemoverHandlerTest.java b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/HeaderRemoverHandlerTest.java index a800b049f3..0ffea907a5 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/HeaderRemoverHandlerTest.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/HeaderRemoverHandlerTest.java @@ -1,5 +1,7 @@ package org.opensearch.migrations.trafficcapture.proxyserver.netty; +import io.netty.buffer.ByteBuf; +import io.netty.channel.embedded.EmbeddedChannel; import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.Random; @@ -8,25 +10,13 @@ import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.IntStream; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.embedded.EmbeddedChannel; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; - import org.opensearch.migrations.testutils.WrapWithNettyLeakDetection; -import io.netty.buffer.ByteBuf; -import io.netty.channel.embedded.EmbeddedChannel; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.ValueSource; - @WrapWithNettyLeakDetection(repetitions = 1) @Slf4j class HeaderRemoverHandlerTest { diff --git a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/NettyScanningHttpProxyTest.java b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/NettyScanningHttpProxyTest.java index 216d0f1d5d..15183ecb72 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/NettyScanningHttpProxyTest.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/netty/NettyScanningHttpProxyTest.java @@ -13,12 +13,10 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.IntStream; - import lombok.Lombok; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; - import org.opensearch.common.collect.Tuple; import org.opensearch.migrations.testutils.HttpRequest; import org.opensearch.migrations.testutils.PortFinder; @@ -33,11 +31,6 @@ import org.opensearch.migrations.trafficcapture.netty.tracing.RootWireLoggingContext; import org.opensearch.migrations.trafficcapture.protos.TrafficStream; -import lombok.Lombok; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - @Slf4j class NettyScanningHttpProxyTest { diff --git a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/CaptureProxyContainer.java b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/CaptureProxyContainer.java index f9af78fa98..f70726c7d2 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/CaptureProxyContainer.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/CaptureProxyContainer.java @@ -1,5 +1,6 @@ package org.opensearch.migrations.trafficcapture.proxyserver.testcontainers; +import com.github.dockerjava.api.command.InspectContainerResponse; import java.time.Duration; import java.util.ArrayList; import java.util.List; @@ -7,23 +8,10 @@ import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.Stream; - -import com.github.dockerjava.api.command.InspectContainerResponse; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.testcontainers.containers.Container; -import org.testcontainers.containers.GenericContainer; -import org.testcontainers.containers.KafkaContainer; -import org.testcontainers.containers.wait.strategy.HttpWaitStrategy; -import org.testcontainers.containers.wait.strategy.WaitStrategyTarget; -import org.testcontainers.lifecycle.Startable; - import org.opensearch.migrations.testutils.PortFinder; import org.opensearch.migrations.trafficcapture.proxyserver.CaptureProxy; - -import com.github.dockerjava.api.command.InspectContainerResponse; -import lombok.AllArgsConstructor; -import lombok.extern.slf4j.Slf4j; import org.testcontainers.containers.Container; import org.testcontainers.containers.GenericContainer; import org.testcontainers.containers.KafkaContainer; diff --git a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/HttpdContainerTestBase.java b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/HttpdContainerTestBase.java index bf85fa0240..46eb933a78 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/HttpdContainerTestBase.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/HttpdContainerTestBase.java @@ -1,9 +1,6 @@ package org.opensearch.migrations.trafficcapture.proxyserver.testcontainers; -import org.testcontainers.containers.GenericContainer; - import org.opensearch.migrations.testutils.SharedDockerImageNames; - import org.testcontainers.containers.GenericContainer; public class HttpdContainerTestBase extends TestContainerTestBase> { diff --git a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/KafkaContainerTestBase.java b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/KafkaContainerTestBase.java index c2f8a045c2..3925d0d40a 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/KafkaContainerTestBase.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/KafkaContainerTestBase.java @@ -1,9 +1,6 @@ package org.opensearch.migrations.trafficcapture.proxyserver.testcontainers; -import org.testcontainers.containers.KafkaContainer; - import org.opensearch.migrations.testutils.SharedDockerImageNames; - import org.testcontainers.containers.KafkaContainer; public class KafkaContainerTestBase extends TestContainerTestBase { diff --git a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/TestContainerTestBase.java b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/TestContainerTestBase.java index 4a852fae58..0d1e23f508 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/TestContainerTestBase.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/TestContainerTestBase.java @@ -2,8 +2,6 @@ import org.testcontainers.containers.GenericContainer; -import org.testcontainers.containers.GenericContainer; - abstract class TestContainerTestBase> { public void start() { diff --git a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/ToxiproxyContainerTestBase.java b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/ToxiproxyContainerTestBase.java index d518c11d3b..e09e8a7c79 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/ToxiproxyContainerTestBase.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/ToxiproxyContainerTestBase.java @@ -1,16 +1,10 @@ package org.opensearch.migrations.trafficcapture.proxyserver.testcontainers; +import eu.rekawek.toxiproxy.Proxy; +import eu.rekawek.toxiproxy.ToxiproxyClient; import java.io.IOException; import java.util.HashSet; import java.util.concurrent.ConcurrentSkipListSet; - -import eu.rekawek.toxiproxy.Proxy; -import eu.rekawek.toxiproxy.ToxiproxyClient; -import org.testcontainers.containers.GenericContainer; -import org.testcontainers.containers.ToxiproxyContainer; - -import eu.rekawek.toxiproxy.Proxy; -import eu.rekawek.toxiproxy.ToxiproxyClient; import org.testcontainers.containers.GenericContainer; import org.testcontainers.containers.ToxiproxyContainer; diff --git a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/HttpdContainerTest.java b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/HttpdContainerTest.java index be6dde9e88..935c108952 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/HttpdContainerTest.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/HttpdContainerTest.java @@ -5,9 +5,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; - -import org.junit.jupiter.api.parallel.ResourceLock; - import org.junit.jupiter.api.parallel.ResourceLock; @Inherited diff --git a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/KafkaContainerTest.java b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/KafkaContainerTest.java index d6a5e7e299..0bde9224ed 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/KafkaContainerTest.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/KafkaContainerTest.java @@ -5,9 +5,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; - -import org.junit.jupiter.api.parallel.ResourceLock; - import org.junit.jupiter.api.parallel.ResourceLock; @Inherited diff --git a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/TestContainerTest.java b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/TestContainerTest.java index b69372d027..057d98b4ff 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/TestContainerTest.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/TestContainerTest.java @@ -5,10 +5,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; - -import org.junit.jupiter.api.Tag; -import org.testcontainers.junit.jupiter.Testcontainers; - import org.junit.jupiter.api.Tag; import org.testcontainers.junit.jupiter.Testcontainers; diff --git a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/ToxiproxyContainerTest.java b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/ToxiproxyContainerTest.java index 11f16db56d..c866e8ab12 100644 --- a/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/ToxiproxyContainerTest.java +++ b/TrafficCapture/trafficCaptureProxyServer/src/test/java/org/opensearch/migrations/trafficcapture/proxyserver/testcontainers/annotations/ToxiproxyContainerTest.java @@ -5,9 +5,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; - -import org.junit.jupiter.api.parallel.ResourceLock; - import org.junit.jupiter.api.parallel.ResourceLock; @Inherited diff --git a/TrafficCapture/trafficCaptureProxyServerTest/src/main/java/org/opensearch/migrations/trafficcapture/JMeterLoadTest.java b/TrafficCapture/trafficCaptureProxyServerTest/src/main/java/org/opensearch/migrations/trafficcapture/JMeterLoadTest.java index fe6cca4934..9d6305cf9e 100644 --- a/TrafficCapture/trafficCaptureProxyServerTest/src/main/java/org/opensearch/migrations/trafficcapture/JMeterLoadTest.java +++ b/TrafficCapture/trafficCaptureProxyServerTest/src/main/java/org/opensearch/migrations/trafficcapture/JMeterLoadTest.java @@ -1,33 +1,12 @@ package org.opensearch.migrations.trafficcapture; +import com.beust.jcommander.JCommander; +import com.beust.jcommander.Parameter; +import com.beust.jcommander.ParameterException; import java.io.File; import java.io.IOException; import java.util.Arrays; import java.util.Optional; - -import com.beust.jcommander.JCommander; -import com.beust.jcommander.Parameter; -import com.beust.jcommander.ParameterException; -import lombok.AllArgsConstructor; -import org.apache.jmeter.assertions.ResponseAssertion; -import org.apache.jmeter.control.LoopController; -import org.apache.jmeter.engine.StandardJMeterEngine; -import org.apache.jmeter.extractor.RegexExtractor; -import org.apache.jmeter.protocol.http.sampler.HTTPSampler; -import org.apache.jmeter.reporters.ResultCollector; -import org.apache.jmeter.reporters.Summariser; -import org.apache.jmeter.testelement.TestElement; -import org.apache.jmeter.testelement.TestPlan; -import org.apache.jmeter.threads.ThreadGroup; -import org.apache.jmeter.timers.ConstantTimer; -import org.apache.jmeter.util.JMeterUtils; -import org.apache.jorphan.collections.HashTree; -import org.apache.jorphan.collections.ListedHashTree; -import org.jetbrains.annotations.NotNull; - -import com.beust.jcommander.JCommander; -import com.beust.jcommander.Parameter; -import com.beust.jcommander.ParameterException; import lombok.AllArgsConstructor; import org.apache.jmeter.assertions.ResponseAssertion; import org.apache.jmeter.control.LoopController; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/NettyFutureBinders.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/NettyFutureBinders.java index 1897881817..a824e08e69 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/NettyFutureBinders.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/NettyFutureBinders.java @@ -1,21 +1,16 @@ package org.opensearch.migrations; +import io.netty.channel.EventLoop; +import io.netty.util.concurrent.Future; import java.time.Duration; import java.util.concurrent.CancellationException; import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; import java.util.function.Function; import java.util.function.Supplier; - -import io.netty.channel.EventLoop; -import io.netty.util.concurrent.Future; - import org.opensearch.migrations.replay.util.TextTrackedFuture; import org.opensearch.migrations.replay.util.TrackedFuture; -import io.netty.channel.EventLoop; -import io.netty.util.concurrent.Future; - public class NettyFutureBinders { private NettyFutureBinders() {} diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/AWSAuthService.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/AWSAuthService.java index a0bc37bcf7..332c557172 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/AWSAuthService.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/AWSAuthService.java @@ -2,12 +2,6 @@ import java.nio.charset.Charset; import java.util.Base64; - -import lombok.extern.slf4j.Slf4j; -import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; -import software.amazon.awssdk.regions.Region; -import software.amazon.awssdk.services.secretsmanager.SecretsManagerClient; - import lombok.extern.slf4j.Slf4j; import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; import software.amazon.awssdk.regions.Region; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/Accumulation.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/Accumulation.java index e1e3953710..fe7c6bcc0d 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/Accumulation.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/Accumulation.java @@ -4,18 +4,12 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import java.util.function.Consumer; - import lombok.AllArgsConstructor; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.datatypes.ITrafficStreamKey; import org.opensearch.migrations.trafficcapture.protos.TrafficStream; -import lombok.AllArgsConstructor; -import lombok.NonNull; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class Accumulation { diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/AccumulationCallbacks.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/AccumulationCallbacks.java index 88ef514e45..db30610f27 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/AccumulationCallbacks.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/AccumulationCallbacks.java @@ -3,14 +3,10 @@ import java.time.Instant; import java.util.List; import java.util.function.Consumer; - import lombok.NonNull; - import org.opensearch.migrations.replay.datatypes.ITrafficStreamKey; import org.opensearch.migrations.replay.tracing.IReplayContexts; -import lombok.NonNull; - public interface AccumulationCallbacks { Consumer onRequestReceived( @NonNull IReplayContexts.IReplayerHttpTransactionContext ctx, diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/AggregatedRawResponse.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/AggregatedRawResponse.java index 18bb8e3b95..f55392fb8e 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/AggregatedRawResponse.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/AggregatedRawResponse.java @@ -1,15 +1,10 @@ package org.opensearch.migrations.replay; +import io.netty.handler.codec.http.HttpResponse; import java.time.Duration; import java.time.Instant; import java.util.AbstractMap; import java.util.List; - -import io.netty.handler.codec.http.HttpResponse; -import lombok.Getter; -import lombok.extern.slf4j.Slf4j; - -import io.netty.handler.codec.http.HttpResponse; import lombok.Getter; import lombok.extern.slf4j.Slf4j; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/AggregatedRawResult.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/AggregatedRawResult.java index def81bfb66..6ee06322bf 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/AggregatedRawResult.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/AggregatedRawResult.java @@ -1,5 +1,7 @@ package org.opensearch.migrations.replay; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; import java.time.Duration; import java.time.Instant; import java.util.AbstractMap; @@ -7,17 +9,9 @@ import java.util.Arrays; import java.util.List; import java.util.Map; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; import lombok.Getter; - import org.opensearch.migrations.replay.datatypes.ByteBufList; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import lombok.Getter; - public class AggregatedRawResult { @Getter protected final int sizeInBytes; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/CapturedTrafficToHttpTransactionAccumulator.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/CapturedTrafficToHttpTransactionAccumulator.java index 456c518a9a..d56103582e 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/CapturedTrafficToHttpTransactionAccumulator.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/CapturedTrafficToHttpTransactionAccumulator.java @@ -8,11 +8,9 @@ import java.util.StringJoiner; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Consumer; - import lombok.AllArgsConstructor; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.datatypes.ITrafficStreamKey; import org.opensearch.migrations.replay.tracing.IReplayContexts; import org.opensearch.migrations.replay.traffic.expiration.BehavioralPolicy; @@ -22,10 +20,6 @@ import org.opensearch.migrations.trafficcapture.protos.TrafficStream; import org.opensearch.migrations.trafficcapture.protos.TrafficStreamUtils; -import lombok.AllArgsConstructor; -import lombok.NonNull; -import lombok.extern.slf4j.Slf4j; - /** * This class consumes TrafficObservation objects, which will be predominated by reads and writes that * were received by some HTTP source. Reads represent data read by a server from traffic that was diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/ClientConnectionPool.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/ClientConnectionPool.java index e2b5b70e1c..9604bbaf0d 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/ClientConnectionPool.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/ClientConnectionPool.java @@ -1,9 +1,5 @@ package org.opensearch.migrations.replay; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.TimeUnit; -import java.util.function.BiFunction; - import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheLoader; import com.google.common.cache.LoadingCache; @@ -13,33 +9,20 @@ import io.netty.channel.nio.NioEventLoopGroup; import io.netty.util.concurrent.DefaultThreadFactory; import io.netty.util.concurrent.ScheduledFuture; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; +import java.util.function.BiFunction; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.NonNull; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.NettyFutureBinders; import org.opensearch.migrations.replay.datatypes.ConnectionReplaySession; import org.opensearch.migrations.replay.tracing.IReplayContexts; import org.opensearch.migrations.replay.util.TextTrackedFuture; import org.opensearch.migrations.replay.util.TrackedFuture; -import com.google.common.cache.CacheBuilder; -import com.google.common.cache.CacheLoader; -import com.google.common.cache.LoadingCache; -import io.netty.channel.Channel; -import io.netty.channel.ChannelFuture; -import io.netty.channel.EventLoop; -import io.netty.channel.nio.NioEventLoopGroup; -import io.netty.util.concurrent.DefaultThreadFactory; -import io.netty.util.concurrent.ScheduledFuture; -import lombok.AllArgsConstructor; -import lombok.EqualsAndHashCode; -import lombok.NonNull; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class ClientConnectionPool { diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/HttpByteBufFormatter.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/HttpByteBufFormatter.java index ea6dbf43d0..0d0b1784b4 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/HttpByteBufFormatter.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/HttpByteBufFormatter.java @@ -1,16 +1,5 @@ package org.opensearch.migrations.replay; -import java.nio.charset.StandardCharsets; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.StringJoiner; -import java.util.concurrent.Callable; -import java.util.function.Supplier; -import java.util.stream.Collectors; -import java.util.stream.IntStream; -import java.util.stream.Stream; - import io.netty.buffer.ByteBuf; import io.netty.buffer.CompositeByteBuf; import io.netty.buffer.Unpooled; @@ -30,34 +19,21 @@ import io.netty.handler.codec.http.HttpResponse; import io.netty.handler.codec.http.HttpServerCodec; import io.netty.handler.codec.http.LastHttpContent; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.StringJoiner; +import java.util.concurrent.Callable; +import java.util.function.Supplier; +import java.util.stream.Collectors; +import java.util.stream.IntStream; +import java.util.stream.Stream; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.util.NettyUtils; import org.opensearch.migrations.replay.util.RefSafeHolder; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.CompositeByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; -import io.netty.channel.embedded.EmbeddedChannel; -import io.netty.handler.codec.http.DefaultFullHttpRequest; -import io.netty.handler.codec.http.DefaultFullHttpResponse; -import io.netty.handler.codec.http.FullHttpRequest; -import io.netty.handler.codec.http.FullHttpResponse; -import io.netty.handler.codec.http.HttpClientCodec; -import io.netty.handler.codec.http.HttpContent; -import io.netty.handler.codec.http.HttpContentDecompressor; -import io.netty.handler.codec.http.HttpMessage; -import io.netty.handler.codec.http.HttpRequest; -import io.netty.handler.codec.http.HttpResponse; -import io.netty.handler.codec.http.HttpServerCodec; -import io.netty.handler.codec.http.LastHttpContent; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class HttpByteBufFormatter { diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/HttpMessageAndTimestamp.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/HttpMessageAndTimestamp.java index 734b153e3c..77edbb2cc7 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/HttpMessageAndTimestamp.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/HttpMessageAndTimestamp.java @@ -1,30 +1,20 @@ package org.opensearch.migrations.replay; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.time.Instant; import java.util.Optional; import java.util.stream.Stream; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Lombok; import lombok.Setter; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.datatypes.RawPackets; import org.opensearch.migrations.replay.util.NettyUtils; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.Lombok; -import lombok.Setter; -import lombok.extern.slf4j.Slf4j; - @Slf4j @EqualsAndHashCode(exclude = "currentSegmentBytes") public class HttpMessageAndTimestamp { diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/PacketToTransformingHttpHandlerFactory.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/PacketToTransformingHttpHandlerFactory.java index 5a90e2cfb1..aa410b8995 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/PacketToTransformingHttpHandlerFactory.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/PacketToTransformingHttpHandlerFactory.java @@ -1,7 +1,6 @@ package org.opensearch.migrations.replay; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.datahandlers.IPacketFinalizingConsumer; import org.opensearch.migrations.replay.datahandlers.TransformedPacketReceiver; import org.opensearch.migrations.replay.datahandlers.http.HttpJsonTransformingConsumer; @@ -11,8 +10,6 @@ import org.opensearch.migrations.transform.IAuthTransformerFactory; import org.opensearch.migrations.transform.IJsonTransformer; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class PacketToTransformingHttpHandlerFactory implements diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/ParsedHttpMessagesAsDicts.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/ParsedHttpMessagesAsDicts.java index fe409c0d65..8b742585ec 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/ParsedHttpMessagesAsDicts.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/ParsedHttpMessagesAsDicts.java @@ -1,5 +1,9 @@ package org.opensearch.migrations.replay; +import io.netty.buffer.ByteBuf; +import io.netty.handler.codec.base64.Base64; +import io.netty.handler.codec.base64.Base64Dialect; +import io.netty.handler.codec.http.HttpHeaders; import java.nio.charset.StandardCharsets; import java.time.Duration; import java.util.LinkedHashMap; @@ -8,26 +12,13 @@ import java.util.Optional; import java.util.concurrent.Callable; import java.util.stream.Collectors; - -import io.netty.buffer.ByteBuf; -import io.netty.handler.codec.base64.Base64; -import io.netty.handler.codec.base64.Base64Dialect; -import io.netty.handler.codec.http.HttpHeaders; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.datatypes.ByteBufList; import org.opensearch.migrations.replay.tracing.IReplayContexts; import org.opensearch.migrations.replay.util.NettyUtils; import org.opensearch.migrations.replay.util.RefSafeHolder; -import io.netty.buffer.ByteBuf; -import io.netty.handler.codec.base64.Base64; -import io.netty.handler.codec.base64.Base64Dialect; -import io.netty.handler.codec.http.HttpHeaders; -import lombok.NonNull; -import lombok.extern.slf4j.Slf4j; - /** * TODO - This class will pull all bodies in as a byte[], even if that byte[] isn't * going to be used. While in most cases, we'll likely want to emit all of the bytes diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/ReplayEngine.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/ReplayEngine.java index e139f13a68..9c83442d6c 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/ReplayEngine.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/ReplayEngine.java @@ -1,23 +1,18 @@ package org.opensearch.migrations.replay; +import io.netty.util.concurrent.ScheduledFuture; import java.time.Duration; import java.time.Instant; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import java.util.function.Supplier; - -import io.netty.util.concurrent.ScheduledFuture; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.datatypes.ByteBufList; import org.opensearch.migrations.replay.datatypes.IndexedChannelInteraction; import org.opensearch.migrations.replay.tracing.IReplayContexts; import org.opensearch.migrations.replay.traffic.source.BufferedFlowController; import org.opensearch.migrations.replay.util.TrackedFuture; -import io.netty.util.concurrent.ScheduledFuture; -import lombok.extern.slf4j.Slf4j; - /** * This class is responsible for managing the BufferedFlowController, which is responsible for releasing * backpressure on the traffic source so that this class can schedule those requests to run on a diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/ReplayUtils.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/ReplayUtils.java index 2b75cef928..783dfd7850 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/ReplayUtils.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/ReplayUtils.java @@ -1,5 +1,6 @@ package org.opensearch.migrations.replay; +import io.netty.buffer.ByteBuf; import java.io.ByteArrayInputStream; import java.io.SequenceInputStream; import java.util.Collections; @@ -7,10 +8,6 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import io.netty.buffer.ByteBuf; - -import io.netty.buffer.ByteBuf; - public class ReplayUtils { private ReplayUtils() {} diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/RequestResponsePacketPair.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/RequestResponsePacketPair.java index 83a769d5e3..9abf6fa692 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/RequestResponsePacketPair.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/RequestResponsePacketPair.java @@ -1,16 +1,14 @@ package org.opensearch.migrations.replay; +import com.google.common.base.Objects; import java.nio.charset.StandardCharsets; import java.time.Instant; import java.util.ArrayList; import java.util.Collections; import java.util.List; - -import com.google.common.base.Objects; import lombok.Getter; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.datatypes.ISourceTrafficChannelKey; import org.opensearch.migrations.replay.datatypes.ITrafficStreamKey; import org.opensearch.migrations.replay.datatypes.UniqueReplayerRequestKey; @@ -18,11 +16,6 @@ import org.opensearch.migrations.tracing.IScopedInstrumentationAttributes; import org.opensearch.migrations.tracing.IWithTypedEnclosingScope; -import com.google.common.base.Objects; -import lombok.Getter; -import lombok.NonNull; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class RequestResponsePacketPair implements IRequestResponsePacketPair { diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/RequestSenderOrchestrator.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/RequestSenderOrchestrator.java index f2544280dd..0febed657e 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/RequestSenderOrchestrator.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/RequestSenderOrchestrator.java @@ -1,5 +1,8 @@ package org.opensearch.migrations.replay; +import io.netty.buffer.ByteBuf; +import io.netty.channel.EventLoop; +import io.netty.util.concurrent.ScheduledFuture; import java.time.Duration; import java.time.Instant; import java.util.Iterator; @@ -10,13 +13,8 @@ import java.util.function.BiFunction; import java.util.function.Function; import java.util.function.Supplier; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.EventLoop; -import io.netty.util.concurrent.ScheduledFuture; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.NettyFutureBinders; import org.opensearch.migrations.replay.datahandlers.IPacketFinalizingConsumer; import org.opensearch.migrations.replay.datatypes.ByteBufList; @@ -30,12 +28,6 @@ import org.opensearch.migrations.replay.util.TextTrackedFuture; import org.opensearch.migrations.replay.util.TrackedFuture; -import io.netty.buffer.ByteBuf; -import io.netty.channel.EventLoop; -import io.netty.util.concurrent.ScheduledFuture; -import lombok.AllArgsConstructor; -import lombok.extern.slf4j.Slf4j; - /** * This class deals with scheduling different HTTP connection/request activities on a Netty Event Loop. * There are 4 public methods for this class. scheduleAtFixedRate serves as a utility function and the diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/RequestTransformerAndSender.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/RequestTransformerAndSender.java index 30a2dc3bf5..f2baf4fd2c 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/RequestTransformerAndSender.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/RequestTransformerAndSender.java @@ -1,15 +1,13 @@ package org.opensearch.migrations.replay; +import io.netty.buffer.Unpooled; import java.time.Instant; import java.util.function.Consumer; import java.util.function.Supplier; import java.util.stream.Stream; - -import io.netty.buffer.Unpooled; import lombok.AllArgsConstructor; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.datahandlers.IPacketFinalizingConsumer; import org.opensearch.migrations.replay.datatypes.ByteBufList; import org.opensearch.migrations.replay.datatypes.HttpRequestTransformationStatus; @@ -19,11 +17,6 @@ import org.opensearch.migrations.replay.util.TextTrackedFuture; import org.opensearch.migrations.replay.util.TrackedFuture; -import io.netty.buffer.Unpooled; -import lombok.AllArgsConstructor; -import lombok.NonNull; -import lombok.extern.slf4j.Slf4j; - @Slf4j @AllArgsConstructor public class RequestTransformerAndSender { diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/ResultsToLogsConsumer.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/ResultsToLogsConsumer.java index f5435e4486..177688d57b 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/ResultsToLogsConsumer.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/ResultsToLogsConsumer.java @@ -1,5 +1,7 @@ package org.opensearch.migrations.replay; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.netty.buffer.ByteBuf; import java.util.LinkedHashMap; import java.util.Map; import java.util.Optional; @@ -10,20 +12,9 @@ import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.Stream; - -import com.fasterxml.jackson.databind.ObjectMapper; -import io.netty.buffer.ByteBuf; import lombok.Lombok; import lombok.extern.slf4j.Slf4j; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import org.opensearch.migrations.replay.datatypes.UniqueSourceRequestKey; - -import com.fasterxml.jackson.databind.ObjectMapper; -import io.netty.buffer.ByteBuf; -import lombok.Lombok; -import lombok.extern.slf4j.Slf4j; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/SourceTargetCaptureTuple.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/SourceTargetCaptureTuple.java index ad137411d5..6b216121f5 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/SourceTargetCaptureTuple.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/SourceTargetCaptureTuple.java @@ -1,5 +1,7 @@ package org.opensearch.migrations.replay; +import static org.opensearch.migrations.replay.HttpByteBufFormatter.LF_LINE_DELIMITER; + import java.time.Duration; import java.util.AbstractMap; import java.util.List; @@ -7,22 +9,14 @@ import java.util.StringJoiner; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; - import lombok.AllArgsConstructor; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.datatypes.ByteBufList; import org.opensearch.migrations.replay.datatypes.HttpRequestTransformationStatus; import org.opensearch.migrations.replay.datatypes.UniqueReplayerRequestKey; import org.opensearch.migrations.replay.tracing.IReplayContexts; -import lombok.AllArgsConstructor; -import lombok.NonNull; -import lombok.extern.slf4j.Slf4j; - -import static org.opensearch.migrations.replay.HttpByteBufFormatter.LF_LINE_DELIMITER; - @Slf4j public class SourceTargetCaptureTuple implements AutoCloseable { @AllArgsConstructor diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TimeShifter.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TimeShifter.java index fd6fa8b98e..c763349f6d 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TimeShifter.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TimeShifter.java @@ -4,10 +4,6 @@ import java.time.Instant; import java.util.Optional; import java.util.concurrent.atomic.AtomicReference; - -import lombok.extern.slf4j.Slf4j; -import org.slf4j.event.Level; - import lombok.extern.slf4j.Slf4j; import org.slf4j.event.Level; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TrafficCaptureSourceFactory.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TrafficCaptureSourceFactory.java index 6f955562a8..3740c0b154 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TrafficCaptureSourceFactory.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TrafficCaptureSourceFactory.java @@ -4,9 +4,7 @@ import java.io.IOException; import java.time.Clock; import java.time.Duration; - import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.kafka.KafkaBehavioralPolicy; import org.opensearch.migrations.replay.kafka.KafkaTrafficCaptureSource; import org.opensearch.migrations.replay.tracing.RootReplayerContext; @@ -14,8 +12,6 @@ import org.opensearch.migrations.replay.traffic.source.ISimpleTrafficCaptureSource; import org.opensearch.migrations.replay.traffic.source.InputStreamOfTraffic; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class TrafficCaptureSourceFactory { diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TrafficReplayer.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TrafficReplayer.java index d115467f3a..3a5110c544 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TrafficReplayer.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TrafficReplayer.java @@ -1,5 +1,9 @@ package org.opensearch.migrations.replay; +import com.beust.jcommander.JCommander; +import com.beust.jcommander.Parameter; +import com.beust.jcommander.ParameterException; +import io.netty.util.concurrent.DefaultThreadFactory; import java.io.IOException; import java.lang.ref.WeakReference; import java.net.URI; @@ -14,18 +18,7 @@ import java.util.Optional; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; - -import com.beust.jcommander.JCommander; -import com.beust.jcommander.Parameter; -import com.beust.jcommander.ParameterException; -import io.netty.util.concurrent.DefaultThreadFactory; import lombok.extern.slf4j.Slf4j; -import org.slf4j.LoggerFactory; -import org.slf4j.event.Level; -import software.amazon.awssdk.arns.Arn; -import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider; -import software.amazon.awssdk.regions.Region; - import org.opensearch.migrations.jcommander.NoSplitter; import org.opensearch.migrations.replay.tracing.RootReplayerContext; import org.opensearch.migrations.replay.traffic.source.TrafficStreamLimiter; @@ -41,12 +34,6 @@ import org.opensearch.migrations.transform.SigV4AuthTransformerFactory; import org.opensearch.migrations.transform.StaticAuthTransformerFactory; import org.opensearch.migrations.utils.ProcessHelpers; - -import com.beust.jcommander.JCommander; -import com.beust.jcommander.Parameter; -import com.beust.jcommander.ParameterException; -import io.netty.util.concurrent.DefaultThreadFactory; -import lombok.extern.slf4j.Slf4j; import org.slf4j.LoggerFactory; import org.slf4j.event.Level; import software.amazon.awssdk.arns.Arn; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TrafficReplayerCore.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TrafficReplayerCore.java index 2b53215849..7f1705e35d 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TrafficReplayerCore.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TrafficReplayerCore.java @@ -13,13 +13,11 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.function.Consumer; import java.util.stream.Collectors; - import lombok.AllArgsConstructor; import lombok.Lombok; import lombok.NonNull; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.datatypes.HttpRequestTransformationStatus; import org.opensearch.migrations.replay.datatypes.ITrafficStreamKey; import org.opensearch.migrations.replay.datatypes.UniqueReplayerRequestKey; @@ -35,12 +33,6 @@ import org.opensearch.migrations.transform.IAuthTransformerFactory; import org.opensearch.migrations.transform.IJsonTransformer; -import lombok.AllArgsConstructor; -import lombok.Lombok; -import lombok.NonNull; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; - @Slf4j public abstract class TrafficReplayerCore extends RequestTransformerAndSender { diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TrafficReplayerTopLevel.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TrafficReplayerTopLevel.java index 16ffd37263..7bb39d58ac 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TrafficReplayerTopLevel.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TrafficReplayerTopLevel.java @@ -1,5 +1,8 @@ package org.opensearch.migrations.replay; +import io.netty.handler.ssl.SslContext; +import io.netty.handler.ssl.SslContextBuilder; +import io.netty.handler.ssl.util.InsecureTrustManagerFactory; import java.net.URI; import java.time.Duration; import java.util.Arrays; @@ -15,16 +18,9 @@ import java.util.function.Consumer; import java.util.stream.Collectors; import java.util.stream.Stream; - -import io.netty.handler.ssl.SslContext; -import io.netty.handler.ssl.SslContextBuilder; -import io.netty.handler.ssl.util.InsecureTrustManagerFactory; import lombok.NonNull; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; -import org.slf4j.event.Level; -import org.slf4j.spi.LoggingEventBuilder; - import org.opensearch.migrations.replay.datahandlers.NettyPacketToHttpConsumer; import org.opensearch.migrations.replay.datatypes.UniqueReplayerRequestKey; import org.opensearch.migrations.replay.http.retries.OpenSearchDefaultRetry; @@ -36,13 +32,6 @@ import org.opensearch.migrations.replay.util.TrackedFuture; import org.opensearch.migrations.transform.IAuthTransformerFactory; import org.opensearch.migrations.transform.IJsonTransformer; - -import io.netty.handler.ssl.SslContext; -import io.netty.handler.ssl.SslContextBuilder; -import io.netty.handler.ssl.util.InsecureTrustManagerFactory; -import lombok.NonNull; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; import org.slf4j.event.Level; import org.slf4j.spi.LoggingEventBuilder; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TransformationLoader.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TransformationLoader.java index f42fdfe8b2..3950fbf9a2 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TransformationLoader.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TransformationLoader.java @@ -1,5 +1,8 @@ package org.opensearch.migrations.replay; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -9,26 +12,14 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; import lombok.AllArgsConstructor; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.transform.IJsonTransformer; import org.opensearch.migrations.transform.IJsonTransformerProvider; import org.opensearch.migrations.transform.JsonCompositeTransformer; import org.opensearch.migrations.transform.JsonKeysForHttpMessage; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; -import lombok.AllArgsConstructor; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class TransformationLoader { public static final String WRONG_JSON_STRUCTURE_MESSAGE = diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TransformedTargetRequestAndResponseList.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TransformedTargetRequestAndResponseList.java index f53fb17638..9d0bbfbe67 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TransformedTargetRequestAndResponseList.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TransformedTargetRequestAndResponseList.java @@ -4,14 +4,10 @@ import java.util.Collections; import java.util.List; import java.util.stream.Collectors; - import lombok.Getter; - import org.opensearch.migrations.replay.datatypes.ByteBufList; import org.opensearch.migrations.replay.datatypes.HttpRequestTransformationStatus; -import lombok.Getter; - public class TransformedTargetRequestAndResponseList { protected final ByteBufList requestPackets; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TupleParserChainConsumer.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TupleParserChainConsumer.java index c3b7203854..f7a3209767 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TupleParserChainConsumer.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/TupleParserChainConsumer.java @@ -2,9 +2,6 @@ import java.util.function.BiConsumer; import java.util.function.Consumer; - -import lombok.NonNull; - import lombok.NonNull; public class TupleParserChainConsumer implements Consumer { diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/Utils.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/Utils.java index c1d9b15c1f..65efb395aa 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/Utils.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/Utils.java @@ -1,5 +1,6 @@ package org.opensearch.migrations.replay; +import com.google.protobuf.ByteString; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.time.Instant; @@ -8,19 +9,12 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Stream; import java.util.zip.GZIPOutputStream; - -import com.google.protobuf.ByteString; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.trafficcapture.protos.ReadObservation; import org.opensearch.migrations.trafficcapture.protos.TrafficObservation; import org.opensearch.migrations.trafficcapture.protos.TrafficStream; -import com.google.protobuf.ByteString; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class Utils { public static final int MAX_BYTES_SHOWN_FOR_TO_STRING = 128; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/IPacketConsumer.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/IPacketConsumer.java index 588e0e1efd..c6c7c7a3dc 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/IPacketConsumer.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/IPacketConsumer.java @@ -2,12 +2,8 @@ import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; - import org.opensearch.migrations.replay.util.TrackedFuture; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; - /** * This class consumes arrays of bytes or ByteBufs, potentially asynchronously, * whose completion is signaled via the CompletableFuture that is returned. diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/JsonAccumulator.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/JsonAccumulator.java index 412a535c9c..72a18293a9 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/JsonAccumulator.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/JsonAccumulator.java @@ -1,5 +1,8 @@ package org.opensearch.migrations.replay.datahandlers; +import com.fasterxml.jackson.core.JsonFactory; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.async.ByteBufferFeeder; import java.io.IOException; import java.nio.ByteBuffer; import java.util.ArrayDeque; @@ -7,16 +10,6 @@ import java.util.Deque; import java.util.LinkedHashMap; import java.util.Map; - -import com.fasterxml.jackson.core.JsonFactory; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.async.ByteBufferFeeder; -import lombok.Getter; -import lombok.extern.slf4j.Slf4j; - -import com.fasterxml.jackson.core.JsonFactory; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.async.ByteBufferFeeder; import lombok.Getter; import lombok.extern.slf4j.Slf4j; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/JsonEmitter.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/JsonEmitter.java index 05b9372f29..5942ddab00 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/JsonEmitter.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/JsonEmitter.java @@ -1,28 +1,5 @@ package org.opensearch.migrations.replay.datahandlers; -import java.io.IOException; -import java.io.OutputStream; -import java.util.ArrayDeque; -import java.util.Arrays; -import java.util.Deque; -import java.util.Iterator; -import java.util.Map; -import java.util.function.Supplier; - -import com.fasterxml.jackson.core.JsonEncoding; -import com.fasterxml.jackson.core.JsonFactory; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufAllocator; -import io.netty.buffer.CompositeByteBuf; -import lombok.Getter; -import lombok.Lombok; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; - import com.fasterxml.jackson.core.JsonEncoding; import com.fasterxml.jackson.core.JsonFactory; import com.fasterxml.jackson.core.JsonGenerator; @@ -32,6 +9,14 @@ import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufAllocator; import io.netty.buffer.CompositeByteBuf; +import java.io.IOException; +import java.io.OutputStream; +import java.util.ArrayDeque; +import java.util.Arrays; +import java.util.Deque; +import java.util.Iterator; +import java.util.Map; +import java.util.function.Supplier; import lombok.Getter; import lombok.Lombok; import lombok.SneakyThrows; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/NettyPacketToHttpConsumer.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/NettyPacketToHttpConsumer.java index 31e93f9b71..377212c204 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/NettyPacketToHttpConsumer.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/NettyPacketToHttpConsumer.java @@ -1,16 +1,5 @@ package org.opensearch.migrations.replay.datahandlers; -import java.io.IOException; -import java.net.URI; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import java.time.Instant; -import java.util.NoSuchElementException; -import java.util.Optional; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.TimeUnit; -import java.util.function.BiFunction; - import io.netty.bootstrap.Bootstrap; import io.netty.buffer.ByteBuf; import io.netty.channel.Channel; @@ -28,10 +17,19 @@ import io.netty.handler.ssl.SslContext; import io.netty.handler.ssl.SslHandler; import io.netty.handler.timeout.ReadTimeoutHandler; +import java.io.IOException; +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.time.Instant; +import java.util.NoSuchElementException; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; +import java.util.function.BiFunction; import lombok.Lombok; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.NettyFutureBinders; import org.opensearch.migrations.replay.AggregatedRawResponse; import org.opensearch.migrations.replay.datahandlers.http.helpers.ReadMeteringHandler; @@ -45,27 +43,6 @@ import org.opensearch.migrations.tracing.IScopedInstrumentationAttributes; import org.opensearch.migrations.tracing.IWithTypedEnclosingScope; -import io.netty.bootstrap.Bootstrap; -import io.netty.buffer.ByteBuf; -import io.netty.channel.Channel; -import io.netty.channel.ChannelFuture; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; -import io.netty.channel.ChannelInitializer; -import io.netty.channel.ChannelOption; -import io.netty.channel.ChannelPipeline; -import io.netty.channel.EventLoop; -import io.netty.channel.socket.nio.NioSocketChannel; -import io.netty.handler.codec.http.HttpResponseDecoder; -import io.netty.handler.logging.LogLevel; -import io.netty.handler.logging.LoggingHandler; -import io.netty.handler.ssl.SslContext; -import io.netty.handler.ssl.SslHandler; -import io.netty.handler.timeout.ReadTimeoutHandler; -import lombok.Lombok; -import lombok.NonNull; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class NettyPacketToHttpConsumer implements IPacketFinalizingConsumer { diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/PayloadAccessFaultingMap.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/PayloadAccessFaultingMap.java index 36fedc0ce8..544f3cf5ad 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/PayloadAccessFaultingMap.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/PayloadAccessFaultingMap.java @@ -7,21 +7,13 @@ import java.util.Optional; import java.util.Set; import java.util.TreeMap; - import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.NonNull; import lombok.Setter; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.datahandlers.http.StrictCaseInsensitiveHttpHeadersMap; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NonNull; -import lombok.Setter; -import lombok.extern.slf4j.Slf4j; - /** * This is a trivial map implementation that can only store one key-value pair, "inlinedJsonBody" * and more importantly, to raise a PayloadNotLoadedException when the mapping isn't present. diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/TransformedPacketReceiver.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/TransformedPacketReceiver.java index 47ca63abac..a003137dcb 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/TransformedPacketReceiver.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/TransformedPacketReceiver.java @@ -1,12 +1,9 @@ package org.opensearch.migrations.replay.datahandlers; import io.netty.buffer.ByteBuf; - import org.opensearch.migrations.replay.datatypes.ByteBufList; import org.opensearch.migrations.replay.util.TrackedFuture; -import io.netty.buffer.ByteBuf; - public class TransformedPacketReceiver implements IPacketFinalizingConsumer { public final ByteBufList packets = new ByteBufList(); diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/HttpJsonMessageWithFaultingPayload.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/HttpJsonMessageWithFaultingPayload.java index 51c052c75c..7ed3ec7296 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/HttpJsonMessageWithFaultingPayload.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/HttpJsonMessageWithFaultingPayload.java @@ -2,7 +2,6 @@ import java.util.LinkedHashMap; import java.util.Map; - import org.opensearch.migrations.replay.datahandlers.PayloadAccessFaultingMap; import org.opensearch.migrations.transform.JsonKeysForHttpMessage; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/HttpJsonTransformingConsumer.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/HttpJsonTransformingConsumer.java index 5d7dc25024..b90b0d2376 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/HttpJsonTransformingConsumer.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/HttpJsonTransformingConsumer.java @@ -1,16 +1,14 @@ package org.opensearch.migrations.replay.datahandlers.http; +import io.netty.buffer.ByteBuf; +import io.netty.channel.embedded.EmbeddedChannel; +import io.netty.handler.codec.http.HttpRequestDecoder; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; import java.util.Optional; import java.util.concurrent.CompletionException; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.embedded.EmbeddedChannel; -import io.netty.handler.codec.http.HttpRequestDecoder; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.Utils; import org.opensearch.migrations.replay.datahandlers.IPacketFinalizingConsumer; import org.opensearch.migrations.replay.datatypes.HttpRequestTransformationStatus; @@ -21,11 +19,6 @@ import org.opensearch.migrations.transform.IAuthTransformerFactory; import org.opensearch.migrations.transform.IJsonTransformer; -import io.netty.buffer.ByteBuf; -import io.netty.channel.embedded.EmbeddedChannel; -import io.netty.handler.codec.http.HttpRequestDecoder; -import lombok.extern.slf4j.Slf4j; - /** * This class implements a packet consuming interface by using an EmbeddedChannel to write individual * packets through handlers that will parse the request's HTTP headers, determine what may need to diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/ListKeyAdaptingCaseInsensitiveHeadersMap.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/ListKeyAdaptingCaseInsensitiveHeadersMap.java index 0c266f55ff..bf27e65c0d 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/ListKeyAdaptingCaseInsensitiveHeadersMap.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/ListKeyAdaptingCaseInsensitiveHeadersMap.java @@ -5,9 +5,6 @@ import java.util.List; import java.util.Set; import java.util.stream.Collectors; - -import lombok.EqualsAndHashCode; - import lombok.EqualsAndHashCode; /** diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyDecodedHttpRequestPreliminaryConvertHandler.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyDecodedHttpRequestPreliminaryConvertHandler.java index ae4a31c07a..25d354e041 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyDecodedHttpRequestPreliminaryConvertHandler.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyDecodedHttpRequestPreliminaryConvertHandler.java @@ -1,30 +1,21 @@ package org.opensearch.migrations.replay.datahandlers.http; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.handler.codec.http.HttpContent; import io.netty.handler.codec.http.HttpRequest; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.datahandlers.PayloadAccessFaultingMap; import org.opensearch.migrations.replay.datahandlers.PayloadNotLoadedException; import org.opensearch.migrations.replay.tracing.IReplayContexts; import org.opensearch.migrations.transform.IAuthTransformer; import org.opensearch.migrations.transform.IJsonTransformer; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; -import io.netty.handler.codec.http.HttpContent; -import io.netty.handler.codec.http.HttpRequest; -import lombok.NonNull; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class NettyDecodedHttpRequestPreliminaryConvertHandler extends ChannelInboundHandlerAdapter { public static final int EXPECTED_PACKET_COUNT_GUESS_FOR_PAYLOAD = 32; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonBodyAccumulateHandler.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonBodyAccumulateHandler.java index fd7fac1a42..0483103125 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonBodyAccumulateHandler.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonBodyAccumulateHandler.java @@ -1,8 +1,5 @@ package org.opensearch.migrations.replay.datahandlers.http; -import java.util.ArrayList; -import java.util.List; - import com.fasterxml.jackson.core.JacksonException; import io.netty.buffer.CompositeByteBuf; import io.netty.buffer.Unpooled; @@ -11,24 +8,14 @@ import io.netty.handler.codec.http.HttpContent; import io.netty.handler.codec.http.LastHttpContent; import io.netty.util.ReferenceCountUtil; +import java.util.ArrayList; +import java.util.List; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.datahandlers.JsonAccumulator; import org.opensearch.migrations.replay.tracing.IReplayContexts; import org.opensearch.migrations.transform.JsonKeysForHttpMessage; -import com.fasterxml.jackson.core.JacksonException; -import io.netty.buffer.CompositeByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; -import io.netty.handler.codec.http.HttpContent; -import io.netty.handler.codec.http.LastHttpContent; -import io.netty.util.ReferenceCountUtil; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; - /** * This accumulates HttpContent messages through a JsonAccumulator and eventually fires off a * fully parsed json object as parsed by the JsonAccumulator (not by a signal that end of content diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonBodyConvertHandler.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonBodyConvertHandler.java index d3edd7cc88..d71893b87b 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonBodyConvertHandler.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonBodyConvertHandler.java @@ -4,16 +4,10 @@ import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.util.ReferenceCountUtil; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.datahandlers.PayloadAccessFaultingMap; import org.opensearch.migrations.transform.IJsonTransformer; import org.opensearch.migrations.transform.JsonKeysForHttpMessage; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; -import io.netty.util.ReferenceCountUtil; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class NettyJsonBodyConvertHandler extends ChannelInboundHandlerAdapter { private final IJsonTransformer transformer; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonBodySerializeHandler.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonBodySerializeHandler.java index c09e873969..00df6fff31 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonBodySerializeHandler.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonBodySerializeHandler.java @@ -1,8 +1,5 @@ package org.opensearch.migrations.replay.datahandlers.http; -import java.io.IOException; -import java.util.List; - import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import io.netty.channel.ChannelHandlerContext; @@ -10,20 +7,12 @@ import io.netty.handler.codec.http.DefaultHttpContent; import io.netty.handler.codec.http.LastHttpContent; import io.netty.util.ReferenceCountUtil; +import java.io.IOException; +import java.util.List; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.datahandlers.JsonEmitter; import org.opensearch.migrations.transform.JsonKeysForHttpMessage; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; -import io.netty.handler.codec.http.DefaultHttpContent; -import io.netty.handler.codec.http.LastHttpContent; -import io.netty.util.ReferenceCountUtil; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class NettyJsonBodySerializeHandler extends ChannelInboundHandlerAdapter { public static final int NUM_BYTES_TO_ACCUMULATE_BEFORE_FIRING = 1024; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonContentAuthSigner.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonContentAuthSigner.java index 1c7c0656f1..1782735789 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonContentAuthSigner.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonContentAuthSigner.java @@ -1,22 +1,14 @@ package org.opensearch.migrations.replay.datahandlers.http; -import java.util.ArrayList; -import java.util.List; - import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.handler.codec.http.HttpContent; import io.netty.handler.codec.http.LastHttpContent; +import java.util.ArrayList; +import java.util.List; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.transform.IAuthTransformer; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; -import io.netty.handler.codec.http.HttpContent; -import io.netty.handler.codec.http.LastHttpContent; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class NettyJsonContentAuthSigner extends ChannelInboundHandlerAdapter { IAuthTransformer.StreamingFullMessageTransformer signer; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonContentCompressor.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonContentCompressor.java index 8a93b0bd24..a6af7a3bb2 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonContentCompressor.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonContentCompressor.java @@ -1,22 +1,14 @@ package org.opensearch.migrations.replay.datahandlers.http; -import java.io.BufferedOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.util.zip.GZIPOutputStream; - -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; -import io.netty.handler.codec.http.DefaultHttpContent; -import io.netty.handler.codec.http.HttpContent; -import io.netty.handler.codec.http.LastHttpContent; -import lombok.extern.slf4j.Slf4j; - import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.handler.codec.http.DefaultHttpContent; import io.netty.handler.codec.http.HttpContent; import io.netty.handler.codec.http.LastHttpContent; +import java.io.BufferedOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.util.zip.GZIPOutputStream; import lombok.extern.slf4j.Slf4j; @Slf4j diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonContentStreamToByteBufHandler.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonContentStreamToByteBufHandler.java index 0a64b500af..bb2ad11109 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonContentStreamToByteBufHandler.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonContentStreamToByteBufHandler.java @@ -1,15 +1,5 @@ package org.opensearch.migrations.replay.datahandlers.http; -import java.nio.charset.StandardCharsets; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.CompositeByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; -import io.netty.handler.codec.http.HttpContent; -import io.netty.handler.codec.http.LastHttpContent; - import io.netty.buffer.ByteBuf; import io.netty.buffer.CompositeByteBuf; import io.netty.buffer.Unpooled; @@ -17,6 +7,7 @@ import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.handler.codec.http.HttpContent; import io.netty.handler.codec.http.LastHttpContent; +import java.nio.charset.StandardCharsets; /** * This class is meant to be situated within a netty pipeline (see @RequestPipelineOrchestrator) diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonToByteBufHandler.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonToByteBufHandler.java index c17b7a5900..229aa4f9d5 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonToByteBufHandler.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonToByteBufHandler.java @@ -1,22 +1,5 @@ package org.opensearch.migrations.replay.datahandlers.http; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.nio.charset.StandardCharsets; -import java.util.List; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; -import io.netty.handler.codec.http.HttpContent; -import io.netty.handler.codec.http.LastHttpContent; -import lombok.Lombok; -import lombok.extern.slf4j.Slf4j; - import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufOutputStream; import io.netty.buffer.Unpooled; @@ -24,6 +7,12 @@ import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.handler.codec.http.HttpContent; import io.netty.handler.codec.http.LastHttpContent; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.nio.charset.StandardCharsets; +import java.util.List; import lombok.Lombok; import lombok.extern.slf4j.Slf4j; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettySendByteBufsToPacketHandlerHandler.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettySendByteBufsToPacketHandlerHandler.java index dc2a77f903..8b1eda0720 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettySendByteBufsToPacketHandlerHandler.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/NettySendByteBufsToPacketHandlerHandler.java @@ -1,14 +1,12 @@ package org.opensearch.migrations.replay.datahandlers.http; -import java.util.Optional; -import java.util.concurrent.atomic.AtomicReference; - import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.handler.codec.http.LastHttpContent; +import java.util.Optional; +import java.util.concurrent.atomic.AtomicReference; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.datahandlers.IPacketFinalizingConsumer; import org.opensearch.migrations.replay.datatypes.HttpRequestTransformationStatus; import org.opensearch.migrations.replay.datatypes.TransformedOutputAndResult; @@ -16,12 +14,6 @@ import org.opensearch.migrations.replay.util.TextTrackedFuture; import org.opensearch.migrations.replay.util.TrackedFuture; -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; -import io.netty.handler.codec.http.LastHttpContent; -import lombok.extern.slf4j.Slf4j; - /** * This class is responsible for sending the ByteBufs to the downstream packet receiver, * which in many cases will be the thing that sends the request over the network. diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/RequestPipelineOrchestrator.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/RequestPipelineOrchestrator.java index bb20e5c5eb..3b3a6ca742 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/RequestPipelineOrchestrator.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/RequestPipelineOrchestrator.java @@ -1,10 +1,5 @@ package org.opensearch.migrations.replay.datahandlers.http; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelPipeline; @@ -12,9 +7,12 @@ import io.netty.handler.codec.http.HttpRequestDecoder; import io.netty.handler.logging.LogLevel; import io.netty.handler.logging.LoggingHandler; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Optional; import lombok.Getter; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.datahandlers.IPacketFinalizingConsumer; import org.opensearch.migrations.replay.datahandlers.http.helpers.LastHttpContentListener; import org.opensearch.migrations.replay.datahandlers.http.helpers.ReadMeteringHandler; @@ -23,16 +21,6 @@ import org.opensearch.migrations.transform.IAuthTransformerFactory; import org.opensearch.migrations.transform.IJsonTransformer; -import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelPipeline; -import io.netty.handler.codec.http.HttpContentDecompressor; -import io.netty.handler.codec.http.HttpRequestDecoder; -import io.netty.handler.logging.LogLevel; -import io.netty.handler.logging.LoggingHandler; -import lombok.Getter; -import lombok.extern.slf4j.Slf4j; - /** * This class is meant to be the single place for all pipeline manipulations for HttpRequests. * Comments are strewn through pipeline additions that show the types of messages that are diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/StrictCaseInsensitiveHttpHeadersMap.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/StrictCaseInsensitiveHttpHeadersMap.java index 9167248163..62293e8991 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/StrictCaseInsensitiveHttpHeadersMap.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/StrictCaseInsensitiveHttpHeadersMap.java @@ -6,9 +6,6 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Set; - -import lombok.EqualsAndHashCode; - import lombok.EqualsAndHashCode; /** diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/helpers/LastHttpContentListener.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/helpers/LastHttpContentListener.java index 9e31f94a9b..d80dda43a6 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/helpers/LastHttpContentListener.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/helpers/LastHttpContentListener.java @@ -4,10 +4,6 @@ import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.handler.codec.http.LastHttpContent; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; -import io.netty.handler.codec.http.LastHttpContent; - public class LastHttpContentListener extends ChannelInboundHandlerAdapter { private final Runnable onLastContentReceived; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/helpers/ReadMeteringHandler.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/helpers/ReadMeteringHandler.java index 36a955763d..abcc9fc72f 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/helpers/ReadMeteringHandler.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/helpers/ReadMeteringHandler.java @@ -1,17 +1,10 @@ package org.opensearch.migrations.replay.datahandlers.http.helpers; -import java.util.function.IntConsumer; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; -import io.netty.handler.codec.http.HttpContent; -import lombok.AllArgsConstructor; - import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.handler.codec.http.HttpContent; +import java.util.function.IntConsumer; import lombok.AllArgsConstructor; @AllArgsConstructor diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/helpers/WriteMeteringHandler.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/helpers/WriteMeteringHandler.java index bef03768ad..573a416169 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/helpers/WriteMeteringHandler.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datahandlers/http/helpers/WriteMeteringHandler.java @@ -1,18 +1,11 @@ package org.opensearch.migrations.replay.datahandlers.http.helpers; -import java.util.function.IntConsumer; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelOutboundHandlerAdapter; -import io.netty.channel.ChannelPromise; -import io.netty.handler.codec.http.HttpContent; - import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelOutboundHandlerAdapter; import io.netty.channel.ChannelPromise; import io.netty.handler.codec.http.HttpContent; +import java.util.function.IntConsumer; public class WriteMeteringHandler extends ChannelOutboundHandlerAdapter { final IntConsumer sizeConsumer; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/ByteBufList.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/ByteBufList.java index dfb12f729e..91ac3e7cb7 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/ByteBufList.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/ByteBufList.java @@ -1,20 +1,13 @@ package org.opensearch.migrations.replay.datatypes; -import java.util.ArrayList; -import java.util.StringJoiner; -import java.util.stream.Stream; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.CompositeByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.util.AbstractReferenceCounted; -import io.netty.util.ReferenceCounted; - import io.netty.buffer.ByteBuf; import io.netty.buffer.CompositeByteBuf; import io.netty.buffer.Unpooled; import io.netty.util.AbstractReferenceCounted; import io.netty.util.ReferenceCounted; +import java.util.ArrayList; +import java.util.StringJoiner; +import java.util.stream.Stream; public class ByteBufList extends AbstractReferenceCounted { diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/ChannelTask.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/ChannelTask.java index 5f9f6c7c5e..e45ead7a37 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/ChannelTask.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/ChannelTask.java @@ -3,9 +3,6 @@ import lombok.AllArgsConstructor; import lombok.Getter; -import lombok.AllArgsConstructor; -import lombok.Getter; - @AllArgsConstructor @Getter public class ChannelTask { diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/ConnectionReplaySession.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/ConnectionReplaySession.java index 00a06b66e3..b72e85aa88 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/ConnectionReplaySession.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/ConnectionReplaySession.java @@ -1,24 +1,16 @@ package org.opensearch.migrations.replay.datatypes; -import java.util.function.BiFunction; - import io.netty.channel.ChannelFuture; import io.netty.channel.EventLoop; +import java.util.function.BiFunction; import lombok.Getter; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.tracing.IReplayContexts; import org.opensearch.migrations.replay.util.OnlineRadixSorter; import org.opensearch.migrations.replay.util.TextTrackedFuture; import org.opensearch.migrations.replay.util.TrackedFuture; -import io.netty.channel.ChannelFuture; -import io.netty.channel.EventLoop; -import lombok.Getter; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; - /** * This class contains everything that is needed to replay packets to a specific channel. * ConnectionClientPool and RequestSenderOrchestrator manage the data within these objects. diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/FutureTransformer.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/FutureTransformer.java index b5ebb7e94d..bb5ea1296d 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/FutureTransformer.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/FutureTransformer.java @@ -1,7 +1,6 @@ package org.opensearch.migrations.replay.datatypes; import java.util.function.Function; - import org.opensearch.migrations.replay.util.TrackedFuture; /** diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/HttpRequestTransformationStatus.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/HttpRequestTransformationStatus.java index 37a30040d7..6135b8a92a 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/HttpRequestTransformationStatus.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/HttpRequestTransformationStatus.java @@ -4,10 +4,6 @@ import lombok.Getter; import lombok.NonNull; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NonNull; - public abstract class HttpRequestTransformationStatus { private HttpRequestTransformationStatus() {} diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/ISourceTrafficChannelKey.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/ISourceTrafficChannelKey.java index c12a5d5407..3ca8482c4d 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/ISourceTrafficChannelKey.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/ISourceTrafficChannelKey.java @@ -3,9 +3,6 @@ import lombok.AllArgsConstructor; import lombok.Getter; -import lombok.AllArgsConstructor; -import lombok.Getter; - public interface ISourceTrafficChannelKey { String getNodeId(); diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/ITrafficStreamKey.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/ITrafficStreamKey.java index 16b6705fa6..5a4fb44985 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/ITrafficStreamKey.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/ITrafficStreamKey.java @@ -1,11 +1,8 @@ package org.opensearch.migrations.replay.datatypes; import lombok.NonNull; - import org.opensearch.migrations.replay.tracing.IReplayContexts; -import lombok.NonNull; - public interface ITrafficStreamKey extends ISourceTrafficChannelKey { int getTrafficStreamIndex(); diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/IndexedChannelInteraction.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/IndexedChannelInteraction.java index 2250901024..e4643f0873 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/IndexedChannelInteraction.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/IndexedChannelInteraction.java @@ -3,9 +3,6 @@ import lombok.AllArgsConstructor; import lombok.ToString; -import lombok.AllArgsConstructor; -import lombok.ToString; - @AllArgsConstructor @ToString public class IndexedChannelInteraction { diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/PojoTrafficStreamAndKey.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/PojoTrafficStreamAndKey.java index c9bb1e0dc0..64285b1470 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/PojoTrafficStreamAndKey.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/PojoTrafficStreamAndKey.java @@ -2,13 +2,9 @@ import lombok.AllArgsConstructor; import lombok.Getter; - import org.opensearch.migrations.replay.traffic.source.ITrafficStreamWithKey; import org.opensearch.migrations.trafficcapture.protos.TrafficStream; -import lombok.AllArgsConstructor; -import lombok.Getter; - @AllArgsConstructor @Getter public class PojoTrafficStreamAndKey implements ITrafficStreamWithKey { diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/PojoTrafficStreamKey.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/PojoTrafficStreamKey.java index 4d2e66ef47..9ed915ab89 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/PojoTrafficStreamKey.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/PojoTrafficStreamKey.java @@ -1,11 +1,8 @@ package org.opensearch.migrations.replay.datatypes; import lombok.EqualsAndHashCode; - import org.opensearch.migrations.replay.util.TrafficChannelKeyFormatter; -import lombok.EqualsAndHashCode; - @EqualsAndHashCode() public abstract class PojoTrafficStreamKey extends ISourceTrafficChannelKey.PojoImpl implements ITrafficStreamKey { protected final int trafficStreamIndex; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/PojoTrafficStreamKeyAndContext.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/PojoTrafficStreamKeyAndContext.java index 868ba8ef43..ba3bd6d7cb 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/PojoTrafficStreamKeyAndContext.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/PojoTrafficStreamKeyAndContext.java @@ -1,19 +1,13 @@ package org.opensearch.migrations.replay.datatypes; import java.util.function.Function; - import lombok.EqualsAndHashCode; import lombok.NonNull; import lombok.Setter; - import org.opensearch.migrations.replay.tracing.IReplayContexts; import org.opensearch.migrations.trafficcapture.protos.TrafficStream; import org.opensearch.migrations.trafficcapture.protos.TrafficStreamUtils; -import lombok.EqualsAndHashCode; -import lombok.NonNull; -import lombok.Setter; - @EqualsAndHashCode(callSuper = true) public class PojoTrafficStreamKeyAndContext extends PojoTrafficStreamKey { @Setter diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/TimeToResponseFulfillmentFutureMap.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/TimeToResponseFulfillmentFutureMap.java index 5fdfa85f92..65c11d0c57 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/TimeToResponseFulfillmentFutureMap.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/TimeToResponseFulfillmentFutureMap.java @@ -4,7 +4,6 @@ import java.util.ArrayDeque; import java.util.Deque; import java.util.StringJoiner; - import org.opensearch.migrations.replay.util.TextTrackedFuture; import org.opensearch.migrations.replay.util.TrackedFuture; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/UniqueReplayerRequestKey.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/UniqueReplayerRequestKey.java index 57785614e0..63185a50d4 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/UniqueReplayerRequestKey.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/UniqueReplayerRequestKey.java @@ -3,9 +3,6 @@ import lombok.EqualsAndHashCode; import lombok.Getter; -import lombok.EqualsAndHashCode; -import lombok.Getter; - @EqualsAndHashCode(callSuper = true) public class UniqueReplayerRequestKey extends UniqueSourceRequestKey { public final ITrafficStreamKey trafficStreamKey; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/UniqueSourceRequestKey.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/UniqueSourceRequestKey.java index 1b11f560f8..80d72ebda4 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/UniqueSourceRequestKey.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/UniqueSourceRequestKey.java @@ -2,8 +2,6 @@ import com.google.common.base.Objects; -import com.google.common.base.Objects; - public abstract class UniqueSourceRequestKey { public abstract ISourceTrafficChannelKey getTrafficStreamKey(); diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/http/retries/DefaultRetry.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/http/retries/DefaultRetry.java index 9db3be0a58..389dcdfbf3 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/http/retries/DefaultRetry.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/http/retries/DefaultRetry.java @@ -1,12 +1,10 @@ package org.opensearch.migrations.replay.http.retries; +import io.netty.buffer.ByteBuf; +import io.netty.handler.codec.http.HttpResponse; import java.util.List; import java.util.Optional; import java.util.stream.Stream; - -import io.netty.buffer.ByteBuf; -import io.netty.handler.codec.http.HttpResponse; - import org.opensearch.migrations.replay.AggregatedRawResponse; import org.opensearch.migrations.replay.HttpByteBufFormatter; import org.opensearch.migrations.replay.IRequestResponsePacketPair; @@ -14,9 +12,6 @@ import org.opensearch.migrations.replay.util.TextTrackedFuture; import org.opensearch.migrations.replay.util.TrackedFuture; -import io.netty.buffer.ByteBuf; -import io.netty.handler.codec.http.HttpResponse; - public class DefaultRetry implements RequestRetryEvaluator { static final int MAX_RETRIES = 4; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/http/retries/NoRetryEvaluatorFactory.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/http/retries/NoRetryEvaluatorFactory.java index 6b81db08a0..92c7a5021d 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/http/retries/NoRetryEvaluatorFactory.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/http/retries/NoRetryEvaluatorFactory.java @@ -1,7 +1,6 @@ package org.opensearch.migrations.replay.http.retries; import io.netty.buffer.ByteBuf; - import org.opensearch.migrations.replay.AggregatedRawResponse; import org.opensearch.migrations.replay.IRequestResponsePacketPair; import org.opensearch.migrations.replay.RequestSenderOrchestrator; @@ -10,8 +9,6 @@ import org.opensearch.migrations.replay.util.TextTrackedFuture; import org.opensearch.migrations.replay.util.TrackedFuture; -import io.netty.buffer.ByteBuf; - public class NoRetryEvaluatorFactory implements IRetryVisitorFactory { public static class NoRetryVisitor diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/http/retries/OpenSearchDefaultRetry.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/http/retries/OpenSearchDefaultRetry.java index 1136a58735..7a6400d6d8 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/http/retries/OpenSearchDefaultRetry.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/http/retries/OpenSearchDefaultRetry.java @@ -1,10 +1,5 @@ package org.opensearch.migrations.replay.http.retries; -import java.io.IOException; -import java.util.Optional; -import java.util.regex.Pattern; -import java.util.stream.Stream; - import com.fasterxml.jackson.core.JsonFactory; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; @@ -15,10 +10,13 @@ import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.handler.codec.http.HttpContent; import io.netty.handler.codec.http.LastHttpContent; +import java.io.IOException; +import java.util.Optional; +import java.util.regex.Pattern; +import java.util.stream.Stream; import lombok.NonNull; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.AggregatedRawResponse; import org.opensearch.migrations.replay.HttpByteBufFormatter; import org.opensearch.migrations.replay.IRequestResponsePacketPair; @@ -26,20 +24,6 @@ import org.opensearch.migrations.replay.util.TextTrackedFuture; import org.opensearch.migrations.replay.util.TrackedFuture; -import com.fasterxml.jackson.core.JsonFactory; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonToken; -import com.fasterxml.jackson.core.async.ByteBufferFeeder; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; -import io.netty.handler.codec.http.HttpContent; -import io.netty.handler.codec.http.LastHttpContent; -import lombok.NonNull; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class OpenSearchDefaultRetry extends DefaultRetry { diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/http/retries/RequestRetryEvaluator.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/http/retries/RequestRetryEvaluator.java index afd1a30d3a..c3bf263768 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/http/retries/RequestRetryEvaluator.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/http/retries/RequestRetryEvaluator.java @@ -1,16 +1,12 @@ package org.opensearch.migrations.replay.http.retries; -import java.util.List; - import io.netty.buffer.ByteBuf; - +import java.util.List; import org.opensearch.migrations.replay.AggregatedRawResponse; import org.opensearch.migrations.replay.IRequestResponsePacketPair; import org.opensearch.migrations.replay.RequestSenderOrchestrator; import org.opensearch.migrations.replay.util.TrackedFuture; -import io.netty.buffer.ByteBuf; - public interface RequestRetryEvaluator { TrackedFuture diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/http/retries/RetryCollectingVisitorFactory.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/http/retries/RetryCollectingVisitorFactory.java index 0be0849293..90a882f0a1 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/http/retries/RetryCollectingVisitorFactory.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/http/retries/RetryCollectingVisitorFactory.java @@ -1,7 +1,6 @@ package org.opensearch.migrations.replay.http.retries; import java.util.Collections; - import org.opensearch.migrations.replay.IRequestResponsePacketPair; import org.opensearch.migrations.replay.RequestSenderOrchestrator; import org.opensearch.migrations.replay.TransformedTargetRequestAndResponseList; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/kafka/KafkaBehavioralPolicy.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/kafka/KafkaBehavioralPolicy.java index f83bf53711..624d17f6db 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/kafka/KafkaBehavioralPolicy.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/kafka/KafkaBehavioralPolicy.java @@ -4,10 +4,6 @@ import lombok.extern.slf4j.Slf4j; import org.apache.kafka.clients.consumer.ConsumerRecord; -import com.google.protobuf.InvalidProtocolBufferException; -import lombok.extern.slf4j.Slf4j; -import org.apache.kafka.clients.consumer.ConsumerRecord; - @Slf4j public class KafkaBehavioralPolicy { diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/kafka/KafkaTrafficCaptureSource.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/kafka/KafkaTrafficCaptureSource.java index d20da72648..aec4a0c683 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/kafka/KafkaTrafficCaptureSource.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/kafka/KafkaTrafficCaptureSource.java @@ -1,5 +1,7 @@ package org.opensearch.migrations.replay.kafka; +import com.google.protobuf.InvalidProtocolBufferException; +import io.netty.util.concurrent.DefaultThreadFactory; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; @@ -19,16 +21,12 @@ import java.util.concurrent.atomic.AtomicLong; import java.util.function.Supplier; import java.util.stream.Collectors; - -import com.google.protobuf.InvalidProtocolBufferException; -import io.netty.util.concurrent.DefaultThreadFactory; import lombok.NonNull; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.apache.kafka.clients.consumer.Consumer; import org.apache.kafka.clients.consumer.ConsumerConfig; import org.apache.kafka.clients.consumer.KafkaConsumer; - import org.opensearch.migrations.replay.datatypes.ITrafficStreamKey; import org.opensearch.migrations.replay.datatypes.PojoTrafficStreamAndKey; import org.opensearch.migrations.replay.tracing.ChannelContextManager; @@ -39,15 +37,6 @@ import org.opensearch.migrations.replay.traffic.source.ITrafficStreamWithKey; import org.opensearch.migrations.trafficcapture.protos.TrafficStream; -import com.google.protobuf.InvalidProtocolBufferException; -import io.netty.util.concurrent.DefaultThreadFactory; -import lombok.NonNull; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; -import org.apache.kafka.clients.consumer.Consumer; -import org.apache.kafka.clients.consumer.ConsumerConfig; -import org.apache.kafka.clients.consumer.KafkaConsumer; - /** * Adapt a Kafka stream into a TrafficCaptureSource. * diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/kafka/OffsetLifecycleTracker.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/kafka/OffsetLifecycleTracker.java index ba756faf0e..9b26ff50c1 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/kafka/OffsetLifecycleTracker.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/kafka/OffsetLifecycleTracker.java @@ -3,9 +3,6 @@ import java.util.Optional; import java.util.PriorityQueue; import java.util.StringJoiner; - -import lombok.extern.slf4j.Slf4j; - import lombok.extern.slf4j.Slf4j; /** diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/kafka/PojoKafkaCommitOffsetData.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/kafka/PojoKafkaCommitOffsetData.java index 2448d76266..bf3d24a623 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/kafka/PojoKafkaCommitOffsetData.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/kafka/PojoKafkaCommitOffsetData.java @@ -3,9 +3,6 @@ import lombok.AllArgsConstructor; import lombok.Getter; -import lombok.AllArgsConstructor; -import lombok.Getter; - @Getter @AllArgsConstructor public class PojoKafkaCommitOffsetData implements KafkaCommitOffsetData { diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/kafka/TrackingKafkaConsumer.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/kafka/TrackingKafkaConsumer.java index 0fe0e71503..b4514fdd38 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/kafka/TrackingKafkaConsumer.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/kafka/TrackingKafkaConsumer.java @@ -17,7 +17,6 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import java.util.stream.StreamSupport; - import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NonNull; @@ -28,25 +27,12 @@ import org.apache.kafka.clients.consumer.ConsumerRecords; import org.apache.kafka.clients.consumer.OffsetAndMetadata; import org.apache.kafka.common.TopicPartition; -import org.slf4j.event.Level; - import org.opensearch.migrations.replay.datatypes.ITrafficStreamKey; import org.opensearch.migrations.replay.tracing.IKafkaConsumerContexts; import org.opensearch.migrations.replay.tracing.ITrafficSourceContexts; import org.opensearch.migrations.replay.tracing.KafkaConsumerContexts; import org.opensearch.migrations.replay.tracing.RootReplayerContext; import org.opensearch.migrations.replay.traffic.source.ITrafficCaptureSource; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NonNull; -import lombok.extern.slf4j.Slf4j; -import org.apache.kafka.clients.consumer.Consumer; -import org.apache.kafka.clients.consumer.ConsumerRebalanceListener; -import org.apache.kafka.clients.consumer.ConsumerRecord; -import org.apache.kafka.clients.consumer.ConsumerRecords; -import org.apache.kafka.clients.consumer.OffsetAndMetadata; -import org.apache.kafka.common.TopicPartition; import org.slf4j.event.Level; /** diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/kafka/TrafficStreamKeyWithKafkaRecordId.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/kafka/TrafficStreamKeyWithKafkaRecordId.java index 9372ea571a..eb95f260e5 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/kafka/TrafficStreamKeyWithKafkaRecordId.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/kafka/TrafficStreamKeyWithKafkaRecordId.java @@ -2,18 +2,13 @@ import java.util.StringJoiner; import java.util.function.Function; - import lombok.EqualsAndHashCode; import lombok.Getter; - import org.opensearch.migrations.replay.datatypes.ITrafficStreamKey; import org.opensearch.migrations.replay.datatypes.PojoTrafficStreamKeyAndContext; import org.opensearch.migrations.replay.tracing.IReplayContexts; import org.opensearch.migrations.trafficcapture.protos.TrafficStream; -import lombok.EqualsAndHashCode; -import lombok.Getter; - @EqualsAndHashCode(callSuper = true) @Getter class TrafficStreamKeyWithKafkaRecordId extends PojoTrafficStreamKeyAndContext implements KafkaCommitOffsetData { diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/netty/BacksideHttpWatcherHandler.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/netty/BacksideHttpWatcherHandler.java index b2987f80e0..1762d9d889 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/netty/BacksideHttpWatcherHandler.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/netty/BacksideHttpWatcherHandler.java @@ -1,25 +1,15 @@ package org.opensearch.migrations.replay.netty; -import java.util.function.Consumer; - import io.netty.channel.ChannelHandlerContext; import io.netty.channel.SimpleChannelInboundHandler; import io.netty.handler.codec.http.HttpObject; import io.netty.handler.codec.http.HttpResponse; import io.netty.handler.codec.http.LastHttpContent; +import java.util.function.Consumer; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.AggregatedRawResponse; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.SimpleChannelInboundHandler; -import io.netty.handler.codec.http.HttpObject; -import io.netty.handler.codec.http.HttpResponse; -import io.netty.handler.codec.http.LastHttpContent; -import lombok.NonNull; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class BacksideHttpWatcherHandler extends SimpleChannelInboundHandler { diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/netty/BacksideSnifferHandler.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/netty/BacksideSnifferHandler.java index f2f77157ae..8a3ca42852 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/netty/BacksideSnifferHandler.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/netty/BacksideSnifferHandler.java @@ -4,14 +4,8 @@ import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.AggregatedRawResponse; -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class BacksideSnifferHandler extends ChannelInboundHandlerAdapter { diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/tracing/ChannelContextManager.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/tracing/ChannelContextManager.java index 38fb7658e3..9e2754ddcc 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/tracing/ChannelContextManager.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/tracing/ChannelContextManager.java @@ -2,13 +2,9 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.function.Function; - import lombok.Getter; - import org.opensearch.migrations.replay.datatypes.ITrafficStreamKey; -import lombok.Getter; - public class ChannelContextManager implements Function { @Getter private final RootReplayerContext globalContext; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/tracing/IReplayContexts.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/tracing/IReplayContexts.java index c15b06e4be..2dc015e2ae 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/tracing/IReplayContexts.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/tracing/IReplayContexts.java @@ -1,19 +1,14 @@ package org.opensearch.migrations.replay.tracing; -import java.time.Instant; - import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.common.AttributesBuilder; - +import java.time.Instant; import org.opensearch.migrations.replay.datatypes.ISourceTrafficChannelKey; import org.opensearch.migrations.replay.datatypes.ITrafficStreamKey; import org.opensearch.migrations.replay.datatypes.UniqueReplayerRequestKey; import org.opensearch.migrations.tracing.IScopedInstrumentationAttributes; import org.opensearch.migrations.tracing.IWithTypedEnclosingScope; -import io.opentelemetry.api.common.AttributeKey; -import io.opentelemetry.api.common.AttributesBuilder; - public interface IReplayContexts { class ActivityNames { diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/tracing/KafkaConsumerContexts.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/tracing/KafkaConsumerContexts.java index 9ff5ce2130..a7455e91c6 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/tracing/KafkaConsumerContexts.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/tracing/KafkaConsumerContexts.java @@ -1,29 +1,19 @@ package org.opensearch.migrations.replay.tracing; -import java.util.Collection; - import io.opentelemetry.api.metrics.LongCounter; import io.opentelemetry.api.metrics.LongUpDownCounter; import io.opentelemetry.api.metrics.Meter; +import java.util.Collection; import lombok.Getter; import lombok.NonNull; import lombok.Setter; import org.apache.kafka.common.TopicPartition; - import org.opensearch.migrations.tracing.BaseNestedSpanContext; import org.opensearch.migrations.tracing.CommonMetricInstruments; import org.opensearch.migrations.tracing.CommonScopedMetricInstruments; import org.opensearch.migrations.tracing.DirectNestedSpanContext; import org.opensearch.migrations.tracing.IScopedInstrumentationAttributes; -import io.opentelemetry.api.metrics.LongCounter; -import io.opentelemetry.api.metrics.LongUpDownCounter; -import io.opentelemetry.api.metrics.Meter; -import lombok.Getter; -import lombok.NonNull; -import lombok.Setter; -import org.apache.kafka.common.TopicPartition; - public class KafkaConsumerContexts { private KafkaConsumerContexts() {} diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/tracing/ReplayContexts.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/tracing/ReplayContexts.java index c1cc528eab..ff27bc9692 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/tracing/ReplayContexts.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/tracing/ReplayContexts.java @@ -1,9 +1,5 @@ package org.opensearch.migrations.replay.tracing; -import java.time.Duration; -import java.time.Instant; -import java.util.Optional; - import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.AttributesBuilder; @@ -11,10 +7,12 @@ import io.opentelemetry.api.metrics.LongCounter; import io.opentelemetry.api.metrics.LongUpDownCounter; import io.opentelemetry.api.metrics.Meter; +import java.time.Duration; +import java.time.Instant; +import java.util.Optional; import lombok.Getter; import lombok.NonNull; import lombok.Setter; - import org.opensearch.migrations.replay.datatypes.ISourceTrafficChannelKey; import org.opensearch.migrations.replay.datatypes.ITrafficStreamKey; import org.opensearch.migrations.replay.datatypes.UniqueReplayerRequestKey; @@ -23,17 +21,6 @@ import org.opensearch.migrations.tracing.DirectNestedSpanContext; import org.opensearch.migrations.tracing.IScopedInstrumentationAttributes; -import io.opentelemetry.api.common.AttributeKey; -import io.opentelemetry.api.common.Attributes; -import io.opentelemetry.api.common.AttributesBuilder; -import io.opentelemetry.api.metrics.DoubleHistogram; -import io.opentelemetry.api.metrics.LongCounter; -import io.opentelemetry.api.metrics.LongUpDownCounter; -import io.opentelemetry.api.metrics.Meter; -import lombok.Getter; -import lombok.NonNull; -import lombok.Setter; - public interface ReplayContexts extends IReplayContexts { String COUNT_UNIT_STR = "count"; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/tracing/RootReplayerContext.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/tracing/RootReplayerContext.java index efc07b7dbc..547e06643a 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/tracing/RootReplayerContext.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/tracing/RootReplayerContext.java @@ -2,16 +2,12 @@ import io.opentelemetry.api.OpenTelemetry; import lombok.Getter; - import org.opensearch.migrations.replay.datatypes.ISourceTrafficChannelKey; import org.opensearch.migrations.replay.datatypes.ITrafficStreamKey; import org.opensearch.migrations.replay.traffic.source.InputStreamOfTraffic; import org.opensearch.migrations.tracing.IContextTracker; import org.opensearch.migrations.tracing.RootOtelContext; -import io.opentelemetry.api.OpenTelemetry; -import lombok.Getter; - @Getter public class RootReplayerContext extends RootOtelContext implements IRootReplayerContext { public static final String SCOPE_NAME = "replayer"; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/tracing/TrafficSourceContexts.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/tracing/TrafficSourceContexts.java index b861ab31db..81a84a75e8 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/tracing/TrafficSourceContexts.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/tracing/TrafficSourceContexts.java @@ -2,14 +2,10 @@ import io.opentelemetry.api.metrics.Meter; import lombok.NonNull; - import org.opensearch.migrations.tracing.BaseNestedSpanContext; import org.opensearch.migrations.tracing.CommonScopedMetricInstruments; import org.opensearch.migrations.tracing.IScopedInstrumentationAttributes; -import io.opentelemetry.api.metrics.Meter; -import lombok.NonNull; - public class TrafficSourceContexts { private TrafficSourceContexts() {} diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/expiration/AccumulatorMap.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/expiration/AccumulatorMap.java index 88f987f14e..c4c1bd30e2 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/expiration/AccumulatorMap.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/expiration/AccumulatorMap.java @@ -1,7 +1,6 @@ package org.opensearch.migrations.replay.traffic.expiration; import java.util.concurrent.ConcurrentHashMap; - import org.opensearch.migrations.replay.Accumulation; public class AccumulatorMap extends ConcurrentHashMap {} diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/expiration/BehavioralPolicy.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/expiration/BehavioralPolicy.java index 65729369a7..8fc4dd9430 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/expiration/BehavioralPolicy.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/expiration/BehavioralPolicy.java @@ -2,14 +2,10 @@ import java.time.Duration; import java.time.Instant; - import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.Accumulation; import org.opensearch.migrations.replay.datatypes.ITrafficStreamKey; -import lombok.extern.slf4j.Slf4j; - /** * I should look up what this is called in the Gang of Four book. * In my mind, this is a metaprogramming policy mixin. diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/expiration/EpochMillis.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/expiration/EpochMillis.java index ab23f6e739..03a00b73d5 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/expiration/EpochMillis.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/expiration/EpochMillis.java @@ -2,9 +2,6 @@ import java.time.Instant; import java.util.function.BiPredicate; - -import lombok.EqualsAndHashCode; - import lombok.EqualsAndHashCode; @EqualsAndHashCode diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/expiration/ExpiringKeyQueue.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/expiration/ExpiringKeyQueue.java index 18293be11f..30f8abce9a 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/expiration/ExpiringKeyQueue.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/expiration/ExpiringKeyQueue.java @@ -5,10 +5,6 @@ import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentSkipListMap; - -import lombok.EqualsAndHashCode; -import lombok.extern.slf4j.Slf4j; - import lombok.EqualsAndHashCode; import lombok.extern.slf4j.Slf4j; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/expiration/ExpiringTrafficStreamMap.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/expiration/ExpiringTrafficStreamMap.java index b68e94f20a..dce1c282be 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/expiration/ExpiringTrafficStreamMap.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/expiration/ExpiringTrafficStreamMap.java @@ -6,14 +6,10 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; import java.util.stream.Stream; - import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.Accumulation; import org.opensearch.migrations.replay.datatypes.ITrafficStreamKey; -import lombok.extern.slf4j.Slf4j; - /** * This object manages the lifecycle of Accumulation objects, creating new ones and expiring old entries. * Callers are expected to modify the Accumulation values themselves, but to proxy every distinct interaction diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/expiration/ScopedConnectionIdKey.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/expiration/ScopedConnectionIdKey.java index de75ba97b4..f8b6422871 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/expiration/ScopedConnectionIdKey.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/expiration/ScopedConnectionIdKey.java @@ -3,9 +3,6 @@ import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; -import lombok.AllArgsConstructor; -import lombok.EqualsAndHashCode; - @AllArgsConstructor @EqualsAndHashCode public class ScopedConnectionIdKey { diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/source/BlockingTrafficSource.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/source/BlockingTrafficSource.java index c8006a8ef3..37419fba36 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/source/BlockingTrafficSource.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/source/BlockingTrafficSource.java @@ -1,5 +1,7 @@ package org.opensearch.migrations.replay.traffic.source; +import com.google.protobuf.Timestamp; +import io.netty.util.concurrent.DefaultThreadFactory; import java.io.IOException; import java.time.Duration; import java.time.Instant; @@ -13,23 +15,13 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Supplier; - -import com.google.protobuf.Timestamp; -import io.netty.util.concurrent.DefaultThreadFactory; import lombok.Getter; import lombok.extern.slf4j.Slf4j; -import org.slf4j.event.Level; - import org.opensearch.migrations.replay.Utils; import org.opensearch.migrations.replay.datatypes.ITrafficStreamKey; import org.opensearch.migrations.replay.tracing.ITrafficSourceContexts; import org.opensearch.migrations.trafficcapture.protos.TrafficObservation; import org.opensearch.migrations.trafficcapture.protos.TrafficStreamUtils; - -import com.google.protobuf.Timestamp; -import io.netty.util.concurrent.DefaultThreadFactory; -import lombok.Getter; -import lombok.extern.slf4j.Slf4j; import org.slf4j.event.Level; /** diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/source/ITrafficCaptureSource.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/source/ITrafficCaptureSource.java index 2b5f4f6ad5..a3b5968b27 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/source/ITrafficCaptureSource.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/source/ITrafficCaptureSource.java @@ -6,7 +6,6 @@ import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.function.Supplier; - import org.opensearch.migrations.replay.datatypes.ITrafficStreamKey; import org.opensearch.migrations.replay.tracing.ITrafficSourceContexts; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/source/InputStreamOfTraffic.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/source/InputStreamOfTraffic.java index 166ab5975c..158eaa2439 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/source/InputStreamOfTraffic.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/source/InputStreamOfTraffic.java @@ -10,10 +10,8 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Supplier; - import lombok.Lombok; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.datatypes.ITrafficStreamKey; import org.opensearch.migrations.replay.datatypes.PojoTrafficStreamAndKey; import org.opensearch.migrations.replay.datatypes.PojoTrafficStreamKeyAndContext; @@ -24,9 +22,6 @@ import org.opensearch.migrations.replay.tracing.RootReplayerContext; import org.opensearch.migrations.trafficcapture.protos.TrafficStream; -import lombok.Lombok; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class InputStreamOfTraffic implements ISimpleTrafficCaptureSource, AutoCloseable { private final BufferedReader bufferedReader; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/source/TrafficStreamLimiter.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/source/TrafficStreamLimiter.java index 169ced7cb4..0d67fb0704 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/source/TrafficStreamLimiter.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/traffic/source/TrafficStreamLimiter.java @@ -4,19 +4,12 @@ import java.util.concurrent.Semaphore; import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Consumer; - import lombok.AllArgsConstructor; import lombok.NonNull; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.tracing.commoncontexts.IHttpTransactionContext; -import lombok.AllArgsConstructor; -import lombok.NonNull; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class TrafficStreamLimiter implements AutoCloseable { diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/ActiveContextMonitor.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/ActiveContextMonitor.java index 130f088dc4..05957fe827 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/ActiveContextMonitor.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/ActiveContextMonitor.java @@ -18,21 +18,13 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; import java.util.stream.Stream; - import lombok.AllArgsConstructor; import lombok.Getter; import lombok.extern.slf4j.Slf4j; -import org.slf4j.Logger; -import org.slf4j.event.Level; - import org.opensearch.migrations.Utils; import org.opensearch.migrations.tracing.ActiveContextTracker; import org.opensearch.migrations.tracing.ActiveContextTrackerByActivityType; import org.opensearch.migrations.tracing.IScopedInstrumentationAttributes; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.extern.slf4j.Slf4j; import org.slf4j.Logger; import org.slf4j.event.Level; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/NettyUtils.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/NettyUtils.java index e9a7125f4a..eb4158115e 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/NettyUtils.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/NettyUtils.java @@ -1,15 +1,10 @@ package org.opensearch.migrations.replay.util; -import java.util.Collection; -import java.util.stream.Stream; - -import com.google.errorprone.annotations.MustBeClosed; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; - import com.google.errorprone.annotations.MustBeClosed; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; +import java.util.Collection; +import java.util.stream.Stream; public final class NettyUtils { @MustBeClosed diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/OnlineRadixSorter.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/OnlineRadixSorter.java index 2ab85a537a..a1bf61a980 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/OnlineRadixSorter.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/OnlineRadixSorter.java @@ -5,18 +5,12 @@ import java.util.TreeMap; import java.util.concurrent.CompletableFuture; import java.util.stream.IntStream; - import lombok.AllArgsConstructor; import lombok.Getter; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.datatypes.FutureTransformer; import org.opensearch.migrations.utils.SequentialSpanCompressingReducer; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.extern.slf4j.Slf4j; - /** * This provides a simple implementation to sort incoming elements that are ordered by a sequence * of unique and contiguous integers. This implementation uses a SortedMap for staging out of order diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/OrderedWorkerTracker.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/OrderedWorkerTracker.java index 867fdc8c7b..54a184a1ce 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/OrderedWorkerTracker.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/OrderedWorkerTracker.java @@ -5,16 +5,11 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentSkipListSet; import java.util.stream.Stream; - import lombok.AllArgsConstructor; import lombok.Getter; - import org.opensearch.migrations.replay.TrafficReplayerTopLevel; import org.opensearch.migrations.replay.datatypes.UniqueReplayerRequestKey; -import lombok.AllArgsConstructor; -import lombok.Getter; - public class OrderedWorkerTracker implements TrafficReplayerTopLevel.IStreamableWorkTracker { @AllArgsConstructor static class TimeKeyAndFuture { diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/RefSafeHolder.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/RefSafeHolder.java index 4dd03a76b9..1131fd6dfb 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/RefSafeHolder.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/RefSafeHolder.java @@ -1,12 +1,8 @@ package org.opensearch.migrations.replay.util; -import javax.annotation.Nullable; - -import com.google.errorprone.annotations.MustBeClosed; -import io.netty.util.ReferenceCountUtil; - import com.google.errorprone.annotations.MustBeClosed; import io.netty.util.ReferenceCountUtil; +import javax.annotation.Nullable; public class RefSafeHolder implements AutoCloseable { private final T resource; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/RefSafeStreamUtils.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/RefSafeStreamUtils.java index d5e02c6bd9..bdecdd72a4 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/RefSafeStreamUtils.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/RefSafeStreamUtils.java @@ -1,16 +1,12 @@ package org.opensearch.migrations.replay.util; +import com.google.errorprone.annotations.MustBeClosed; +import io.netty.util.ReferenceCounted; import java.util.ArrayDeque; import java.util.Deque; import java.util.function.Function; import java.util.stream.Stream; -import com.google.errorprone.annotations.MustBeClosed; -import io.netty.util.ReferenceCounted; - -import com.google.errorprone.annotations.MustBeClosed; -import io.netty.util.ReferenceCounted; - public final class RefSafeStreamUtils { @MustBeClosed public static Stream refSafeMap( diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/TextTrackedFuture.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/TextTrackedFuture.java index 4f0878da3b..c57809f58f 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/TextTrackedFuture.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/TextTrackedFuture.java @@ -4,9 +4,6 @@ import java.util.concurrent.CompletableFuture; import java.util.function.Supplier; import java.util.stream.Stream; - -import lombok.NonNull; - import lombok.NonNull; public class TextTrackedFuture extends TrackedFuture { diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/TrackedFuture.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/TrackedFuture.java index 2253a358f8..d81b541b91 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/TrackedFuture.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/TrackedFuture.java @@ -15,11 +15,6 @@ import java.util.function.Supplier; import java.util.stream.IntStream; import java.util.stream.Stream; - -import lombok.Getter; -import lombok.NonNull; -import lombok.extern.slf4j.Slf4j; - import lombok.Getter; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/TrackedFutureJsonFormatter.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/TrackedFutureJsonFormatter.java index 85d0f3fed0..67f8092aeb 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/TrackedFutureJsonFormatter.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/TrackedFutureJsonFormatter.java @@ -1,18 +1,12 @@ package org.opensearch.migrations.replay.util; +import com.fasterxml.jackson.databind.ObjectMapper; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.function.Function; import java.util.stream.Collectors; - -import com.fasterxml.jackson.databind.ObjectMapper; -import lombok.Lombok; -import lombok.NonNull; -import lombok.SneakyThrows; - -import com.fasterxml.jackson.databind.ObjectMapper; import lombok.Lombok; import lombok.NonNull; import lombok.SneakyThrows; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/TrackedFutureStringFormatter.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/TrackedFutureStringFormatter.java index 0d043d80b7..3862dad639 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/TrackedFutureStringFormatter.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/util/TrackedFutureStringFormatter.java @@ -3,10 +3,6 @@ import java.util.Optional; import java.util.function.Function; import java.util.stream.Collectors; - -import lombok.NonNull; -import lombok.SneakyThrows; - import lombok.NonNull; import lombok.SneakyThrows; diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/trafficcapture/protos/TrafficStreamUtils.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/trafficcapture/protos/TrafficStreamUtils.java index 347f4b9ec6..68014c690e 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/trafficcapture/protos/TrafficStreamUtils.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/trafficcapture/protos/TrafficStreamUtils.java @@ -1,14 +1,11 @@ package org.opensearch.migrations.trafficcapture.protos; +import com.google.protobuf.Timestamp; import java.nio.charset.StandardCharsets; import java.time.Instant; import java.util.Optional; import java.util.stream.Collectors; -import com.google.protobuf.Timestamp; - -import com.google.protobuf.Timestamp; - public class TrafficStreamUtils { private TrafficStreamUtils() {} diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/transform/IAuthTransformer.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/transform/IAuthTransformer.java index 8929f0eb04..e9c53c7397 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/transform/IAuthTransformer.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/transform/IAuthTransformer.java @@ -1,7 +1,6 @@ package org.opensearch.migrations.transform; import java.nio.ByteBuffer; - import org.opensearch.migrations.replay.datahandlers.http.HttpJsonMessageWithFaultingPayload; public interface IAuthTransformer { diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/transform/IAuthTransformerFactory.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/transform/IAuthTransformerFactory.java index 76219eafbc..21c6f7157c 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/transform/IAuthTransformerFactory.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/transform/IAuthTransformerFactory.java @@ -1,7 +1,6 @@ package org.opensearch.migrations.transform; import java.io.IOException; - import org.opensearch.migrations.replay.datahandlers.http.HttpJsonMessageWithFaultingPayload; public interface IAuthTransformerFactory extends AutoCloseable { diff --git a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/transform/SigV4AuthTransformerFactory.java b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/transform/SigV4AuthTransformerFactory.java index 5d0082947e..e83721fa45 100644 --- a/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/transform/SigV4AuthTransformerFactory.java +++ b/TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/transform/SigV4AuthTransformerFactory.java @@ -8,13 +8,9 @@ import java.util.Map; import java.util.Optional; import java.util.function.Supplier; - -import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; - import org.opensearch.migrations.IHttpMessage; import org.opensearch.migrations.aws.SigV4Signer; import org.opensearch.migrations.replay.datahandlers.http.HttpJsonMessageWithFaultingPayload; - import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; public class SigV4AuthTransformerFactory implements IAuthTransformerFactory { diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/PruferTreeGeneratorTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/PruferTreeGeneratorTest.java index a7327809d7..cb5f6c66fd 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/PruferTreeGeneratorTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/PruferTreeGeneratorTest.java @@ -6,15 +6,10 @@ import java.nio.charset.StandardCharsets; import java.util.Random; import java.util.stream.IntStream; - import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.testutils.WrapWithNettyLeakDetection; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - @WrapWithNettyLeakDetection(disableLeakChecks = true) public class PruferTreeGeneratorTest { diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/AWSAuthServiceTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/AWSAuthServiceTest.java index e0e178c1b9..9a47040041 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/AWSAuthServiceTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/AWSAuthServiceTest.java @@ -1,28 +1,18 @@ package org.opensearch.migrations.replay; -import java.util.function.Consumer; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; +import java.util.function.Consumer; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import software.amazon.awssdk.services.secretsmanager.SecretsManagerClient; -import software.amazon.awssdk.services.secretsmanager.model.GetSecretValueResponse; - import org.opensearch.migrations.testutils.WrapWithNettyLeakDetection; - -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; import software.amazon.awssdk.services.secretsmanager.SecretsManagerClient; import software.amazon.awssdk.services.secretsmanager.model.GetSecretValueResponse; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.when; - @ExtendWith(MockitoExtension.class) @WrapWithNettyLeakDetection(disableLeakChecks = true) public class AWSAuthServiceTest { diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/BlockingTrafficSourceTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/BlockingTrafficSourceTest.java index cf59a52e31..bb8b3e160a 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/BlockingTrafficSourceTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/BlockingTrafficSourceTest.java @@ -1,5 +1,6 @@ package org.opensearch.migrations.replay; +import com.google.protobuf.Timestamp; import java.io.EOFException; import java.io.IOException; import java.time.Duration; @@ -11,12 +12,9 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Supplier; - -import com.google.protobuf.Timestamp; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.replay.datatypes.ITrafficStreamKey; import org.opensearch.migrations.replay.datatypes.PojoTrafficStreamAndKey; import org.opensearch.migrations.replay.datatypes.PojoTrafficStreamKeyAndContext; @@ -32,11 +30,6 @@ import org.opensearch.migrations.trafficcapture.protos.TrafficStream; import org.opensearch.migrations.trafficcapture.protos.TrafficStreamUtils; -import com.google.protobuf.Timestamp; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - @Slf4j @WrapWithNettyLeakDetection(disableLeakChecks = true) class BlockingTrafficSourceTest extends InstrumentationTest { diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/CompressedFileTrafficCaptureSource.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/CompressedFileTrafficCaptureSource.java index d5f4248ac3..9b83389934 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/CompressedFileTrafficCaptureSource.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/CompressedFileTrafficCaptureSource.java @@ -9,7 +9,6 @@ import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.zip.GZIPInputStream; - import org.opensearch.migrations.replay.datatypes.ITrafficStreamKey; import org.opensearch.migrations.replay.tracing.ITrafficSourceContexts; import org.opensearch.migrations.replay.tracing.RootReplayerContext; diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/ExhaustiveCapturedTrafficToHttpTransactionAccumulatorTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/ExhaustiveCapturedTrafficToHttpTransactionAccumulatorTest.java index 9d22184707..6095e1b34f 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/ExhaustiveCapturedTrafficToHttpTransactionAccumulatorTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/ExhaustiveCapturedTrafficToHttpTransactionAccumulatorTest.java @@ -8,27 +8,18 @@ import java.util.TreeSet; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.IntStream; - import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Tag; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; - import org.opensearch.migrations.replay.traffic.generator.ExhaustiveTrafficStreamGenerator; import org.opensearch.migrations.tracing.InstrumentationTest; import org.opensearch.migrations.tracing.TestContext; import org.opensearch.migrations.trafficcapture.protos.TrafficStream; import org.opensearch.migrations.trafficcapture.protos.TrafficStreamUtils; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; -import org.junit.jupiter.params.provider.MethodSource; - @Slf4j @Tag("longTest") public class ExhaustiveCapturedTrafficToHttpTransactionAccumulatorTest extends InstrumentationTest { diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/ExpiringTrafficStreamMapSequentialTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/ExpiringTrafficStreamMapSequentialTest.java index c9b078ee9f..c34dd5c663 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/ExpiringTrafficStreamMapSequentialTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/ExpiringTrafficStreamMapSequentialTest.java @@ -7,18 +7,13 @@ import java.util.Arrays; import java.util.function.Function; import java.util.stream.Collectors; - import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.replay.datatypes.PojoTrafficStreamKeyAndContext; import org.opensearch.migrations.replay.traffic.expiration.BehavioralPolicy; import org.opensearch.migrations.replay.traffic.expiration.ExpiringTrafficStreamMap; import org.opensearch.migrations.tracing.InstrumentationTest; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - class ExpiringTrafficStreamMapSequentialTest extends InstrumentationTest { public static final String TEST_NODE_ID_STRING = "test_node_id"; diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/ExpiringTrafficStreamMapUnorderedTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/ExpiringTrafficStreamMapUnorderedTest.java index a512d054c4..2414e6c06d 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/ExpiringTrafficStreamMapUnorderedTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/ExpiringTrafficStreamMapUnorderedTest.java @@ -7,19 +7,14 @@ import java.util.Arrays; import java.util.function.Function; import java.util.stream.Collectors; - import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.replay.datatypes.PojoTrafficStreamKeyAndContext; import org.opensearch.migrations.replay.traffic.expiration.BehavioralPolicy; import org.opensearch.migrations.replay.traffic.expiration.ExpiringTrafficStreamMap; import org.opensearch.migrations.testutils.WrapWithNettyLeakDetection; import org.opensearch.migrations.tracing.InstrumentationTest; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - @WrapWithNettyLeakDetection(disableLeakChecks = true) class ExpiringTrafficStreamMapUnorderedTest extends InstrumentationTest { diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/HeaderTransformerTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/HeaderTransformerTest.java index 25302e3e05..4e26a1827b 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/HeaderTransformerTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/HeaderTransformerTest.java @@ -9,11 +9,9 @@ import java.util.function.IntFunction; import java.util.stream.Collectors; import java.util.stream.IntStream; - import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.replay.datahandlers.http.HttpJsonTransformingConsumer; import org.opensearch.migrations.replay.datatypes.HttpRequestTransformationStatus; import org.opensearch.migrations.replay.util.TrackedFuture; @@ -21,10 +19,6 @@ import org.opensearch.migrations.tracing.InstrumentationTest; import org.opensearch.migrations.transform.StaticAuthTransformerFactory; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - @Slf4j @WrapWithNettyLeakDetection(repetitions = 2) public class HeaderTransformerTest extends InstrumentationTest { diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/HttpByteBufFormatterTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/HttpByteBufFormatterTest.java index 5faf7437dd..f6f944afad 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/HttpByteBufFormatterTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/HttpByteBufFormatterTest.java @@ -1,12 +1,11 @@ package org.opensearch.migrations.replay; +import io.netty.buffer.Unpooled; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.stream.Stream; - -import io.netty.buffer.Unpooled; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -14,21 +13,11 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; import org.junit.jupiter.params.provider.ValueSource; - import org.opensearch.migrations.replay.util.RefSafeStreamUtils; import org.opensearch.migrations.testutils.CountingNettyResourceLeakDetector; import org.opensearch.migrations.testutils.TestUtilities; import org.opensearch.migrations.testutils.WrapWithNettyLeakDetection; -import io.netty.buffer.Unpooled; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; -import org.junit.jupiter.params.provider.MethodSource; -import org.junit.jupiter.params.provider.ValueSource; - @WrapWithNettyLeakDetection public class HttpByteBufFormatterTest { diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/ParsedHttpMessagesAsDictsTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/ParsedHttpMessagesAsDictsTest.java index 177236b35d..0a1e697502 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/ParsedHttpMessagesAsDictsTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/ParsedHttpMessagesAsDictsTest.java @@ -3,7 +3,6 @@ import java.util.List; import java.util.Map; import java.util.Optional; - import org.opensearch.migrations.tracing.InstrumentationTest; import org.opensearch.migrations.tracing.TestContext; diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/RequestSenderOrchestratorTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/RequestSenderOrchestratorTest.java index 3186a9cdff..15feeee08a 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/RequestSenderOrchestratorTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/RequestSenderOrchestratorTest.java @@ -1,5 +1,10 @@ package org.opensearch.migrations.replay; +import static org.opensearch.migrations.replay.datahandlers.NettyPacketToHttpConsumerTest.REGULAR_RESPONSE_TIMEOUT; + +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import io.netty.handler.codec.http.FullHttpResponse; import java.net.URI; import java.nio.charset.StandardCharsets; import java.time.Duration; @@ -14,10 +19,6 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; import java.util.stream.IntStream; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.handler.codec.http.FullHttpResponse; import lombok.Lombok; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; @@ -25,7 +26,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; - import org.opensearch.migrations.replay.datahandlers.IPacketFinalizingConsumer; import org.opensearch.migrations.replay.datahandlers.NettyPacketToHttpConsumer; import org.opensearch.migrations.replay.datatypes.ByteBufList; @@ -38,19 +38,6 @@ import org.opensearch.migrations.testutils.WrapWithNettyLeakDetection; import org.opensearch.migrations.tracing.InstrumentationTest; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.handler.codec.http.FullHttpResponse; -import lombok.Lombok; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.parallel.Execution; -import org.junit.jupiter.api.parallel.ExecutionMode; - -import static org.opensearch.migrations.replay.datahandlers.NettyPacketToHttpConsumerTest.REGULAR_RESPONSE_TIMEOUT; - @Slf4j @WrapWithNettyLeakDetection(repetitions = 1) class RequestSenderOrchestratorTest extends InstrumentationTest { diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/ResultsToLogsConsumerTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/ResultsToLogsConsumerTest.java index f3946158c2..960dd007ef 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/ResultsToLogsConsumerTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/ResultsToLogsConsumerTest.java @@ -1,5 +1,8 @@ package org.opensearch.migrations.replay; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.netty.buffer.Unpooled; import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; @@ -8,10 +11,6 @@ import java.util.AbstractMap; import java.util.ArrayList; import java.util.stream.Collectors; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import io.netty.buffer.Unpooled; import lombok.extern.slf4j.Slf4j; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.core.impl.Log4jContextFactory; @@ -20,7 +19,6 @@ import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.ResourceLock; - import org.opensearch.migrations.replay.datatypes.ByteBufList; import org.opensearch.migrations.replay.datatypes.HttpRequestTransformationStatus; import org.opensearch.migrations.replay.datatypes.PojoTrafficStreamKeyAndContext; @@ -29,18 +27,6 @@ import org.opensearch.migrations.tracing.InstrumentationTest; import org.opensearch.migrations.tracing.TestContext; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import io.netty.buffer.Unpooled; -import lombok.extern.slf4j.Slf4j; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.core.impl.Log4jContextFactory; -import org.apache.logging.log4j.core.selector.ClassLoaderContextSelector; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.parallel.ResourceLock; - @Slf4j @WrapWithNettyLeakDetection(repetitions = 4) class ResultsToLogsConsumerTest extends InstrumentationTest { diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/SimpleCapturedTrafficToHttpTransactionAccumulatorTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/SimpleCapturedTrafficToHttpTransactionAccumulatorTest.java index c746c4b3c9..9c17867cb3 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/SimpleCapturedTrafficToHttpTransactionAccumulatorTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/SimpleCapturedTrafficToHttpTransactionAccumulatorTest.java @@ -11,14 +11,12 @@ import java.util.function.Consumer; import java.util.stream.Collectors; import java.util.stream.Stream; - import lombok.NonNull; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; - import org.opensearch.migrations.replay.datatypes.ITrafficStreamKey; import org.opensearch.migrations.replay.datatypes.PojoTrafficStreamAndKey; import org.opensearch.migrations.replay.datatypes.PojoTrafficStreamKeyAndContext; @@ -31,13 +29,6 @@ import org.opensearch.migrations.tracing.TestContext; import org.opensearch.migrations.trafficcapture.protos.TrafficStream; -import lombok.NonNull; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; -import org.junit.jupiter.params.provider.MethodSource; - /** * Some things to consider - Reads, Writes, ReadSegments, WriteSegments, EndOfSegment, EndOfMessage * In a well-formed stream, these will always occur in the pattern diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/TimeShifterTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/TimeShifterTest.java index c30b1171c3..e088d13193 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/TimeShifterTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/TimeShifterTest.java @@ -3,15 +3,10 @@ import java.time.Duration; import java.time.Instant; import java.util.Optional; - import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.testutils.WrapWithNettyLeakDetection; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - @WrapWithNettyLeakDetection(disableLeakChecks = true) class TimeShifterTest { diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/TrafficReplayerTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/TrafficReplayerTest.java index c6167ef6a5..6aa5bf1755 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/TrafficReplayerTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/TrafficReplayerTest.java @@ -1,5 +1,7 @@ package org.opensearch.migrations.replay; +import com.google.protobuf.ByteString; +import com.google.protobuf.Timestamp; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.EOFException; @@ -18,16 +20,11 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Consumer; import java.util.stream.Collectors; - -import com.google.protobuf.ByteString; -import com.google.protobuf.Timestamp; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; -import org.slf4j.event.Level; - import org.opensearch.migrations.replay.datatypes.ITrafficStreamKey; import org.opensearch.migrations.replay.tracing.IReplayContexts; import org.opensearch.migrations.replay.traffic.source.InputStreamOfTraffic; @@ -40,14 +37,6 @@ import org.opensearch.migrations.trafficcapture.protos.TrafficObservation; import org.opensearch.migrations.trafficcapture.protos.TrafficStream; import org.opensearch.migrations.trafficcapture.protos.WriteObservation; - -import com.google.protobuf.ByteString; -import com.google.protobuf.Timestamp; -import lombok.NonNull; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; import org.slf4j.event.Level; @Slf4j diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/TransformationLoaderTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/TransformationLoaderTest.java index 9b85c265ce..983e313353 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/TransformationLoaderTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/TransformationLoaderTest.java @@ -1,14 +1,8 @@ package org.opensearch.migrations.replay; -import java.util.Map; - -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Map; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/UtilsTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/UtilsTest.java index 94aac15659..d1924e6042 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/UtilsTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/UtilsTest.java @@ -2,17 +2,11 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; - import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.Utils; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - @Slf4j class UtilsTest { @Test diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/V0_1TrafficCaptureSource.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/V0_1TrafficCaptureSource.java index 9ce63a2db3..c4384019ba 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/V0_1TrafficCaptureSource.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/V0_1TrafficCaptureSource.java @@ -3,7 +3,6 @@ import java.io.IOException; import java.util.HashMap; import java.util.Optional; - import org.opensearch.migrations.replay.datatypes.PojoTrafficStreamAndKey; import org.opensearch.migrations.replay.tracing.RootReplayerContext; import org.opensearch.migrations.replay.traffic.source.ITrafficStreamWithKey; diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datahandlers/JsonAccumulatorTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datahandlers/JsonAccumulatorTest.java index b1edb3b900..699214dbf8 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datahandlers/JsonAccumulatorTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datahandlers/JsonAccumulatorTest.java @@ -1,25 +1,17 @@ package org.opensearch.migrations.replay.datahandlers; +import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.Random; - -import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Tag; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; - import org.opensearch.migrations.replay.GenerateRandomNestedJsonObject; import org.opensearch.migrations.testutils.WrapWithNettyLeakDetection; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.CsvSource; - @WrapWithNettyLeakDetection public class JsonAccumulatorTest { public static final String TINY = "tiny"; diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datahandlers/JsonEmitterTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datahandlers/JsonEmitterTest.java index 2236ee0f3d..e958c2b28f 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datahandlers/JsonEmitterTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datahandlers/JsonEmitterTest.java @@ -1,24 +1,16 @@ package org.opensearch.migrations.replay.datahandlers; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.netty.buffer.ByteBufAllocator; import java.io.IOException; import java.io.StringReader; import java.io.StringWriter; import java.nio.charset.StandardCharsets; - -import com.fasterxml.jackson.databind.ObjectMapper; -import io.netty.buffer.ByteBufAllocator; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.testutils.WrapWithNettyLeakDetection; -import com.fasterxml.jackson.databind.ObjectMapper; -import io.netty.buffer.ByteBufAllocator; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - @Slf4j @WrapWithNettyLeakDetection public class JsonEmitterTest { diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datahandlers/NettyPacketToHttpConsumerTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datahandlers/NettyPacketToHttpConsumerTest.java index fbe17e9de7..48d6949eb8 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datahandlers/NettyPacketToHttpConsumerTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datahandlers/NettyPacketToHttpConsumerTest.java @@ -1,5 +1,12 @@ package org.opensearch.migrations.replay.datahandlers; +import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.handler.codec.http.HttpHeaderNames; +import io.netty.handler.codec.http.HttpHeaderValues; +import io.netty.handler.ssl.SslContextBuilder; +import io.netty.handler.ssl.util.InsecureTrustManagerFactory; +import io.netty.handler.timeout.ReadTimeoutException; +import io.netty.util.concurrent.DefaultThreadFactory; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; @@ -15,14 +22,6 @@ import java.util.concurrent.locks.LockSupport; import java.util.stream.Collectors; import java.util.stream.Stream; - -import io.netty.channel.nio.NioEventLoopGroup; -import io.netty.handler.codec.http.HttpHeaderNames; -import io.netty.handler.codec.http.HttpHeaderValues; -import io.netty.handler.ssl.SslContextBuilder; -import io.netty.handler.ssl.util.InsecureTrustManagerFactory; -import io.netty.handler.timeout.ReadTimeoutException; -import io.netty.util.concurrent.DefaultThreadFactory; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; @@ -31,7 +30,6 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; import org.junit.jupiter.params.provider.ValueSource; - import org.opensearch.migrations.replay.AggregatedRawResponse; import org.opensearch.migrations.replay.ClientConnectionPool; import org.opensearch.migrations.replay.PacketToTransformingHttpHandlerFactory; @@ -52,22 +50,6 @@ import org.opensearch.migrations.tracing.InstrumentationTest; import org.opensearch.migrations.tracing.TestContext; -import io.netty.channel.nio.NioEventLoopGroup; -import io.netty.handler.codec.http.HttpHeaderNames; -import io.netty.handler.codec.http.HttpHeaderValues; -import io.netty.handler.ssl.SslContextBuilder; -import io.netty.handler.ssl.util.InsecureTrustManagerFactory; -import io.netty.handler.timeout.ReadTimeoutException; -import io.netty.util.concurrent.DefaultThreadFactory; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.CsvSource; -import org.junit.jupiter.params.provider.ValueSource; - @Slf4j @WrapWithNettyLeakDetection public class NettyPacketToHttpConsumerTest extends InstrumentationTest { diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datahandlers/http/HttpJsonTransformingConsumerTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datahandlers/http/HttpJsonTransformingConsumerTest.java index d8c30c4be0..04b59df3ee 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datahandlers/http/HttpJsonTransformingConsumerTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datahandlers/http/HttpJsonTransformingConsumerTest.java @@ -1,5 +1,6 @@ package org.opensearch.migrations.replay.datahandlers.http; +import io.netty.buffer.ByteBuf; import java.nio.charset.StandardCharsets; import java.time.Duration; import java.util.ArrayList; @@ -11,15 +12,12 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; import java.util.stream.Stream; - -import io.netty.buffer.ByteBuf; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; - import org.opensearch.migrations.replay.AggregatedRawResponse; import org.opensearch.migrations.replay.TestCapturePacketToHttpHandler; import org.opensearch.migrations.replay.TestUtils; @@ -33,14 +31,6 @@ import org.opensearch.migrations.transform.JsonKeysForHttpMessage; import org.opensearch.migrations.transform.RemovingAuthTransformerFactory; -import io.netty.buffer.ByteBuf; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; -import org.junit.jupiter.params.provider.MethodSource; - @WrapWithNettyLeakDetection class HttpJsonTransformingConsumerTest extends InstrumentationTest { diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datahandlers/http/ListKeyAdaptingCaseInsensitiveHeadersMapTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datahandlers/http/ListKeyAdaptingCaseInsensitiveHeadersMapTest.java index 7304ffa115..3a6273c6f4 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datahandlers/http/ListKeyAdaptingCaseInsensitiveHeadersMapTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datahandlers/http/ListKeyAdaptingCaseInsensitiveHeadersMapTest.java @@ -3,15 +3,10 @@ import java.util.AbstractMap; import java.util.ArrayList; import java.util.List; - import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.testutils.WrapWithNettyLeakDetection; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - @WrapWithNettyLeakDetection(disableLeakChecks = true) class ListKeyAdaptingCaseInsensitiveHeadersMapTest { diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonBodySerializeHandlerTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonBodySerializeHandlerTest.java index 004354dd5d..0a73b5bd7e 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonBodySerializeHandlerTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonBodySerializeHandlerTest.java @@ -1,32 +1,22 @@ package org.opensearch.migrations.replay.datahandlers.http; -import java.nio.charset.StandardCharsets; -import java.util.List; -import java.util.Random; -import java.util.stream.Stream; - import com.fasterxml.jackson.databind.ObjectMapper; import io.netty.buffer.ByteBuf; import io.netty.channel.embedded.EmbeddedChannel; import io.netty.handler.codec.http.HttpContent; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.Random; +import java.util.stream.Stream; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.replay.GenerateRandomNestedJsonObject; import org.opensearch.migrations.replay.ReplayUtils; import org.opensearch.migrations.replay.datahandlers.PayloadAccessFaultingMap; import org.opensearch.migrations.testutils.WrapWithNettyLeakDetection; import org.opensearch.migrations.transform.JsonKeysForHttpMessage; -import com.fasterxml.jackson.databind.ObjectMapper; -import io.netty.buffer.ByteBuf; -import io.netty.channel.embedded.EmbeddedChannel; -import io.netty.handler.codec.http.HttpContent; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - @Slf4j @WrapWithNettyLeakDetection public class NettyJsonBodySerializeHandlerTest { diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonToByteBufHandlerTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonToByteBufHandlerTest.java index bc0c8501be..3b2bc906bc 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonToByteBufHandlerTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datahandlers/http/NettyJsonToByteBufHandlerTest.java @@ -1,5 +1,9 @@ package org.opensearch.migrations.replay.datahandlers.http; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import io.netty.channel.embedded.EmbeddedChannel; +import io.netty.handler.codec.http.DefaultHttpContent; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -7,25 +11,11 @@ import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.IntStream; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.channel.embedded.EmbeddedChannel; -import io.netty.handler.codec.http.DefaultHttpContent; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.testutils.WrapWithNettyLeakDetection; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.channel.embedded.EmbeddedChannel; -import io.netty.handler.codec.http.DefaultHttpContent; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - @Slf4j @WrapWithNettyLeakDetection public class NettyJsonToByteBufHandlerTest { diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datatypes/PojoUniqueSourceRequestKey.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datatypes/PojoUniqueSourceRequestKey.java index 1adb4c4e9d..85e5bfd2d9 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datatypes/PojoUniqueSourceRequestKey.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datatypes/PojoUniqueSourceRequestKey.java @@ -3,9 +3,6 @@ import lombok.AllArgsConstructor; import lombok.Getter; -import lombok.AllArgsConstructor; -import lombok.Getter; - @AllArgsConstructor public class PojoUniqueSourceRequestKey extends UniqueSourceRequestKey { @Getter diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datatypes/TimeToResponseFulfillmentFutureMapTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datatypes/TimeToResponseFulfillmentFutureMapTest.java index 7601b1f07c..5da9c9ddb3 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datatypes/TimeToResponseFulfillmentFutureMapTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/datatypes/TimeToResponseFulfillmentFutureMapTest.java @@ -2,15 +2,10 @@ import java.time.Duration; import java.time.Instant; - import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.testutils.WrapWithNettyLeakDetection; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - @WrapWithNettyLeakDetection(disableLeakChecks = true) class TimeToResponseFulfillmentFutureMapTest { @Test diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/e2etests/FullReplayerWithTracingChecksTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/e2etests/FullReplayerWithTracingChecksTest.java index 7943582ab7..fea2e191eb 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/e2etests/FullReplayerWithTracingChecksTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/e2etests/FullReplayerWithTracingChecksTest.java @@ -1,5 +1,8 @@ package org.opensearch.migrations.replay.e2etests; +import com.google.protobuf.ByteString; +import com.google.protobuf.Timestamp; +import io.opentelemetry.sdk.trace.data.SpanData; import java.nio.charset.StandardCharsets; import java.time.Duration; import java.time.Instant; @@ -9,17 +12,12 @@ import java.util.Optional; import java.util.Random; import java.util.stream.Collectors; - -import com.google.protobuf.ByteString; -import com.google.protobuf.Timestamp; -import io.opentelemetry.sdk.trace.data.SpanData; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.parallel.ResourceLock; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; - import org.opensearch.migrations.replay.RootReplayerConstructorExtensions; import org.opensearch.migrations.replay.TestHttpServerContext; import org.opensearch.migrations.replay.TimeShifter; @@ -39,16 +37,6 @@ import org.opensearch.migrations.trafficcapture.protos.WriteObservation; import org.opensearch.migrations.transform.StaticAuthTransformerFactory; -import com.google.protobuf.ByteString; -import com.google.protobuf.Timestamp; -import io.opentelemetry.sdk.trace.data.SpanData; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.parallel.ResourceLock; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.ValueSource; - @Slf4j @WrapWithNettyLeakDetection(disableLeakChecks = true) public class FullReplayerWithTracingChecksTest extends FullTrafficReplayerTest { diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/e2etests/FullTrafficReplayerTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/e2etests/FullTrafficReplayerTest.java index 7d09dec4e4..52100499f8 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/e2etests/FullTrafficReplayerTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/e2etests/FullTrafficReplayerTest.java @@ -14,7 +14,6 @@ import java.util.function.Supplier; import java.util.stream.Collectors; import javax.net.ssl.SSLException; - import lombok.Lombok; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; @@ -24,7 +23,6 @@ import org.junit.jupiter.api.parallel.ResourceLock; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; - import org.opensearch.migrations.replay.CapturedTrafficToHttpTransactionAccumulator; import org.opensearch.migrations.replay.ReplayEngine; import org.opensearch.migrations.replay.SourceTargetCaptureTuple; @@ -56,16 +54,6 @@ import org.opensearch.migrations.transform.IJsonTransformer; import org.opensearch.migrations.transform.StaticAuthTransformerFactory; -import lombok.Lombok; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.parallel.ResourceLock; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.CsvSource; - @Slf4j // It would be great to test with leak detection here, but right now this test relies upon TrafficReplayer.shutdown() // to recycle the TrafficReplayers. Since that shutdown process optimizes for speed of teardown, rather than tidying diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/e2etests/KafkaRestartingTrafficReplayerTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/e2etests/KafkaRestartingTrafficReplayerTest.java index b34405a9a6..870f210045 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/e2etests/KafkaRestartingTrafficReplayerTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/e2etests/KafkaRestartingTrafficReplayerTest.java @@ -1,5 +1,6 @@ package org.opensearch.migrations.replay.e2etests; +import com.google.common.collect.Streams; import java.time.Duration; import java.time.Instant; import java.util.List; @@ -10,8 +11,6 @@ import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.Stream; - -import com.google.common.collect.Streams; import lombok.Lombok; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; @@ -24,10 +23,6 @@ import org.junit.jupiter.api.parallel.ResourceLock; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; -import org.testcontainers.containers.KafkaContainer; -import org.testcontainers.junit.jupiter.Container; -import org.testcontainers.junit.jupiter.Testcontainers; - import org.opensearch.migrations.replay.SourceTargetCaptureTuple; import org.opensearch.migrations.replay.TestHttpServerContext; import org.opensearch.migrations.replay.V0_1TrafficCaptureSource; @@ -43,20 +38,6 @@ import org.opensearch.migrations.tracing.TestContext; import org.opensearch.migrations.trafficcapture.protos.TrafficStream; import org.opensearch.migrations.trafficcapture.protos.TrafficStreamUtils; - -import com.google.common.collect.Streams; -import lombok.Lombok; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; -import org.apache.kafka.clients.consumer.KafkaConsumer; -import org.apache.kafka.clients.producer.KafkaProducer; -import org.apache.kafka.clients.producer.Producer; -import org.apache.kafka.clients.producer.ProducerConfig; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.parallel.ResourceLock; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.CsvSource; import org.testcontainers.containers.KafkaContainer; import org.testcontainers.junit.jupiter.Container; import org.testcontainers.junit.jupiter.Testcontainers; diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/e2etests/SentinelSensingTrafficSource.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/e2etests/SentinelSensingTrafficSource.java index 4e935c9532..194c3578f2 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/e2etests/SentinelSensingTrafficSource.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/e2etests/SentinelSensingTrafficSource.java @@ -7,16 +7,12 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Supplier; import java.util.stream.Collectors; - import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.datatypes.ITrafficStreamKey; import org.opensearch.migrations.replay.tracing.ITrafficSourceContexts; import org.opensearch.migrations.replay.traffic.source.ISimpleTrafficCaptureSource; import org.opensearch.migrations.replay.traffic.source.ITrafficStreamWithKey; -import lombok.extern.slf4j.Slf4j; - @Slf4j class SentinelSensingTrafficSource implements ISimpleTrafficCaptureSource { public static final String SENTINEL_CONNECTION_ID = "EOF_MARKER_TRAFFIC_STREAM"; diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/e2etests/SlowAndExpiredTrafficStreamBecomesTwoTargetChannelsTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/e2etests/SlowAndExpiredTrafficStreamBecomesTwoTargetChannelsTest.java index 23f099de74..d1b25cc1f8 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/e2etests/SlowAndExpiredTrafficStreamBecomesTwoTargetChannelsTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/e2etests/SlowAndExpiredTrafficStreamBecomesTwoTargetChannelsTest.java @@ -1,5 +1,7 @@ package org.opensearch.migrations.replay.e2etests; +import com.google.protobuf.ByteString; +import com.google.protobuf.Timestamp; import java.nio.charset.StandardCharsets; import java.time.Duration; import java.time.Instant; @@ -14,14 +16,10 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; import java.util.stream.Stream; - -import com.google.protobuf.ByteString; -import com.google.protobuf.Timestamp; import lombok.SneakyThrows; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.replay.RootReplayerConstructorExtensions; import org.opensearch.migrations.replay.TimeShifter; import org.opensearch.migrations.replay.TransformationLoader; @@ -39,13 +37,6 @@ import org.opensearch.migrations.trafficcapture.protos.TrafficStream; import org.opensearch.migrations.transform.StaticAuthTransformerFactory; -import com.google.protobuf.ByteString; -import com.google.protobuf.Timestamp; -import lombok.SneakyThrows; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; - public class SlowAndExpiredTrafficStreamBecomesTwoTargetChannelsTest { private static final Instant START_TIME = Instant.EPOCH.plus(Duration.ofDays(1)); diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/e2etests/TrafficReplayerRunner.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/e2etests/TrafficReplayerRunner.java index 3482d1e30b..234196e8fb 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/e2etests/TrafficReplayerRunner.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/e2etests/TrafficReplayerRunner.java @@ -1,5 +1,6 @@ package org.opensearch.migrations.replay.e2etests; +import com.google.common.base.Strings; import java.net.URI; import java.time.Duration; import java.util.ArrayList; @@ -15,13 +16,9 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; import javax.net.ssl.SSLException; - -import com.google.common.base.Strings; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; -import org.slf4j.event.Level; - import org.opensearch.migrations.replay.RootReplayerConstructorExtensions; import org.opensearch.migrations.replay.SourceTargetCaptureTuple; import org.opensearch.migrations.replay.TimeShifter; @@ -34,11 +31,6 @@ import org.opensearch.migrations.replay.traffic.source.ISimpleTrafficCaptureSource; import org.opensearch.migrations.tracing.TestContext; import org.opensearch.migrations.transform.StaticAuthTransformerFactory; - -import com.google.common.base.Strings; -import lombok.AllArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; import org.slf4j.event.Level; @Slf4j diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/http/retries/HttpRetryTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/http/retries/HttpRetryTest.java index 2cb2c8fedd..08c19143e0 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/http/retries/HttpRetryTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/http/retries/HttpRetryTest.java @@ -1,5 +1,9 @@ package org.opensearch.migrations.replay.http.retries; +import static org.opensearch.migrations.replay.datahandlers.NettyPacketToHttpConsumerTest.REGULAR_RESPONSE_TIMEOUT; + +import io.netty.buffer.Unpooled; +import io.netty.util.concurrent.DefaultThreadFactory; import java.net.URI; import java.nio.charset.StandardCharsets; import java.time.Duration; @@ -8,19 +12,12 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; - -import io.netty.buffer.Unpooled; -import io.netty.util.concurrent.DefaultThreadFactory; import lombok.Lombok; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; -import org.testcontainers.containers.GenericContainer; -import org.testcontainers.containers.Network; -import org.testcontainers.containers.wait.strategy.Wait; - import org.opensearch.migrations.replay.ClientConnectionPool; import org.opensearch.migrations.replay.RequestSenderOrchestrator; import org.opensearch.migrations.replay.TestHttpServerContext; @@ -39,21 +36,10 @@ import org.opensearch.migrations.testutils.WrapWithNettyLeakDetection; import org.opensearch.migrations.tracing.InMemoryInstrumentationBundle; import org.opensearch.migrations.tracing.TestContext; - -import io.netty.buffer.Unpooled; -import io.netty.util.concurrent.DefaultThreadFactory; -import lombok.Lombok; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; import org.testcontainers.containers.GenericContainer; import org.testcontainers.containers.Network; import org.testcontainers.containers.wait.strategy.Wait; -import static org.opensearch.migrations.replay.datahandlers.NettyPacketToHttpConsumerTest.REGULAR_RESPONSE_TIMEOUT; - @Slf4j @WrapWithNettyLeakDetection(repetitions = 1) public class HttpRetryTest { diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/http/retries/OpenSearchDefaultRetryTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/http/retries/OpenSearchDefaultRetryTest.java index 887e5c12a9..278bff78c0 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/http/retries/OpenSearchDefaultRetryTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/http/retries/OpenSearchDefaultRetryTest.java @@ -1,5 +1,6 @@ package org.opensearch.migrations.replay.http.retries; +import io.netty.buffer.Unpooled; import java.nio.charset.StandardCharsets; import java.time.Instant; import java.util.List; @@ -7,22 +8,14 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; import java.util.stream.Stream; - -import io.netty.buffer.Unpooled; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; - import org.opensearch.migrations.replay.AggregatedRawResponse; import org.opensearch.migrations.replay.HttpByteBufFormatter; import org.opensearch.migrations.replay.RequestSenderOrchestrator; import org.opensearch.migrations.replay.util.TextTrackedFuture; -import io.netty.buffer.Unpooled; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.CsvSource; - class OpenSearchDefaultRetryTest { @ParameterizedTest diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/http/retries/RetryTestUtils.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/http/retries/RetryTestUtils.java index f79bd44b86..fcfab2c55b 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/http/retries/RetryTestUtils.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/http/retries/RetryTestUtils.java @@ -1,14 +1,10 @@ package org.opensearch.migrations.replay.http.retries; import java.time.Instant; - import lombok.Getter; - import org.opensearch.migrations.replay.HttpMessageAndTimestamp; import org.opensearch.migrations.replay.IRequestResponsePacketPair; -import lombok.Getter; - class RetryTestUtils { public static final String GET_SLASH_REQUEST = diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/kafka/KafkaCommitsWorkBetweenLongPollsTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/kafka/KafkaCommitsWorkBetweenLongPollsTest.java index 27c9350eb8..38193fc144 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/kafka/KafkaCommitsWorkBetweenLongPollsTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/kafka/KafkaCommitsWorkBetweenLongPollsTest.java @@ -4,7 +4,6 @@ import java.time.Instant; import java.util.List; import java.util.concurrent.LinkedBlockingQueue; - import lombok.Lombok; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; @@ -13,23 +12,10 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; -import org.testcontainers.containers.KafkaContainer; -import org.testcontainers.junit.jupiter.Container; -import org.testcontainers.junit.jupiter.Testcontainers; - import org.opensearch.migrations.replay.traffic.source.BlockingTrafficSource; import org.opensearch.migrations.replay.traffic.source.ITrafficStreamWithKey; import org.opensearch.migrations.testutils.SharedDockerImageNames; import org.opensearch.migrations.tracing.InstrumentationTest; - -import lombok.Lombok; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; -import org.apache.kafka.clients.consumer.KafkaConsumer; -import org.apache.kafka.clients.producer.Producer; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; import org.testcontainers.containers.KafkaContainer; import org.testcontainers.junit.jupiter.Container; import org.testcontainers.junit.jupiter.Testcontainers; diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/kafka/KafkaKeepAliveTests.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/kafka/KafkaKeepAliveTests.java index 4d271cf3cd..c65380540f 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/kafka/KafkaKeepAliveTests.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/kafka/KafkaKeepAliveTests.java @@ -8,7 +8,6 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; - import lombok.Lombok; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; @@ -18,25 +17,11 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; -import org.testcontainers.containers.KafkaContainer; -import org.testcontainers.junit.jupiter.Container; -import org.testcontainers.junit.jupiter.Testcontainers; - import org.opensearch.migrations.replay.datatypes.ITrafficStreamKey; import org.opensearch.migrations.replay.traffic.source.BlockingTrafficSource; import org.opensearch.migrations.testutils.SharedDockerImageNames; import org.opensearch.migrations.tracing.InstrumentationTest; import org.opensearch.migrations.tracing.TestContext; - -import lombok.Lombok; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; -import org.apache.kafka.clients.consumer.KafkaConsumer; -import org.apache.kafka.clients.producer.Producer; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; import org.testcontainers.containers.KafkaContainer; import org.testcontainers.junit.jupiter.Container; import org.testcontainers.junit.jupiter.Testcontainers; diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/kafka/KafkaTestUtils.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/kafka/KafkaTestUtils.java index e929a46529..2ca202fd07 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/kafka/KafkaTestUtils.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/kafka/KafkaTestUtils.java @@ -1,14 +1,13 @@ package org.opensearch.migrations.replay.kafka; +import com.google.protobuf.ByteString; +import com.google.protobuf.Timestamp; import java.nio.charset.StandardCharsets; import java.time.Duration; import java.time.Instant; import java.util.Properties; import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicInteger; - -import com.google.protobuf.ByteString; -import com.google.protobuf.Timestamp; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.apache.kafka.clients.producer.KafkaProducer; @@ -16,22 +15,11 @@ import org.apache.kafka.clients.producer.ProducerConfig; import org.apache.kafka.clients.producer.ProducerRecord; import org.jetbrains.annotations.NotNull; - import org.opensearch.migrations.replay.util.TrafficChannelKeyFormatter; import org.opensearch.migrations.trafficcapture.protos.ReadObservation; import org.opensearch.migrations.trafficcapture.protos.TrafficObservation; import org.opensearch.migrations.trafficcapture.protos.TrafficStream; -import com.google.protobuf.ByteString; -import com.google.protobuf.Timestamp; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; -import org.apache.kafka.clients.producer.KafkaProducer; -import org.apache.kafka.clients.producer.Producer; -import org.apache.kafka.clients.producer.ProducerConfig; -import org.apache.kafka.clients.producer.ProducerRecord; -import org.jetbrains.annotations.NotNull; - @Slf4j public class KafkaTestUtils { diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/kafka/KafkaTrafficCaptureSourceLongTermTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/kafka/KafkaTrafficCaptureSourceLongTermTest.java index b8cd000167..9c3b043c7f 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/kafka/KafkaTrafficCaptureSourceLongTermTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/kafka/KafkaTrafficCaptureSourceLongTermTest.java @@ -5,24 +5,13 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicInteger; - import lombok.extern.slf4j.Slf4j; import org.apache.kafka.clients.consumer.KafkaConsumer; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; -import org.testcontainers.containers.KafkaContainer; -import org.testcontainers.junit.jupiter.Container; -import org.testcontainers.junit.jupiter.Testcontainers; - import org.opensearch.migrations.testutils.SharedDockerImageNames; import org.opensearch.migrations.tracing.InstrumentationTest; - -import lombok.extern.slf4j.Slf4j; -import org.apache.kafka.clients.consumer.KafkaConsumer; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; import org.testcontainers.containers.KafkaContainer; import org.testcontainers.junit.jupiter.Container; import org.testcontainers.junit.jupiter.Testcontainers; diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/kafka/KafkaTrafficCaptureSourceTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/kafka/KafkaTrafficCaptureSourceTest.java index 9373009c2d..8b55abd331 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/kafka/KafkaTrafficCaptureSourceTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/kafka/KafkaTrafficCaptureSourceTest.java @@ -1,5 +1,7 @@ package org.opensearch.migrations.replay.kafka; +import com.google.protobuf.ByteString; +import com.google.protobuf.Timestamp; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; @@ -14,9 +16,6 @@ import java.util.Random; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Supplier; - -import com.google.protobuf.ByteString; -import com.google.protobuf.Timestamp; import lombok.extern.slf4j.Slf4j; import org.apache.kafka.clients.consumer.ConsumerConfig; import org.apache.kafka.clients.consumer.ConsumerRecord; @@ -25,7 +24,6 @@ import org.apache.kafka.common.TopicPartition; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.replay.tracing.ChannelContextManager; import org.opensearch.migrations.replay.tracing.ReplayContexts; import org.opensearch.migrations.replay.traffic.source.ITrafficStreamWithKey; @@ -34,17 +32,6 @@ import org.opensearch.migrations.trafficcapture.protos.TrafficObservation; import org.opensearch.migrations.trafficcapture.protos.TrafficStream; -import com.google.protobuf.ByteString; -import com.google.protobuf.Timestamp; -import lombok.extern.slf4j.Slf4j; -import org.apache.kafka.clients.consumer.ConsumerConfig; -import org.apache.kafka.clients.consumer.ConsumerRecord; -import org.apache.kafka.clients.consumer.MockConsumer; -import org.apache.kafka.clients.consumer.OffsetResetStrategy; -import org.apache.kafka.common.TopicPartition; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - @Slf4j class KafkaTrafficCaptureSourceTest extends InstrumentationTest { public static final int NUM_READ_ITEMS_BOUND = 1000; diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/tracing/TracingTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/tracing/TracingTest.java index a714107295..9d8b634ef1 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/tracing/TracingTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/tracing/TracingTest.java @@ -1,30 +1,22 @@ package org.opensearch.migrations.replay.tracing; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.trace.data.SpanData; import java.time.Instant; import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; - -import io.opentelemetry.sdk.metrics.data.MetricData; -import io.opentelemetry.sdk.trace.data.SpanData; import lombok.Lombok; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.replay.datatypes.ISourceTrafficChannelKey; import org.opensearch.migrations.replay.datatypes.PojoTrafficStreamKeyAndContext; import org.opensearch.migrations.replay.datatypes.UniqueReplayerRequestKey; import org.opensearch.migrations.tracing.InstrumentationTest; import org.opensearch.migrations.tracing.TestContext; -import io.opentelemetry.sdk.metrics.data.MetricData; -import io.opentelemetry.sdk.trace.data.SpanData; -import lombok.Lombok; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - public class TracingTest extends InstrumentationTest { @Override diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/transform/SigV4AuthTransformerFactoryTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/transform/SigV4AuthTransformerFactoryTest.java index 726b221e05..055f4413d7 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/transform/SigV4AuthTransformerFactoryTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/transform/SigV4AuthTransformerFactoryTest.java @@ -1,5 +1,6 @@ package org.opensearch.migrations.replay.transform; +import io.netty.handler.codec.http.DefaultHttpHeaders; import java.time.Clock; import java.time.Instant; import java.time.ZoneOffset; @@ -7,24 +8,13 @@ import java.util.Random; import java.util.stream.Collectors; import java.util.stream.IntStream; - -import io.netty.handler.codec.http.DefaultHttpHeaders; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; -import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; -import software.amazon.awssdk.auth.credentials.AwsCredentials; -import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; - import org.opensearch.migrations.replay.TestUtils; import org.opensearch.migrations.testutils.WrapWithNettyLeakDetection; import org.opensearch.migrations.tracing.InstrumentationTest; import org.opensearch.migrations.transform.SigV4AuthTransformerFactory; - -import io.netty.handler.codec.http.DefaultHttpHeaders; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.ValueSource; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.AwsCredentials; import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/util/ActiveContextMonitorTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/util/ActiveContextMonitorTest.java index c18c595455..a57dcadd96 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/util/ActiveContextMonitorTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/util/ActiveContextMonitorTest.java @@ -9,21 +9,14 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.IntStream; - import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.slf4j.event.Level; - import org.opensearch.migrations.tracing.ActiveContextTracker; import org.opensearch.migrations.tracing.ActiveContextTrackerByActivityType; import org.opensearch.migrations.tracing.CompositeContextTracker; import org.opensearch.migrations.tracing.IScopedInstrumentationAttributes; import org.opensearch.migrations.tracing.TestContext; - -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; import org.slf4j.event.Level; @Slf4j diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/util/OnlineRadixSorterTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/util/OnlineRadixSorterTest.java index 6dd8318114..f5eb5d6315 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/util/OnlineRadixSorterTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/util/OnlineRadixSorterTest.java @@ -5,11 +5,6 @@ import java.util.Map; import java.util.stream.Collectors; import java.util.stream.Stream; - -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/util/RefSafeStreamUtilsTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/util/RefSafeStreamUtilsTest.java index f33e54e7eb..65f161f519 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/util/RefSafeStreamUtilsTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/util/RefSafeStreamUtilsTest.java @@ -1,21 +1,16 @@ package org.opensearch.migrations.replay.util; +import static org.junit.jupiter.api.Assertions.*; + +import io.netty.util.AbstractReferenceCounted; +import io.netty.util.ReferenceCounted; import java.util.ArrayList; import java.util.List; import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.Stream; - -import io.netty.util.AbstractReferenceCounted; -import io.netty.util.ReferenceCounted; import org.junit.jupiter.api.Test; -import io.netty.util.AbstractReferenceCounted; -import io.netty.util.ReferenceCounted; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.*; - class RefSafeStreamUtilsTest { @Test diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/util/TextTrackedFutureTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/util/TextTrackedFutureTest.java index 136dd5abc4..1633396b93 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/util/TextTrackedFutureTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/util/TextTrackedFutureTest.java @@ -3,17 +3,11 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; - import lombok.SneakyThrows; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.testutils.WrapWithNettyLeakDetection; -import lombok.SneakyThrows; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - @WrapWithNettyLeakDetection(disableLeakChecks = true) class TextTrackedFutureTest { @SneakyThrows diff --git a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/util/TrackedFutureTest.java b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/util/TrackedFutureTest.java index 0127bdb8d6..315af32358 100644 --- a/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/util/TrackedFutureTest.java +++ b/TrafficCapture/trafficReplayer/src/test/java/org/opensearch/migrations/replay/util/TrackedFutureTest.java @@ -1,11 +1,6 @@ package org.opensearch.migrations.replay.util; import java.util.concurrent.Semaphore; - -import lombok.Lombok; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Test; - import lombok.Lombok; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Test; diff --git a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/PruferTreeGenerator.java b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/PruferTreeGenerator.java index 98244f04c1..d1dbb9fe86 100644 --- a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/PruferTreeGenerator.java +++ b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/PruferTreeGenerator.java @@ -12,11 +12,6 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; import java.util.stream.Stream; - -import lombok.Builder; -import lombok.ToString; -import lombok.extern.slf4j.Slf4j; - import lombok.Builder; import lombok.ToString; import lombok.extern.slf4j.Slf4j; diff --git a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/GenerateRandomNestedJsonObject.java b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/GenerateRandomNestedJsonObject.java index 14cd62b216..2fc8583ccf 100644 --- a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/GenerateRandomNestedJsonObject.java +++ b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/GenerateRandomNestedJsonObject.java @@ -1,5 +1,7 @@ package org.opensearch.migrations.replay; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; import java.util.AbstractMap; import java.util.Comparator; import java.util.LinkedHashMap; @@ -8,17 +10,9 @@ import java.util.Random; import java.util.stream.Collectors; import java.util.stream.IntStream; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; import lombok.SneakyThrows; - import org.opensearch.migrations.PruferTreeGenerator; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import lombok.SneakyThrows; - public class GenerateRandomNestedJsonObject { public static final String KEY_PREFIX = "keyPrefix-"; diff --git a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/ReplayEngineFactory.java b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/ReplayEngineFactory.java index 5222063388..81a14cd215 100644 --- a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/ReplayEngineFactory.java +++ b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/ReplayEngineFactory.java @@ -2,14 +2,10 @@ import java.time.Duration; import java.util.function.Function; - import lombok.AllArgsConstructor; - import org.opensearch.migrations.replay.datahandlers.NettyPacketToHttpConsumer; import org.opensearch.migrations.replay.traffic.source.BufferedFlowController; -import lombok.AllArgsConstructor; - @AllArgsConstructor public class ReplayEngineFactory implements Function { Duration targetServerResponseTimeout; diff --git a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/RootReplayerConstructorExtensions.java b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/RootReplayerConstructorExtensions.java index 4519c8c321..ad6d75c233 100644 --- a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/RootReplayerConstructorExtensions.java +++ b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/RootReplayerConstructorExtensions.java @@ -3,7 +3,6 @@ import java.net.URI; import java.time.Duration; import javax.net.ssl.SSLException; - import org.opensearch.migrations.replay.tracing.IRootReplayerContext; import org.opensearch.migrations.replay.traffic.source.BufferedFlowController; import org.opensearch.migrations.replay.traffic.source.TrafficStreamLimiter; diff --git a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/TestCapturePacketToHttpHandler.java b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/TestCapturePacketToHttpHandler.java index f696bb7f4c..76202291dc 100644 --- a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/TestCapturePacketToHttpHandler.java +++ b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/TestCapturePacketToHttpHandler.java @@ -1,30 +1,21 @@ package org.opensearch.migrations.replay; +import io.netty.buffer.ByteBuf; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.time.Duration; import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicInteger; - -import io.netty.buffer.ByteBuf; import lombok.Getter; import lombok.Lombok; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; - import org.opensearch.migrations.replay.datahandlers.IPacketFinalizingConsumer; import org.opensearch.migrations.replay.util.TextTrackedFuture; import org.opensearch.migrations.replay.util.TrackedFuture; -import io.netty.buffer.ByteBuf; -import lombok.Getter; -import lombok.Lombok; -import lombok.NonNull; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; - @Slf4j public class TestCapturePacketToHttpHandler implements IPacketFinalizingConsumer { private final Duration consumeDuration; diff --git a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/TestHttpServerContext.java b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/TestHttpServerContext.java index 555f26c109..4f302fb881 100644 --- a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/TestHttpServerContext.java +++ b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/TestHttpServerContext.java @@ -4,14 +4,10 @@ import java.time.Duration; import java.util.Map; import java.util.Random; - import lombok.Lombok; - import org.opensearch.migrations.testutils.HttpRequest; import org.opensearch.migrations.testutils.SimpleHttpResponse; -import lombok.Lombok; - public class TestHttpServerContext { private TestHttpServerContext() {} diff --git a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/TestUtils.java b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/TestUtils.java index 7668d13b2b..7e9ae6556e 100644 --- a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/TestUtils.java +++ b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/TestUtils.java @@ -1,5 +1,14 @@ package org.opensearch.migrations.replay; +import io.netty.buffer.Unpooled; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.SimpleChannelInboundHandler; +import io.netty.channel.embedded.EmbeddedChannel; +import io.netty.handler.codec.http.DefaultHttpHeaders; +import io.netty.handler.codec.http.FullHttpRequest; +import io.netty.handler.codec.http.HttpContentDecompressor; +import io.netty.handler.codec.http.HttpObjectAggregator; +import io.netty.handler.codec.http.HttpRequestDecoder; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.time.Duration; @@ -14,19 +23,8 @@ import java.util.function.Function; import java.util.function.IntFunction; import java.util.stream.Collectors; - -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.SimpleChannelInboundHandler; -import io.netty.channel.embedded.EmbeddedChannel; -import io.netty.handler.codec.http.DefaultHttpHeaders; -import io.netty.handler.codec.http.FullHttpRequest; -import io.netty.handler.codec.http.HttpContentDecompressor; -import io.netty.handler.codec.http.HttpObjectAggregator; -import io.netty.handler.codec.http.HttpRequestDecoder; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; - import org.opensearch.migrations.Utils; import org.opensearch.migrations.replay.datahandlers.IPacketConsumer; import org.opensearch.migrations.replay.datahandlers.http.HttpJsonTransformingConsumer; @@ -35,18 +33,6 @@ import org.opensearch.migrations.transform.IAuthTransformerFactory; import org.opensearch.migrations.transform.IJsonTransformer; -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.SimpleChannelInboundHandler; -import io.netty.channel.embedded.EmbeddedChannel; -import io.netty.handler.codec.http.DefaultHttpHeaders; -import io.netty.handler.codec.http.FullHttpRequest; -import io.netty.handler.codec.http.HttpContentDecompressor; -import io.netty.handler.codec.http.HttpObjectAggregator; -import io.netty.handler.codec.http.HttpRequestDecoder; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; - @Slf4j public class TestUtils { diff --git a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/traffic/generator/ExhaustiveTrafficStreamGenerator.java b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/traffic/generator/ExhaustiveTrafficStreamGenerator.java index 4cdf200de7..cb330a5352 100644 --- a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/traffic/generator/ExhaustiveTrafficStreamGenerator.java +++ b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/traffic/generator/ExhaustiveTrafficStreamGenerator.java @@ -12,21 +12,15 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; import java.util.stream.Stream; - import lombok.AllArgsConstructor; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.testutils.StreamInterleaver; import org.opensearch.migrations.tracing.TestContext; import org.opensearch.migrations.trafficcapture.protos.TrafficObservation; import org.opensearch.migrations.trafficcapture.protos.TrafficStream; import org.opensearch.migrations.trafficcapture.protos.TrafficStreamUtils; -import lombok.AllArgsConstructor; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class ExhaustiveTrafficStreamGenerator { diff --git a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/traffic/generator/ObservationDirective.java b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/traffic/generator/ObservationDirective.java index a78042d869..cb978bca3c 100644 --- a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/traffic/generator/ObservationDirective.java +++ b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/traffic/generator/ObservationDirective.java @@ -2,8 +2,6 @@ import lombok.AllArgsConstructor; -import lombok.AllArgsConstructor; - @AllArgsConstructor public class ObservationDirective { public final OffloaderCommandType offloaderCommandType; diff --git a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/traffic/generator/TrafficStreamGenerator.java b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/traffic/generator/TrafficStreamGenerator.java index 3afc3960b5..485ca5e4b3 100644 --- a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/traffic/generator/TrafficStreamGenerator.java +++ b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/traffic/generator/TrafficStreamGenerator.java @@ -1,22 +1,17 @@ package org.opensearch.migrations.replay.traffic.generator; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; import java.io.IOException; import java.time.Instant; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; - import org.opensearch.migrations.replay.datatypes.PojoTrafficStreamKeyAndContext; import org.opensearch.migrations.tracing.TestContext; import org.opensearch.migrations.trafficcapture.IChannelConnectionCaptureSerializer; import org.opensearch.migrations.trafficcapture.InMemoryConnectionCaptureFactory; import org.opensearch.migrations.trafficcapture.protos.TrafficStream; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; - public class TrafficStreamGenerator { public static final int MAX_COMMANDS_IN_CONNECTION = 256; diff --git a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/traffic/source/ArrayCursorTrafficCaptureSource.java b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/traffic/source/ArrayCursorTrafficCaptureSource.java index 02a4716a40..72836101a2 100644 --- a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/traffic/source/ArrayCursorTrafficCaptureSource.java +++ b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/traffic/source/ArrayCursorTrafficCaptureSource.java @@ -7,16 +7,12 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Supplier; - import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.replay.datatypes.ITrafficStreamKey; import org.opensearch.migrations.replay.datatypes.PojoTrafficStreamAndKey; import org.opensearch.migrations.replay.tracing.ITrafficSourceContexts; import org.opensearch.migrations.tracing.TestContext; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class ArrayCursorTrafficCaptureSource implements ISimpleTrafficCaptureSource { final AtomicInteger readCursor; diff --git a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/traffic/source/ArrayCursorTrafficSourceContext.java b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/traffic/source/ArrayCursorTrafficSourceContext.java index 946602566a..3f6a4d8be4 100644 --- a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/traffic/source/ArrayCursorTrafficSourceContext.java +++ b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/traffic/source/ArrayCursorTrafficSourceContext.java @@ -3,14 +3,10 @@ import java.util.List; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; - import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.tracing.TestContext; import org.opensearch.migrations.trafficcapture.protos.TrafficStream; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class ArrayCursorTrafficSourceContext implements Function { public final List trafficStreamsList; diff --git a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/traffic/source/TrafficStreamCursorKey.java b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/traffic/source/TrafficStreamCursorKey.java index 65acc7ee5d..bff3dedad8 100644 --- a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/traffic/source/TrafficStreamCursorKey.java +++ b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/traffic/source/TrafficStreamCursorKey.java @@ -3,17 +3,12 @@ import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.ToString; - import org.opensearch.migrations.replay.datatypes.ITrafficStreamKey; import org.opensearch.migrations.replay.tracing.IReplayContexts; import org.opensearch.migrations.tracing.TestContext; import org.opensearch.migrations.trafficcapture.protos.TrafficStream; import org.opensearch.migrations.trafficcapture.protos.TrafficStreamUtils; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.ToString; - @Getter @ToString @EqualsAndHashCode diff --git a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/util/OnlineRadixSorterForIntegratedKeys.java b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/util/OnlineRadixSorterForIntegratedKeys.java index f087f578aa..43efab78c8 100644 --- a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/util/OnlineRadixSorterForIntegratedKeys.java +++ b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/replay/util/OnlineRadixSorterForIntegratedKeys.java @@ -1,9 +1,6 @@ package org.opensearch.migrations.replay.util; import java.util.function.ToIntFunction; - -import lombok.extern.slf4j.Slf4j; - import lombok.extern.slf4j.Slf4j; /** diff --git a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/tracing/InstrumentationTest.java b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/tracing/InstrumentationTest.java index 14851c381b..826ada5293 100644 --- a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/tracing/InstrumentationTest.java +++ b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/tracing/InstrumentationTest.java @@ -3,9 +3,6 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; - public class InstrumentationTest { protected TestContext rootContext; diff --git a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/tracing/TestContext.java b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/tracing/TestContext.java index a23a7efe53..f5e051ed9d 100644 --- a/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/tracing/TestContext.java +++ b/TrafficCapture/trafficReplayer/src/testFixtures/java/org/opensearch/migrations/tracing/TestContext.java @@ -1,7 +1,6 @@ package org.opensearch.migrations.tracing; import java.time.Instant; - import org.opensearch.migrations.replay.datatypes.ITrafficStreamKey; import org.opensearch.migrations.replay.datatypes.PojoTrafficStreamKeyAndContext; import org.opensearch.migrations.replay.datatypes.UniqueReplayerRequestKey; diff --git a/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJMESPathMessageTransformer/src/main/java/org/opensearch/migrations/transform/JsonJMESPathTransformer.java b/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJMESPathMessageTransformer/src/main/java/org/opensearch/migrations/transform/JsonJMESPathTransformer.java index 46ab382c46..a21b0b580e 100644 --- a/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJMESPathMessageTransformer/src/main/java/org/opensearch/migrations/transform/JsonJMESPathTransformer.java +++ b/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJMESPathMessageTransformer/src/main/java/org/opensearch/migrations/transform/JsonJMESPathTransformer.java @@ -1,13 +1,8 @@ package org.opensearch.migrations.transform; -import java.util.Map; - -import io.burt.jmespath.BaseRuntime; -import io.burt.jmespath.Expression; -import lombok.extern.slf4j.Slf4j; - import io.burt.jmespath.BaseRuntime; import io.burt.jmespath.Expression; +import java.util.Map; import lombok.extern.slf4j.Slf4j; @Slf4j diff --git a/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJMESPathMessageTransformerProvider/src/main/java/org/opensearch/migrations/transform/JsonJMESPathTransformerProvider.java b/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJMESPathMessageTransformerProvider/src/main/java/org/opensearch/migrations/transform/JsonJMESPathTransformerProvider.java index d29c996df3..306ea99fe0 100644 --- a/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJMESPathMessageTransformerProvider/src/main/java/org/opensearch/migrations/transform/JsonJMESPathTransformerProvider.java +++ b/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJMESPathMessageTransformerProvider/src/main/java/org/opensearch/migrations/transform/JsonJMESPathTransformerProvider.java @@ -1,15 +1,11 @@ package org.opensearch.migrations.transform; +import io.burt.jmespath.BaseRuntime; +import io.burt.jmespath.jcf.JcfRuntime; import java.util.ArrayList; import java.util.List; import java.util.Map; -import io.burt.jmespath.BaseRuntime; -import io.burt.jmespath.jcf.JcfRuntime; - -import io.burt.jmespath.BaseRuntime; -import io.burt.jmespath.jcf.JcfRuntime; - public class JsonJMESPathTransformerProvider implements IJsonTransformerProvider { public static final String SCRIPT_KEY = "script"; diff --git a/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJMESPathMessageTransformerProvider/src/test/java/org/opensearch/migrations/replay/JsonTransformerTest.java b/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJMESPathMessageTransformerProvider/src/test/java/org/opensearch/migrations/replay/JsonTransformerTest.java index 225f49ca2e..7a8dae7e7f 100644 --- a/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJMESPathMessageTransformerProvider/src/test/java/org/opensearch/migrations/replay/JsonTransformerTest.java +++ b/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJMESPathMessageTransformerProvider/src/test/java/org/opensearch/migrations/replay/JsonTransformerTest.java @@ -1,27 +1,17 @@ package org.opensearch.migrations.replay; -import java.util.LinkedHashMap; -import java.util.Map; - import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import io.burt.jmespath.jcf.JcfRuntime; +import java.util.LinkedHashMap; +import java.util.Map; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.testutils.WrapWithNettyLeakDetection; import org.opensearch.migrations.transform.JsonJMESPathTransformer; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; -import io.burt.jmespath.jcf.JcfRuntime; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - @Slf4j @WrapWithNettyLeakDetection(disableLeakChecks = true) class JsonTransformerTest { diff --git a/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJMESPathMessageTransformerProvider/src/test/java/org/opensearch/migrations/replay/MultipleJMESPathScriptsTest.java b/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJMESPathMessageTransformerProvider/src/test/java/org/opensearch/migrations/replay/MultipleJMESPathScriptsTest.java index 28522032e0..fa6002e3ac 100644 --- a/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJMESPathMessageTransformerProvider/src/test/java/org/opensearch/migrations/replay/MultipleJMESPathScriptsTest.java +++ b/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJMESPathMessageTransformerProvider/src/test/java/org/opensearch/migrations/replay/MultipleJMESPathScriptsTest.java @@ -1,15 +1,9 @@ package org.opensearch.migrations.replay; -import java.util.Map; -import java.util.StringJoiner; - -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Map; +import java.util.StringJoiner; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJoltMessageTransformer/src/main/java/org/opensearch/migrations/transform/JsonJoltTransformBuilder.java b/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJoltMessageTransformer/src/main/java/org/opensearch/migrations/transform/JsonJoltTransformBuilder.java index 020540cfca..b3d8924773 100644 --- a/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJoltMessageTransformer/src/main/java/org/opensearch/migrations/transform/JsonJoltTransformBuilder.java +++ b/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJoltMessageTransformer/src/main/java/org/opensearch/migrations/transform/JsonJoltTransformBuilder.java @@ -1,5 +1,7 @@ package org.opensearch.migrations.transform; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; @@ -7,14 +9,6 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; - -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; - -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; diff --git a/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJoltMessageTransformer/src/main/java/org/opensearch/migrations/transform/JsonJoltTransformer.java b/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJoltMessageTransformer/src/main/java/org/opensearch/migrations/transform/JsonJoltTransformer.java index cff760857d..5451a77687 100644 --- a/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJoltMessageTransformer/src/main/java/org/opensearch/migrations/transform/JsonJoltTransformer.java +++ b/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJoltMessageTransformer/src/main/java/org/opensearch/migrations/transform/JsonJoltTransformer.java @@ -1,12 +1,9 @@ package org.opensearch.migrations.transform; +import com.bazaarvoice.jolt.Chainr; import java.util.List; import java.util.Map; -import com.bazaarvoice.jolt.Chainr; - -import com.bazaarvoice.jolt.Chainr; - public class JsonJoltTransformer implements IJsonTransformer { Chainr spec; diff --git a/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJoltMessageTransformerProvider/src/test/java/org/opensearch/migrations/replay/AddCompressionEncodingTest.java b/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJoltMessageTransformerProvider/src/test/java/org/opensearch/migrations/replay/AddCompressionEncodingTest.java index c259334ac5..eec6afc6d8 100644 --- a/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJoltMessageTransformerProvider/src/test/java/org/opensearch/migrations/replay/AddCompressionEncodingTest.java +++ b/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJoltMessageTransformerProvider/src/test/java/org/opensearch/migrations/replay/AddCompressionEncodingTest.java @@ -1,5 +1,10 @@ package org.opensearch.migrations.replay; +import io.netty.buffer.Unpooled; +import io.netty.channel.embedded.EmbeddedChannel; +import io.netty.handler.codec.http.FullHttpRequest; +import io.netty.handler.codec.http.HttpObjectAggregator; +import io.netty.handler.codec.http.HttpServerCodec; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.IOException; @@ -11,30 +16,14 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicInteger; import java.util.zip.GZIPInputStream; - -import io.netty.buffer.Unpooled; -import io.netty.channel.embedded.EmbeddedChannel; -import io.netty.handler.codec.http.FullHttpRequest; -import io.netty.handler.codec.http.HttpObjectAggregator; -import io.netty.handler.codec.http.HttpServerCodec; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.replay.datahandlers.http.HttpJsonTransformingConsumer; import org.opensearch.migrations.tracing.InstrumentationTest; import org.opensearch.migrations.transform.JsonJoltTransformBuilder; import org.opensearch.migrations.transform.JsonJoltTransformer; -import io.netty.buffer.Unpooled; -import io.netty.channel.embedded.EmbeddedChannel; -import io.netty.handler.codec.http.FullHttpRequest; -import io.netty.handler.codec.http.HttpObjectAggregator; -import io.netty.handler.codec.http.HttpServerCodec; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - @Slf4j public class AddCompressionEncodingTest extends InstrumentationTest { diff --git a/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJoltMessageTransformerProvider/src/test/java/org/opensearch/migrations/replay/JsonTransformerTest.java b/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJoltMessageTransformerProvider/src/test/java/org/opensearch/migrations/replay/JsonTransformerTest.java index f06bdb1c25..d0820d9d94 100644 --- a/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJoltMessageTransformerProvider/src/test/java/org/opensearch/migrations/replay/JsonTransformerTest.java +++ b/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJoltMessageTransformerProvider/src/test/java/org/opensearch/migrations/replay/JsonTransformerTest.java @@ -1,30 +1,20 @@ package org.opensearch.migrations.replay; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; import java.io.InputStream; import java.util.LinkedHashMap; import java.util.Map; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.testutils.WrapWithNettyLeakDetection; import org.opensearch.migrations.transform.JsonJoltTransformBuilder; import org.opensearch.migrations.transform.JsonJoltTransformer; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - @Slf4j @WrapWithNettyLeakDetection(disableLeakChecks = true) class JsonTransformerTest { diff --git a/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJoltMessageTransformerProvider/src/test/java/org/opensearch/migrations/replay/MultipleJoltScriptsTest.java b/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJoltMessageTransformerProvider/src/test/java/org/opensearch/migrations/replay/MultipleJoltScriptsTest.java index 1de47859d0..6f0bade6d2 100644 --- a/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJoltMessageTransformerProvider/src/test/java/org/opensearch/migrations/replay/MultipleJoltScriptsTest.java +++ b/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJoltMessageTransformerProvider/src/test/java/org/opensearch/migrations/replay/MultipleJoltScriptsTest.java @@ -1,19 +1,12 @@ package org.opensearch.migrations.replay; -import java.util.Map; - import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Map; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.transform.JsonKeysForHttpMessage; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - public class MultipleJoltScriptsTest { private static final ObjectMapper mapper = new ObjectMapper(); diff --git a/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJoltMessageTransformerProvider/src/test/java/org/opensearch/migrations/replay/PayloadRepackingTest.java b/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJoltMessageTransformerProvider/src/test/java/org/opensearch/migrations/replay/PayloadRepackingTest.java index fc0677ecda..ef77c7765b 100644 --- a/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJoltMessageTransformerProvider/src/test/java/org/opensearch/migrations/replay/PayloadRepackingTest.java +++ b/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonJoltMessageTransformerProvider/src/test/java/org/opensearch/migrations/replay/PayloadRepackingTest.java @@ -1,5 +1,8 @@ package org.opensearch.migrations.replay; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.netty.handler.codec.http.DefaultHttpHeaders; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; @@ -7,30 +10,16 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; import java.util.stream.Stream; - -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; -import io.netty.handler.codec.http.DefaultHttpHeaders; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; - import org.opensearch.migrations.testutils.WrapWithNettyLeakDetection; import org.opensearch.migrations.tracing.InstrumentationTest; import org.opensearch.migrations.transform.JsonJoltTransformBuilder; import org.opensearch.migrations.transform.JsonJoltTransformer; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; -import io.netty.handler.codec.http.DefaultHttpHeaders; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; -import org.junit.jupiter.params.provider.MethodSource; - @Slf4j @WrapWithNettyLeakDetection(repetitions = 1) public class PayloadRepackingTest extends InstrumentationTest { diff --git a/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonMessageTransformerInterface/src/main/java/org/opensearch/migrations/transform/IJsonTransformerProvider.java b/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonMessageTransformerInterface/src/main/java/org/opensearch/migrations/transform/IJsonTransformerProvider.java index 5dafc189fe..c406b15d94 100644 --- a/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonMessageTransformerInterface/src/main/java/org/opensearch/migrations/transform/IJsonTransformerProvider.java +++ b/TrafficCapture/transformationPlugins/jsonMessageTransformers/jsonMessageTransformerInterface/src/main/java/org/opensearch/migrations/transform/IJsonTransformerProvider.java @@ -2,8 +2,6 @@ import lombok.NonNull; -import lombok.NonNull; - public interface IJsonTransformerProvider { /** * Create a new transformer from the given configuration. This transformer diff --git a/TrafficCapture/transformationPlugins/jsonMessageTransformers/openSearch23PlusTargetTransformerProvider/src/test/java/org/opensearch/migrations/transform/TypeMappingsExcisionTest.java b/TrafficCapture/transformationPlugins/jsonMessageTransformers/openSearch23PlusTargetTransformerProvider/src/test/java/org/opensearch/migrations/transform/TypeMappingsExcisionTest.java index 30f8aab045..bf48319291 100644 --- a/TrafficCapture/transformationPlugins/jsonMessageTransformers/openSearch23PlusTargetTransformerProvider/src/test/java/org/opensearch/migrations/transform/TypeMappingsExcisionTest.java +++ b/TrafficCapture/transformationPlugins/jsonMessageTransformers/openSearch23PlusTargetTransformerProvider/src/test/java/org/opensearch/migrations/transform/TypeMappingsExcisionTest.java @@ -1,26 +1,18 @@ package org.opensearch.migrations.transform; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.common.io.CharStreams; import java.io.InputStream; import java.io.InputStreamReader; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.LinkedHashMap; import java.util.Map; - -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.common.io.CharStreams; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.replay.datahandlers.JsonAccumulator; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.common.io.CharStreams; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - public class TypeMappingsExcisionTest { static final TypeReference> TYPE_REFERENCE_FOR_MAP_TYPE = new TypeReference<>() { diff --git a/awsUtilities/src/main/java/org/opensearch/migrations/aws/SigV4Signer.java b/awsUtilities/src/main/java/org/opensearch/migrations/aws/SigV4Signer.java index d115f808e1..53720a84a2 100644 --- a/awsUtilities/src/main/java/org/opensearch/migrations/aws/SigV4Signer.java +++ b/awsUtilities/src/main/java/org/opensearch/migrations/aws/SigV4Signer.java @@ -12,22 +12,9 @@ import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.Stream; - import lombok.Lombok; import lombok.extern.slf4j.Slf4j; -import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; -import software.amazon.awssdk.auth.signer.internal.BaseAws4Signer; -import software.amazon.awssdk.auth.signer.params.Aws4SignerParams; -import software.amazon.awssdk.core.checksums.SdkChecksum; -import software.amazon.awssdk.http.SdkHttpFullRequest; -import software.amazon.awssdk.http.SdkHttpMethod; -import software.amazon.awssdk.regions.Region; -import software.amazon.awssdk.utils.BinaryUtils; - import org.opensearch.migrations.IHttpMessage; - -import lombok.Lombok; -import lombok.extern.slf4j.Slf4j; import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; import software.amazon.awssdk.auth.signer.internal.BaseAws4Signer; import software.amazon.awssdk.auth.signer.params.Aws4SignerParams; diff --git a/awsUtilities/src/test/java/org/opensearch/migrations/aws/SigV4SigningTransformationTest.java b/awsUtilities/src/test/java/org/opensearch/migrations/aws/SigV4SigningTransformationTest.java index 1cc33295fe..7e677320f0 100644 --- a/awsUtilities/src/test/java/org/opensearch/migrations/aws/SigV4SigningTransformationTest.java +++ b/awsUtilities/src/test/java/org/opensearch/migrations/aws/SigV4SigningTransformationTest.java @@ -1,5 +1,7 @@ package org.opensearch.migrations.aws; +import static org.junit.jupiter.api.Assertions.*; + import java.nio.charset.StandardCharsets; import java.security.MessageDigest; import java.time.Clock; @@ -10,29 +12,16 @@ import java.util.Map; import java.util.Optional; import java.util.stream.Stream; - import lombok.SneakyThrows; import org.junit.jupiter.api.TestInstance; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; -import software.amazon.awssdk.auth.credentials.AwsCredentials; -import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; - import org.opensearch.migrations.IHttpMessage; - -import lombok.SneakyThrows; -import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; -import org.junit.jupiter.params.provider.MethodSource; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.AwsCredentials; import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; -import static org.junit.jupiter.api.Assertions.*; - @TestInstance(TestInstance.Lifecycle.PER_CLASS) public class SigV4SigningTransformationTest { diff --git a/build.gradle b/build.gradle index 1aa4c73f87..6935b7e704 100644 --- a/build.gradle +++ b/build.gradle @@ -60,13 +60,7 @@ subprojects { java { target "**/*.java" targetExclude '**/build/**', ".gradle/**" - importOrder( - 'java|javax', - '', - 'org.opensearch', - '', - '\\#javax|\\#java|\\#org.opensearch|\\#' - ) + importOrder() indentWithSpaces() endWithNewline() removeUnusedImports() diff --git a/coreUtilities/src/main/java/org/opensearch/migrations/jcommander/NoSplitter.java b/coreUtilities/src/main/java/org/opensearch/migrations/jcommander/NoSplitter.java index fd59243fc8..7df33ed999 100644 --- a/coreUtilities/src/main/java/org/opensearch/migrations/jcommander/NoSplitter.java +++ b/coreUtilities/src/main/java/org/opensearch/migrations/jcommander/NoSplitter.java @@ -1,10 +1,7 @@ package org.opensearch.migrations.jcommander; -import java.util.List; - -import com.beust.jcommander.converters.IParameterSplitter; - import com.beust.jcommander.converters.IParameterSplitter; +import java.util.List; public class NoSplitter implements IParameterSplitter { @Override diff --git a/coreUtilities/src/main/java/org/opensearch/migrations/tracing/BaseSpanContext.java b/coreUtilities/src/main/java/org/opensearch/migrations/tracing/BaseSpanContext.java index a0083db265..9833a50959 100644 --- a/coreUtilities/src/main/java/org/opensearch/migrations/tracing/BaseSpanContext.java +++ b/coreUtilities/src/main/java/org/opensearch/migrations/tracing/BaseSpanContext.java @@ -1,18 +1,11 @@ package org.opensearch.migrations.tracing; -import java.time.Instant; -import java.util.Optional; -import java.util.stream.Stream; - -import io.opentelemetry.api.common.AttributeKey; -import io.opentelemetry.api.common.AttributesBuilder; -import io.opentelemetry.api.trace.Span; -import lombok.Getter; -import lombok.NonNull; - import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.common.AttributesBuilder; import io.opentelemetry.api.trace.Span; +import java.time.Instant; +import java.util.Optional; +import java.util.stream.Stream; import lombok.Getter; import lombok.NonNull; diff --git a/coreUtilities/src/main/java/org/opensearch/migrations/tracing/CommonMetricInstruments.java b/coreUtilities/src/main/java/org/opensearch/migrations/tracing/CommonMetricInstruments.java index 9e52d4d4d8..7f546cbea2 100644 --- a/coreUtilities/src/main/java/org/opensearch/migrations/tracing/CommonMetricInstruments.java +++ b/coreUtilities/src/main/java/org/opensearch/migrations/tracing/CommonMetricInstruments.java @@ -4,10 +4,6 @@ import io.opentelemetry.api.metrics.Meter; import lombok.AllArgsConstructor; -import io.opentelemetry.api.metrics.LongCounter; -import io.opentelemetry.api.metrics.Meter; -import lombok.AllArgsConstructor; - public class CommonMetricInstruments { @AllArgsConstructor public static class Labels { diff --git a/coreUtilities/src/main/java/org/opensearch/migrations/tracing/CommonScopedMetricInstruments.java b/coreUtilities/src/main/java/org/opensearch/migrations/tracing/CommonScopedMetricInstruments.java index 697a5a3737..f72a7f2242 100644 --- a/coreUtilities/src/main/java/org/opensearch/migrations/tracing/CommonScopedMetricInstruments.java +++ b/coreUtilities/src/main/java/org/opensearch/migrations/tracing/CommonScopedMetricInstruments.java @@ -1,18 +1,11 @@ package org.opensearch.migrations.tracing; -import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.DoubleStream; - -import io.opentelemetry.api.metrics.DoubleHistogram; -import io.opentelemetry.api.metrics.LongCounter; -import io.opentelemetry.api.metrics.Meter; -import lombok.AllArgsConstructor; -import lombok.extern.slf4j.Slf4j; - import io.opentelemetry.api.metrics.DoubleHistogram; import io.opentelemetry.api.metrics.LongCounter; import io.opentelemetry.api.metrics.Meter; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.DoubleStream; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/coreUtilities/src/main/java/org/opensearch/migrations/tracing/IInstrumentConstructor.java b/coreUtilities/src/main/java/org/opensearch/migrations/tracing/IInstrumentConstructor.java index f68a329581..ea1b4d7810 100644 --- a/coreUtilities/src/main/java/org/opensearch/migrations/tracing/IInstrumentConstructor.java +++ b/coreUtilities/src/main/java/org/opensearch/migrations/tracing/IInstrumentConstructor.java @@ -1,11 +1,7 @@ package org.opensearch.migrations.tracing; -import java.util.stream.Stream; - -import io.opentelemetry.api.trace.Span; -import lombok.NonNull; - import io.opentelemetry.api.trace.Span; +import java.util.stream.Stream; import lombok.NonNull; public interface IInstrumentConstructor extends IContextTracker { diff --git a/coreUtilities/src/main/java/org/opensearch/migrations/tracing/IInstrumentationAttributes.java b/coreUtilities/src/main/java/org/opensearch/migrations/tracing/IInstrumentationAttributes.java index 2f623d9794..aaeb337c73 100644 --- a/coreUtilities/src/main/java/org/opensearch/migrations/tracing/IInstrumentationAttributes.java +++ b/coreUtilities/src/main/java/org/opensearch/migrations/tracing/IInstrumentationAttributes.java @@ -1,21 +1,12 @@ package org.opensearch.migrations.tracing; -import java.time.Duration; - -import io.opentelemetry.api.common.Attributes; -import io.opentelemetry.api.common.AttributesBuilder; -import io.opentelemetry.api.metrics.DoubleHistogram; -import io.opentelemetry.api.metrics.LongCounter; -import io.opentelemetry.api.metrics.LongHistogram; -import io.opentelemetry.api.metrics.LongUpDownCounter; -import lombok.NonNull; - import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.AttributesBuilder; import io.opentelemetry.api.metrics.DoubleHistogram; import io.opentelemetry.api.metrics.LongCounter; import io.opentelemetry.api.metrics.LongHistogram; import io.opentelemetry.api.metrics.LongUpDownCounter; +import java.time.Duration; import lombok.NonNull; public interface IInstrumentationAttributes { diff --git a/coreUtilities/src/main/java/org/opensearch/migrations/tracing/IRootOtelContext.java b/coreUtilities/src/main/java/org/opensearch/migrations/tracing/IRootOtelContext.java index 8fc1b2e280..4fb34ece9c 100644 --- a/coreUtilities/src/main/java/org/opensearch/migrations/tracing/IRootOtelContext.java +++ b/coreUtilities/src/main/java/org/opensearch/migrations/tracing/IRootOtelContext.java @@ -2,8 +2,6 @@ import io.opentelemetry.api.metrics.MeterProvider; -import io.opentelemetry.api.metrics.MeterProvider; - public interface IRootOtelContext extends IInstrumentationAttributes, IInstrumentConstructor { MeterProvider getMeterProvider(); } diff --git a/coreUtilities/src/main/java/org/opensearch/migrations/tracing/IScopedInstrumentationAttributes.java b/coreUtilities/src/main/java/org/opensearch/migrations/tracing/IScopedInstrumentationAttributes.java index d43614cc88..ba83faf63d 100644 --- a/coreUtilities/src/main/java/org/opensearch/migrations/tracing/IScopedInstrumentationAttributes.java +++ b/coreUtilities/src/main/java/org/opensearch/migrations/tracing/IScopedInstrumentationAttributes.java @@ -1,7 +1,5 @@ package org.opensearch.migrations.tracing; -import java.util.ArrayDeque; - import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.AttributesBuilder; @@ -11,21 +9,10 @@ import io.opentelemetry.api.metrics.LongUpDownCounter; import io.opentelemetry.api.trace.Span; import io.opentelemetry.semconv.SemanticAttributes; +import java.util.ArrayDeque; import lombok.NonNull; - import org.opensearch.migrations.Utils; -import io.opentelemetry.api.common.AttributeKey; -import io.opentelemetry.api.common.Attributes; -import io.opentelemetry.api.common.AttributesBuilder; -import io.opentelemetry.api.metrics.DoubleHistogram; -import io.opentelemetry.api.metrics.LongCounter; -import io.opentelemetry.api.metrics.LongHistogram; -import io.opentelemetry.api.metrics.LongUpDownCounter; -import io.opentelemetry.api.trace.Span; -import io.opentelemetry.semconv.SemanticAttributes; -import lombok.NonNull; - public interface IScopedInstrumentationAttributes extends IWithStartTimeAndAttributes, AutoCloseable { String getActivityName(); diff --git a/coreUtilities/src/main/java/org/opensearch/migrations/tracing/IWithStartTimeAndAttributes.java b/coreUtilities/src/main/java/org/opensearch/migrations/tracing/IWithStartTimeAndAttributes.java index e3a3560f6a..02c70edff6 100644 --- a/coreUtilities/src/main/java/org/opensearch/migrations/tracing/IWithStartTimeAndAttributes.java +++ b/coreUtilities/src/main/java/org/opensearch/migrations/tracing/IWithStartTimeAndAttributes.java @@ -1,13 +1,9 @@ package org.opensearch.migrations.tracing; -import java.time.Duration; -import java.time.Instant; - -import io.opentelemetry.api.common.AttributesBuilder; -import io.opentelemetry.api.metrics.DoubleHistogram; - import io.opentelemetry.api.common.AttributesBuilder; import io.opentelemetry.api.metrics.DoubleHistogram; +import java.time.Duration; +import java.time.Instant; public interface IWithStartTimeAndAttributes extends IInstrumentationAttributes { /** diff --git a/coreUtilities/src/main/java/org/opensearch/migrations/tracing/NullableExemplarScope.java b/coreUtilities/src/main/java/org/opensearch/migrations/tracing/NullableExemplarScope.java index c8ee36de34..f84c3f8020 100644 --- a/coreUtilities/src/main/java/org/opensearch/migrations/tracing/NullableExemplarScope.java +++ b/coreUtilities/src/main/java/org/opensearch/migrations/tracing/NullableExemplarScope.java @@ -4,10 +4,6 @@ import io.opentelemetry.context.Context; import io.opentelemetry.context.Scope; -import io.opentelemetry.api.trace.Span; -import io.opentelemetry.context.Context; -import io.opentelemetry.context.Scope; - public class NullableExemplarScope implements Scope { final Scope underlyingScope; diff --git a/coreUtilities/src/main/java/org/opensearch/migrations/tracing/RootOtelContext.java b/coreUtilities/src/main/java/org/opensearch/migrations/tracing/RootOtelContext.java index b2b0559976..8001e8fdd2 100644 --- a/coreUtilities/src/main/java/org/opensearch/migrations/tracing/RootOtelContext.java +++ b/coreUtilities/src/main/java/org/opensearch/migrations/tracing/RootOtelContext.java @@ -1,10 +1,5 @@ package org.opensearch.migrations.tracing; -import java.time.Duration; -import java.util.Optional; -import java.util.concurrent.TimeUnit; -import java.util.stream.Stream; - import io.opentelemetry.api.OpenTelemetry; import io.opentelemetry.api.metrics.MeterProvider; import io.opentelemetry.api.trace.Span; @@ -19,30 +14,15 @@ import io.opentelemetry.sdk.trace.SdkTracerProvider; import io.opentelemetry.sdk.trace.export.BatchSpanProcessor; import io.opentelemetry.semconv.ResourceAttributes; +import java.time.Duration; +import java.util.Optional; +import java.util.concurrent.TimeUnit; +import java.util.stream.Stream; import lombok.Getter; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.Utils; -import io.opentelemetry.api.OpenTelemetry; -import io.opentelemetry.api.metrics.MeterProvider; -import io.opentelemetry.api.trace.Span; -import io.opentelemetry.api.trace.SpanBuilder; -import io.opentelemetry.context.Context; -import io.opentelemetry.exporter.otlp.metrics.OtlpGrpcMetricExporter; -import io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter; -import io.opentelemetry.sdk.OpenTelemetrySdk; -import io.opentelemetry.sdk.metrics.SdkMeterProvider; -import io.opentelemetry.sdk.metrics.export.PeriodicMetricReader; -import io.opentelemetry.sdk.resources.Resource; -import io.opentelemetry.sdk.trace.SdkTracerProvider; -import io.opentelemetry.sdk.trace.export.BatchSpanProcessor; -import io.opentelemetry.semconv.ResourceAttributes; -import lombok.Getter; -import lombok.NonNull; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class RootOtelContext implements IRootOtelContext { private final OpenTelemetry openTelemetryImpl; diff --git a/coreUtilities/src/main/java/org/opensearch/migrations/tracing/commoncontexts/IConnectionContext.java b/coreUtilities/src/main/java/org/opensearch/migrations/tracing/commoncontexts/IConnectionContext.java index ba8176079c..43d5917a54 100644 --- a/coreUtilities/src/main/java/org/opensearch/migrations/tracing/commoncontexts/IConnectionContext.java +++ b/coreUtilities/src/main/java/org/opensearch/migrations/tracing/commoncontexts/IConnectionContext.java @@ -2,12 +2,8 @@ import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.common.AttributesBuilder; - import org.opensearch.migrations.tracing.IScopedInstrumentationAttributes; -import io.opentelemetry.api.common.AttributeKey; -import io.opentelemetry.api.common.AttributesBuilder; - public interface IConnectionContext extends IScopedInstrumentationAttributes { static final AttributeKey CONNECTION_ID_ATTR = AttributeKey.stringKey("connectionId"); static final AttributeKey NODE_ID_ATTR = AttributeKey.stringKey("nodeId"); diff --git a/coreUtilities/src/main/java/org/opensearch/migrations/tracing/commoncontexts/IHttpTransactionContext.java b/coreUtilities/src/main/java/org/opensearch/migrations/tracing/commoncontexts/IHttpTransactionContext.java index 132a38f0df..2dc76a4bd0 100644 --- a/coreUtilities/src/main/java/org/opensearch/migrations/tracing/commoncontexts/IHttpTransactionContext.java +++ b/coreUtilities/src/main/java/org/opensearch/migrations/tracing/commoncontexts/IHttpTransactionContext.java @@ -2,12 +2,8 @@ import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.common.AttributesBuilder; - import org.opensearch.migrations.tracing.IScopedInstrumentationAttributes; -import io.opentelemetry.api.common.AttributeKey; -import io.opentelemetry.api.common.AttributesBuilder; - public interface IHttpTransactionContext extends IScopedInstrumentationAttributes { static final AttributeKey SOURCE_REQUEST_INDEX_KEY = AttributeKey.longKey("sourceRequestIndex"); diff --git a/coreUtilities/src/main/java/org/opensearch/migrations/utils/ProcessHelpers.java b/coreUtilities/src/main/java/org/opensearch/migrations/utils/ProcessHelpers.java index 9533c43336..daa164106e 100644 --- a/coreUtilities/src/main/java/org/opensearch/migrations/utils/ProcessHelpers.java +++ b/coreUtilities/src/main/java/org/opensearch/migrations/utils/ProcessHelpers.java @@ -2,9 +2,6 @@ import java.util.Optional; import java.util.UUID; - -import lombok.extern.slf4j.Slf4j; - import lombok.extern.slf4j.Slf4j; @Slf4j diff --git a/coreUtilities/src/main/java/org/opensearch/migrations/utils/SequentialSpanCompressingReducer.java b/coreUtilities/src/main/java/org/opensearch/migrations/utils/SequentialSpanCompressingReducer.java index 83fd3c3be1..4d3fdab7c8 100644 --- a/coreUtilities/src/main/java/org/opensearch/migrations/utils/SequentialSpanCompressingReducer.java +++ b/coreUtilities/src/main/java/org/opensearch/migrations/utils/SequentialSpanCompressingReducer.java @@ -2,8 +2,6 @@ import lombok.AllArgsConstructor; -import lombok.AllArgsConstructor; - /** * This class can be used to reduce a stream of Integers into a string (calling getFinalAccumulation()). * diff --git a/coreUtilities/src/test/java/org/opensearch/migrations/tracing/CommonScopedMetricInstrumentsTest.java b/coreUtilities/src/test/java/org/opensearch/migrations/tracing/CommonScopedMetricInstrumentsTest.java index 0dd76fffb1..00ba8a28cf 100644 --- a/coreUtilities/src/test/java/org/opensearch/migrations/tracing/CommonScopedMetricInstrumentsTest.java +++ b/coreUtilities/src/test/java/org/opensearch/migrations/tracing/CommonScopedMetricInstrumentsTest.java @@ -1,13 +1,10 @@ package org.opensearch.migrations.tracing; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; - class CommonScopedMetricInstrumentsTest { @Test public void testThatBadSizeThrowsException() { diff --git a/coreUtilities/src/test/java/org/opensearch/migrations/tracing/IInstrumentationAttributesTest.java b/coreUtilities/src/test/java/org/opensearch/migrations/tracing/IInstrumentationAttributesTest.java index ebab0eb10b..bf14fcfe97 100644 --- a/coreUtilities/src/test/java/org/opensearch/migrations/tracing/IInstrumentationAttributesTest.java +++ b/coreUtilities/src/test/java/org/opensearch/migrations/tracing/IInstrumentationAttributesTest.java @@ -1,14 +1,8 @@ package org.opensearch.migrations.tracing; -import java.util.Optional; - -import io.opentelemetry.api.common.AttributeKey; -import io.opentelemetry.api.common.AttributesBuilder; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.common.AttributesBuilder; +import java.util.Optional; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/coreUtilities/src/testFixtures/java/org/opensearch/migrations/tracing/BacktracingContextTracker.java b/coreUtilities/src/testFixtures/java/org/opensearch/migrations/tracing/BacktracingContextTracker.java index ab9f0bbf86..caa3c8c7b9 100644 --- a/coreUtilities/src/testFixtures/java/org/opensearch/migrations/tracing/BacktracingContextTracker.java +++ b/coreUtilities/src/testFixtures/java/org/opensearch/migrations/tracing/BacktracingContextTracker.java @@ -3,10 +3,6 @@ import java.util.Map; import java.util.WeakHashMap; import java.util.stream.Collectors; - -import lombok.Getter; -import lombok.extern.slf4j.Slf4j; - import lombok.Getter; import lombok.extern.slf4j.Slf4j; diff --git a/coreUtilities/src/testFixtures/java/org/opensearch/migrations/tracing/InMemoryInstrumentationBundle.java b/coreUtilities/src/testFixtures/java/org/opensearch/migrations/tracing/InMemoryInstrumentationBundle.java index 664018ee24..f6e9e55fa6 100644 --- a/coreUtilities/src/testFixtures/java/org/opensearch/migrations/tracing/InMemoryInstrumentationBundle.java +++ b/coreUtilities/src/testFixtures/java/org/opensearch/migrations/tracing/InMemoryInstrumentationBundle.java @@ -1,5 +1,14 @@ package org.opensearch.migrations.tracing; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import io.opentelemetry.sdk.metrics.SdkMeterProvider; +import io.opentelemetry.sdk.metrics.data.LongPointData; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader; +import io.opentelemetry.sdk.testing.exporter.InMemorySpanExporter; +import io.opentelemetry.sdk.trace.SdkTracerProvider; +import io.opentelemetry.sdk.trace.data.SpanData; +import io.opentelemetry.sdk.trace.export.SimpleSpanProcessor; import java.io.IOException; import java.util.Collection; import java.util.List; @@ -10,30 +19,6 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; import java.util.stream.Stream; - -import io.opentelemetry.sdk.OpenTelemetrySdk; -import io.opentelemetry.sdk.metrics.SdkMeterProvider; -import io.opentelemetry.sdk.metrics.data.LongPointData; -import io.opentelemetry.sdk.metrics.data.MetricData; -import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader; -import io.opentelemetry.sdk.testing.exporter.InMemorySpanExporter; -import io.opentelemetry.sdk.trace.SdkTracerProvider; -import io.opentelemetry.sdk.trace.data.SpanData; -import io.opentelemetry.sdk.trace.export.SimpleSpanProcessor; -import lombok.Getter; -import lombok.Lombok; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; - -import io.opentelemetry.sdk.OpenTelemetrySdk; -import io.opentelemetry.sdk.metrics.SdkMeterProvider; -import io.opentelemetry.sdk.metrics.data.LongPointData; -import io.opentelemetry.sdk.metrics.data.MetricData; -import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader; -import io.opentelemetry.sdk.testing.exporter.InMemorySpanExporter; -import io.opentelemetry.sdk.trace.SdkTracerProvider; -import io.opentelemetry.sdk.trace.data.SpanData; -import io.opentelemetry.sdk.trace.export.SimpleSpanProcessor; import lombok.Getter; import lombok.Lombok; import lombok.SneakyThrows; diff --git a/coreUtilities/src/testFixtures/java/org/opensearch/migrations/tracing/LoggingContextTracer.java b/coreUtilities/src/testFixtures/java/org/opensearch/migrations/tracing/LoggingContextTracer.java index ecd191e267..5d158fab5d 100644 --- a/coreUtilities/src/testFixtures/java/org/opensearch/migrations/tracing/LoggingContextTracer.java +++ b/coreUtilities/src/testFixtures/java/org/opensearch/migrations/tracing/LoggingContextTracer.java @@ -2,8 +2,6 @@ import lombok.extern.slf4j.Slf4j; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class LoggingContextTracer implements IContextTracker { diff --git a/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/Sanitizer.java b/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/Sanitizer.java index 5c20268263..38ad4c8791 100644 --- a/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/Sanitizer.java +++ b/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/Sanitizer.java @@ -1,15 +1,13 @@ package org.opensearch.migrations.dashboards; +import com.fasterxml.jackson.core.JsonProcessingException; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Queue; import java.util.Set; - -import com.fasterxml.jackson.core.JsonProcessingException; import lombok.Getter; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.dashboards.converter.DashboardConverter; import org.opensearch.migrations.dashboards.converter.IndexPatternConverter; import org.opensearch.migrations.dashboards.converter.QueryConverter; @@ -21,10 +19,6 @@ import org.opensearch.migrations.dashboards.savedobjects.SavedObjectParser; import org.opensearch.migrations.dashboards.util.Stats; -import com.fasterxml.jackson.core.JsonProcessingException; -import lombok.Getter; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class Sanitizer { diff --git a/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/SanitizerCli.java b/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/SanitizerCli.java index c5bd1a5a40..59818c6ca8 100644 --- a/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/SanitizerCli.java +++ b/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/SanitizerCli.java @@ -1,20 +1,13 @@ package org.opensearch.migrations.dashboards; -import java.io.*; -import java.util.Scanner; - import com.beust.jcommander.JCommander; import com.beust.jcommander.Parameter; import com.beust.jcommander.ParameterException; +import java.io.*; +import java.util.Scanner; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.dashboards.util.Stats; -import com.beust.jcommander.JCommander; -import com.beust.jcommander.Parameter; -import com.beust.jcommander.ParameterException; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class SanitizerCli implements Runnable { diff --git a/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/converter/DashboardConverter.java b/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/converter/DashboardConverter.java index 083fbaa4ea..42cdf15b96 100644 --- a/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/converter/DashboardConverter.java +++ b/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/converter/DashboardConverter.java @@ -1,30 +1,22 @@ package org.opensearch.migrations.dashboards.converter; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ObjectNode; import java.util.ArrayList; import java.util.List; import java.util.Optional; import java.util.Set; import java.util.UUID; import java.util.stream.Collectors; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.dashboards.Sanitizer; import org.opensearch.migrations.dashboards.savedobjects.Dashboard; import org.opensearch.migrations.dashboards.savedobjects.Dashboard.Panel; import org.opensearch.migrations.dashboards.savedobjects.Reference; import org.opensearch.migrations.dashboards.savedobjects.SavedObject; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; -import lombok.extern.slf4j.Slf4j; - @Slf4j public class DashboardConverter extends SavedObjectConverter { diff --git a/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/converter/QueryConverter.java b/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/converter/QueryConverter.java index 32f032fe90..4672f53dd0 100644 --- a/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/converter/QueryConverter.java +++ b/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/converter/QueryConverter.java @@ -1,7 +1,6 @@ package org.opensearch.migrations.dashboards.converter; import java.util.List; - import org.opensearch.migrations.dashboards.savedobjects.SavedObject; /** diff --git a/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/converter/SavedObjectConverter.java b/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/converter/SavedObjectConverter.java index f4278dca5b..01f020b37b 100644 --- a/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/converter/SavedObjectConverter.java +++ b/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/converter/SavedObjectConverter.java @@ -1,5 +1,7 @@ package org.opensearch.migrations.dashboards.converter; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; import java.util.ArrayList; import java.util.Comparator; import java.util.Iterator; @@ -7,17 +9,8 @@ import java.util.Map; import java.util.SortedMap; import java.util.function.Consumer; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ObjectNode; import lombok.extern.slf4j.Slf4j; -import org.semver4j.Semver; - import org.opensearch.migrations.dashboards.savedobjects.SavedObject; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import lombok.extern.slf4j.Slf4j; import org.semver4j.Semver; @Slf4j diff --git a/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/converter/SearchConverter.java b/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/converter/SearchConverter.java index a759db3d5d..92c432bea7 100644 --- a/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/converter/SearchConverter.java +++ b/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/converter/SearchConverter.java @@ -1,7 +1,6 @@ package org.opensearch.migrations.dashboards.converter; import java.util.List; - import org.opensearch.migrations.dashboards.savedobjects.SavedObject; /** diff --git a/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/converter/UrlConverter.java b/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/converter/UrlConverter.java index da6fcccc87..c465ce81ce 100644 --- a/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/converter/UrlConverter.java +++ b/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/converter/UrlConverter.java @@ -2,12 +2,8 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import lombok.extern.slf4j.Slf4j; - import org.opensearch.migrations.dashboards.savedobjects.SavedObject; -import com.fasterxml.jackson.databind.node.ObjectNode; -import lombok.extern.slf4j.Slf4j; - /** * Class URL defines the migration for the search object type between ES and OpenSearch. * diff --git a/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/converter/VisualizationConverter.java b/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/converter/VisualizationConverter.java index 09f18cda88..698e2ff20a 100644 --- a/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/converter/VisualizationConverter.java +++ b/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/converter/VisualizationConverter.java @@ -1,14 +1,10 @@ package org.opensearch.migrations.dashboards.converter; +import com.fasterxml.jackson.databind.node.ObjectNode; import java.util.HashMap; import java.util.Map; - -import com.fasterxml.jackson.databind.node.ObjectNode; - import org.opensearch.migrations.dashboards.savedobjects.SavedObject; -import com.fasterxml.jackson.databind.node.ObjectNode; - // // Class Visualization defined the migration for the search object type between ES and OpenSearch // diff --git a/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/savedobjects/Dashboard.java b/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/savedobjects/Dashboard.java index 266daf6bd1..c8ce4ff042 100644 --- a/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/savedobjects/Dashboard.java +++ b/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/savedobjects/Dashboard.java @@ -1,18 +1,11 @@ package org.opensearch.migrations.dashboards.savedobjects; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import lombok.Getter; -import lombok.ToString; - import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; import lombok.Getter; import lombok.ToString; diff --git a/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/savedobjects/Reference.java b/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/savedobjects/Reference.java index 10aa63c98c..daa186239c 100644 --- a/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/savedobjects/Reference.java +++ b/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/savedobjects/Reference.java @@ -3,9 +3,6 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import lombok.ToString; -import com.fasterxml.jackson.databind.node.ObjectNode; -import lombok.ToString; - @ToString(includeFieldNames = true) public class Reference { diff --git a/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/savedobjects/SavedObject.java b/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/savedobjects/SavedObject.java index 3d664ffd57..90a5c3e9dd 100644 --- a/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/savedobjects/SavedObject.java +++ b/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/savedobjects/SavedObject.java @@ -1,23 +1,12 @@ package org.opensearch.migrations.dashboards.savedobjects; -import java.util.ArrayList; -import java.util.List; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.ObjectNode; -import lombok.Getter; -import lombok.ToString; -import lombok.extern.slf4j.Slf4j; -import org.semver4j.Semver; - import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.ArrayList; +import java.util.List; import lombok.Getter; import lombok.ToString; import lombok.extern.slf4j.Slf4j; diff --git a/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/savedobjects/SavedObjectParser.java b/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/savedobjects/SavedObjectParser.java index a6c9298845..ab863f17fe 100644 --- a/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/savedobjects/SavedObjectParser.java +++ b/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/savedobjects/SavedObjectParser.java @@ -1,20 +1,12 @@ package org.opensearch.migrations.dashboards.savedobjects; -import java.util.HashMap; -import java.util.Map; -import java.util.Optional; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; -import lombok.NoArgsConstructor; -import lombok.extern.slf4j.Slf4j; - import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; import lombok.NoArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/util/Stats.java b/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/util/Stats.java index 372e94e35a..4e3e1738cc 100644 --- a/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/util/Stats.java +++ b/dashboardsSanitizer/src/main/java/org/opensearch/migrations/dashboards/util/Stats.java @@ -1,15 +1,9 @@ package org.opensearch.migrations.dashboards.util; -import java.util.HashMap; -import java.util.Map; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import lombok.Data; -import lombok.Getter; - import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; import lombok.Data; import lombok.Getter; diff --git a/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/SanitizerTest.java b/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/SanitizerTest.java index e9c8014fd5..ec7445177e 100644 --- a/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/SanitizerTest.java +++ b/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/SanitizerTest.java @@ -1,18 +1,14 @@ package org.opensearch.migrations.dashboards; +import static org.junit.jupiter.api.Assertions.*; + +import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; import java.net.URISyntaxException; import java.nio.file.Files; import java.nio.file.Path; - -import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.jupiter.api.Test; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.*; - class SanitizerTest { private static final ObjectMapper objectMapper = new ObjectMapper(); diff --git a/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/converters/DashboardConverterTest.java b/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/converters/DashboardConverterTest.java index 407f8bc6b0..8a3383db9f 100644 --- a/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/converters/DashboardConverterTest.java +++ b/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/converters/DashboardConverterTest.java @@ -1,29 +1,20 @@ package org.opensearch.migrations.dashboards.converters; -import java.util.ArrayList; -import java.util.List; +import static org.junit.jupiter.api.Assertions.*; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.ArrayList; +import java.util.List; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.dashboards.Sanitizer; import org.opensearch.migrations.dashboards.converter.DashboardConverter; import org.opensearch.migrations.dashboards.savedobjects.Dashboard; import org.opensearch.migrations.dashboards.savedobjects.SavedObject; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.*; - public class DashboardConverterTest extends SavedObjectsBase { @Test diff --git a/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/converters/IndexPatternConverterTest.java b/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/converters/IndexPatternConverterTest.java index 29cf9c1ce5..8ef6335a5c 100644 --- a/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/converters/IndexPatternConverterTest.java +++ b/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/converters/IndexPatternConverterTest.java @@ -1,23 +1,16 @@ package org.opensearch.migrations.dashboards.converters; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; + import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.dashboards.converter.IndexPatternConverter; import org.opensearch.migrations.dashboards.savedobjects.SavedObject; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNull; - public class IndexPatternConverterTest extends SavedObjectsBase { private static final ObjectMapper objectMapper = new ObjectMapper(); diff --git a/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/converters/QueryConverterTest.java b/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/converters/QueryConverterTest.java index 94e07a9504..0f857741c9 100644 --- a/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/converters/QueryConverterTest.java +++ b/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/converters/QueryConverterTest.java @@ -1,19 +1,14 @@ package org.opensearch.migrations.dashboards.converters; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; + import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.node.ObjectNode; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.dashboards.converter.QueryConverter; import org.opensearch.migrations.dashboards.savedobjects.SavedObject; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.node.ObjectNode; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNull; - public class QueryConverterTest extends SavedObjectsBase { diff --git a/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/converters/SavedObjectsBase.java b/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/converters/SavedObjectsBase.java index 503f54db03..62509594fe 100644 --- a/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/converters/SavedObjectsBase.java +++ b/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/converters/SavedObjectsBase.java @@ -1,18 +1,12 @@ package org.opensearch.migrations.dashboards.converters; -import java.io.IOException; -import java.io.InputStream; - import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; +import java.io.IOException; +import java.io.InputStream; import org.junit.jupiter.api.BeforeEach; - import org.opensearch.migrations.dashboards.Sanitizer; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; -import org.junit.jupiter.api.BeforeEach; - public abstract class SavedObjectsBase { protected static final ObjectMapper objectMapper = new ObjectMapper(); diff --git a/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/converters/SearchConverterTest.java b/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/converters/SearchConverterTest.java index de47e4029f..5bb2f3d25a 100644 --- a/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/converters/SearchConverterTest.java +++ b/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/converters/SearchConverterTest.java @@ -1,18 +1,13 @@ package org.opensearch.migrations.dashboards.converters; +import static org.junit.jupiter.api.Assertions.assertEquals; + import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.node.ObjectNode; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.dashboards.converter.SearchConverter; import org.opensearch.migrations.dashboards.savedobjects.SavedObject; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.node.ObjectNode; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertEquals; - public class SearchConverterTest extends SavedObjectsBase { @Test diff --git a/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/converters/UrlConverterTest.java b/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/converters/UrlConverterTest.java index f2858892c7..acb97cb2f3 100644 --- a/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/converters/UrlConverterTest.java +++ b/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/converters/UrlConverterTest.java @@ -1,19 +1,14 @@ package org.opensearch.migrations.dashboards.converters; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; + import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.node.ObjectNode; import org.junit.jupiter.api.Test; - import org.opensearch.migrations.dashboards.converter.UrlConverter; import org.opensearch.migrations.dashboards.savedobjects.SavedObject; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.node.ObjectNode; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNull; - public class UrlConverterTest extends SavedObjectsBase { @Test diff --git a/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/util/StatsTest.java b/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/util/StatsTest.java index 09167547a5..480ebb14e5 100644 --- a/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/util/StatsTest.java +++ b/dashboardsSanitizer/src/test/java/org/opensearch/migrations/dashboards/util/StatsTest.java @@ -1,17 +1,12 @@ package org.opensearch.migrations.dashboards.util; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; - class StatsTest { private Stats stats; diff --git a/libraries/kafkaCommandLineFormatter/src/main/java/org/opensearch/migrations/utils/kafka/Base64Formatter.java b/libraries/kafkaCommandLineFormatter/src/main/java/org/opensearch/migrations/utils/kafka/Base64Formatter.java index d2cc695e22..718f31af6e 100644 --- a/libraries/kafkaCommandLineFormatter/src/main/java/org/opensearch/migrations/utils/kafka/Base64Formatter.java +++ b/libraries/kafkaCommandLineFormatter/src/main/java/org/opensearch/migrations/utils/kafka/Base64Formatter.java @@ -3,10 +3,6 @@ import java.io.PrintStream; import java.util.Base64; - -import org.apache.kafka.clients.consumer.ConsumerRecord; -import org.apache.kafka.common.MessageFormatter; - import org.apache.kafka.clients.consumer.ConsumerRecord; import org.apache.kafka.common.MessageFormatter; diff --git a/testHelperFixtures/src/test/java/org/opensearch/migrations/testutils/NettyLeakCheckTestExtensionTest.java b/testHelperFixtures/src/test/java/org/opensearch/migrations/testutils/NettyLeakCheckTestExtensionTest.java index 0c787c50f9..4dd289c68b 100644 --- a/testHelperFixtures/src/test/java/org/opensearch/migrations/testutils/NettyLeakCheckTestExtensionTest.java +++ b/testHelperFixtures/src/test/java/org/opensearch/migrations/testutils/NettyLeakCheckTestExtensionTest.java @@ -1,14 +1,6 @@ package org.opensearch.migrations.testutils; import java.time.Duration; - -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.parallel.Execution; -import org.junit.jupiter.api.parallel.ExecutionMode; - import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; diff --git a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/matchers/ContainsStringCount.java b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/matchers/ContainsStringCount.java index de4feecb0d..1646becc4f 100644 --- a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/matchers/ContainsStringCount.java +++ b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/matchers/ContainsStringCount.java @@ -4,10 +4,6 @@ import org.hamcrest.Description; import org.hamcrest.TypeSafeMatcher; -import lombok.AllArgsConstructor; -import org.hamcrest.Description; -import org.hamcrest.TypeSafeMatcher; - @AllArgsConstructor public class ContainsStringCount extends TypeSafeMatcher { private final String expectedString; diff --git a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/matchers/HasLineCount.java b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/matchers/HasLineCount.java index 6b4b00f14f..be837dad65 100644 --- a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/matchers/HasLineCount.java +++ b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/matchers/HasLineCount.java @@ -4,10 +4,6 @@ import org.hamcrest.Description; import org.hamcrest.TypeSafeMatcher; -import lombok.AllArgsConstructor; -import org.hamcrest.Description; -import org.hamcrest.TypeSafeMatcher; - @AllArgsConstructor public class HasLineCount extends TypeSafeMatcher { private int expectedLineCount; diff --git a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/CloseableLogSetup.java b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/CloseableLogSetup.java index 753e317efd..47528d49c1 100644 --- a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/CloseableLogSetup.java +++ b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/CloseableLogSetup.java @@ -1,18 +1,9 @@ package org.opensearch.migrations.testutils; +import com.google.errorprone.annotations.MustBeClosed; import java.util.ArrayList; import java.util.Collections; import java.util.List; - -import com.google.errorprone.annotations.MustBeClosed; -import lombok.Getter; -import org.apache.logging.log4j.Level; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.core.LogEvent; -import org.apache.logging.log4j.core.appender.AbstractAppender; -import org.slf4j.LoggerFactory; - -import com.google.errorprone.annotations.MustBeClosed; import lombok.Getter; import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; diff --git a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/CountingNettyResourceLeakDetector.java b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/CountingNettyResourceLeakDetector.java index d82d52533e..b02f59aee3 100644 --- a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/CountingNettyResourceLeakDetector.java +++ b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/CountingNettyResourceLeakDetector.java @@ -1,18 +1,11 @@ package org.opensearch.migrations.testutils; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; - -import io.netty.channel.nio.NioEventLoopGroup; -import io.netty.util.ResourceLeakDetector; -import io.netty.util.ResourceLeakDetectorFactory; -import io.netty.util.concurrent.DefaultThreadFactory; -import lombok.extern.slf4j.Slf4j; - import io.netty.channel.nio.NioEventLoopGroup; import io.netty.util.ResourceLeakDetector; import io.netty.util.ResourceLeakDetectorFactory; import io.netty.util.concurrent.DefaultThreadFactory; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; import lombok.extern.slf4j.Slf4j; /** diff --git a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/HeapDumper.java b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/HeapDumper.java index 27a6222202..00476a95f6 100644 --- a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/HeapDumper.java +++ b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/HeapDumper.java @@ -1,12 +1,9 @@ package org.opensearch.migrations.testutils; +import com.sun.management.HotSpotDiagnosticMXBean; import java.lang.management.ManagementFactory; import javax.management.MBeanServer; -import com.sun.management.HotSpotDiagnosticMXBean; - -import com.sun.management.HotSpotDiagnosticMXBean; - public class HeapDumper { private HeapDumper() {} diff --git a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/NettyLeakCheckTestExtension.java b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/NettyLeakCheckTestExtension.java index d37b7e16fe..119d071f2f 100644 --- a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/NettyLeakCheckTestExtension.java +++ b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/NettyLeakCheckTestExtension.java @@ -3,13 +3,6 @@ import java.lang.reflect.Method; import java.util.Optional; import java.util.concurrent.Callable; - -import lombok.Lombok; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.extension.ExtensionContext; -import org.junit.jupiter.api.extension.InvocationInterceptor; -import org.junit.jupiter.api.extension.ReflectiveInvocationContext; - import lombok.Lombok; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.extension.ExtensionContext; diff --git a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/PortFinder.java b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/PortFinder.java index 036c3019da..edcfe79b78 100644 --- a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/PortFinder.java +++ b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/PortFinder.java @@ -3,9 +3,6 @@ import java.io.IOException; import java.net.ServerSocket; import java.util.function.IntConsumer; - -import lombok.extern.slf4j.Slf4j; - import lombok.extern.slf4j.Slf4j; /** diff --git a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/SelfSignedSSLContextBuilder.java b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/SelfSignedSSLContextBuilder.java index 83edfa6a32..23e4a1cac1 100644 --- a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/SelfSignedSSLContextBuilder.java +++ b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/SelfSignedSSLContextBuilder.java @@ -13,15 +13,6 @@ import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManagerFactory; - -import org.bouncycastle.asn1.x500.X500Name; -import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter; -import org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder; -import org.bouncycastle.jce.provider.BouncyCastleProvider; -import org.bouncycastle.operator.ContentSigner; -import org.bouncycastle.operator.OperatorCreationException; -import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder; - import org.bouncycastle.asn1.x500.X500Name; import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter; import org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder; diff --git a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/SharedDockerImageNames.java b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/SharedDockerImageNames.java index c58be1384b..cd5fc5880e 100644 --- a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/SharedDockerImageNames.java +++ b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/SharedDockerImageNames.java @@ -2,8 +2,6 @@ import org.testcontainers.utility.DockerImageName; -import org.testcontainers.utility.DockerImageName; - public interface SharedDockerImageNames { DockerImageName KAFKA = DockerImageName.parse("confluentinc/cp-kafka:7.5.0"); DockerImageName HTTPD = DockerImageName.parse("httpd:alpine"); diff --git a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/SimpleHttpClientForTesting.java b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/SimpleHttpClientForTesting.java index 660e108503..2384e15cef 100644 --- a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/SimpleHttpClientForTesting.java +++ b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/SimpleHttpClientForTesting.java @@ -10,25 +10,6 @@ import java.util.Map; import java.util.stream.Collectors; import java.util.stream.Stream; - -import lombok.AllArgsConstructor; -import org.apache.hc.client5.http.classic.methods.HttpGet; -import org.apache.hc.client5.http.classic.methods.HttpPut; -import org.apache.hc.client5.http.config.RequestConfig; -import org.apache.hc.client5.http.impl.classic.CloseableHttpClient; -import org.apache.hc.client5.http.impl.classic.HttpClients; -import org.apache.hc.client5.http.impl.io.BasicHttpClientConnectionManager; -import org.apache.hc.client5.http.socket.ConnectionSocketFactory; -import org.apache.hc.client5.http.socket.PlainConnectionSocketFactory; -import org.apache.hc.client5.http.ssl.NoopHostnameVerifier; -import org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory; -import org.apache.hc.client5.http.ssl.TrustAllStrategy; -import org.apache.hc.core5.http.ContentType; -import org.apache.hc.core5.http.config.RegistryBuilder; -import org.apache.hc.core5.http.io.entity.InputStreamEntity; -import org.apache.hc.core5.ssl.SSLContexts; -import org.apache.hc.core5.util.Timeout; - import lombok.AllArgsConstructor; import org.apache.hc.client5.http.classic.methods.HttpGet; import org.apache.hc.client5.http.classic.methods.HttpPut; diff --git a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/SimpleHttpResponse.java b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/SimpleHttpResponse.java index 8c0e62b30e..9ad74b1baa 100644 --- a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/SimpleHttpResponse.java +++ b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/SimpleHttpResponse.java @@ -1,9 +1,6 @@ package org.opensearch.migrations.testutils; import java.util.Map; - -import lombok.AllArgsConstructor; - import lombok.AllArgsConstructor; /** diff --git a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/SimpleHttpServer.java b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/SimpleHttpServer.java index b573de1be5..ba215672f9 100644 --- a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/SimpleHttpServer.java +++ b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/SimpleHttpServer.java @@ -1,5 +1,9 @@ package org.opensearch.migrations.testutils; +import com.sun.net.httpserver.HttpServer; +import com.sun.net.httpserver.HttpsConfigurator; +import com.sun.net.httpserver.HttpsParameters; +import com.sun.net.httpserver.HttpsServer; import java.net.InetSocketAddress; import java.net.URI; import java.net.URISyntaxException; @@ -9,19 +13,6 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.function.Function; import java.util.stream.Collectors; - -import com.sun.net.httpserver.HttpServer; -import com.sun.net.httpserver.HttpsConfigurator; -import com.sun.net.httpserver.HttpsParameters; -import com.sun.net.httpserver.HttpsServer; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.Lombok; - -import com.sun.net.httpserver.HttpServer; -import com.sun.net.httpserver.HttpsConfigurator; -import com.sun.net.httpserver.HttpsParameters; -import com.sun.net.httpserver.HttpsServer; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.Lombok; diff --git a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/SimpleNettyHttpServer.java b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/SimpleNettyHttpServer.java index f8e6616653..a300979c36 100644 --- a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/SimpleNettyHttpServer.java +++ b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/SimpleNettyHttpServer.java @@ -1,43 +1,5 @@ package org.opensearch.migrations.testutils; -import java.net.URI; -import java.net.URISyntaxException; -import java.time.Duration; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicReference; -import java.util.function.Function; -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLEngine; - -import io.netty.bootstrap.ServerBootstrap; -import io.netty.buffer.Unpooled; -import io.netty.channel.Channel; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInitializer; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.SimpleChannelInboundHandler; -import io.netty.channel.nio.NioEventLoopGroup; -import io.netty.channel.socket.SocketChannel; -import io.netty.channel.socket.nio.NioServerSocketChannel; -import io.netty.handler.codec.http.DefaultFullHttpResponse; -import io.netty.handler.codec.http.DefaultHttpHeaders; -import io.netty.handler.codec.http.FullHttpRequest; -import io.netty.handler.codec.http.HttpHeaders; -import io.netty.handler.codec.http.HttpObjectAggregator; -import io.netty.handler.codec.http.HttpRequestDecoder; -import io.netty.handler.codec.http.HttpResponseEncoder; -import io.netty.handler.codec.http.HttpResponseStatus; -import io.netty.handler.codec.http.HttpVersion; -import io.netty.handler.logging.LoggingHandler; -import io.netty.handler.ssl.SslHandler; -import io.netty.handler.timeout.ReadTimeoutHandler; -import io.netty.util.concurrent.DefaultThreadFactory; -import lombok.Lombok; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; - import io.netty.bootstrap.ServerBootstrap; import io.netty.buffer.Unpooled; import io.netty.channel.Channel; @@ -61,6 +23,16 @@ import io.netty.handler.ssl.SslHandler; import io.netty.handler.timeout.ReadTimeoutHandler; import io.netty.util.concurrent.DefaultThreadFactory; +import java.net.URI; +import java.net.URISyntaxException; +import java.time.Duration; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Function; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLEngine; import lombok.Lombok; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; diff --git a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/StreamInterleaver.java b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/StreamInterleaver.java index 7ffbe128f1..06f7454e27 100644 --- a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/StreamInterleaver.java +++ b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/StreamInterleaver.java @@ -1,5 +1,6 @@ package org.opensearch.migrations.testutils; +import com.google.common.collect.Streams; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -7,10 +8,6 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import com.google.common.collect.Streams; - -import com.google.common.collect.Streams; - public class StreamInterleaver { public static Stream randomlyInterleaveStreams(Random r, Stream> orderedItemStreams) { diff --git a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/TestUtilities.java b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/TestUtilities.java index d08de69dd4..e4a11ffa35 100644 --- a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/TestUtilities.java +++ b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/TestUtilities.java @@ -4,10 +4,6 @@ import io.netty.buffer.ByteBufAllocator; import io.netty.buffer.Unpooled; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufAllocator; -import io.netty.buffer.Unpooled; - public class TestUtilities { public static ByteBuf getByteBuf(byte[] src, boolean usePool) { var unpooled = Unpooled.wrappedBuffer(src); diff --git a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/ToxiProxyWrapper.java b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/ToxiProxyWrapper.java index aba2ae37dc..c9047272c8 100644 --- a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/ToxiProxyWrapper.java +++ b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/ToxiProxyWrapper.java @@ -1,16 +1,8 @@ package org.opensearch.migrations.testutils; -import java.net.URI; - -import eu.rekawek.toxiproxy.Proxy; -import eu.rekawek.toxiproxy.ToxiproxyClient; -import lombok.Getter; -import lombok.SneakyThrows; -import org.testcontainers.containers.Network; -import org.testcontainers.containers.ToxiproxyContainer; - import eu.rekawek.toxiproxy.Proxy; import eu.rekawek.toxiproxy.ToxiproxyClient; +import java.net.URI; import lombok.Getter; import lombok.SneakyThrows; import org.testcontainers.containers.Network; diff --git a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/WrapWithNettyLeakDetection.java b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/WrapWithNettyLeakDetection.java index 09f24ffe41..e7f1af5fff 100644 --- a/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/WrapWithNettyLeakDetection.java +++ b/testHelperFixtures/src/testFixtures/java/org/opensearch/migrations/testutils/WrapWithNettyLeakDetection.java @@ -4,9 +4,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; - -import org.junit.jupiter.api.extension.ExtendWith; - import org.junit.jupiter.api.extension.ExtendWith; /** diff --git a/transformation/src/main/java/org/opensearch/migrations/Flavor.java b/transformation/src/main/java/org/opensearch/migrations/Flavor.java index cd85cb14dc..f835c92dc8 100644 --- a/transformation/src/main/java/org/opensearch/migrations/Flavor.java +++ b/transformation/src/main/java/org/opensearch/migrations/Flavor.java @@ -3,9 +3,6 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; -import lombok.Getter; -import lombok.RequiredArgsConstructor; - @RequiredArgsConstructor @Getter public enum Flavor { diff --git a/transformation/src/main/java/org/opensearch/migrations/Version.java b/transformation/src/main/java/org/opensearch/migrations/Version.java index e213d60537..0dab2cd3da 100644 --- a/transformation/src/main/java/org/opensearch/migrations/Version.java +++ b/transformation/src/main/java/org/opensearch/migrations/Version.java @@ -1,12 +1,6 @@ package org.opensearch.migrations; import java.util.Arrays; - -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.RequiredArgsConstructor; - import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/transformation/src/main/java/org/opensearch/migrations/VersionMatchers.java b/transformation/src/main/java/org/opensearch/migrations/VersionMatchers.java index d72dc32c0b..25c4d28c42 100644 --- a/transformation/src/main/java/org/opensearch/migrations/VersionMatchers.java +++ b/transformation/src/main/java/org/opensearch/migrations/VersionMatchers.java @@ -1,9 +1,6 @@ package org.opensearch.migrations; import java.util.function.Predicate; - -import lombok.experimental.UtilityClass; - import lombok.experimental.UtilityClass; @UtilityClass diff --git a/transformation/src/main/java/org/opensearch/migrations/transformation/CanApplyResult.java b/transformation/src/main/java/org/opensearch/migrations/transformation/CanApplyResult.java index 30b1155e11..a1cdac073d 100644 --- a/transformation/src/main/java/org/opensearch/migrations/transformation/CanApplyResult.java +++ b/transformation/src/main/java/org/opensearch/migrations/transformation/CanApplyResult.java @@ -3,9 +3,6 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; -import lombok.Getter; -import lombok.RequiredArgsConstructor; - /** * The result after checking if a transformer can be applied to an entity */ diff --git a/transformation/src/main/java/org/opensearch/migrations/transformation/entity/Entity.java b/transformation/src/main/java/org/opensearch/migrations/transformation/entity/Entity.java index 32c124c3a1..47161001d7 100644 --- a/transformation/src/main/java/org/opensearch/migrations/transformation/entity/Entity.java +++ b/transformation/src/main/java/org/opensearch/migrations/transformation/entity/Entity.java @@ -2,8 +2,6 @@ import com.fasterxml.jackson.databind.node.ObjectNode; -import com.fasterxml.jackson.databind.node.ObjectNode; - /** * Common interface for entities that are used to perform transformations * diff --git a/transformation/src/main/java/org/opensearch/migrations/transformation/rules/IndexMappingTypeRemoval.java b/transformation/src/main/java/org/opensearch/migrations/transformation/rules/IndexMappingTypeRemoval.java index e2c58b7d43..0d6163274c 100644 --- a/transformation/src/main/java/org/opensearch/migrations/transformation/rules/IndexMappingTypeRemoval.java +++ b/transformation/src/main/java/org/opensearch/migrations/transformation/rules/IndexMappingTypeRemoval.java @@ -1,16 +1,12 @@ package org.opensearch.migrations.transformation.rules; -import java.util.Map.Entry; - import com.fasterxml.jackson.databind.node.ObjectNode; - +import java.util.Map.Entry; import org.opensearch.migrations.transformation.CanApplyResult; import org.opensearch.migrations.transformation.CanApplyResult.Unsupported; import org.opensearch.migrations.transformation.TransformationRule; import org.opensearch.migrations.transformation.entity.Index; -import com.fasterxml.jackson.databind.node.ObjectNode; - /** * Supports transformation of the Index Mapping types that were changed from mutliple types to a single type between ES 6 to ES 7 * diff --git a/transformation/src/test/java/org/opensearch/migrations/VersionMatchersTest.java b/transformation/src/test/java/org/opensearch/migrations/VersionMatchersTest.java index 847f486e2c..5835193857 100644 --- a/transformation/src/test/java/org/opensearch/migrations/VersionMatchersTest.java +++ b/transformation/src/test/java/org/opensearch/migrations/VersionMatchersTest.java @@ -1,15 +1,12 @@ package org.opensearch.migrations; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.MatcherAssert.assertThat; + import java.util.List; import java.util.function.Predicate; - import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.MatcherAssert.assertThat; - public class VersionMatchersTest { private void testPredicate(Predicate predicate, String matcherName, List expectMatches, List expectDoesNotMatch) { diff --git a/transformation/src/test/java/org/opensearch/migrations/VersionTest.java b/transformation/src/test/java/org/opensearch/migrations/VersionTest.java index cb37536b17..0419d56cd3 100644 --- a/transformation/src/test/java/org/opensearch/migrations/VersionTest.java +++ b/transformation/src/test/java/org/opensearch/migrations/VersionTest.java @@ -1,14 +1,11 @@ package org.opensearch.migrations; -import org.apache.logging.log4j.core.parser.ParseException; -import org.junit.jupiter.api.Test; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.equalTo; import org.apache.logging.log4j.core.parser.ParseException; import org.junit.jupiter.api.Test; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.equalTo; - public class VersionTest { @Test diff --git a/transformation/src/test/java/org/opensearch/migrations/transformation/rules/IndexMappingTypeRemovalTest.java b/transformation/src/test/java/org/opensearch/migrations/transformation/rules/IndexMappingTypeRemovalTest.java index 9ed766cdd8..f7f30e6411 100644 --- a/transformation/src/test/java/org/opensearch/migrations/transformation/rules/IndexMappingTypeRemovalTest.java +++ b/transformation/src/test/java/org/opensearch/migrations/transformation/rules/IndexMappingTypeRemovalTest.java @@ -1,31 +1,23 @@ package org.opensearch.migrations.transformation.rules; -import java.util.function.BiFunction; -import java.util.function.Function; +import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.not; +import static org.mockito.Mockito.mock; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.function.BiFunction; +import java.util.function.Function; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Test; import org.mockito.Mockito; - import org.opensearch.migrations.transformation.CanApplyResult; import org.opensearch.migrations.transformation.CanApplyResult.Unsupported; import org.opensearch.migrations.transformation.entity.Index; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; -import lombok.extern.slf4j.Slf4j; -import org.junit.jupiter.api.Test; -import org.mockito.Mockito; - -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.not; -import static org.mockito.Mockito.mock; - @Slf4j public class IndexMappingTypeRemovalTest {