From d89e8d463dbf56318e7c70d34219b6dd368f6290 Mon Sep 17 00:00:00 2001 From: Nicholas Walter Knize Date: Wed, 29 Mar 2023 13:53:35 -0500 Subject: [PATCH 1/4] [Refactor] Various Utilities, Assertion, and Concurrency Exception from server to libraries To further reduce the surface area of utility methods in :server: this commit refactors the following: * MapBuilder from server module to common library * Assertions from server module to core library * BytesRef methods from CollectionUtils in server module to new BytesRefUtils in core library It also removes CollectionUtils dependency on hppc in prep for refactoring CollectionUtils methods to the proper library. Signed-off-by: Nicholas Walter Knize --- .../opensearch/common/collect/MapBuilder.java | 0 libs/core/build.gradle | 4 + libs/core/licenses/lucene-LICENSE.txt | 475 ++++++++++++++++++ libs/core/licenses/lucene-NOTICE.txt | 192 +++++++ libs/core/licenses/lucene-core-9.5.0.jar.sha1 | 1 + .../java/org/opensearch/core}/Assertions.java | 4 +- .../OpenSearchRejectedExecutionException.java | 2 +- .../core/concurrency/package-info.java | 9 + .../opensearch/core/util/BytesRefUtils.java | 105 ++++ .../opensearch/core/util/package-info.java | 10 + .../core/util/BytesRefUtilsTests.java | 89 ++++ .../reindex/remote/RemoteResponseParsers.java | 2 +- .../reindex/AsyncBulkByScrollActionTests.java | 2 +- .../ClientScrollableHitSourceTests.java | 2 +- .../opensearch/index/reindex/RetryTests.java | 2 +- .../remote/RemoteResponseParsersTests.java | 2 +- .../RemoteScrollableHitSourceTests.java | 2 +- .../opensearch/action/RejectionActionIT.java | 2 +- .../action/bulk/BulkRejectionIT.java | 2 +- .../opensearch/index/IndexingPressureIT.java | 2 +- .../index/SegmentReplicationPressureIT.java | 2 +- .../index/ShardIndexingPressureIT.java | 2 +- .../ShardIndexingPressureSettingsIT.java | 2 +- .../indices/recovery/IndexRecoveryIT.java | 2 +- .../java/org/opensearch/ExceptionsHelper.java | 2 +- .../java/org/opensearch/LegacyESVersion.java | 17 +- .../action/bulk/TransportBulkAction.java | 2 +- .../action/support/RetryableAction.java | 2 +- .../replication/ReplicationOperation.java | 4 +- .../TransportReplicationAction.java | 2 +- .../cluster/InternalClusterInfoService.java | 2 +- .../cluster/metadata/IndexMetadata.java | 2 +- .../cluster/routing/RoutingNodes.java | 2 +- .../allocator/BalancedShardsAllocator.java | 2 +- .../service/ClusterApplierService.java | 2 +- .../cluster/service/MasterService.java | 4 +- .../cluster/service/TaskBatcher.java | 2 +- .../common/compress/DeflateCompressor.java | 2 +- .../common/geo/builders/ShapeBuilder.java | 2 +- .../common/io/stream/StreamInput.java | 2 +- .../common/io/stream/StreamOutput.java | 2 +- .../common/lucene/ShardCoreKeyMap.java | 2 +- .../common/util/CollectionUtils.java | 63 --- .../concurrent/OpenSearchAbortPolicy.java | 1 + .../OpenSearchThreadPoolExecutor.java | 1 + .../util/concurrent/ReleasableLock.java | 2 +- .../opensearch/gateway/AsyncShardFetch.java | 2 +- .../org/opensearch/index/IndexService.java | 2 +- .../opensearch/index/IndexingPressure.java | 2 +- .../SegmentReplicationPressureService.java | 2 +- .../index/ShardIndexingPressure.java | 2 +- .../index/engine/InternalEngine.java | 2 +- .../index/mapper/MapperService.java | 2 +- .../reindex/ClientScrollableHitSource.java | 2 +- .../reindex/WorkerBulkByScrollTaskState.java | 2 +- .../shard/GlobalCheckpointListeners.java | 2 +- .../opensearch/index/shard/IndexShard.java | 2 +- .../shard/IndexShardOperationPermits.java | 2 +- .../translog/TranslogDeletionPolicy.java | 2 +- .../index/translog/TranslogWriter.java | 2 +- .../opensearch/indices/IndicesService.java | 2 +- .../indices/recovery/MultiChunkTransfer.java | 2 +- .../indices/recovery/RecoveryTarget.java | 2 +- .../recovery/RetryableTransportClient.java | 2 +- .../indices/store/IndicesStore.java | 2 +- .../main/java/org/opensearch/node/Node.java | 2 +- .../search/DefaultSearchContext.java | 2 +- .../org/opensearch/search/SearchService.java | 2 +- .../org/opensearch/tasks/TaskManager.java | 2 +- .../opensearch/tasks/TaskResultsService.java | 2 +- .../org/opensearch/threadpool/Scheduler.java | 2 +- .../org/opensearch/threadpool/ThreadPool.java | 4 +- .../transport/RemoteConnectionStrategy.java | 2 +- .../transport/TransportService.java | 2 +- .../org/opensearch/ExceptionsHelperTests.java | 2 +- .../opensearch/action/bulk/RetryTests.java | 2 +- .../action/bulk/TransportBulkActionTests.java | 2 +- .../bulk/TransportShardBulkActionTests.java | 2 +- .../SearchPhaseExecutionExceptionTests.java | 2 +- ...ultShardOperationFailedExceptionTests.java | 2 +- .../action/support/RetryableActionTests.java | 2 +- .../ReplicationOperationTests.java | 2 +- .../coordination/CoordinationStateTests.java | 2 +- .../FailAwareWeightedRoutingTests.java | 2 +- .../allocation/BalanceConfigurationTests.java | 1 - .../opensearch/common/hppc/HppcMapsTests.java | 2 +- .../common/util/CollectionUtilsTests.java | 70 --- .../concurrent/OpenSearchExecutorsTests.java | 1 + .../opensearch/index/IndexModuleTests.java | 2 +- .../index/IndexingPressureTests.java | 2 +- ...egmentReplicationPressureServiceTests.java | 2 +- ...exingPressureConcurrentExecutionTests.java | 2 +- .../index/ShardIndexingPressureTests.java | 2 +- .../shard/GlobalCheckpointListenersTests.java | 2 +- .../IndexShardOperationPermitsTests.java | 2 +- .../index/shard/IndexShardTests.java | 2 +- .../index/translog/LocalTranslogTests.java | 2 +- .../search/DefaultSearchContextTests.java | 2 +- .../opensearch/search/SearchServiceTests.java | 2 +- .../threadpool/FixedThreadPoolTests.java | 2 +- .../ScheduleWithFixedDelayTests.java | 2 +- .../test/OpenSearchIntegTestCase.java | 2 +- 102 files changed, 987 insertions(+), 232 deletions(-) rename {server => libs/common}/src/main/java/org/opensearch/common/collect/MapBuilder.java (100%) create mode 100644 libs/core/licenses/lucene-LICENSE.txt create mode 100644 libs/core/licenses/lucene-NOTICE.txt create mode 100644 libs/core/licenses/lucene-core-9.5.0.jar.sha1 rename {server/src/main/java/org/opensearch => libs/core/src/main/java/org/opensearch/core}/Assertions.java (92%) rename {server/src/main/java/org/opensearch/common/util/concurrent => libs/core/src/main/java/org/opensearch/core/concurrency}/OpenSearchRejectedExecutionException.java (97%) create mode 100644 libs/core/src/main/java/org/opensearch/core/concurrency/package-info.java create mode 100644 libs/core/src/main/java/org/opensearch/core/util/BytesRefUtils.java create mode 100644 libs/core/src/main/java/org/opensearch/core/util/package-info.java create mode 100644 libs/core/src/test/java/org/opensearch/core/util/BytesRefUtilsTests.java diff --git a/server/src/main/java/org/opensearch/common/collect/MapBuilder.java b/libs/common/src/main/java/org/opensearch/common/collect/MapBuilder.java similarity index 100% rename from server/src/main/java/org/opensearch/common/collect/MapBuilder.java rename to libs/common/src/main/java/org/opensearch/common/collect/MapBuilder.java diff --git a/libs/core/build.gradle b/libs/core/build.gradle index 5e27c15c7477f..717320b95ac85 100644 --- a/libs/core/build.gradle +++ b/libs/core/build.gradle @@ -79,6 +79,9 @@ dependencies { api "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" + // lucene + api "org.apache.lucene:lucene-core:${versions.lucene}" + testImplementation "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}" testImplementation "junit:junit:${versions.junit}" testImplementation "org.hamcrest:hamcrest:${versions.hamcrest}" @@ -96,4 +99,5 @@ tasks.named('forbiddenApisMain').configure { tasks.named("dependencyLicenses").configure { mapping from: /jackson-.*/, to: 'jackson' + mapping from: /lucene-.*/, to: 'lucene' } diff --git a/libs/core/licenses/lucene-LICENSE.txt b/libs/core/licenses/lucene-LICENSE.txt new file mode 100644 index 0000000000000..28b134f5f8e4d --- /dev/null +++ b/libs/core/licenses/lucene-LICENSE.txt @@ -0,0 +1,475 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + + +Some code in core/src/java/org/apache/lucene/util/UnicodeUtil.java was +derived from unicode conversion examples available at +http://www.unicode.org/Public/PROGRAMS/CVTUTF. Here is the copyright +from those sources: + +/* + * Copyright 2001-2004 Unicode, Inc. + * + * Disclaimer + * + * This source code is provided as is by Unicode, Inc. No claims are + * made as to fitness for any particular purpose. No warranties of any + * kind are expressed or implied. The recipient agrees to determine + * applicability of information provided. If this file has been + * purchased on magnetic or optical media from Unicode, Inc., the + * sole remedy for any claim will be exchange of defective media + * within 90 days of receipt. + * + * Limitations on Rights to Redistribute This Code + * + * Unicode, Inc. hereby grants the right to freely use the information + * supplied in this file in the creation of products supporting the + * Unicode Standard, and to make copies of this file in any form + * for internal or external distribution as long as this notice + * remains attached. + */ + + +Some code in core/src/java/org/apache/lucene/util/ArrayUtil.java was +derived from Python 2.4.2 sources available at +http://www.python.org. Full license is here: + + http://www.python.org/download/releases/2.4.2/license/ + +Some code in core/src/java/org/apache/lucene/util/UnicodeUtil.java was +derived from Python 3.1.2 sources available at +http://www.python.org. Full license is here: + + http://www.python.org/download/releases/3.1.2/license/ + +Some code in core/src/java/org/apache/lucene/util/automaton was +derived from Brics automaton sources available at +www.brics.dk/automaton/. Here is the copyright from those sources: + +/* + * Copyright (c) 2001-2009 Anders Moeller + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +The levenshtein automata tables in core/src/java/org/apache/lucene/util/automaton +were automatically generated with the moman/finenight FSA package. +Here is the copyright for those sources: + +# Copyright (c) 2010, Jean-Philippe Barrette-LaPierre, +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation +# files (the "Software"), to deal in the Software without +# restriction, including without limitation the rights to use, +# copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following +# conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. + +Some code in core/src/java/org/apache/lucene/util/UnicodeUtil.java was +derived from ICU (http://www.icu-project.org) +The full license is available here: + http://source.icu-project.org/repos/icu/icu/trunk/license.html + +/* + * Copyright (C) 1999-2010, International Business Machines + * Corporation and others. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * provided that the above copyright notice(s) and this permission notice appear + * in all copies of the Software and that both the above copyright notice(s) and + * this permission notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE + * LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR + * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Except as contained in this notice, the name of a copyright holder shall not + * be used in advertising or otherwise to promote the sale, use or other + * dealings in this Software without prior written authorization of the + * copyright holder. + */ + +The following license applies to the Snowball stemmers: + +Copyright (c) 2001, Dr Martin Porter +Copyright (c) 2002, Richard Boulton +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holders nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The following license applies to the KStemmer: + +Copyright © 2003, +Center for Intelligent Information Retrieval, +University of Massachusetts, Amherst. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +3. The names "Center for Intelligent Information Retrieval" and +"University of Massachusetts" must not be used to endorse or promote products +derived from this software without prior written permission. To obtain +permission, contact info@ciir.cs.umass.edu. + +THIS SOFTWARE IS PROVIDED BY UNIVERSITY OF MASSACHUSETTS AND OTHER CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +The following license applies to the Morfologik project: + +Copyright (c) 2006 Dawid Weiss +Copyright (c) 2007-2011 Dawid Weiss, Marcin Miłkowski +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of Morfologik nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +The dictionary comes from Morfologik project. Morfologik uses data from +Polish ispell/myspell dictionary hosted at http://www.sjp.pl/slownik/en/ and +is licenced on the terms of (inter alia) LGPL and Creative Commons +ShareAlike. The part-of-speech tags were added in Morfologik project and +are not found in the data from sjp.pl. The tagset is similar to IPI PAN +tagset. + +--- + +The following license applies to the Morfeusz project, +used by org.apache.lucene.analysis.morfologik. + +BSD-licensed dictionary of Polish (SGJP) +http://sgjp.pl/morfeusz/ + +Copyright © 2011 Zygmunt Saloni, Włodzimierz Gruszczyński, + Marcin Woliński, Robert Wołosz + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the + distribution. + +THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDERS “AS IS” AND ANY EXPRESS +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/libs/core/licenses/lucene-NOTICE.txt b/libs/core/licenses/lucene-NOTICE.txt new file mode 100644 index 0000000000000..1a1d51572432a --- /dev/null +++ b/libs/core/licenses/lucene-NOTICE.txt @@ -0,0 +1,192 @@ +Apache Lucene +Copyright 2014 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). + +Includes software from other Apache Software Foundation projects, +including, but not limited to: + - Apache Ant + - Apache Jakarta Regexp + - Apache Commons + - Apache Xerces + +ICU4J, (under analysis/icu) is licensed under an MIT styles license +and Copyright (c) 1995-2008 International Business Machines Corporation and others + +Some data files (under analysis/icu/src/data) are derived from Unicode data such +as the Unicode Character Database. See http://unicode.org/copyright.html for more +details. + +Brics Automaton (under core/src/java/org/apache/lucene/util/automaton) is +BSD-licensed, created by Anders Møller. See http://www.brics.dk/automaton/ + +The levenshtein automata tables (under core/src/java/org/apache/lucene/util/automaton) were +automatically generated with the moman/finenight FSA library, created by +Jean-Philippe Barrette-LaPierre. This library is available under an MIT license, +see http://sites.google.com/site/rrettesite/moman and +http://bitbucket.org/jpbarrette/moman/overview/ + +The class org.apache.lucene.util.WeakIdentityMap was derived from +the Apache CXF project and is Apache License 2.0. + +The Google Code Prettify is Apache License 2.0. +See http://code.google.com/p/google-code-prettify/ + +JUnit (junit-4.10) is licensed under the Common Public License v. 1.0 +See http://junit.sourceforge.net/cpl-v10.html + +This product includes code (JaspellTernarySearchTrie) from Java Spelling Checkin +g Package (jaspell): http://jaspell.sourceforge.net/ +License: The BSD License (http://www.opensource.org/licenses/bsd-license.php) + +The snowball stemmers in + analysis/common/src/java/net/sf/snowball +were developed by Martin Porter and Richard Boulton. +The snowball stopword lists in + analysis/common/src/resources/org/apache/lucene/analysis/snowball +were developed by Martin Porter and Richard Boulton. +The full snowball package is available from + http://snowball.tartarus.org/ + +The KStem stemmer in + analysis/common/src/org/apache/lucene/analysis/en +was developed by Bob Krovetz and Sergio Guzman-Lara (CIIR-UMass Amherst) +under the BSD-license. + +The Arabic,Persian,Romanian,Bulgarian, Hindi and Bengali analyzers (common) come with a default +stopword list that is BSD-licensed created by Jacques Savoy. These files reside in: +analysis/common/src/resources/org/apache/lucene/analysis/ar/stopwords.txt, +analysis/common/src/resources/org/apache/lucene/analysis/fa/stopwords.txt, +analysis/common/src/resources/org/apache/lucene/analysis/ro/stopwords.txt, +analysis/common/src/resources/org/apache/lucene/analysis/bg/stopwords.txt, +analysis/common/src/resources/org/apache/lucene/analysis/hi/stopwords.txt, +analysis/common/src/resources/org/apache/lucene/analysis/bn/stopwords.txt +See http://members.unine.ch/jacques.savoy/clef/index.html. + +The German,Spanish,Finnish,French,Hungarian,Italian,Portuguese,Russian and Swedish light stemmers +(common) are based on BSD-licensed reference implementations created by Jacques Savoy and +Ljiljana Dolamic. These files reside in: +analysis/common/src/java/org/apache/lucene/analysis/de/GermanLightStemmer.java +analysis/common/src/java/org/apache/lucene/analysis/de/GermanMinimalStemmer.java +analysis/common/src/java/org/apache/lucene/analysis/es/SpanishLightStemmer.java +analysis/common/src/java/org/apache/lucene/analysis/fi/FinnishLightStemmer.java +analysis/common/src/java/org/apache/lucene/analysis/fr/FrenchLightStemmer.java +analysis/common/src/java/org/apache/lucene/analysis/fr/FrenchMinimalStemmer.java +analysis/common/src/java/org/apache/lucene/analysis/hu/HungarianLightStemmer.java +analysis/common/src/java/org/apache/lucene/analysis/it/ItalianLightStemmer.java +analysis/common/src/java/org/apache/lucene/analysis/pt/PortugueseLightStemmer.java +analysis/common/src/java/org/apache/lucene/analysis/ru/RussianLightStemmer.java +analysis/common/src/java/org/apache/lucene/analysis/sv/SwedishLightStemmer.java + +The Stempel analyzer (stempel) includes BSD-licensed software developed +by the Egothor project http://egothor.sf.net/, created by Leo Galambos, Martin Kvapil, +and Edmond Nolan. + +The Polish analyzer (stempel) comes with a default +stopword list that is BSD-licensed created by the Carrot2 project. The file resides +in stempel/src/resources/org/apache/lucene/analysis/pl/stopwords.txt. +See http://project.carrot2.org/license.html. + +The SmartChineseAnalyzer source code (smartcn) was +provided by Xiaoping Gao and copyright 2009 by www.imdict.net. + +WordBreakTestUnicode_*.java (under modules/analysis/common/src/test/) +is derived from Unicode data such as the Unicode Character Database. +See http://unicode.org/copyright.html for more details. + +The Morfologik analyzer (morfologik) includes BSD-licensed software +developed by Dawid Weiss and Marcin Miłkowski (http://morfologik.blogspot.com/). + +Morfologik uses data from Polish ispell/myspell dictionary +(http://www.sjp.pl/slownik/en/) licenced on the terms of (inter alia) +LGPL and Creative Commons ShareAlike. + +Morfologic includes data from BSD-licensed dictionary of Polish (SGJP) +(http://sgjp.pl/morfeusz/) + +Servlet-api.jar and javax.servlet-*.jar are under the CDDL license, the original +source code for this can be found at http://www.eclipse.org/jetty/downloads.php + +=========================================================================== +Kuromoji Japanese Morphological Analyzer - Apache Lucene Integration +=========================================================================== + +This software includes a binary and/or source version of data from + + mecab-ipadic-2.7.0-20070801 + +which can be obtained from + + http://atilika.com/releases/mecab-ipadic/mecab-ipadic-2.7.0-20070801.tar.gz + +or + + http://jaist.dl.sourceforge.net/project/mecab/mecab-ipadic/2.7.0-20070801/mecab-ipadic-2.7.0-20070801.tar.gz + +=========================================================================== +mecab-ipadic-2.7.0-20070801 Notice +=========================================================================== + +Nara Institute of Science and Technology (NAIST), +the copyright holders, disclaims all warranties with regard to this +software, including all implied warranties of merchantability and +fitness, in no event shall NAIST be liable for +any special, indirect or consequential damages or any damages +whatsoever resulting from loss of use, data or profits, whether in an +action of contract, negligence or other tortuous action, arising out +of or in connection with the use or performance of this software. + +A large portion of the dictionary entries +originate from ICOT Free Software. The following conditions for ICOT +Free Software applies to the current dictionary as well. + +Each User may also freely distribute the Program, whether in its +original form or modified, to any third party or parties, PROVIDED +that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear +on, or be attached to, the Program, which is distributed substantially +in the same form as set out herein and that such intended +distribution, if actually made, will neither violate or otherwise +contravene any of the laws and regulations of the countries having +jurisdiction over the User or the intended distribution itself. + +NO WARRANTY + +The program was produced on an experimental basis in the course of the +research and development conducted during the project and is provided +to users as so produced on an experimental basis. Accordingly, the +program is provided without any warranty whatsoever, whether express, +implied, statutory or otherwise. The term "warranty" used herein +includes, but is not limited to, any warranty of the quality, +performance, merchantability and fitness for a particular purpose of +the program and the nonexistence of any infringement or violation of +any right of any third party. + +Each user of the program will agree and understand, and be deemed to +have agreed and understood, that there is no warranty whatsoever for +the program and, accordingly, the entire risk arising from or +otherwise connected with the program is assumed by the user. + +Therefore, neither ICOT, the copyright holder, or any other +organization that participated in or was otherwise related to the +development of the program and their respective officials, directors, +officers and other employees shall be held liable for any and all +damages, including, without limitation, general, special, incidental +and consequential damages, arising out of or otherwise in connection +with the use or inability to use the program or any product, material +or result produced or otherwise obtained by using the program, +regardless of whether they have been advised of, or otherwise had +knowledge of, the possibility of such damages at any time during the +project or thereafter. Each user will be deemed to have agreed to the +foregoing by his or her commencement of use of the program. The term +"use" as used herein includes, but is not limited to, the use, +modification, copying and distribution of the program and the +production of secondary products from the program. + +In the case where the program, whether in its original form or +modified, was distributed or delivered to or received by a user from +any person, organization or entity other than ICOT, unless it makes or +grants independently of ICOT any specific warranty to the user in +writing, such person, organization or entity, will also be exempted +from and not be held liable to the user for any such damages as noted +above as far as the program is concerned. diff --git a/libs/core/licenses/lucene-core-9.5.0.jar.sha1 b/libs/core/licenses/lucene-core-9.5.0.jar.sha1 new file mode 100644 index 0000000000000..bca72d4375dab --- /dev/null +++ b/libs/core/licenses/lucene-core-9.5.0.jar.sha1 @@ -0,0 +1 @@ +bba4ba5d30e71a5f0017e45e8469db8cff8ad102 \ No newline at end of file diff --git a/server/src/main/java/org/opensearch/Assertions.java b/libs/core/src/main/java/org/opensearch/core/Assertions.java similarity index 92% rename from server/src/main/java/org/opensearch/Assertions.java rename to libs/core/src/main/java/org/opensearch/core/Assertions.java index dd2fcf9481a3c..da93f2f435441 100644 --- a/server/src/main/java/org/opensearch/Assertions.java +++ b/libs/core/src/main/java/org/opensearch/core/Assertions.java @@ -30,12 +30,12 @@ * GitHub history for details. */ -package org.opensearch; +package org.opensearch.core; /** * Provides a static final field that can be used to check if assertions are enabled. Since this field might be used elsewhere to check if * assertions are enabled, if you are running with assertions enabled for specific packages or classes, you should enable assertions on this - * class too (e.g., {@code -ea org.opensearch.Assertions -ea org.opensearch.cluster.service.ClusterManagerService}). + * class too (e.g., {@code -ea org.opensearch.core.Assertions -ea org.opensearch.cluster.service.ClusterManagerService}). * * @opensearch.internal */ diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchRejectedExecutionException.java b/libs/core/src/main/java/org/opensearch/core/concurrency/OpenSearchRejectedExecutionException.java similarity index 97% rename from server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchRejectedExecutionException.java rename to libs/core/src/main/java/org/opensearch/core/concurrency/OpenSearchRejectedExecutionException.java index 74b5e477c36ee..2a1234eb66c4e 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchRejectedExecutionException.java +++ b/libs/core/src/main/java/org/opensearch/core/concurrency/OpenSearchRejectedExecutionException.java @@ -30,7 +30,7 @@ * GitHub history for details. */ -package org.opensearch.common.util.concurrent; +package org.opensearch.core.concurrency; import java.util.concurrent.RejectedExecutionException; diff --git a/libs/core/src/main/java/org/opensearch/core/concurrency/package-info.java b/libs/core/src/main/java/org/opensearch/core/concurrency/package-info.java new file mode 100644 index 0000000000000..331066995ccd5 --- /dev/null +++ b/libs/core/src/main/java/org/opensearch/core/concurrency/package-info.java @@ -0,0 +1,9 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ +/** core concurrency package */ +package org.opensearch.core.concurrency; diff --git a/libs/core/src/main/java/org/opensearch/core/util/BytesRefUtils.java b/libs/core/src/main/java/org/opensearch/core/util/BytesRefUtils.java new file mode 100644 index 0000000000000..bfea55479c235 --- /dev/null +++ b/libs/core/src/main/java/org/opensearch/core/util/BytesRefUtils.java @@ -0,0 +1,105 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +package org.opensearch.core.util; + +import org.apache.lucene.util.BytesRef; +import org.apache.lucene.util.BytesRefArray; +import org.apache.lucene.util.BytesRefBuilder; +import org.apache.lucene.util.InPlaceMergeSorter; + +import java.util.Comparator; + +/** + * Utilities for sorting Lucene {@link BytesRefArray} + * + * @opensearch.internal + */ +public class BytesRefUtils { + public static void sort(final BytesRefArray bytes, final int[] indices) { + sort(new BytesRefBuilder(), new BytesRefBuilder(), bytes, indices); + } + + private static void sort( + final BytesRefBuilder scratch, + final BytesRefBuilder scratch1, + final BytesRefArray bytes, + final int[] indices + ) { + + final int numValues = bytes.size(); + assert indices.length >= numValues; + if (numValues > 1) { + new InPlaceMergeSorter() { + final Comparator comparator = Comparator.naturalOrder(); + + @Override + protected int compare(int i, int j) { + return comparator.compare(bytes.get(scratch, indices[i]), bytes.get(scratch1, indices[j])); + } + + @Override + protected void swap(int i, int j) { + int value_i = indices[i]; + indices[i] = indices[j]; + indices[j] = value_i; + } + }.sort(0, numValues); + } + + } + + public static int sortAndDedup(final BytesRefArray bytes, final int[] indices) { + final BytesRefBuilder scratch = new BytesRefBuilder(); + final BytesRefBuilder scratch1 = new BytesRefBuilder(); + final int numValues = bytes.size(); + assert indices.length >= numValues; + if (numValues <= 1) { + return numValues; + } + sort(scratch, scratch1, bytes, indices); + int uniqueCount = 1; + BytesRefBuilder previous = scratch; + BytesRefBuilder current = scratch1; + bytes.get(previous, indices[0]); + for (int i = 1; i < numValues; ++i) { + bytes.get(current, indices[i]); + if (!previous.get().equals(current.get())) { + indices[uniqueCount++] = indices[i]; + } + BytesRefBuilder tmp = previous; + previous = current; + current = tmp; + } + return uniqueCount; + } +} diff --git a/libs/core/src/main/java/org/opensearch/core/util/package-info.java b/libs/core/src/main/java/org/opensearch/core/util/package-info.java new file mode 100644 index 0000000000000..deab57b120644 --- /dev/null +++ b/libs/core/src/main/java/org/opensearch/core/util/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Core utility classes that need the Lucene API */ +package org.opensearch.core.util; diff --git a/libs/core/src/test/java/org/opensearch/core/util/BytesRefUtilsTests.java b/libs/core/src/test/java/org/opensearch/core/util/BytesRefUtilsTests.java new file mode 100644 index 0000000000000..98ecbe96ca5fd --- /dev/null +++ b/libs/core/src/test/java/org/opensearch/core/util/BytesRefUtilsTests.java @@ -0,0 +1,89 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.core.util; + +import org.apache.lucene.util.BytesRef; +import org.apache.lucene.util.BytesRefArray; +import org.apache.lucene.util.BytesRefBuilder; +import org.apache.lucene.util.Counter; +import org.opensearch.test.OpenSearchTestCase; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.SortedSet; +import java.util.TreeSet; + +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.is; + +/** + * Tests for the {@link BytesRefUtils} class + */ +public class BytesRefUtilsTests extends OpenSearchTestCase { + public void testSortAndDedupByteRefArray() { + SortedSet set = new TreeSet<>(); + final int numValues = scaledRandomIntBetween(0, 10000); + List tmpList = new ArrayList<>(); + BytesRefArray array = new BytesRefArray(Counter.newCounter()); + for (int i = 0; i < numValues; i++) { + String s = randomRealisticUnicodeOfCodepointLengthBetween(1, 100); + set.add(new BytesRef(s)); + tmpList.add(new BytesRef(s)); + array.append(new BytesRef(s)); + } + if (randomBoolean()) { + Collections.shuffle(tmpList, random()); + for (BytesRef ref : tmpList) { + array.append(ref); + } + } + int[] indices = new int[array.size()]; + for (int i = 0; i < indices.length; i++) { + indices[i] = i; + } + int numUnique = BytesRefUtils.sortAndDedup(array, indices); + assertThat(numUnique, equalTo(set.size())); + Iterator iterator = set.iterator(); + + BytesRefBuilder spare = new BytesRefBuilder(); + for (int i = 0; i < numUnique; i++) { + assertThat(iterator.hasNext(), is(true)); + assertThat(array.get(spare, indices[i]), equalTo(iterator.next())); + } + } + + public void testSortByteRefArray() { + List values = new ArrayList<>(); + final int numValues = scaledRandomIntBetween(0, 10000); + BytesRefArray array = new BytesRefArray(Counter.newCounter()); + for (int i = 0; i < numValues; i++) { + String s = randomRealisticUnicodeOfCodepointLengthBetween(1, 100); + values.add(new BytesRef(s)); + array.append(new BytesRef(s)); + } + if (randomBoolean()) { + Collections.shuffle(values, random()); + } + int[] indices = new int[array.size()]; + for (int i = 0; i < indices.length; i++) { + indices[i] = i; + } + BytesRefUtils.sort(array, indices); + Collections.sort(values); + Iterator iterator = values.iterator(); + + BytesRefBuilder spare = new BytesRefBuilder(); + for (int i = 0; i < values.size(); i++) { + assertThat(iterator.hasNext(), is(true)); + assertThat(array.get(spare, indices[i]), equalTo(iterator.next())); + } + } +} diff --git a/modules/reindex/src/main/java/org/opensearch/index/reindex/remote/RemoteResponseParsers.java b/modules/reindex/src/main/java/org/opensearch/index/reindex/remote/RemoteResponseParsers.java index ac3c6ee82a40d..b1e4d53c90d92 100644 --- a/modules/reindex/src/main/java/org/opensearch/index/reindex/remote/RemoteResponseParsers.java +++ b/modules/reindex/src/main/java/org/opensearch/index/reindex/remote/RemoteResponseParsers.java @@ -39,7 +39,7 @@ import org.opensearch.common.ParsingException; import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.collect.Tuple; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.core.xcontent.ConstructingObjectParser; import org.opensearch.core.xcontent.ObjectParser; import org.opensearch.core.xcontent.ObjectParser.ValueType; diff --git a/modules/reindex/src/test/java/org/opensearch/index/reindex/AsyncBulkByScrollActionTests.java b/modules/reindex/src/test/java/org/opensearch/index/reindex/AsyncBulkByScrollActionTests.java index 145aaaf24fbee..61336156a83d0 100644 --- a/modules/reindex/src/test/java/org/opensearch/index/reindex/AsyncBulkByScrollActionTests.java +++ b/modules/reindex/src/test/java/org/opensearch/index/reindex/AsyncBulkByScrollActionTests.java @@ -75,7 +75,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.concurrent.AbstractRunnable; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.common.xcontent.XContentType; import org.opensearch.index.Index; import org.opensearch.index.engine.VersionConflictEngineException; diff --git a/modules/reindex/src/test/java/org/opensearch/index/reindex/ClientScrollableHitSourceTests.java b/modules/reindex/src/test/java/org/opensearch/index/reindex/ClientScrollableHitSourceTests.java index 3a79a0b35e391..25917893645cf 100644 --- a/modules/reindex/src/test/java/org/opensearch/index/reindex/ClientScrollableHitSourceTests.java +++ b/modules/reindex/src/test/java/org/opensearch/index/reindex/ClientScrollableHitSourceTests.java @@ -48,7 +48,7 @@ import org.opensearch.common.bytes.BytesArray; import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.search.SearchHit; import org.opensearch.search.SearchHits; import org.opensearch.search.internal.InternalSearchResponse; diff --git a/modules/reindex/src/test/java/org/opensearch/index/reindex/RetryTests.java b/modules/reindex/src/test/java/org/opensearch/index/reindex/RetryTests.java index 0a01843405d9f..4dbd18a15b521 100644 --- a/modules/reindex/src/test/java/org/opensearch/index/reindex/RetryTests.java +++ b/modules/reindex/src/test/java/org/opensearch/index/reindex/RetryTests.java @@ -43,7 +43,7 @@ import org.opensearch.common.bytes.BytesArray; import org.opensearch.common.settings.Settings; import org.opensearch.common.transport.TransportAddress; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.http.HttpInfo; import org.opensearch.index.query.QueryBuilders; import org.opensearch.plugins.Plugin; diff --git a/modules/reindex/src/test/java/org/opensearch/index/reindex/remote/RemoteResponseParsersTests.java b/modules/reindex/src/test/java/org/opensearch/index/reindex/remote/RemoteResponseParsersTests.java index 68a37f758288d..2a082e496b9e2 100644 --- a/modules/reindex/src/test/java/org/opensearch/index/reindex/remote/RemoteResponseParsersTests.java +++ b/modules/reindex/src/test/java/org/opensearch/index/reindex/remote/RemoteResponseParsersTests.java @@ -33,7 +33,7 @@ package org.opensearch.index.reindex.remote; import org.opensearch.action.search.ShardSearchFailure; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.core.xcontent.XContentParser; diff --git a/modules/reindex/src/test/java/org/opensearch/index/reindex/remote/RemoteScrollableHitSourceTests.java b/modules/reindex/src/test/java/org/opensearch/index/reindex/remote/RemoteScrollableHitSourceTests.java index c0e2bd14f55bc..b1dd92b5f6dc2 100644 --- a/modules/reindex/src/test/java/org/opensearch/index/reindex/remote/RemoteScrollableHitSourceTests.java +++ b/modules/reindex/src/test/java/org/opensearch/index/reindex/remote/RemoteScrollableHitSourceTests.java @@ -48,7 +48,7 @@ import org.opensearch.common.unit.ByteSizeValue; import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.concurrent.OpenSearchExecutors; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.index.reindex.RejectAwareActionListener; import org.opensearch.index.reindex.ScrollableHitSource; import org.opensearch.index.reindex.ScrollableHitSource.Response; diff --git a/server/src/internalClusterTest/java/org/opensearch/action/RejectionActionIT.java b/server/src/internalClusterTest/java/org/opensearch/action/RejectionActionIT.java index f930b9e9cfda0..bda24b48b7f10 100644 --- a/server/src/internalClusterTest/java/org/opensearch/action/RejectionActionIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/action/RejectionActionIT.java @@ -38,7 +38,7 @@ import org.opensearch.action.search.SearchType; import org.opensearch.action.search.ShardSearchFailure; import org.opensearch.common.settings.Settings; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.index.query.QueryBuilders; import org.opensearch.test.OpenSearchIntegTestCase; import org.opensearch.test.OpenSearchIntegTestCase.ClusterScope; diff --git a/server/src/internalClusterTest/java/org/opensearch/action/bulk/BulkRejectionIT.java b/server/src/internalClusterTest/java/org/opensearch/action/bulk/BulkRejectionIT.java index aa2f2a214de27..7dde67791a2ec 100644 --- a/server/src/internalClusterTest/java/org/opensearch/action/bulk/BulkRejectionIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/action/bulk/BulkRejectionIT.java @@ -35,7 +35,7 @@ import org.opensearch.action.index.IndexRequest; import org.opensearch.action.support.WriteRequest; import org.opensearch.common.settings.Settings; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.index.IndexService; import org.opensearch.plugins.Plugin; import org.opensearch.test.OpenSearchIntegTestCase; diff --git a/server/src/internalClusterTest/java/org/opensearch/index/IndexingPressureIT.java b/server/src/internalClusterTest/java/org/opensearch/index/IndexingPressureIT.java index b461322735ce0..b63ffb2653741 100644 --- a/server/src/internalClusterTest/java/org/opensearch/index/IndexingPressureIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/index/IndexingPressureIT.java @@ -46,7 +46,7 @@ import org.opensearch.common.collect.Tuple; import org.opensearch.common.lease.Releasable; import org.opensearch.common.settings.Settings; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.plugins.Plugin; import org.opensearch.test.OpenSearchIntegTestCase; import org.opensearch.test.InternalSettingsPlugin; diff --git a/server/src/internalClusterTest/java/org/opensearch/index/SegmentReplicationPressureIT.java b/server/src/internalClusterTest/java/org/opensearch/index/SegmentReplicationPressureIT.java index ad6c396df69a1..d0b6d14aa3b9e 100644 --- a/server/src/internalClusterTest/java/org/opensearch/index/SegmentReplicationPressureIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/index/SegmentReplicationPressureIT.java @@ -14,7 +14,7 @@ import org.opensearch.common.lease.Releasable; import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.index.shard.IndexShard; import org.opensearch.indices.replication.SegmentReplicationBaseIT; import org.opensearch.indices.replication.common.ReplicationType; diff --git a/server/src/internalClusterTest/java/org/opensearch/index/ShardIndexingPressureIT.java b/server/src/internalClusterTest/java/org/opensearch/index/ShardIndexingPressureIT.java index f14540cec4e2b..0c95b71be8b91 100644 --- a/server/src/internalClusterTest/java/org/opensearch/index/ShardIndexingPressureIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/index/ShardIndexingPressureIT.java @@ -22,7 +22,7 @@ import org.opensearch.common.collect.Tuple; import org.opensearch.common.lease.Releasable; import org.opensearch.common.settings.Settings; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.index.shard.ShardId; import org.opensearch.indices.IndicesService; import org.opensearch.plugins.Plugin; diff --git a/server/src/internalClusterTest/java/org/opensearch/index/ShardIndexingPressureSettingsIT.java b/server/src/internalClusterTest/java/org/opensearch/index/ShardIndexingPressureSettingsIT.java index 1cdf8e702aafa..dafc8fd16e892 100644 --- a/server/src/internalClusterTest/java/org/opensearch/index/ShardIndexingPressureSettingsIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/index/ShardIndexingPressureSettingsIT.java @@ -24,7 +24,7 @@ import org.opensearch.common.collect.Tuple; import org.opensearch.common.lease.Releasable; import org.opensearch.common.settings.Settings; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.index.shard.ShardId; import org.opensearch.indices.IndicesService; import org.opensearch.plugins.Plugin; diff --git a/server/src/internalClusterTest/java/org/opensearch/indices/recovery/IndexRecoveryIT.java b/server/src/internalClusterTest/java/org/opensearch/indices/recovery/IndexRecoveryIT.java index ad4789981fa42..e448b018dd061 100644 --- a/server/src/internalClusterTest/java/org/opensearch/indices/recovery/IndexRecoveryIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/indices/recovery/IndexRecoveryIT.java @@ -80,7 +80,7 @@ import org.opensearch.common.unit.ByteSizeUnit; import org.opensearch.common.unit.ByteSizeValue; import org.opensearch.common.unit.TimeValue; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.common.xcontent.XContentType; import org.opensearch.gateway.ReplicaShardAllocatorIT; import org.opensearch.index.Index; diff --git a/server/src/main/java/org/opensearch/ExceptionsHelper.java b/server/src/main/java/org/opensearch/ExceptionsHelper.java index aa638514f9cc7..486fb7a3c72ee 100644 --- a/server/src/main/java/org/opensearch/ExceptionsHelper.java +++ b/server/src/main/java/org/opensearch/ExceptionsHelper.java @@ -43,7 +43,7 @@ import org.opensearch.common.CheckedSupplier; import org.opensearch.common.Nullable; import org.opensearch.common.compress.NotXContentException; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.index.Index; import org.opensearch.rest.RestStatus; diff --git a/server/src/main/java/org/opensearch/LegacyESVersion.java b/server/src/main/java/org/opensearch/LegacyESVersion.java index e9333ffb58148..6dca66b181e76 100644 --- a/server/src/main/java/org/opensearch/LegacyESVersion.java +++ b/server/src/main/java/org/opensearch/LegacyESVersion.java @@ -33,10 +33,11 @@ package org.opensearch; import org.opensearch.common.Strings; -import org.opensearch.common.collect.ImmutableOpenIntMap; -import org.opensearch.common.collect.ImmutableOpenMap; +import org.opensearch.core.Assertions; import java.lang.reflect.Field; +import java.util.HashMap; +import java.util.Map; /** * The Contents of this file were originally moved from {@link Version}. @@ -53,11 +54,11 @@ public class LegacyESVersion extends Version { public static final LegacyESVersion V_7_2_0 = new LegacyESVersion(7020099, org.apache.lucene.util.Version.LUCENE_8_0_0); // todo move back to Version.java if retiring legacy version support - protected static final ImmutableOpenIntMap idToVersion; - protected static final ImmutableOpenMap stringToVersion; + protected static final Map idToVersion; + protected static final Map stringToVersion; static { - final ImmutableOpenIntMap.Builder builder = ImmutableOpenIntMap.builder(); - final ImmutableOpenMap.Builder builderByString = ImmutableOpenMap.builder(); + final Map builder = new HashMap<>(); + final Map builderByString = new HashMap<>(); for (final Field declaredField : LegacyESVersion.class.getFields()) { if (declaredField.getType().equals(Version.class) || declaredField.getType().equals(LegacyESVersion.class)) { @@ -119,8 +120,8 @@ public class LegacyESVersion extends Version { builder.put(V_EMPTY_ID, V_EMPTY); builderByString.put(V_EMPTY.toString(), V_EMPTY); - idToVersion = builder.build(); - stringToVersion = builderByString.build(); + idToVersion = Map.copyOf(builder); + stringToVersion = Map.copyOf(builderByString); } protected LegacyESVersion(int id, org.apache.lucene.util.Version luceneVersion) { diff --git a/server/src/main/java/org/opensearch/action/bulk/TransportBulkAction.java b/server/src/main/java/org/opensearch/action/bulk/TransportBulkAction.java index 862d63aeedf53..ebba7c93af023 100644 --- a/server/src/main/java/org/opensearch/action/bulk/TransportBulkAction.java +++ b/server/src/main/java/org/opensearch/action/bulk/TransportBulkAction.java @@ -35,7 +35,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.lucene.util.SparseFixedBitSet; -import org.opensearch.Assertions; +import org.opensearch.core.Assertions; import org.opensearch.OpenSearchParseException; import org.opensearch.ExceptionsHelper; import org.opensearch.ResourceAlreadyExistsException; diff --git a/server/src/main/java/org/opensearch/action/support/RetryableAction.java b/server/src/main/java/org/opensearch/action/support/RetryableAction.java index 281cf728fb18c..cf9c140a54bc8 100644 --- a/server/src/main/java/org/opensearch/action/support/RetryableAction.java +++ b/server/src/main/java/org/opensearch/action/support/RetryableAction.java @@ -38,7 +38,7 @@ import org.opensearch.action.ActionRunnable; import org.opensearch.action.bulk.BackoffPolicy; import org.opensearch.common.unit.TimeValue; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.threadpool.Scheduler; import org.opensearch.threadpool.ThreadPool; diff --git a/server/src/main/java/org/opensearch/action/support/replication/ReplicationOperation.java b/server/src/main/java/org/opensearch/action/support/replication/ReplicationOperation.java index 944729df2ab1e..423fbd12a6447 100644 --- a/server/src/main/java/org/opensearch/action/support/replication/ReplicationOperation.java +++ b/server/src/main/java/org/opensearch/action/support/replication/ReplicationOperation.java @@ -34,7 +34,7 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; import org.apache.lucene.store.AlreadyClosedException; -import org.opensearch.Assertions; +import org.opensearch.core.Assertions; import org.opensearch.ExceptionsHelper; import org.opensearch.OpenSearchException; import org.opensearch.action.ActionListener; @@ -50,7 +50,7 @@ import org.opensearch.common.breaker.CircuitBreakingException; import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.unit.TimeValue; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.index.seqno.SequenceNumbers; import org.opensearch.index.shard.ReplicationGroup; import org.opensearch.index.shard.ShardId; diff --git a/server/src/main/java/org/opensearch/action/support/replication/TransportReplicationAction.java b/server/src/main/java/org/opensearch/action/support/replication/TransportReplicationAction.java index e804aa31adb4e..5b4b6a35771b0 100644 --- a/server/src/main/java/org/opensearch/action/support/replication/TransportReplicationAction.java +++ b/server/src/main/java/org/opensearch/action/support/replication/TransportReplicationAction.java @@ -34,7 +34,7 @@ import org.apache.logging.log4j.message.ParameterizedMessage; import org.apache.lucene.store.AlreadyClosedException; -import org.opensearch.Assertions; +import org.opensearch.core.Assertions; import org.opensearch.ExceptionsHelper; import org.opensearch.OpenSearchException; import org.opensearch.action.ActionListener; diff --git a/server/src/main/java/org/opensearch/cluster/InternalClusterInfoService.java b/server/src/main/java/org/opensearch/cluster/InternalClusterInfoService.java index 5d0ba2c67e961..052c320e9b268 100644 --- a/server/src/main/java/org/opensearch/cluster/InternalClusterInfoService.java +++ b/server/src/main/java/org/opensearch/cluster/InternalClusterInfoService.java @@ -58,7 +58,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.concurrent.AbstractRunnable; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.index.store.StoreStats; import org.opensearch.monitor.fs.FsInfo; import org.opensearch.threadpool.ThreadPool; diff --git a/server/src/main/java/org/opensearch/cluster/metadata/IndexMetadata.java b/server/src/main/java/org/opensearch/cluster/metadata/IndexMetadata.java index 56f9d9df95d02..f96eb9955593e 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/IndexMetadata.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/IndexMetadata.java @@ -36,7 +36,7 @@ import com.carrotsearch.hppc.cursors.IntObjectCursor; import com.carrotsearch.hppc.cursors.ObjectCursor; import com.carrotsearch.hppc.cursors.ObjectObjectCursor; -import org.opensearch.Assertions; +import org.opensearch.core.Assertions; import org.opensearch.LegacyESVersion; import org.opensearch.Version; import org.opensearch.action.admin.indices.rollover.RolloverInfo; diff --git a/server/src/main/java/org/opensearch/cluster/routing/RoutingNodes.java b/server/src/main/java/org/opensearch/cluster/routing/RoutingNodes.java index 118d2998bae67..5cb0ecab1f27c 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/RoutingNodes.java +++ b/server/src/main/java/org/opensearch/cluster/routing/RoutingNodes.java @@ -36,7 +36,7 @@ import com.carrotsearch.hppc.cursors.ObjectCursor; import org.apache.logging.log4j.Logger; import org.apache.lucene.util.CollectionUtil; -import org.opensearch.Assertions; +import org.opensearch.core.Assertions; import org.opensearch.cluster.ClusterState; import org.opensearch.cluster.metadata.IndexMetadata; import org.opensearch.cluster.metadata.Metadata; diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/allocator/BalancedShardsAllocator.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/allocator/BalancedShardsAllocator.java index 0ff0eeba7d394..6ba8e5d893bc0 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/allocation/allocator/BalancedShardsAllocator.java +++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/allocator/BalancedShardsAllocator.java @@ -162,7 +162,7 @@ private void setWeightFunction(float indexBalance, float shardBalanceFactor) { /** * When primary shards balance is desired, enable primary shard balancing constraints - * @param preferPrimaryShardBalance + * @param preferPrimaryShardBalance boolean to prefer balancing by primary shard */ private void setPreferPrimaryShardBalance(boolean preferPrimaryShardBalance) { this.preferPrimaryShardBalance = preferPrimaryShardBalance; diff --git a/server/src/main/java/org/opensearch/cluster/service/ClusterApplierService.java b/server/src/main/java/org/opensearch/cluster/service/ClusterApplierService.java index ce6672f0961bd..a7d870513b107 100644 --- a/server/src/main/java/org/opensearch/cluster/service/ClusterApplierService.java +++ b/server/src/main/java/org/opensearch/cluster/service/ClusterApplierService.java @@ -57,7 +57,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.concurrent.OpenSearchExecutors; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.common.util.concurrent.PrioritizedOpenSearchThreadPoolExecutor; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.threadpool.Scheduler; diff --git a/server/src/main/java/org/opensearch/cluster/service/MasterService.java b/server/src/main/java/org/opensearch/cluster/service/MasterService.java index 03bc3219ac8f8..9712fdbfbe8ec 100644 --- a/server/src/main/java/org/opensearch/cluster/service/MasterService.java +++ b/server/src/main/java/org/opensearch/cluster/service/MasterService.java @@ -35,7 +35,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; -import org.opensearch.Assertions; +import org.opensearch.core.Assertions; import org.opensearch.Version; import org.opensearch.action.support.PlainActionFuture; import org.opensearch.cluster.AckedClusterStateTaskListener; @@ -63,7 +63,7 @@ import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.concurrent.CountDown; import org.opensearch.common.util.concurrent.OpenSearchExecutors; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.common.util.concurrent.FutureUtils; import org.opensearch.common.util.concurrent.PrioritizedOpenSearchThreadPoolExecutor; import org.opensearch.common.util.concurrent.ThreadContext; diff --git a/server/src/main/java/org/opensearch/cluster/service/TaskBatcher.java b/server/src/main/java/org/opensearch/cluster/service/TaskBatcher.java index ed744f4f42d07..ea8b74f15b8a9 100644 --- a/server/src/main/java/org/opensearch/cluster/service/TaskBatcher.java +++ b/server/src/main/java/org/opensearch/cluster/service/TaskBatcher.java @@ -36,7 +36,7 @@ import org.opensearch.common.Nullable; import org.opensearch.common.Priority; import org.opensearch.common.unit.TimeValue; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.common.util.concurrent.PrioritizedOpenSearchThreadPoolExecutor; import java.util.ArrayList; diff --git a/server/src/main/java/org/opensearch/common/compress/DeflateCompressor.java b/server/src/main/java/org/opensearch/common/compress/DeflateCompressor.java index 05c5250ee32a4..36ee41e2d723d 100644 --- a/server/src/main/java/org/opensearch/common/compress/DeflateCompressor.java +++ b/server/src/main/java/org/opensearch/common/compress/DeflateCompressor.java @@ -32,7 +32,7 @@ package org.opensearch.common.compress; -import org.opensearch.Assertions; +import org.opensearch.core.Assertions; import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.io.stream.BytesStreamOutput; import org.opensearch.common.lease.Releasable; diff --git a/server/src/main/java/org/opensearch/common/geo/builders/ShapeBuilder.java b/server/src/main/java/org/opensearch/common/geo/builders/ShapeBuilder.java index 5702eb9f5d85e..2ec70f5fc0098 100644 --- a/server/src/main/java/org/opensearch/common/geo/builders/ShapeBuilder.java +++ b/server/src/main/java/org/opensearch/common/geo/builders/ShapeBuilder.java @@ -38,7 +38,7 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; -import org.opensearch.Assertions; +import org.opensearch.core.Assertions; import org.opensearch.common.Strings; import org.opensearch.common.geo.GeoShapeType; import org.opensearch.common.geo.parsers.GeoWKTParser; diff --git a/server/src/main/java/org/opensearch/common/io/stream/StreamInput.java b/server/src/main/java/org/opensearch/common/io/stream/StreamInput.java index 4f3555fdb1852..419308880f04e 100644 --- a/server/src/main/java/org/opensearch/common/io/stream/StreamInput.java +++ b/server/src/main/java/org/opensearch/common/io/stream/StreamInput.java @@ -55,7 +55,7 @@ import org.opensearch.common.text.Text; import org.opensearch.common.time.DateUtils; import org.opensearch.common.unit.TimeValue; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.script.JodaCompatibleZonedDateTime; import java.io.ByteArrayInputStream; diff --git a/server/src/main/java/org/opensearch/common/io/stream/StreamOutput.java b/server/src/main/java/org/opensearch/common/io/stream/StreamOutput.java index 11a22c4edf0c1..f3c184ea288bd 100644 --- a/server/src/main/java/org/opensearch/common/io/stream/StreamOutput.java +++ b/server/src/main/java/org/opensearch/common/io/stream/StreamOutput.java @@ -57,7 +57,7 @@ import org.opensearch.common.settings.SecureString; import org.opensearch.common.text.Text; import org.opensearch.common.unit.TimeValue; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.script.JodaCompatibleZonedDateTime; import java.io.EOFException; diff --git a/server/src/main/java/org/opensearch/common/lucene/ShardCoreKeyMap.java b/server/src/main/java/org/opensearch/common/lucene/ShardCoreKeyMap.java index 017aef1528243..f6f43cc214c5a 100644 --- a/server/src/main/java/org/opensearch/common/lucene/ShardCoreKeyMap.java +++ b/server/src/main/java/org/opensearch/common/lucene/ShardCoreKeyMap.java @@ -34,7 +34,7 @@ import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.LeafReader; -import org.opensearch.Assertions; +import org.opensearch.core.Assertions; import org.opensearch.index.shard.ShardId; import org.opensearch.index.shard.ShardUtils; diff --git a/server/src/main/java/org/opensearch/common/util/CollectionUtils.java b/server/src/main/java/org/opensearch/common/util/CollectionUtils.java index 6452d7061fdfa..85d897af7479c 100644 --- a/server/src/main/java/org/opensearch/common/util/CollectionUtils.java +++ b/server/src/main/java/org/opensearch/common/util/CollectionUtils.java @@ -32,10 +32,6 @@ package org.opensearch.common.util; -import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.BytesRefArray; -import org.apache.lucene.util.BytesRefBuilder; -import org.apache.lucene.util.InPlaceMergeSorter; import org.opensearch.common.Strings; import org.opensearch.common.collect.Iterators; @@ -221,65 +217,6 @@ public int size() { } } - public static void sort(final BytesRefArray bytes, final int[] indices) { - sort(new BytesRefBuilder(), new BytesRefBuilder(), bytes, indices); - } - - private static void sort( - final BytesRefBuilder scratch, - final BytesRefBuilder scratch1, - final BytesRefArray bytes, - final int[] indices - ) { - - final int numValues = bytes.size(); - assert indices.length >= numValues; - if (numValues > 1) { - new InPlaceMergeSorter() { - final Comparator comparator = Comparator.naturalOrder(); - - @Override - protected int compare(int i, int j) { - return comparator.compare(bytes.get(scratch, indices[i]), bytes.get(scratch1, indices[j])); - } - - @Override - protected void swap(int i, int j) { - int value_i = indices[i]; - indices[i] = indices[j]; - indices[j] = value_i; - } - }.sort(0, numValues); - } - - } - - public static int sortAndDedup(final BytesRefArray bytes, final int[] indices) { - final BytesRefBuilder scratch = new BytesRefBuilder(); - final BytesRefBuilder scratch1 = new BytesRefBuilder(); - final int numValues = bytes.size(); - assert indices.length >= numValues; - if (numValues <= 1) { - return numValues; - } - sort(scratch, scratch1, bytes, indices); - int uniqueCount = 1; - BytesRefBuilder previous = scratch; - BytesRefBuilder current = scratch1; - bytes.get(previous, indices[0]); - for (int i = 1; i < numValues; ++i) { - bytes.get(current, indices[i]); - if (!previous.get().equals(current.get())) { - indices[uniqueCount++] = indices[i]; - } - BytesRefBuilder tmp = previous; - previous = current; - current = tmp; - } - return uniqueCount; - - } - public static ArrayList iterableAsArrayList(Iterable elements) { if (elements == null) { throw new NullPointerException("elements"); diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchAbortPolicy.java b/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchAbortPolicy.java index fc9a179083f59..2ea38e45d54d5 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchAbortPolicy.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchAbortPolicy.java @@ -33,6 +33,7 @@ package org.opensearch.common.util.concurrent; import org.opensearch.common.metrics.CounterMetric; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import java.util.concurrent.BlockingQueue; import java.util.concurrent.ThreadPoolExecutor; diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchThreadPoolExecutor.java b/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchThreadPoolExecutor.java index 7fda911fe7959..d967b7423ca80 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchThreadPoolExecutor.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/OpenSearchThreadPoolExecutor.java @@ -33,6 +33,7 @@ package org.opensearch.common.util.concurrent; import org.opensearch.common.SuppressForbidden; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import java.util.concurrent.BlockingQueue; import java.util.concurrent.ThreadFactory; diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/ReleasableLock.java b/server/src/main/java/org/opensearch/common/util/concurrent/ReleasableLock.java index e1aa6bd5d169a..883239cea9d99 100644 --- a/server/src/main/java/org/opensearch/common/util/concurrent/ReleasableLock.java +++ b/server/src/main/java/org/opensearch/common/util/concurrent/ReleasableLock.java @@ -32,7 +32,7 @@ package org.opensearch.common.util.concurrent; -import org.opensearch.Assertions; +import org.opensearch.core.Assertions; import org.opensearch.common.lease.Releasable; import org.opensearch.common.unit.TimeValue; import org.opensearch.index.engine.EngineException; diff --git a/server/src/main/java/org/opensearch/gateway/AsyncShardFetch.java b/server/src/main/java/org/opensearch/gateway/AsyncShardFetch.java index 6e359d690b1ec..b5c4d00228caa 100644 --- a/server/src/main/java/org/opensearch/gateway/AsyncShardFetch.java +++ b/server/src/main/java/org/opensearch/gateway/AsyncShardFetch.java @@ -45,7 +45,7 @@ import org.opensearch.cluster.routing.allocation.RoutingAllocation; import org.opensearch.common.Nullable; import org.opensearch.common.lease.Releasable; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.index.shard.ShardId; import org.opensearch.transport.ReceiveTimeoutTransportException; diff --git a/server/src/main/java/org/opensearch/index/IndexService.java b/server/src/main/java/org/opensearch/index/IndexService.java index 2ced9f56d7a35..696ec62f3b512 100644 --- a/server/src/main/java/org/opensearch/index/IndexService.java +++ b/server/src/main/java/org/opensearch/index/IndexService.java @@ -40,7 +40,7 @@ import org.apache.lucene.store.AlreadyClosedException; import org.apache.lucene.store.Directory; import org.apache.lucene.util.Accountable; -import org.opensearch.Assertions; +import org.opensearch.core.Assertions; import org.opensearch.client.Client; import org.opensearch.cluster.metadata.IndexMetadata; import org.opensearch.cluster.metadata.IndexNameExpressionResolver; diff --git a/server/src/main/java/org/opensearch/index/IndexingPressure.java b/server/src/main/java/org/opensearch/index/IndexingPressure.java index a100f0b76f996..6285a06286e29 100644 --- a/server/src/main/java/org/opensearch/index/IndexingPressure.java +++ b/server/src/main/java/org/opensearch/index/IndexingPressure.java @@ -39,7 +39,7 @@ import org.opensearch.common.settings.Setting; import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.ByteSizeValue; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.index.stats.IndexingPressureStats; import java.util.concurrent.atomic.AtomicBoolean; diff --git a/server/src/main/java/org/opensearch/index/SegmentReplicationPressureService.java b/server/src/main/java/org/opensearch/index/SegmentReplicationPressureService.java index f31e236fb6184..55b4a2d3b6d21 100644 --- a/server/src/main/java/org/opensearch/index/SegmentReplicationPressureService.java +++ b/server/src/main/java/org/opensearch/index/SegmentReplicationPressureService.java @@ -16,7 +16,7 @@ import org.opensearch.common.settings.Setting; import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.index.shard.IndexShard; import org.opensearch.index.shard.ShardId; import org.opensearch.indices.IndicesService; diff --git a/server/src/main/java/org/opensearch/index/ShardIndexingPressure.java b/server/src/main/java/org/opensearch/index/ShardIndexingPressure.java index 59dde20c9a904..09e809c902ec6 100644 --- a/server/src/main/java/org/opensearch/index/ShardIndexingPressure.java +++ b/server/src/main/java/org/opensearch/index/ShardIndexingPressure.java @@ -12,7 +12,7 @@ import org.opensearch.common.lease.Releasable; import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Settings; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.index.ShardIndexingPressureTracker.CommonOperationTracker; import org.opensearch.index.ShardIndexingPressureTracker.OperationTracker; import org.opensearch.index.ShardIndexingPressureTracker.PerformanceTracker; diff --git a/server/src/main/java/org/opensearch/index/engine/InternalEngine.java b/server/src/main/java/org/opensearch/index/engine/InternalEngine.java index 55aad817a5816..1c56f22c0d6d2 100644 --- a/server/src/main/java/org/opensearch/index/engine/InternalEngine.java +++ b/server/src/main/java/org/opensearch/index/engine/InternalEngine.java @@ -65,7 +65,7 @@ import org.apache.lucene.store.LockObtainFailedException; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.InfoStream; -import org.opensearch.Assertions; +import org.opensearch.core.Assertions; import org.opensearch.ExceptionsHelper; import org.opensearch.action.index.IndexRequest; import org.opensearch.common.Booleans; diff --git a/server/src/main/java/org/opensearch/index/mapper/MapperService.java b/server/src/main/java/org/opensearch/index/mapper/MapperService.java index a5669bf9f99b4..521de037e63d0 100644 --- a/server/src/main/java/org/opensearch/index/mapper/MapperService.java +++ b/server/src/main/java/org/opensearch/index/mapper/MapperService.java @@ -35,7 +35,7 @@ import org.apache.logging.log4j.message.ParameterizedMessage; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.DelegatingAnalyzerWrapper; -import org.opensearch.Assertions; +import org.opensearch.core.Assertions; import org.opensearch.Version; import org.opensearch.cluster.metadata.IndexMetadata; import org.opensearch.cluster.metadata.MappingMetadata; diff --git a/server/src/main/java/org/opensearch/index/reindex/ClientScrollableHitSource.java b/server/src/main/java/org/opensearch/index/reindex/ClientScrollableHitSource.java index f01f90ef68bcd..286aa2cc93045 100644 --- a/server/src/main/java/org/opensearch/index/reindex/ClientScrollableHitSource.java +++ b/server/src/main/java/org/opensearch/index/reindex/ClientScrollableHitSource.java @@ -48,7 +48,7 @@ import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.document.DocumentField; import org.opensearch.common.unit.TimeValue; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.common.xcontent.XContentHelper; import org.opensearch.common.xcontent.XContentType; import org.opensearch.index.mapper.RoutingFieldMapper; diff --git a/server/src/main/java/org/opensearch/index/reindex/WorkerBulkByScrollTaskState.java b/server/src/main/java/org/opensearch/index/reindex/WorkerBulkByScrollTaskState.java index eefdc4f90dc7b..e925e57784aa3 100644 --- a/server/src/main/java/org/opensearch/index/reindex/WorkerBulkByScrollTaskState.java +++ b/server/src/main/java/org/opensearch/index/reindex/WorkerBulkByScrollTaskState.java @@ -36,7 +36,7 @@ import org.apache.logging.log4j.Logger; import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.concurrent.AbstractRunnable; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.common.util.concurrent.RunOnce; import org.opensearch.threadpool.Scheduler; import org.opensearch.threadpool.ThreadPool; diff --git a/server/src/main/java/org/opensearch/index/shard/GlobalCheckpointListeners.java b/server/src/main/java/org/opensearch/index/shard/GlobalCheckpointListeners.java index 6dbbb62e231af..35dfcf1a0f46d 100644 --- a/server/src/main/java/org/opensearch/index/shard/GlobalCheckpointListeners.java +++ b/server/src/main/java/org/opensearch/index/shard/GlobalCheckpointListeners.java @@ -34,7 +34,7 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; -import org.opensearch.Assertions; +import org.opensearch.core.Assertions; import org.opensearch.common.collect.Tuple; import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.concurrent.FutureUtils; diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShard.java b/server/src/main/java/org/opensearch/index/shard/IndexShard.java index 4a2d0f0198051..2aacc51c4f4c8 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShard.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShard.java @@ -56,7 +56,7 @@ import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.util.ThreadInterruptedException; -import org.opensearch.Assertions; +import org.opensearch.core.Assertions; import org.opensearch.ExceptionsHelper; import org.opensearch.OpenSearchException; import org.opensearch.action.ActionListener; diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShardOperationPermits.java b/server/src/main/java/org/opensearch/index/shard/IndexShardOperationPermits.java index 9d500db1d8036..23d3a30185ce1 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShardOperationPermits.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShardOperationPermits.java @@ -32,7 +32,7 @@ package org.opensearch.index.shard; -import org.opensearch.Assertions; +import org.opensearch.core.Assertions; import org.opensearch.ExceptionsHelper; import org.opensearch.action.ActionListener; import org.opensearch.action.ActionRunnable; diff --git a/server/src/main/java/org/opensearch/index/translog/TranslogDeletionPolicy.java b/server/src/main/java/org/opensearch/index/translog/TranslogDeletionPolicy.java index 95f39c1188b2b..fde6d6bbc0632 100644 --- a/server/src/main/java/org/opensearch/index/translog/TranslogDeletionPolicy.java +++ b/server/src/main/java/org/opensearch/index/translog/TranslogDeletionPolicy.java @@ -33,7 +33,7 @@ package org.opensearch.index.translog; import org.apache.lucene.util.Counter; -import org.opensearch.Assertions; +import org.opensearch.core.Assertions; import org.opensearch.common.lease.Releasable; import org.opensearch.index.seqno.SequenceNumbers; diff --git a/server/src/main/java/org/opensearch/index/translog/TranslogWriter.java b/server/src/main/java/org/opensearch/index/translog/TranslogWriter.java index 1250184ff656b..3c3d7402dff70 100644 --- a/server/src/main/java/org/opensearch/index/translog/TranslogWriter.java +++ b/server/src/main/java/org/opensearch/index/translog/TranslogWriter.java @@ -37,7 +37,7 @@ import org.apache.lucene.store.AlreadyClosedException; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRefIterator; -import org.opensearch.Assertions; +import org.opensearch.core.Assertions; import org.opensearch.common.SuppressForbidden; import org.opensearch.common.bytes.BytesArray; import org.opensearch.common.bytes.BytesReference; diff --git a/server/src/main/java/org/opensearch/indices/IndicesService.java b/server/src/main/java/org/opensearch/indices/IndicesService.java index 671eb5d72d574..d82df07ca0a0f 100644 --- a/server/src/main/java/org/opensearch/indices/IndicesService.java +++ b/server/src/main/java/org/opensearch/indices/IndicesService.java @@ -80,7 +80,7 @@ import org.opensearch.common.util.concurrent.AbstractRefCounted; import org.opensearch.common.util.concurrent.AbstractRunnable; import org.opensearch.common.util.concurrent.OpenSearchExecutors; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.common.util.concurrent.OpenSearchThreadPoolExecutor; import org.opensearch.common.util.FeatureFlags; import org.opensearch.common.util.iterable.Iterables; diff --git a/server/src/main/java/org/opensearch/indices/recovery/MultiChunkTransfer.java b/server/src/main/java/org/opensearch/indices/recovery/MultiChunkTransfer.java index 4cc75de7cd5d9..188b648449685 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/MultiChunkTransfer.java +++ b/server/src/main/java/org/opensearch/indices/recovery/MultiChunkTransfer.java @@ -34,7 +34,7 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; -import org.opensearch.Assertions; +import org.opensearch.core.Assertions; import org.opensearch.action.ActionListener; import org.opensearch.common.collect.Tuple; import org.opensearch.common.util.concurrent.AsyncIOProcessor; diff --git a/server/src/main/java/org/opensearch/indices/recovery/RecoveryTarget.java b/server/src/main/java/org/opensearch/indices/recovery/RecoveryTarget.java index 9d7ca715979a4..7466ab5c1ca86 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RecoveryTarget.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RecoveryTarget.java @@ -35,7 +35,7 @@ import org.apache.lucene.index.CorruptIndexException; import org.apache.lucene.index.IndexFormatTooNewException; import org.apache.lucene.index.IndexFormatTooOldException; -import org.opensearch.Assertions; +import org.opensearch.core.Assertions; import org.opensearch.ExceptionsHelper; import org.opensearch.action.ActionListener; import org.opensearch.action.admin.indices.flush.FlushRequest; diff --git a/server/src/main/java/org/opensearch/indices/recovery/RetryableTransportClient.java b/server/src/main/java/org/opensearch/indices/recovery/RetryableTransportClient.java index 9637b4a791e5d..77ffd75d0148a 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RetryableTransportClient.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RetryableTransportClient.java @@ -19,7 +19,7 @@ import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.CancellableThreads; import org.opensearch.common.util.concurrent.ConcurrentCollections; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.ConnectTransportException; import org.opensearch.transport.RemoteTransportException; diff --git a/server/src/main/java/org/opensearch/indices/store/IndicesStore.java b/server/src/main/java/org/opensearch/indices/store/IndicesStore.java index 96e84fb69b573..5c34aba6632b2 100644 --- a/server/src/main/java/org/opensearch/indices/store/IndicesStore.java +++ b/server/src/main/java/org/opensearch/indices/store/IndicesStore.java @@ -56,7 +56,7 @@ import org.opensearch.common.settings.Setting.Property; import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.index.IndexService; import org.opensearch.index.IndexSettings; import org.opensearch.index.shard.IndexShard; diff --git a/server/src/main/java/org/opensearch/node/Node.java b/server/src/main/java/org/opensearch/node/Node.java index 7fc4412e53d3e..980faf865be00 100644 --- a/server/src/main/java/org/opensearch/node/Node.java +++ b/server/src/main/java/org/opensearch/node/Node.java @@ -52,7 +52,7 @@ import org.opensearch.threadpool.RunnableTaskExecutionListener; import org.opensearch.index.store.RemoteSegmentStoreDirectoryFactory; import org.opensearch.watcher.ResourceWatcherService; -import org.opensearch.Assertions; +import org.opensearch.core.Assertions; import org.opensearch.Build; import org.opensearch.OpenSearchException; import org.opensearch.OpenSearchTimeoutException; diff --git a/server/src/main/java/org/opensearch/search/DefaultSearchContext.java b/server/src/main/java/org/opensearch/search/DefaultSearchContext.java index 4bc40610facf2..b4278681346e3 100644 --- a/server/src/main/java/org/opensearch/search/DefaultSearchContext.java +++ b/server/src/main/java/org/opensearch/search/DefaultSearchContext.java @@ -49,7 +49,7 @@ import org.opensearch.common.lucene.search.Queries; import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.BigArrays; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.index.IndexService; import org.opensearch.index.IndexSettings; import org.opensearch.index.cache.bitset.BitsetFilterCache; diff --git a/server/src/main/java/org/opensearch/search/SearchService.java b/server/src/main/java/org/opensearch/search/SearchService.java index a15489cd4d127..3911bd094b594 100644 --- a/server/src/main/java/org/opensearch/search/SearchService.java +++ b/server/src/main/java/org/opensearch/search/SearchService.java @@ -69,7 +69,7 @@ import org.opensearch.common.util.CollectionUtils; import org.opensearch.common.util.concurrent.ConcurrentCollections; import org.opensearch.common.util.concurrent.ConcurrentMapLong; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.core.internal.io.IOUtils; import org.opensearch.index.Index; import org.opensearch.index.IndexNotFoundException; diff --git a/server/src/main/java/org/opensearch/tasks/TaskManager.java b/server/src/main/java/org/opensearch/tasks/TaskManager.java index ff760219716e6..519837311eb94 100644 --- a/server/src/main/java/org/opensearch/tasks/TaskManager.java +++ b/server/src/main/java/org/opensearch/tasks/TaskManager.java @@ -37,7 +37,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; -import org.opensearch.Assertions; +import org.opensearch.core.Assertions; import org.opensearch.ExceptionsHelper; import org.opensearch.OpenSearchException; import org.opensearch.OpenSearchTimeoutException; diff --git a/server/src/main/java/org/opensearch/tasks/TaskResultsService.java b/server/src/main/java/org/opensearch/tasks/TaskResultsService.java index 5374cd52e23b2..c38cd6d65e7d2 100644 --- a/server/src/main/java/org/opensearch/tasks/TaskResultsService.java +++ b/server/src/main/java/org/opensearch/tasks/TaskResultsService.java @@ -53,7 +53,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentFactory; diff --git a/server/src/main/java/org/opensearch/threadpool/Scheduler.java b/server/src/main/java/org/opensearch/threadpool/Scheduler.java index 7c502216af31b..86c322ec89dd7 100644 --- a/server/src/main/java/org/opensearch/threadpool/Scheduler.java +++ b/server/src/main/java/org/opensearch/threadpool/Scheduler.java @@ -39,7 +39,7 @@ import org.opensearch.common.util.concurrent.AbstractRunnable; import org.opensearch.common.util.concurrent.OpenSearchAbortPolicy; import org.opensearch.common.util.concurrent.OpenSearchExecutors; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import java.util.concurrent.Delayed; import java.util.concurrent.Future; diff --git a/server/src/main/java/org/opensearch/threadpool/ThreadPool.java b/server/src/main/java/org/opensearch/threadpool/ThreadPool.java index 1bf9cbd200b2b..104af6945dfe8 100644 --- a/server/src/main/java/org/opensearch/threadpool/ThreadPool.java +++ b/server/src/main/java/org/opensearch/threadpool/ThreadPool.java @@ -45,7 +45,7 @@ import org.opensearch.common.unit.SizeValue; import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.concurrent.OpenSearchExecutors; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.common.util.concurrent.OpenSearchThreadPoolExecutor; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.common.util.concurrent.XRejectedExecutionHandler; @@ -410,7 +410,7 @@ public ExecutorService executor(String name) { * @return a ScheduledFuture who's get will return when the task is has been added to its target thread pool and throw an exception if * the task is canceled before it was added to its target thread pool. Once the task has been added to its target thread pool * the ScheduledFuture will cannot interact with it. - * @throws org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException if the task cannot be scheduled for execution + * @throws OpenSearchRejectedExecutionException if the task cannot be scheduled for execution */ @Override public ScheduledCancellable schedule(Runnable command, TimeValue delay, String executor) { diff --git a/server/src/main/java/org/opensearch/transport/RemoteConnectionStrategy.java b/server/src/main/java/org/opensearch/transport/RemoteConnectionStrategy.java index 6a3063a835d5e..15aebd5f71123 100644 --- a/server/src/main/java/org/opensearch/transport/RemoteConnectionStrategy.java +++ b/server/src/main/java/org/opensearch/transport/RemoteConnectionStrategy.java @@ -45,7 +45,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.concurrent.AbstractRunnable; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.threadpool.ThreadPool; import java.io.Closeable; diff --git a/server/src/main/java/org/opensearch/transport/TransportService.java b/server/src/main/java/org/opensearch/transport/TransportService.java index c73d38517276b..f397d22a4e681 100644 --- a/server/src/main/java/org/opensearch/transport/TransportService.java +++ b/server/src/main/java/org/opensearch/transport/TransportService.java @@ -56,7 +56,7 @@ import org.opensearch.common.transport.TransportAddress; import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.concurrent.AbstractRunnable; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.core.internal.io.IOUtils; import org.opensearch.node.NodeClosedException; diff --git a/server/src/test/java/org/opensearch/ExceptionsHelperTests.java b/server/src/test/java/org/opensearch/ExceptionsHelperTests.java index 41051d7ff2dd0..4c65eadf46e89 100644 --- a/server/src/test/java/org/opensearch/ExceptionsHelperTests.java +++ b/server/src/test/java/org/opensearch/ExceptionsHelperTests.java @@ -40,7 +40,7 @@ import org.opensearch.action.search.ShardSearchFailure; import org.opensearch.cluster.metadata.IndexMetadata; import org.opensearch.common.ParsingException; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.index.Index; import org.opensearch.index.query.QueryShardException; import org.opensearch.index.shard.ShardId; diff --git a/server/src/test/java/org/opensearch/action/bulk/RetryTests.java b/server/src/test/java/org/opensearch/action/bulk/RetryTests.java index d3280ede6ce15..9da2d482ef5bd 100644 --- a/server/src/test/java/org/opensearch/action/bulk/RetryTests.java +++ b/server/src/test/java/org/opensearch/action/bulk/RetryTests.java @@ -39,7 +39,7 @@ import org.opensearch.action.support.PlainActionFuture; import org.opensearch.action.update.UpdateRequest; import org.opensearch.common.unit.TimeValue; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.index.shard.ShardId; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.client.NoOpClient; diff --git a/server/src/test/java/org/opensearch/action/bulk/TransportBulkActionTests.java b/server/src/test/java/org/opensearch/action/bulk/TransportBulkActionTests.java index 6c23092c789d1..d53b860e6524a 100644 --- a/server/src/test/java/org/opensearch/action/bulk/TransportBulkActionTests.java +++ b/server/src/test/java/org/opensearch/action/bulk/TransportBulkActionTests.java @@ -56,7 +56,7 @@ import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.index.IndexNotFoundException; import org.opensearch.index.IndexingPressureService; import org.opensearch.index.VersionType; diff --git a/server/src/test/java/org/opensearch/action/bulk/TransportShardBulkActionTests.java b/server/src/test/java/org/opensearch/action/bulk/TransportShardBulkActionTests.java index 1d7828027baa0..d412b5383bc89 100644 --- a/server/src/test/java/org/opensearch/action/bulk/TransportShardBulkActionTests.java +++ b/server/src/test/java/org/opensearch/action/bulk/TransportShardBulkActionTests.java @@ -64,7 +64,7 @@ import org.opensearch.common.lucene.uid.Versions; import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Settings; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.index.Index; import org.opensearch.index.IndexService; import org.opensearch.index.IndexSettings; diff --git a/server/src/test/java/org/opensearch/action/search/SearchPhaseExecutionExceptionTests.java b/server/src/test/java/org/opensearch/action/search/SearchPhaseExecutionExceptionTests.java index e1f94d79bfe4e..169f2d47743d1 100644 --- a/server/src/test/java/org/opensearch/action/search/SearchPhaseExecutionExceptionTests.java +++ b/server/src/test/java/org/opensearch/action/search/SearchPhaseExecutionExceptionTests.java @@ -38,7 +38,7 @@ import org.opensearch.common.ParsingException; import org.opensearch.common.Strings; import org.opensearch.common.bytes.BytesReference; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.XContent; import org.opensearch.common.xcontent.XContentHelper; diff --git a/server/src/test/java/org/opensearch/action/support/DefaultShardOperationFailedExceptionTests.java b/server/src/test/java/org/opensearch/action/support/DefaultShardOperationFailedExceptionTests.java index ceac5ed07f266..ee96ce5ad505c 100644 --- a/server/src/test/java/org/opensearch/action/support/DefaultShardOperationFailedExceptionTests.java +++ b/server/src/test/java/org/opensearch/action/support/DefaultShardOperationFailedExceptionTests.java @@ -43,7 +43,7 @@ import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.io.stream.BytesStreamOutput; import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.core.xcontent.XContent; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.core.xcontent.XContentParser; diff --git a/server/src/test/java/org/opensearch/action/support/RetryableActionTests.java b/server/src/test/java/org/opensearch/action/support/RetryableActionTests.java index fc6853ecdc9af..85eda47e9b797 100644 --- a/server/src/test/java/org/opensearch/action/support/RetryableActionTests.java +++ b/server/src/test/java/org/opensearch/action/support/RetryableActionTests.java @@ -37,7 +37,7 @@ import org.opensearch.cluster.coordination.DeterministicTaskQueue; import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.test.OpenSearchTestCase; import org.junit.Before; diff --git a/server/src/test/java/org/opensearch/action/support/replication/ReplicationOperationTests.java b/server/src/test/java/org/opensearch/action/support/replication/ReplicationOperationTests.java index c5d4f3326746d..652f82409679b 100644 --- a/server/src/test/java/org/opensearch/action/support/replication/ReplicationOperationTests.java +++ b/server/src/test/java/org/opensearch/action/support/replication/ReplicationOperationTests.java @@ -54,7 +54,7 @@ import org.opensearch.common.transport.TransportAddress; import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.concurrent.ConcurrentCollections; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.common.util.set.Sets; import org.opensearch.index.shard.IndexShardNotStartedException; import org.opensearch.index.shard.IndexShardState; diff --git a/server/src/test/java/org/opensearch/cluster/coordination/CoordinationStateTests.java b/server/src/test/java/org/opensearch/cluster/coordination/CoordinationStateTests.java index c4db0641717c6..23087e6dd2ba4 100644 --- a/server/src/test/java/org/opensearch/cluster/coordination/CoordinationStateTests.java +++ b/server/src/test/java/org/opensearch/cluster/coordination/CoordinationStateTests.java @@ -31,7 +31,7 @@ package org.opensearch.cluster.coordination; -import org.opensearch.Assertions; +import org.opensearch.core.Assertions; import org.opensearch.Version; import org.opensearch.cluster.ClusterName; import org.opensearch.cluster.ClusterState; diff --git a/server/src/test/java/org/opensearch/cluster/routing/FailAwareWeightedRoutingTests.java b/server/src/test/java/org/opensearch/cluster/routing/FailAwareWeightedRoutingTests.java index c0164f1afd924..c325517837d09 100644 --- a/server/src/test/java/org/opensearch/cluster/routing/FailAwareWeightedRoutingTests.java +++ b/server/src/test/java/org/opensearch/cluster/routing/FailAwareWeightedRoutingTests.java @@ -20,7 +20,7 @@ import org.opensearch.cluster.node.DiscoveryNodeRole; import org.opensearch.cluster.node.DiscoveryNodes; import org.opensearch.common.settings.Settings; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.index.shard.ShardId; import org.opensearch.search.SearchShardTarget; import org.opensearch.test.OpenSearchTestCase; diff --git a/server/src/test/java/org/opensearch/cluster/routing/allocation/BalanceConfigurationTests.java b/server/src/test/java/org/opensearch/cluster/routing/allocation/BalanceConfigurationTests.java index f5a418bc6a100..e1f5eba735904 100644 --- a/server/src/test/java/org/opensearch/cluster/routing/allocation/BalanceConfigurationTests.java +++ b/server/src/test/java/org/opensearch/cluster/routing/allocation/BalanceConfigurationTests.java @@ -365,7 +365,6 @@ public void testPrimaryBalanceWithContrainstBreaching() { /** * This test verifies global balance by creating indices iteratively and verify primary shards do not pile up on one * node. - * @throws Exception */ public void testGlobalPrimaryBalance() throws Exception { AllocationService strategy = createAllocationService(getSettingsBuilderForPrimaryBalance().build(), new TestGatewayAllocator()); diff --git a/server/src/test/java/org/opensearch/common/hppc/HppcMapsTests.java b/server/src/test/java/org/opensearch/common/hppc/HppcMapsTests.java index de3c2cf909383..42450bb69ce75 100644 --- a/server/src/test/java/org/opensearch/common/hppc/HppcMapsTests.java +++ b/server/src/test/java/org/opensearch/common/hppc/HppcMapsTests.java @@ -32,7 +32,7 @@ package org.opensearch.common.hppc; import com.carrotsearch.hppc.ObjectHashSet; -import org.opensearch.Assertions; +import org.opensearch.core.Assertions; import org.opensearch.common.collect.HppcMaps; import org.opensearch.test.OpenSearchTestCase; diff --git a/server/src/test/java/org/opensearch/common/util/CollectionUtilsTests.java b/server/src/test/java/org/opensearch/common/util/CollectionUtilsTests.java index c237bdeb5c5cf..f0a0d41aa7aab 100644 --- a/server/src/test/java/org/opensearch/common/util/CollectionUtilsTests.java +++ b/server/src/test/java/org/opensearch/common/util/CollectionUtilsTests.java @@ -32,10 +32,6 @@ package org.opensearch.common.util; -import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.BytesRefArray; -import org.apache.lucene.util.BytesRefBuilder; -import org.apache.lucene.util.Counter; import org.opensearch.test.OpenSearchTestCase; import java.util.ArrayList; @@ -44,18 +40,13 @@ import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; -import java.util.SortedSet; -import java.util.TreeSet; import static java.util.Collections.emptyMap; import static org.opensearch.common.util.CollectionUtils.eagerPartition; import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.is; public class CollectionUtilsTests extends OpenSearchTestCase { public void testRotateEmpty() { @@ -113,67 +104,6 @@ public void testSortAndDedup() { // test sorted } - public void testSortAndDedupByteRefArray() { - SortedSet set = new TreeSet<>(); - final int numValues = scaledRandomIntBetween(0, 10000); - List tmpList = new ArrayList<>(); - BytesRefArray array = new BytesRefArray(Counter.newCounter()); - for (int i = 0; i < numValues; i++) { - String s = randomRealisticUnicodeOfCodepointLengthBetween(1, 100); - set.add(new BytesRef(s)); - tmpList.add(new BytesRef(s)); - array.append(new BytesRef(s)); - } - if (randomBoolean()) { - Collections.shuffle(tmpList, random()); - for (BytesRef ref : tmpList) { - array.append(ref); - } - } - int[] indices = new int[array.size()]; - for (int i = 0; i < indices.length; i++) { - indices[i] = i; - } - int numUnique = CollectionUtils.sortAndDedup(array, indices); - assertThat(numUnique, equalTo(set.size())); - Iterator iterator = set.iterator(); - - BytesRefBuilder spare = new BytesRefBuilder(); - for (int i = 0; i < numUnique; i++) { - assertThat(iterator.hasNext(), is(true)); - assertThat(array.get(spare, indices[i]), equalTo(iterator.next())); - } - - } - - public void testSortByteRefArray() { - List values = new ArrayList<>(); - final int numValues = scaledRandomIntBetween(0, 10000); - BytesRefArray array = new BytesRefArray(Counter.newCounter()); - for (int i = 0; i < numValues; i++) { - String s = randomRealisticUnicodeOfCodepointLengthBetween(1, 100); - values.add(new BytesRef(s)); - array.append(new BytesRef(s)); - } - if (randomBoolean()) { - Collections.shuffle(values, random()); - } - int[] indices = new int[array.size()]; - for (int i = 0; i < indices.length; i++) { - indices[i] = i; - } - CollectionUtils.sort(array, indices); - Collections.sort(values); - Iterator iterator = values.iterator(); - - BytesRefBuilder spare = new BytesRefBuilder(); - for (int i = 0; i < values.size(); i++) { - assertThat(iterator.hasNext(), is(true)); - assertThat(array.get(spare, indices[i]), equalTo(iterator.next())); - } - - } - public void testEmptyPartition() { assertEquals(Collections.emptyList(), eagerPartition(Collections.emptyList(), 1)); } diff --git a/server/src/test/java/org/opensearch/common/util/concurrent/OpenSearchExecutorsTests.java b/server/src/test/java/org/opensearch/common/util/concurrent/OpenSearchExecutorsTests.java index 61f489f32adfd..2063cd26a9e8e 100644 --- a/server/src/test/java/org/opensearch/common/util/concurrent/OpenSearchExecutorsTests.java +++ b/server/src/test/java/org/opensearch/common/util/concurrent/OpenSearchExecutorsTests.java @@ -34,6 +34,7 @@ import org.opensearch.common.settings.Setting; import org.opensearch.common.settings.Settings; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.test.OpenSearchTestCase; import org.hamcrest.Matcher; diff --git a/server/src/test/java/org/opensearch/index/IndexModuleTests.java b/server/src/test/java/org/opensearch/index/IndexModuleTests.java index ad6344882b70d..4fe09f83e5147 100644 --- a/server/src/test/java/org/opensearch/index/IndexModuleTests.java +++ b/server/src/test/java/org/opensearch/index/IndexModuleTests.java @@ -63,7 +63,7 @@ import org.opensearch.common.settings.SettingsException; import org.opensearch.common.util.BigArrays; import org.opensearch.common.util.PageCacheRecycler; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.core.internal.io.IOUtils; import org.opensearch.env.Environment; diff --git a/server/src/test/java/org/opensearch/index/IndexingPressureTests.java b/server/src/test/java/org/opensearch/index/IndexingPressureTests.java index 0f9d9c7be1395..1aa20506222d1 100644 --- a/server/src/test/java/org/opensearch/index/IndexingPressureTests.java +++ b/server/src/test/java/org/opensearch/index/IndexingPressureTests.java @@ -34,7 +34,7 @@ import org.opensearch.common.lease.Releasable; import org.opensearch.common.settings.Settings; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.index.stats.IndexingPressureStats; import org.opensearch.test.OpenSearchTestCase; diff --git a/server/src/test/java/org/opensearch/index/SegmentReplicationPressureServiceTests.java b/server/src/test/java/org/opensearch/index/SegmentReplicationPressureServiceTests.java index a050a4c2243db..7a940c1a6a94d 100644 --- a/server/src/test/java/org/opensearch/index/SegmentReplicationPressureServiceTests.java +++ b/server/src/test/java/org/opensearch/index/SegmentReplicationPressureServiceTests.java @@ -14,7 +14,7 @@ import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.index.engine.NRTReplicationEngineFactory; import org.opensearch.index.replication.OpenSearchIndexLevelReplicationTestCase; import org.opensearch.index.shard.IndexShard; diff --git a/server/src/test/java/org/opensearch/index/ShardIndexingPressureConcurrentExecutionTests.java b/server/src/test/java/org/opensearch/index/ShardIndexingPressureConcurrentExecutionTests.java index 8757458e3317e..170919fbf351c 100644 --- a/server/src/test/java/org/opensearch/index/ShardIndexingPressureConcurrentExecutionTests.java +++ b/server/src/test/java/org/opensearch/index/ShardIndexingPressureConcurrentExecutionTests.java @@ -16,7 +16,7 @@ import org.opensearch.common.lease.Releasable; import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Settings; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.index.shard.ShardId; import org.opensearch.index.stats.IndexingPressurePerShardStats; import org.opensearch.index.stats.IndexingPressureStats; diff --git a/server/src/test/java/org/opensearch/index/ShardIndexingPressureTests.java b/server/src/test/java/org/opensearch/index/ShardIndexingPressureTests.java index 5722ebdf27fb5..77593660a7d12 100644 --- a/server/src/test/java/org/opensearch/index/ShardIndexingPressureTests.java +++ b/server/src/test/java/org/opensearch/index/ShardIndexingPressureTests.java @@ -12,7 +12,7 @@ import org.opensearch.common.lease.Releasable; import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Settings; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.index.shard.ShardId; import org.opensearch.index.stats.IndexingPressurePerShardStats; import org.opensearch.index.stats.IndexingPressureStats; diff --git a/server/src/test/java/org/opensearch/index/shard/GlobalCheckpointListenersTests.java b/server/src/test/java/org/opensearch/index/shard/GlobalCheckpointListenersTests.java index 1b7bdaf710de4..aa86b4067d566 100644 --- a/server/src/test/java/org/opensearch/index/shard/GlobalCheckpointListenersTests.java +++ b/server/src/test/java/org/opensearch/index/shard/GlobalCheckpointListenersTests.java @@ -34,7 +34,7 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; -import org.opensearch.Assertions; +import org.opensearch.core.Assertions; import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.concurrent.OpenSearchExecutors; diff --git a/server/src/test/java/org/opensearch/index/shard/IndexShardOperationPermitsTests.java b/server/src/test/java/org/opensearch/index/shard/IndexShardOperationPermitsTests.java index 6e130c1938b4f..1e09ae56f0049 100644 --- a/server/src/test/java/org/opensearch/index/shard/IndexShardOperationPermitsTests.java +++ b/server/src/test/java/org/opensearch/index/shard/IndexShardOperationPermitsTests.java @@ -36,7 +36,7 @@ import org.opensearch.common.CheckedRunnable; import org.opensearch.common.lease.Releasable; import org.opensearch.common.settings.Settings; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.common.util.concurrent.OpenSearchThreadPoolExecutor; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.test.OpenSearchTestCase; diff --git a/server/src/test/java/org/opensearch/index/shard/IndexShardTests.java b/server/src/test/java/org/opensearch/index/shard/IndexShardTests.java index 9fc360e182439..563b1cf566bf4 100644 --- a/server/src/test/java/org/opensearch/index/shard/IndexShardTests.java +++ b/server/src/test/java/org/opensearch/index/shard/IndexShardTests.java @@ -49,7 +49,7 @@ import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.Constants; import org.junit.Assert; -import org.opensearch.Assertions; +import org.opensearch.core.Assertions; import org.opensearch.OpenSearchException; import org.opensearch.Version; import org.opensearch.action.ActionListener; diff --git a/server/src/test/java/org/opensearch/index/translog/LocalTranslogTests.java b/server/src/test/java/org/opensearch/index/translog/LocalTranslogTests.java index 8d19c265da052..3fb40ab64cc52 100644 --- a/server/src/test/java/org/opensearch/index/translog/LocalTranslogTests.java +++ b/server/src/test/java/org/opensearch/index/translog/LocalTranslogTests.java @@ -49,7 +49,7 @@ import org.apache.lucene.tests.store.MockDirectoryWrapper; import org.apache.lucene.tests.util.LineFileDocs; import org.apache.lucene.tests.util.LuceneTestCase; -import org.opensearch.Assertions; +import org.opensearch.core.Assertions; import org.opensearch.Version; import org.opensearch.cluster.metadata.IndexMetadata; import org.opensearch.common.Randomness; diff --git a/server/src/test/java/org/opensearch/search/DefaultSearchContextTests.java b/server/src/test/java/org/opensearch/search/DefaultSearchContextTests.java index 96a4d9ad1d8d9..d2242b7d3f07e 100644 --- a/server/src/test/java/org/opensearch/search/DefaultSearchContextTests.java +++ b/server/src/test/java/org/opensearch/search/DefaultSearchContextTests.java @@ -52,7 +52,7 @@ import org.opensearch.common.util.BigArrays; import org.opensearch.common.util.MockBigArrays; import org.opensearch.common.util.MockPageCacheRecycler; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.index.IndexService; import org.opensearch.index.IndexSettings; import org.opensearch.index.cache.IndexCache; diff --git a/server/src/test/java/org/opensearch/search/SearchServiceTests.java b/server/src/test/java/org/opensearch/search/SearchServiceTests.java index a0747d5ddff14..4540e860b23ef 100644 --- a/server/src/test/java/org/opensearch/search/SearchServiceTests.java +++ b/server/src/test/java/org/opensearch/search/SearchServiceTests.java @@ -61,7 +61,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.settings.SettingsException; import org.opensearch.common.unit.TimeValue; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.index.Index; import org.opensearch.index.IndexModule; diff --git a/server/src/test/java/org/opensearch/threadpool/FixedThreadPoolTests.java b/server/src/test/java/org/opensearch/threadpool/FixedThreadPoolTests.java index 52b4a4ce6a231..3cba803e84e68 100644 --- a/server/src/test/java/org/opensearch/threadpool/FixedThreadPoolTests.java +++ b/server/src/test/java/org/opensearch/threadpool/FixedThreadPoolTests.java @@ -34,7 +34,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.util.concurrent.OpenSearchExecutors; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.threadpool.ThreadPool.Names; import java.util.concurrent.CountDownLatch; diff --git a/server/src/test/java/org/opensearch/threadpool/ScheduleWithFixedDelayTests.java b/server/src/test/java/org/opensearch/threadpool/ScheduleWithFixedDelayTests.java index 0e5dc23bf8b5c..cfa0b7738e2ac 100644 --- a/server/src/test/java/org/opensearch/threadpool/ScheduleWithFixedDelayTests.java +++ b/server/src/test/java/org/opensearch/threadpool/ScheduleWithFixedDelayTests.java @@ -36,7 +36,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.concurrent.BaseFuture; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.node.Node; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.threadpool.Scheduler.Cancellable; diff --git a/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java b/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java index 7c074b07f5f3d..a93de8a9b4ce9 100644 --- a/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java @@ -110,7 +110,7 @@ import org.opensearch.common.unit.ByteSizeUnit; import org.opensearch.common.unit.ByteSizeValue; import org.opensearch.common.unit.TimeValue; -import org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException; +import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.ToXContent; From 8d6af8258dd34b6523b6b2995c46c707e66bc472 Mon Sep 17 00:00:00 2001 From: Nicholas Walter Knize Date: Fri, 31 Mar 2023 11:01:02 -0500 Subject: [PATCH 2/4] remove dependency on opensearch-core lib from opensearch-nio Signed-off-by: Nicholas Walter Knize --- libs/nio/build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/libs/nio/build.gradle b/libs/nio/build.gradle index a497ace80f664..1bd0c91135330 100644 --- a/libs/nio/build.gradle +++ b/libs/nio/build.gradle @@ -33,7 +33,6 @@ import org.opensearch.gradle.info.BuildParams apply plugin: 'opensearch.publish' dependencies { - api project(':libs:opensearch-core') api project(':libs:opensearch-common') testImplementation "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}" From 12d20bde1415ace4ea1f584576a5c129c903e295 Mon Sep 17 00:00:00 2001 From: Nicholas Walter Knize Date: Fri, 31 Mar 2023 14:03:26 -0500 Subject: [PATCH 3/4] remove opensearch-core dependency from ssl-config and nio libraries Signed-off-by: Nicholas Walter Knize --- .../src/main/java/org/opensearch/common/util}/net/NetUtils.java | 2 +- .../main/java/org/opensearch/common/util}/net/package-info.java | 2 +- .../java/org/opensearch/core/internal/net/NetUtilsTests.java | 1 + .../src/main/java/org/opensearch/nio/SocketChannelContext.java | 2 +- libs/ssl-config/build.gradle | 1 - .../org/opensearch/http/netty4/Netty4HttpServerTransport.java | 2 +- .../java/org/opensearch/transport/netty4/Netty4Transport.java | 2 +- .../opensearch/transport/netty4/SimpleNetty4TransportTests.java | 2 +- .../org/opensearch/transport/nio/SimpleNioTransportTests.java | 2 +- 9 files changed, 8 insertions(+), 8 deletions(-) rename libs/{core/src/main/java/org/opensearch/core/internal => common/src/main/java/org/opensearch/common/util}/net/NetUtils.java (99%) rename libs/{core/src/main/java/org/opensearch/core/internal => common/src/main/java/org/opensearch/common/util}/net/package-info.java (85%) diff --git a/libs/core/src/main/java/org/opensearch/core/internal/net/NetUtils.java b/libs/common/src/main/java/org/opensearch/common/util/net/NetUtils.java similarity index 99% rename from libs/core/src/main/java/org/opensearch/core/internal/net/NetUtils.java rename to libs/common/src/main/java/org/opensearch/common/util/net/NetUtils.java index a77efb81e5bd0..708b62c290949 100644 --- a/libs/core/src/main/java/org/opensearch/core/internal/net/NetUtils.java +++ b/libs/common/src/main/java/org/opensearch/common/util/net/NetUtils.java @@ -30,7 +30,7 @@ * GitHub history for details. */ -package org.opensearch.core.internal.net; +package org.opensearch.common.util.net; import java.io.IOException; import java.lang.reflect.Field; diff --git a/libs/core/src/main/java/org/opensearch/core/internal/net/package-info.java b/libs/common/src/main/java/org/opensearch/common/util/net/package-info.java similarity index 85% rename from libs/core/src/main/java/org/opensearch/core/internal/net/package-info.java rename to libs/common/src/main/java/org/opensearch/common/util/net/package-info.java index 2b530f88aedbf..126b0939eab32 100644 --- a/libs/core/src/main/java/org/opensearch/core/internal/net/package-info.java +++ b/libs/common/src/main/java/org/opensearch/common/util/net/package-info.java @@ -7,4 +7,4 @@ */ /** Common Network Utility Classes */ -package org.opensearch.core.internal.net; +package org.opensearch.common.util.net; diff --git a/libs/core/src/test/java/org/opensearch/core/internal/net/NetUtilsTests.java b/libs/core/src/test/java/org/opensearch/core/internal/net/NetUtilsTests.java index 448c39731def5..74c7591eae8ac 100644 --- a/libs/core/src/test/java/org/opensearch/core/internal/net/NetUtilsTests.java +++ b/libs/core/src/test/java/org/opensearch/core/internal/net/NetUtilsTests.java @@ -33,6 +33,7 @@ package org.opensearch.core.internal.net; import org.apache.lucene.util.Constants; +import org.opensearch.common.util.net.NetUtils; import org.opensearch.core.internal.io.IOUtils; import org.opensearch.test.OpenSearchTestCase; diff --git a/libs/nio/src/main/java/org/opensearch/nio/SocketChannelContext.java b/libs/nio/src/main/java/org/opensearch/nio/SocketChannelContext.java index 9cf57910a2b96..12a1e80055823 100644 --- a/libs/nio/src/main/java/org/opensearch/nio/SocketChannelContext.java +++ b/libs/nio/src/main/java/org/opensearch/nio/SocketChannelContext.java @@ -33,7 +33,7 @@ package org.opensearch.nio; import org.opensearch.common.concurrent.CompletableContext; -import org.opensearch.core.internal.net.NetUtils; +import org.opensearch.common.util.net.NetUtils; import org.opensearch.nio.utils.ByteBufferUtils; import org.opensearch.nio.utils.ExceptionsHelper; diff --git a/libs/ssl-config/build.gradle b/libs/ssl-config/build.gradle index 2ace2e03bc09d..3226ec12ff6f7 100644 --- a/libs/ssl-config/build.gradle +++ b/libs/ssl-config/build.gradle @@ -34,7 +34,6 @@ apply plugin: "opensearch.publish" dependencies { api project(':libs:opensearch-common') - api project(':libs:opensearch-core') testImplementation(project(":test:framework")) { exclude group: 'org.opensearch', module: 'opensearch-ssl-config' diff --git a/modules/transport-netty4/src/main/java/org/opensearch/http/netty4/Netty4HttpServerTransport.java b/modules/transport-netty4/src/main/java/org/opensearch/http/netty4/Netty4HttpServerTransport.java index 0e61362686959..df1d82e0d090f 100644 --- a/modules/transport-netty4/src/main/java/org/opensearch/http/netty4/Netty4HttpServerTransport.java +++ b/modules/transport-netty4/src/main/java/org/opensearch/http/netty4/Netty4HttpServerTransport.java @@ -84,7 +84,7 @@ import org.opensearch.common.util.concurrent.OpenSearchExecutors; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.internal.io.IOUtils; -import org.opensearch.core.internal.net.NetUtils; +import org.opensearch.common.util.net.NetUtils; import org.opensearch.http.AbstractHttpServerTransport; import org.opensearch.http.HttpChannel; import org.opensearch.http.HttpHandlingSettings; diff --git a/modules/transport-netty4/src/main/java/org/opensearch/transport/netty4/Netty4Transport.java b/modules/transport-netty4/src/main/java/org/opensearch/transport/netty4/Netty4Transport.java index 45bd5464485d5..444cf420e4110 100644 --- a/modules/transport-netty4/src/main/java/org/opensearch/transport/netty4/Netty4Transport.java +++ b/modules/transport-netty4/src/main/java/org/opensearch/transport/netty4/Netty4Transport.java @@ -62,7 +62,7 @@ import org.opensearch.common.unit.ByteSizeValue; import org.opensearch.common.util.PageCacheRecycler; import org.opensearch.common.util.concurrent.OpenSearchExecutors; -import org.opensearch.core.internal.net.NetUtils; +import org.opensearch.common.util.net.NetUtils; import org.opensearch.indices.breaker.CircuitBreakerService; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.Netty4NioSocketChannel; diff --git a/modules/transport-netty4/src/test/java/org/opensearch/transport/netty4/SimpleNetty4TransportTests.java b/modules/transport-netty4/src/test/java/org/opensearch/transport/netty4/SimpleNetty4TransportTests.java index 848819ee5b840..dedb540bc3e55 100644 --- a/modules/transport-netty4/src/test/java/org/opensearch/transport/netty4/SimpleNetty4TransportTests.java +++ b/modules/transport-netty4/src/test/java/org/opensearch/transport/netty4/SimpleNetty4TransportTests.java @@ -42,7 +42,7 @@ import org.opensearch.common.transport.TransportAddress; import org.opensearch.common.util.PageCacheRecycler; import org.opensearch.core.internal.io.IOUtils; -import org.opensearch.core.internal.net.NetUtils; +import org.opensearch.common.util.net.NetUtils; import org.opensearch.indices.breaker.NoneCircuitBreakerService; import org.opensearch.test.transport.MockTransportService; import org.opensearch.test.transport.StubbableTransport; diff --git a/plugins/transport-nio/src/test/java/org/opensearch/transport/nio/SimpleNioTransportTests.java b/plugins/transport-nio/src/test/java/org/opensearch/transport/nio/SimpleNioTransportTests.java index 230f89bbafe9f..5f11b97274092 100644 --- a/plugins/transport-nio/src/test/java/org/opensearch/transport/nio/SimpleNioTransportTests.java +++ b/plugins/transport-nio/src/test/java/org/opensearch/transport/nio/SimpleNioTransportTests.java @@ -42,7 +42,7 @@ import org.opensearch.common.transport.TransportAddress; import org.opensearch.common.util.MockPageCacheRecycler; import org.opensearch.core.internal.io.IOUtils; -import org.opensearch.core.internal.net.NetUtils; +import org.opensearch.common.util.net.NetUtils; import org.opensearch.indices.breaker.NoneCircuitBreakerService; import org.opensearch.test.transport.MockTransportService; import org.opensearch.test.transport.StubbableTransport; From 138b52855c1e599d28630fe5533353c62338a93e Mon Sep 17 00:00:00 2001 From: Nicholas Walter Knize Date: Fri, 31 Mar 2023 15:49:12 -0500 Subject: [PATCH 4/4] remove opensearch-cli dependency on opensearch-core Signed-off-by: Nicholas Walter Knize --- .../client/OpenSearchRestHighLevelClientTestCase.java | 2 +- .../java/org/opensearch/bootstrap/BootstrapTests.java | 2 +- .../common/settings/KeyStoreCommandTestCase.java | 2 +- .../common/settings/KeyStoreWrapperTests.java | 2 +- .../org/opensearch/plugins/InstallPluginCommand.java | 2 +- .../main/java/org/opensearch/plugins/PluginCli.java | 2 +- .../org/opensearch/plugins/RemovePluginCommand.java | 2 +- .../java/org/opensearch/upgrade/UpgradeCliTests.java | 2 +- libs/cli/build.gradle | 1 - .../src/main/java/org/opensearch/cli/MultiCommand.java | 2 +- .../java/org/opensearch/common/util}/io/IOUtils.java | 2 +- .../java/org/opensearch/common/util}/io/Streams.java | 2 +- .../org/opensearch/common/util}/io/package-info.java | 4 ++-- .../org/opensearch/core/internal/package-info.java | 10 ---------- .../org/opensearch/core/internal/io/IOUtilsTests.java | 1 + .../org/opensearch/core/internal/io/StreamsTests.java | 1 + .../opensearch/core/internal/net/NetUtilsTests.java | 2 +- .../java/org/opensearch/nio/ChannelFactoryTests.java | 2 +- .../common/xcontent/json/JsonXContentGenerator.java | 2 +- .../common/xcontent/json/JsonXContentParser.java | 2 +- .../ingest/geoip/DatabaseReaderLazyLoader.java | 2 +- .../ingest/geoip/IngestGeoIpModulePlugin.java | 2 +- .../org/opensearch/painless/ContextDocGenerator.java | 2 +- .../index/mapper/ScaledFloatFieldTypeTests.java | 2 +- .../http/netty4/Netty4HttpServerTransport.java | 2 +- .../transport/netty4/SimpleNetty4TransportTests.java | 2 +- .../org/opensearch/discovery/ec2/Ec2NameResolver.java | 2 +- .../discovery/ec2/AbstractEC2MockAPITestCase.java | 2 +- .../plugin/discovery/gce/GceDiscoveryPlugin.java | 2 +- .../repositories/gcs/GoogleCloudStorageBlobStore.java | 2 +- .../gcs/GoogleCloudStorageRetryingInputStream.java | 2 +- .../repositories/s3/S3RetryingInputStream.java | 2 +- .../repositories/s3/S3BlobContainerRetriesTests.java | 2 +- .../opensearch/transport/nio/TcpReadWriteHandler.java | 2 +- .../java/org/opensearch/http/nio/NioHttpClient.java | 2 +- .../transport/nio/SimpleNioTransportTests.java | 2 +- .../src/test/java/org/opensearch/search/CCSDuelIT.java | 2 +- .../opensearch/packaging/test/PackagingTestCase.java | 2 +- .../java/org/opensearch/packaging/util/FileUtils.java | 2 +- .../test/AbstractMultiClusterRemoteTestCase.java | 2 +- .../search/profile/query/QueryProfilerTests.java | 2 +- .../cluster/allocation/ClusterRerouteIT.java | 2 +- .../opensearch/cluster/shards/ClusterShardLimitIT.java | 2 +- .../java/org/opensearch/index/shard/IndexShardIT.java | 2 +- .../repositories/fs/FsBlobStoreRepositoryIT.java | 2 +- .../java/org/opensearch/search/geo/GeoFilterIT.java | 2 +- .../snapshots/CorruptedBlobStoreRepositoryIT.java | 2 +- .../opensearch/snapshots/MultiClusterRepoAccessIT.java | 2 +- .../org/opensearch/snapshots/SnapshotStatusApisIT.java | 2 +- .../admin/indices/analyze/TransportAnalyzeAction.java | 2 +- .../main/java/org/opensearch/bootstrap/Bootstrap.java | 2 +- .../main/java/org/opensearch/bootstrap/Spawner.java | 2 +- .../org/opensearch/bootstrap/SystemCallFilter.java | 2 +- .../coordination/PublicationTransportHandler.java | 2 +- .../cluster/metadata/MetadataMappingService.java | 2 +- .../common/blobstore/fs/FsBlobContainer.java | 4 ++-- .../common/bytes/RecyclingBytesStreamOutput.java | 2 +- .../java/org/opensearch/common/io/FileSystemUtils.java | 2 +- .../main/java/org/opensearch/common/io/Streams.java | 4 ++-- .../java/org/opensearch/common/lease/Releasables.java | 2 +- .../opensearch/common/network/CloseableChannel.java | 2 +- .../java/org/opensearch/common/settings/Settings.java | 3 +-- .../HandshakingTransportAddressConnector.java | 2 +- .../main/java/org/opensearch/env/NodeEnvironment.java | 2 +- .../java/org/opensearch/env/NodeRepurposeCommand.java | 2 +- .../java/org/opensearch/gateway/GatewayMetaState.java | 2 +- .../org/opensearch/gateway/MetadataStateFormat.java | 2 +- .../gateway/PersistedClusterStateService.java | 2 +- .../main/java/org/opensearch/index/IndexModule.java | 2 +- .../main/java/org/opensearch/index/IndexService.java | 2 +- .../opensearch/index/analysis/AnalysisRegistry.java | 2 +- .../org/opensearch/index/analysis/IndexAnalyzers.java | 2 +- .../analysis/PreBuiltAnalyzerProviderFactory.java | 2 +- .../java/org/opensearch/index/cache/IndexCache.java | 2 +- .../org/opensearch/index/engine/InternalEngine.java | 2 +- .../opensearch/index/engine/LuceneChangesSnapshot.java | 2 +- .../opensearch/index/engine/NRTReplicationEngine.java | 2 +- .../org/opensearch/index/engine/ReadOnlyEngine.java | 2 +- .../index/search/QueryStringQueryParser.java | 2 +- .../java/org/opensearch/index/shard/IndexShard.java | 2 +- .../index/shard/IndexShardOperationPermits.java | 2 +- .../opensearch/index/shard/PrimaryReplicaSyncer.java | 2 +- .../java/org/opensearch/index/shard/ShardPath.java | 2 +- .../index/snapshots/blobstore/SlicedInputStream.java | 2 +- .../org/opensearch/index/store/FsDirectoryFactory.java | 2 +- .../main/java/org/opensearch/index/store/Store.java | 2 +- .../index/translog/InternalTranslogManager.java | 2 +- .../org/opensearch/index/translog/LocalTranslog.java | 2 +- .../opensearch/index/translog/RemoteFsTranslog.java | 2 +- .../java/org/opensearch/index/translog/Translog.java | 2 +- .../org/opensearch/index/translog/TranslogReader.java | 2 +- .../org/opensearch/index/translog/TranslogWriter.java | 2 +- .../index/translog/TruncateTranslogAction.java | 2 +- .../index/translog/transfer/FileSnapshot.java | 2 +- .../java/org/opensearch/indices/IndicesService.java | 2 +- .../opensearch/indices/analysis/HunspellService.java | 2 +- .../indices/recovery/MultiChunkTransfer.java | 2 +- .../indices/recovery/RecoverySourceHandler.java | 2 +- .../replication/SegmentFileTransferHandler.java | 2 +- .../replication/SegmentReplicationSourceHandler.java | 2 +- .../org/opensearch/monitor/fs/FsHealthService.java | 2 +- server/src/main/java/org/opensearch/node/Node.java | 2 +- .../src/main/java/org/opensearch/node/NodeService.java | 2 +- .../java/org/opensearch/plugins/PluginSecurity.java | 2 +- .../opensearch/repositories/RepositoriesService.java | 2 +- .../main/java/org/opensearch/rest/RestController.java | 2 +- .../main/java/org/opensearch/script/ScriptService.java | 2 +- .../main/java/org/opensearch/search/SearchService.java | 2 +- .../suggest/phrase/DirectCandidateGenerator.java | 2 +- .../opensearch/snapshots/SnapshotShardsService.java | 2 +- .../java/org/opensearch/tasks/TaskResultsService.java | 2 +- .../opensearch/transport/ClusterConnectionManager.java | 2 +- .../transport/CompressibleBytesOutputStream.java | 2 +- .../java/org/opensearch/transport/InboundDecoder.java | 2 +- .../java/org/opensearch/transport/InboundMessage.java | 2 +- .../java/org/opensearch/transport/OutboundHandler.java | 2 +- .../opensearch/transport/RemoteClusterConnection.java | 2 +- .../org/opensearch/transport/RemoteClusterService.java | 2 +- .../opensearch/transport/SniffConnectionStrategy.java | 2 +- .../java/org/opensearch/transport/TransportLogger.java | 2 +- .../org/opensearch/transport/TransportService.java | 2 +- .../support/replication/BroadcastReplicationTests.java | 2 +- .../cluster/routing/OperationRoutingTests.java | 2 +- .../common/blobstore/fs/FsBlobContainerTests.java | 2 +- .../java/org/opensearch/common/io/StreamsTests.java | 2 +- .../java/org/opensearch/common/lucene/LuceneTests.java | 2 +- .../common/lucene/index/FreqTermsEnumTests.java | 2 +- .../lucene/index/OpenSearchDirectoryReaderTests.java | 2 +- .../common/util/concurrent/AbstractAsyncTaskTests.java | 2 +- .../org/opensearch/discovery/DiscoveryModuleTests.java | 2 +- .../opensearch/discovery/SeedHostsResolverTests.java | 2 +- .../java/org/opensearch/env/NodeEnvironmentTests.java | 2 +- .../gateway/GatewayMetaStatePersistedStateTests.java | 2 +- .../gateway/PersistedClusterStateServiceTests.java | 2 +- .../java/org/opensearch/index/IndexModuleTests.java | 2 +- .../index/cache/bitset/BitSetFilterCacheTests.java | 2 +- .../index/engine/CompletionStatsCacheTests.java | 2 +- .../opensearch/index/engine/InternalEngineTests.java | 2 +- .../index/engine/LuceneChangesSnapshotTests.java | 2 +- .../org/opensearch/index/engine/NoOpEngineTests.java | 2 +- .../opensearch/index/engine/ReadOnlyEngineTests.java | 2 +- .../index/fielddata/plain/HalfFloatFielddataTests.java | 2 +- .../opensearch/index/mapper/DateFieldTypeTests.java | 2 +- .../opensearch/index/mapper/NumberFieldTypeTests.java | 2 +- .../index/seqno/GlobalCheckpointSyncActionTests.java | 2 +- .../seqno/RetentionLeaseBackgroundSyncActionTests.java | 2 +- .../index/seqno/RetentionLeaseSyncActionTests.java | 2 +- .../index/shard/IndexReaderWrapperTests.java | 2 +- .../opensearch/index/shard/RefreshListenersTests.java | 2 +- .../org/opensearch/index/shard/ShardUtilsTests.java | 2 +- .../org/opensearch/index/shard/StoreRecoveryTests.java | 2 +- .../java/org/opensearch/index/store/StoreTests.java | 2 +- .../opensearch/index/translog/LocalTranslogTests.java | 2 +- .../index/translog/RemoteFSTranslogTests.java | 2 +- .../org/opensearch/index/translog/TestTranslog.java | 2 +- .../index/translog/TranslogDeletionPolicyTests.java | 2 +- .../index/translog/TranslogManagerTestCase.java | 2 +- .../org/opensearch/indices/IndicesQueryCacheTests.java | 2 +- .../opensearch/indices/IndicesRequestCacheTests.java | 2 +- .../LocalStorePeerRecoverySourceHandlerTests.java | 2 +- .../recovery/PeerRecoveryTargetServiceTests.java | 2 +- .../PrimaryShardReplicationSourceTests.java | 2 +- .../replication/SegmentFileTransferHandlerTests.java | 2 +- .../checkpoint/PublishCheckpointActionTests.java | 2 +- .../blobstore/BlobStoreRepositoryRestoreTests.java | 2 +- .../java/org/opensearch/rest/RestControllerTests.java | 2 +- .../org/opensearch/search/SearchCancellationTests.java | 2 +- .../search/internal/ContextIndexSearcherTests.java | 2 +- .../search/profile/query/QueryProfilerTests.java | 2 +- .../org/opensearch/transport/InboundPipelineTests.java | 2 +- .../org/opensearch/transport/OutboundHandlerTests.java | 2 +- .../transport/RemoteClusterConnectionTests.java | 2 +- .../transport/RemoteClusterServiceTests.java | 2 +- .../transport/TransportActionProxyTests.java | 2 +- .../java/org/opensearch/watcher/FileWatcherTests.java | 2 +- .../org/opensearch/index/engine/EngineTestCase.java | 2 +- .../org/opensearch/index/shard/IndexShardTestCase.java | 2 +- .../org/opensearch/test/AbstractBuilderTestCase.java | 2 +- .../opensearch/test/AbstractMultiClustersTestCase.java | 2 +- .../java/org/opensearch/test/InternalTestCluster.java | 2 +- .../org/opensearch/test/OpenSearchIntegTestCase.java | 2 +- .../opensearch/test/OpenSearchSingleNodeTestCase.java | 2 +- .../main/java/org/opensearch/test/StreamsUtils.java | 2 +- .../opensearch/test/rest/OpenSearchRestTestCase.java | 2 +- .../rest/yaml/OpenSearchClientYamlSuiteTestCase.java | 2 +- .../test/transport/MockTransportService.java | 2 +- .../transport/AbstractSimpleTransportTestCase.java | 2 +- .../org/opensearch/transport/nio/MockNioTransport.java | 2 +- .../opensearch/test/test/InternalTestClusterTests.java | 2 +- 189 files changed, 190 insertions(+), 200 deletions(-) rename libs/{core/src/main/java/org/opensearch/core/internal => common/src/main/java/org/opensearch/common/util}/io/IOUtils.java (99%) rename libs/{core/src/main/java/org/opensearch/core/internal => common/src/main/java/org/opensearch/common/util}/io/Streams.java (98%) rename libs/{core/src/main/java/org/opensearch/core/internal => common/src/main/java/org/opensearch/common/util}/io/package-info.java (71%) delete mode 100644 libs/core/src/main/java/org/opensearch/core/internal/package-info.java diff --git a/client/rest-high-level/src/test/java/org/opensearch/client/OpenSearchRestHighLevelClientTestCase.java b/client/rest-high-level/src/test/java/org/opensearch/client/OpenSearchRestHighLevelClientTestCase.java index bd143c4a8aef7..c1e2420d86d20 100644 --- a/client/rest-high-level/src/test/java/org/opensearch/client/OpenSearchRestHighLevelClientTestCase.java +++ b/client/rest-high-level/src/test/java/org/opensearch/client/OpenSearchRestHighLevelClientTestCase.java @@ -55,7 +55,7 @@ import org.opensearch.common.xcontent.XContentHelper; import org.opensearch.common.xcontent.XContentType; import org.opensearch.common.xcontent.json.JsonXContent; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.ingest.Pipeline; import org.opensearch.search.SearchHit; import org.opensearch.search.SearchModule; diff --git a/distribution/tools/keystore-cli/src/test/java/org/opensearch/bootstrap/BootstrapTests.java b/distribution/tools/keystore-cli/src/test/java/org/opensearch/bootstrap/BootstrapTests.java index 58beba16820c6..936fd032f36de 100644 --- a/distribution/tools/keystore-cli/src/test/java/org/opensearch/bootstrap/BootstrapTests.java +++ b/distribution/tools/keystore-cli/src/test/java/org/opensearch/bootstrap/BootstrapTests.java @@ -31,7 +31,7 @@ package org.opensearch.bootstrap; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.common.settings.KeyStoreCommandTestCase; import org.opensearch.common.settings.KeyStoreWrapper; import org.opensearch.common.settings.SecureSettings; diff --git a/distribution/tools/keystore-cli/src/test/java/org/opensearch/common/settings/KeyStoreCommandTestCase.java b/distribution/tools/keystore-cli/src/test/java/org/opensearch/common/settings/KeyStoreCommandTestCase.java index 32618923498ff..b87d08bb08399 100644 --- a/distribution/tools/keystore-cli/src/test/java/org/opensearch/common/settings/KeyStoreCommandTestCase.java +++ b/distribution/tools/keystore-cli/src/test/java/org/opensearch/common/settings/KeyStoreCommandTestCase.java @@ -42,7 +42,7 @@ import com.google.common.jimfs.Configuration; import com.google.common.jimfs.Jimfs; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.apache.lucene.tests.util.LuceneTestCase; import org.opensearch.cli.CommandTestCase; import org.opensearch.common.io.PathUtilsForTesting; diff --git a/distribution/tools/keystore-cli/src/test/java/org/opensearch/common/settings/KeyStoreWrapperTests.java b/distribution/tools/keystore-cli/src/test/java/org/opensearch/common/settings/KeyStoreWrapperTests.java index 70046c567b00e..7a0e286d2d961 100644 --- a/distribution/tools/keystore-cli/src/test/java/org/opensearch/common/settings/KeyStoreWrapperTests.java +++ b/distribution/tools/keystore-cli/src/test/java/org/opensearch/common/settings/KeyStoreWrapperTests.java @@ -39,7 +39,7 @@ import org.apache.lucene.store.IndexOutput; import org.apache.lucene.store.NIOFSDirectory; import org.opensearch.common.Randomness; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.Environment; import org.opensearch.test.OpenSearchTestCase; import org.hamcrest.Matchers; diff --git a/distribution/tools/plugin-cli/src/main/java/org/opensearch/plugins/InstallPluginCommand.java b/distribution/tools/plugin-cli/src/main/java/org/opensearch/plugins/InstallPluginCommand.java index 5bf0bc7763ddd..5a93165b1d992 100644 --- a/distribution/tools/plugin-cli/src/main/java/org/opensearch/plugins/InstallPluginCommand.java +++ b/distribution/tools/plugin-cli/src/main/java/org/opensearch/plugins/InstallPluginCommand.java @@ -58,7 +58,7 @@ import org.opensearch.common.SuppressForbidden; import org.opensearch.common.collect.Tuple; import org.opensearch.common.hash.MessageDigests; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.Environment; import java.io.BufferedReader; diff --git a/distribution/tools/plugin-cli/src/main/java/org/opensearch/plugins/PluginCli.java b/distribution/tools/plugin-cli/src/main/java/org/opensearch/plugins/PluginCli.java index 9b06235e87e86..3ea8e539cdd5c 100644 --- a/distribution/tools/plugin-cli/src/main/java/org/opensearch/plugins/PluginCli.java +++ b/distribution/tools/plugin-cli/src/main/java/org/opensearch/plugins/PluginCli.java @@ -32,7 +32,7 @@ package org.opensearch.plugins; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.cli.Command; import org.opensearch.cli.LoggingAwareMultiCommand; import org.opensearch.cli.Terminal; diff --git a/distribution/tools/plugin-cli/src/main/java/org/opensearch/plugins/RemovePluginCommand.java b/distribution/tools/plugin-cli/src/main/java/org/opensearch/plugins/RemovePluginCommand.java index 809c8172bae1c..4ac99c816717a 100644 --- a/distribution/tools/plugin-cli/src/main/java/org/opensearch/plugins/RemovePluginCommand.java +++ b/distribution/tools/plugin-cli/src/main/java/org/opensearch/plugins/RemovePluginCommand.java @@ -38,7 +38,7 @@ import org.opensearch.cli.ExitCodes; import org.opensearch.cli.Terminal; import org.opensearch.cli.UserException; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.Environment; import java.io.IOException; diff --git a/distribution/tools/upgrade-cli/src/test/java/org/opensearch/upgrade/UpgradeCliTests.java b/distribution/tools/upgrade-cli/src/test/java/org/opensearch/upgrade/UpgradeCliTests.java index 39fa2cef24bb1..ee871e1d89001 100644 --- a/distribution/tools/upgrade-cli/src/test/java/org/opensearch/upgrade/UpgradeCliTests.java +++ b/distribution/tools/upgrade-cli/src/test/java/org/opensearch/upgrade/UpgradeCliTests.java @@ -18,7 +18,7 @@ import org.opensearch.common.io.PathUtilsForTesting; import org.opensearch.common.settings.KeyStoreWrapper; import org.opensearch.common.settings.Settings; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.Environment; import org.opensearch.env.TestEnvironment; diff --git a/libs/cli/build.gradle b/libs/cli/build.gradle index 2ce9cc86cf69a..802bd7a774af7 100644 --- a/libs/cli/build.gradle +++ b/libs/cli/build.gradle @@ -34,7 +34,6 @@ apply plugin: 'opensearch.publish' dependencies { api 'net.sf.jopt-simple:jopt-simple:5.0.4' api project(':libs:opensearch-common') - api project(':libs:opensearch-core') } test.enabled = false diff --git a/libs/cli/src/main/java/org/opensearch/cli/MultiCommand.java b/libs/cli/src/main/java/org/opensearch/cli/MultiCommand.java index 1bdcd6189c757..837a93ea95f83 100644 --- a/libs/cli/src/main/java/org/opensearch/cli/MultiCommand.java +++ b/libs/cli/src/main/java/org/opensearch/cli/MultiCommand.java @@ -36,7 +36,7 @@ import joptsimple.OptionSet; import joptsimple.OptionSpec; import joptsimple.util.KeyValuePair; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import java.io.IOException; import java.util.ArrayList; diff --git a/libs/core/src/main/java/org/opensearch/core/internal/io/IOUtils.java b/libs/common/src/main/java/org/opensearch/common/util/io/IOUtils.java similarity index 99% rename from libs/core/src/main/java/org/opensearch/core/internal/io/IOUtils.java rename to libs/common/src/main/java/org/opensearch/common/util/io/IOUtils.java index 25494ca440ef4..6b72a0f92c14d 100644 --- a/libs/core/src/main/java/org/opensearch/core/internal/io/IOUtils.java +++ b/libs/common/src/main/java/org/opensearch/common/util/io/IOUtils.java @@ -30,7 +30,7 @@ * GitHub history for details. */ -package org.opensearch.core.internal.io; +package org.opensearch.common.util.io; import org.opensearch.common.Nullable; diff --git a/libs/core/src/main/java/org/opensearch/core/internal/io/Streams.java b/libs/common/src/main/java/org/opensearch/common/util/io/Streams.java similarity index 98% rename from libs/core/src/main/java/org/opensearch/core/internal/io/Streams.java rename to libs/common/src/main/java/org/opensearch/common/util/io/Streams.java index a54e23f18d1a5..96672a3be3dc1 100644 --- a/libs/core/src/main/java/org/opensearch/core/internal/io/Streams.java +++ b/libs/common/src/main/java/org/opensearch/common/util/io/Streams.java @@ -30,7 +30,7 @@ * GitHub history for details. */ -package org.opensearch.core.internal.io; +package org.opensearch.common.util.io; import java.io.IOException; import java.io.InputStream; diff --git a/libs/core/src/main/java/org/opensearch/core/internal/io/package-info.java b/libs/common/src/main/java/org/opensearch/common/util/io/package-info.java similarity index 71% rename from libs/core/src/main/java/org/opensearch/core/internal/io/package-info.java rename to libs/common/src/main/java/org/opensearch/common/util/io/package-info.java index 6bcb414ab584e..5789028538a48 100644 --- a/libs/core/src/main/java/org/opensearch/core/internal/io/package-info.java +++ b/libs/common/src/main/java/org/opensearch/common/util/io/package-info.java @@ -6,5 +6,5 @@ * compatible open source license. */ -/** Common internal I/O classes */ -package org.opensearch.core.internal.io; +/** Common internal I/O utility classes */ +package org.opensearch.common.util.io; diff --git a/libs/core/src/main/java/org/opensearch/core/internal/package-info.java b/libs/core/src/main/java/org/opensearch/core/internal/package-info.java deleted file mode 100644 index c39e17c401a1c..0000000000000 --- a/libs/core/src/main/java/org/opensearch/core/internal/package-info.java +++ /dev/null @@ -1,10 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/** Common internal core classes */ -package org.opensearch.core.internal; diff --git a/libs/core/src/test/java/org/opensearch/core/internal/io/IOUtilsTests.java b/libs/core/src/test/java/org/opensearch/core/internal/io/IOUtilsTests.java index e1f3cb7520a7e..cd7a40b655579 100644 --- a/libs/core/src/test/java/org/opensearch/core/internal/io/IOUtilsTests.java +++ b/libs/core/src/test/java/org/opensearch/core/internal/io/IOUtilsTests.java @@ -35,6 +35,7 @@ import org.apache.lucene.util.Constants; import org.opensearch.common.CheckedConsumer; import org.opensearch.common.io.PathUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.test.OpenSearchTestCase; import java.io.Closeable; diff --git a/libs/core/src/test/java/org/opensearch/core/internal/io/StreamsTests.java b/libs/core/src/test/java/org/opensearch/core/internal/io/StreamsTests.java index b489a9a018ae5..2ba18221cbe4f 100644 --- a/libs/core/src/test/java/org/opensearch/core/internal/io/StreamsTests.java +++ b/libs/core/src/test/java/org/opensearch/core/internal/io/StreamsTests.java @@ -32,6 +32,7 @@ package org.opensearch.core.internal.io; +import org.opensearch.common.util.io.Streams; import org.opensearch.test.OpenSearchTestCase; import java.io.ByteArrayInputStream; diff --git a/libs/core/src/test/java/org/opensearch/core/internal/net/NetUtilsTests.java b/libs/core/src/test/java/org/opensearch/core/internal/net/NetUtilsTests.java index 74c7591eae8ac..c97b74ee0d624 100644 --- a/libs/core/src/test/java/org/opensearch/core/internal/net/NetUtilsTests.java +++ b/libs/core/src/test/java/org/opensearch/core/internal/net/NetUtilsTests.java @@ -34,7 +34,7 @@ import org.apache.lucene.util.Constants; import org.opensearch.common.util.net.NetUtils; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.test.OpenSearchTestCase; import java.lang.Runtime.Version; diff --git a/libs/nio/src/test/java/org/opensearch/nio/ChannelFactoryTests.java b/libs/nio/src/test/java/org/opensearch/nio/ChannelFactoryTests.java index ba212de7941e5..0e4ec4a1b3bc5 100644 --- a/libs/nio/src/test/java/org/opensearch/nio/ChannelFactoryTests.java +++ b/libs/nio/src/test/java/org/opensearch/nio/ChannelFactoryTests.java @@ -32,7 +32,7 @@ package org.opensearch.nio; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.test.OpenSearchTestCase; import org.junit.After; import org.junit.Before; diff --git a/libs/x-content/src/main/java/org/opensearch/common/xcontent/json/JsonXContentGenerator.java b/libs/x-content/src/main/java/org/opensearch/common/xcontent/json/JsonXContentGenerator.java index d538c20b5767f..9164b5216f9a5 100644 --- a/libs/x-content/src/main/java/org/opensearch/common/xcontent/json/JsonXContentGenerator.java +++ b/libs/x-content/src/main/java/org/opensearch/common/xcontent/json/JsonXContentGenerator.java @@ -50,7 +50,7 @@ import org.opensearch.core.xcontent.XContentParser; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.xcontent.filtering.FilterPathBasedFilter; -import org.opensearch.core.internal.io.Streams; +import org.opensearch.common.util.io.Streams; import java.io.BufferedInputStream; import java.io.IOException; diff --git a/libs/x-content/src/main/java/org/opensearch/common/xcontent/json/JsonXContentParser.java b/libs/x-content/src/main/java/org/opensearch/common/xcontent/json/JsonXContentParser.java index 8ff212893da87..d11b5630b6656 100644 --- a/libs/x-content/src/main/java/org/opensearch/common/xcontent/json/JsonXContentParser.java +++ b/libs/x-content/src/main/java/org/opensearch/common/xcontent/json/JsonXContentParser.java @@ -40,7 +40,7 @@ import org.opensearch.core.xcontent.XContentLocation; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.xcontent.AbstractXContentParser; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import java.io.IOException; import java.nio.CharBuffer; diff --git a/modules/ingest-geoip/src/main/java/org/opensearch/ingest/geoip/DatabaseReaderLazyLoader.java b/modules/ingest-geoip/src/main/java/org/opensearch/ingest/geoip/DatabaseReaderLazyLoader.java index 44b03744b6685..05a969daf3836 100644 --- a/modules/ingest-geoip/src/main/java/org/opensearch/ingest/geoip/DatabaseReaderLazyLoader.java +++ b/modules/ingest-geoip/src/main/java/org/opensearch/ingest/geoip/DatabaseReaderLazyLoader.java @@ -37,7 +37,7 @@ import org.apache.logging.log4j.Logger; import org.opensearch.common.CheckedSupplier; import org.opensearch.common.SetOnce; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import java.io.Closeable; import java.io.IOException; diff --git a/modules/ingest-geoip/src/main/java/org/opensearch/ingest/geoip/IngestGeoIpModulePlugin.java b/modules/ingest-geoip/src/main/java/org/opensearch/ingest/geoip/IngestGeoIpModulePlugin.java index 7869e4a7de7fc..491f55147ef24 100644 --- a/modules/ingest-geoip/src/main/java/org/opensearch/ingest/geoip/IngestGeoIpModulePlugin.java +++ b/modules/ingest-geoip/src/main/java/org/opensearch/ingest/geoip/IngestGeoIpModulePlugin.java @@ -43,7 +43,7 @@ import org.opensearch.common.cache.CacheBuilder; import org.opensearch.common.io.PathUtils; import org.opensearch.common.settings.Setting; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.ingest.Processor; import org.opensearch.plugins.IngestPlugin; import org.opensearch.plugins.Plugin; diff --git a/modules/lang-painless/src/doc/java/org/opensearch/painless/ContextDocGenerator.java b/modules/lang-painless/src/doc/java/org/opensearch/painless/ContextDocGenerator.java index 64e9a57917e3f..3fca92a216b26 100644 --- a/modules/lang-painless/src/doc/java/org/opensearch/painless/ContextDocGenerator.java +++ b/modules/lang-painless/src/doc/java/org/opensearch/painless/ContextDocGenerator.java @@ -36,7 +36,7 @@ import org.opensearch.common.io.PathUtils; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.common.xcontent.json.JsonXContent; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.painless.action.PainlessContextClassBindingInfo; import org.opensearch.painless.action.PainlessContextClassInfo; import org.opensearch.painless.action.PainlessContextConstructorInfo; diff --git a/modules/mapper-extras/src/test/java/org/opensearch/index/mapper/ScaledFloatFieldTypeTests.java b/modules/mapper-extras/src/test/java/org/opensearch/index/mapper/ScaledFloatFieldTypeTests.java index 0baf3db32a4d8..be12c49321b87 100644 --- a/modules/mapper-extras/src/test/java/org/opensearch/index/mapper/ScaledFloatFieldTypeTests.java +++ b/modules/mapper-extras/src/test/java/org/opensearch/index/mapper/ScaledFloatFieldTypeTests.java @@ -45,7 +45,7 @@ import org.opensearch.Version; import org.opensearch.cluster.metadata.IndexMetadata; import org.opensearch.common.settings.Settings; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.fielddata.IndexNumericFieldData; import org.opensearch.index.fielddata.LeafNumericFieldData; import org.opensearch.index.fielddata.SortedNumericDoubleValues; diff --git a/modules/transport-netty4/src/main/java/org/opensearch/http/netty4/Netty4HttpServerTransport.java b/modules/transport-netty4/src/main/java/org/opensearch/http/netty4/Netty4HttpServerTransport.java index df1d82e0d090f..2074279a99f79 100644 --- a/modules/transport-netty4/src/main/java/org/opensearch/http/netty4/Netty4HttpServerTransport.java +++ b/modules/transport-netty4/src/main/java/org/opensearch/http/netty4/Netty4HttpServerTransport.java @@ -83,7 +83,7 @@ import org.opensearch.common.util.BigArrays; import org.opensearch.common.util.concurrent.OpenSearchExecutors; import org.opensearch.core.xcontent.NamedXContentRegistry; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.common.util.net.NetUtils; import org.opensearch.http.AbstractHttpServerTransport; import org.opensearch.http.HttpChannel; diff --git a/modules/transport-netty4/src/test/java/org/opensearch/transport/netty4/SimpleNetty4TransportTests.java b/modules/transport-netty4/src/test/java/org/opensearch/transport/netty4/SimpleNetty4TransportTests.java index dedb540bc3e55..2546e2fba8c58 100644 --- a/modules/transport-netty4/src/test/java/org/opensearch/transport/netty4/SimpleNetty4TransportTests.java +++ b/modules/transport-netty4/src/test/java/org/opensearch/transport/netty4/SimpleNetty4TransportTests.java @@ -41,7 +41,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.transport.TransportAddress; import org.opensearch.common.util.PageCacheRecycler; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.common.util.net.NetUtils; import org.opensearch.indices.breaker.NoneCircuitBreakerService; import org.opensearch.test.transport.MockTransportService; diff --git a/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/Ec2NameResolver.java b/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/Ec2NameResolver.java index 9fa479e90c956..093ea1eef3ab3 100644 --- a/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/Ec2NameResolver.java +++ b/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/Ec2NameResolver.java @@ -38,7 +38,7 @@ import org.apache.logging.log4j.Logger; import org.opensearch.common.SuppressForbidden; import org.opensearch.common.network.NetworkService.CustomNameResolver; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import java.io.BufferedReader; import java.io.IOException; diff --git a/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/AbstractEC2MockAPITestCase.java b/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/AbstractEC2MockAPITestCase.java index 51b48a8a45f21..3256a01838169 100644 --- a/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/AbstractEC2MockAPITestCase.java +++ b/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/AbstractEC2MockAPITestCase.java @@ -39,7 +39,7 @@ import org.opensearch.common.network.NetworkService; import org.opensearch.common.settings.MockSecureSettings; import org.opensearch.common.settings.Settings; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.transport.MockTransportService; import org.opensearch.threadpool.TestThreadPool; diff --git a/plugins/discovery-gce/src/main/java/org/opensearch/plugin/discovery/gce/GceDiscoveryPlugin.java b/plugins/discovery-gce/src/main/java/org/opensearch/plugin/discovery/gce/GceDiscoveryPlugin.java index 282361c893689..d4df6d94c061b 100644 --- a/plugins/discovery-gce/src/main/java/org/opensearch/plugin/discovery/gce/GceDiscoveryPlugin.java +++ b/plugins/discovery-gce/src/main/java/org/opensearch/plugin/discovery/gce/GceDiscoveryPlugin.java @@ -46,7 +46,7 @@ import org.opensearch.common.network.NetworkService; import org.opensearch.common.settings.Setting; import org.opensearch.common.settings.Settings; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.discovery.SeedHostsProvider; import org.opensearch.discovery.gce.GceSeedHostsProvider; import org.opensearch.plugins.DiscoveryPlugin; diff --git a/plugins/repository-gcs/src/main/java/org/opensearch/repositories/gcs/GoogleCloudStorageBlobStore.java b/plugins/repository-gcs/src/main/java/org/opensearch/repositories/gcs/GoogleCloudStorageBlobStore.java index cd6eb5357ea97..226aec437fc0f 100644 --- a/plugins/repository-gcs/src/main/java/org/opensearch/repositories/gcs/GoogleCloudStorageBlobStore.java +++ b/plugins/repository-gcs/src/main/java/org/opensearch/repositories/gcs/GoogleCloudStorageBlobStore.java @@ -295,7 +295,7 @@ private void writeBlobResumable(BlobInfo blobInfo, InputStream inputStream, long * It is not enough to wrap the call to Streams#copy, we have to wrap the privileged calls too; this is because Streams#copy * is in the stacktrace and is not granted the permissions needed to close and write the channel. */ - org.opensearch.core.internal.io.Streams.copy(inputStream, Channels.newOutputStream(new WritableByteChannel() { + org.opensearch.common.util.io.Streams.copy(inputStream, Channels.newOutputStream(new WritableByteChannel() { @SuppressForbidden(reason = "channel is based on a socket") @Override diff --git a/plugins/repository-gcs/src/main/java/org/opensearch/repositories/gcs/GoogleCloudStorageRetryingInputStream.java b/plugins/repository-gcs/src/main/java/org/opensearch/repositories/gcs/GoogleCloudStorageRetryingInputStream.java index 5448799e7f81b..e15b37f209c5f 100644 --- a/plugins/repository-gcs/src/main/java/org/opensearch/repositories/gcs/GoogleCloudStorageRetryingInputStream.java +++ b/plugins/repository-gcs/src/main/java/org/opensearch/repositories/gcs/GoogleCloudStorageRetryingInputStream.java @@ -44,7 +44,7 @@ import org.apache.logging.log4j.message.ParameterizedMessage; import org.opensearch.SpecialPermission; import org.opensearch.common.SuppressForbidden; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import java.io.FilterInputStream; import java.io.IOException; diff --git a/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3RetryingInputStream.java b/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3RetryingInputStream.java index f751d63232f79..477b5ab9cceeb 100644 --- a/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3RetryingInputStream.java +++ b/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3RetryingInputStream.java @@ -40,7 +40,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import java.io.IOException; import java.io.InputStream; diff --git a/plugins/repository-s3/src/test/java/org/opensearch/repositories/s3/S3BlobContainerRetriesTests.java b/plugins/repository-s3/src/test/java/org/opensearch/repositories/s3/S3BlobContainerRetriesTests.java index b847890f1ea89..e08a19ede0380 100644 --- a/plugins/repository-s3/src/test/java/org/opensearch/repositories/s3/S3BlobContainerRetriesTests.java +++ b/plugins/repository-s3/src/test/java/org/opensearch/repositories/s3/S3BlobContainerRetriesTests.java @@ -51,7 +51,7 @@ import org.opensearch.common.unit.ByteSizeValue; import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.concurrent.CountDown; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.repositories.blobstore.AbstractBlobContainerRetriesTestCase; import org.junit.After; import org.junit.Before; diff --git a/plugins/transport-nio/src/main/java/org/opensearch/transport/nio/TcpReadWriteHandler.java b/plugins/transport-nio/src/main/java/org/opensearch/transport/nio/TcpReadWriteHandler.java index 1427429f0b766..9c9179c584a38 100644 --- a/plugins/transport-nio/src/main/java/org/opensearch/transport/nio/TcpReadWriteHandler.java +++ b/plugins/transport-nio/src/main/java/org/opensearch/transport/nio/TcpReadWriteHandler.java @@ -39,7 +39,7 @@ import org.opensearch.common.lease.Releasable; import org.opensearch.common.lease.Releasables; import org.opensearch.common.util.PageCacheRecycler; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.nio.BytesWriteHandler; import org.opensearch.nio.InboundChannelBuffer; import org.opensearch.nio.Page; diff --git a/plugins/transport-nio/src/test/java/org/opensearch/http/nio/NioHttpClient.java b/plugins/transport-nio/src/test/java/org/opensearch/http/nio/NioHttpClient.java index 1229aab244a6d..edaee15507df9 100644 --- a/plugins/transport-nio/src/test/java/org/opensearch/http/nio/NioHttpClient.java +++ b/plugins/transport-nio/src/test/java/org/opensearch/http/nio/NioHttpClient.java @@ -53,7 +53,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.ByteSizeUnit; import org.opensearch.common.unit.ByteSizeValue; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.nio.BytesChannelContext; import org.opensearch.nio.ChannelFactory; import org.opensearch.nio.Config; diff --git a/plugins/transport-nio/src/test/java/org/opensearch/transport/nio/SimpleNioTransportTests.java b/plugins/transport-nio/src/test/java/org/opensearch/transport/nio/SimpleNioTransportTests.java index 5f11b97274092..b42fb7fc4a749 100644 --- a/plugins/transport-nio/src/test/java/org/opensearch/transport/nio/SimpleNioTransportTests.java +++ b/plugins/transport-nio/src/test/java/org/opensearch/transport/nio/SimpleNioTransportTests.java @@ -41,7 +41,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.transport.TransportAddress; import org.opensearch.common.util.MockPageCacheRecycler; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.common.util.net.NetUtils; import org.opensearch.indices.breaker.NoneCircuitBreakerService; import org.opensearch.test.transport.MockTransportService; diff --git a/qa/multi-cluster-search/src/test/java/org/opensearch/search/CCSDuelIT.java b/qa/multi-cluster-search/src/test/java/org/opensearch/search/CCSDuelIT.java index ec6789d702743..e54a3a1221fc9 100644 --- a/qa/multi-cluster-search/src/test/java/org/opensearch/search/CCSDuelIT.java +++ b/qa/multi-cluster-search/src/test/java/org/opensearch/search/CCSDuelIT.java @@ -58,7 +58,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.XContentHelper; import org.opensearch.common.xcontent.XContentType; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.query.InnerHitBuilder; import org.opensearch.index.query.MatchQueryBuilder; import org.opensearch.index.query.QueryBuilders; diff --git a/qa/os/src/test/java/org/opensearch/packaging/test/PackagingTestCase.java b/qa/os/src/test/java/org/opensearch/packaging/test/PackagingTestCase.java index 259ae6e766c8e..7551bddc3226c 100644 --- a/qa/os/src/test/java/org/opensearch/packaging/test/PackagingTestCase.java +++ b/qa/os/src/test/java/org/opensearch/packaging/test/PackagingTestCase.java @@ -42,7 +42,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.opensearch.common.CheckedConsumer; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.packaging.util.Archives; import org.opensearch.packaging.util.Distribution; import org.opensearch.packaging.util.Docker; diff --git a/qa/os/src/test/java/org/opensearch/packaging/util/FileUtils.java b/qa/os/src/test/java/org/opensearch/packaging/util/FileUtils.java index d7005a17926ad..5169ce18fff79 100644 --- a/qa/os/src/test/java/org/opensearch/packaging/util/FileUtils.java +++ b/qa/os/src/test/java/org/opensearch/packaging/util/FileUtils.java @@ -33,7 +33,7 @@ package org.opensearch.packaging.util; import org.apache.logging.log4j.Logger; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.hamcrest.FeatureMatcher; import org.hamcrest.Matcher; diff --git a/qa/remote-clusters/src/test/java/org/opensearch/cluster/remote/test/AbstractMultiClusterRemoteTestCase.java b/qa/remote-clusters/src/test/java/org/opensearch/cluster/remote/test/AbstractMultiClusterRemoteTestCase.java index 5f73144501f94..cc6e286d812ce 100644 --- a/qa/remote-clusters/src/test/java/org/opensearch/cluster/remote/test/AbstractMultiClusterRemoteTestCase.java +++ b/qa/remote-clusters/src/test/java/org/opensearch/cluster/remote/test/AbstractMultiClusterRemoteTestCase.java @@ -39,7 +39,7 @@ import org.opensearch.client.RestClient; import org.opensearch.client.RestHighLevelClient; import org.opensearch.common.settings.Settings; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.test.rest.OpenSearchRestTestCase; import java.io.IOException; diff --git a/sandbox/plugins/concurrent-search/src/test/java/org/opensearch/search/profile/query/QueryProfilerTests.java b/sandbox/plugins/concurrent-search/src/test/java/org/opensearch/search/profile/query/QueryProfilerTests.java index 51cb3c8c0cddc..0b88abb314fcd 100644 --- a/sandbox/plugins/concurrent-search/src/test/java/org/opensearch/search/profile/query/QueryProfilerTests.java +++ b/sandbox/plugins/concurrent-search/src/test/java/org/opensearch/search/profile/query/QueryProfilerTests.java @@ -36,7 +36,7 @@ import org.apache.lucene.tests.index.RandomIndexWriter; import org.apache.lucene.tests.search.RandomApproximationQuery; import org.apache.lucene.tests.util.TestUtil; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.search.internal.ContextIndexSearcher; import org.opensearch.search.profile.ProfileResult; import org.opensearch.test.OpenSearchTestCase; diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/allocation/ClusterRerouteIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/allocation/ClusterRerouteIT.java index ee2a8784fa0ed..b0aeb786b0268 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/allocation/ClusterRerouteIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/allocation/ClusterRerouteIT.java @@ -61,7 +61,7 @@ import org.opensearch.common.io.FileSystemUtils; import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.NodeEnvironment; import org.opensearch.index.Index; import org.opensearch.index.shard.ShardId; diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/shards/ClusterShardLimitIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/shards/ClusterShardLimitIT.java index 8059266916f3f..5d6bed4629587 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/shards/ClusterShardLimitIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/shards/ClusterShardLimitIT.java @@ -47,7 +47,7 @@ import org.opensearch.common.network.NetworkModule; import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.ByteSizeUnit; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.indices.ShardLimitValidator; import org.opensearch.snapshots.SnapshotInfo; import org.opensearch.snapshots.SnapshotState; diff --git a/server/src/internalClusterTest/java/org/opensearch/index/shard/IndexShardIT.java b/server/src/internalClusterTest/java/org/opensearch/index/shard/IndexShardIT.java index 9cdac985310bd..11f187ac6e619 100644 --- a/server/src/internalClusterTest/java/org/opensearch/index/shard/IndexShardIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/index/shard/IndexShardIT.java @@ -62,7 +62,7 @@ import org.opensearch.common.unit.ByteSizeValue; import org.opensearch.common.unit.TimeValue; import org.opensearch.common.xcontent.XContentType; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.Environment; import org.opensearch.env.NodeEnvironment; import org.opensearch.env.ShardLock; diff --git a/server/src/internalClusterTest/java/org/opensearch/repositories/fs/FsBlobStoreRepositoryIT.java b/server/src/internalClusterTest/java/org/opensearch/repositories/fs/FsBlobStoreRepositoryIT.java index 75deb731881ec..c09bd743ca361 100644 --- a/server/src/internalClusterTest/java/org/opensearch/repositories/fs/FsBlobStoreRepositoryIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/repositories/fs/FsBlobStoreRepositoryIT.java @@ -39,7 +39,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.ByteSizeUnit; import org.opensearch.common.unit.ByteSizeValue; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.repositories.blobstore.OpenSearchBlobStoreRepositoryIntegTestCase; import java.io.IOException; diff --git a/server/src/internalClusterTest/java/org/opensearch/search/geo/GeoFilterIT.java b/server/src/internalClusterTest/java/org/opensearch/search/geo/GeoFilterIT.java index 277d6b45be4ea..3444ddbca9e65 100644 --- a/server/src/internalClusterTest/java/org/opensearch/search/geo/GeoFilterIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/search/geo/GeoFilterIT.java @@ -60,7 +60,7 @@ import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; -import org.opensearch.core.internal.io.Streams; +import org.opensearch.common.util.io.Streams; import org.opensearch.index.query.QueryBuilders; import org.opensearch.search.SearchHit; import org.opensearch.test.OpenSearchIntegTestCase; diff --git a/server/src/internalClusterTest/java/org/opensearch/snapshots/CorruptedBlobStoreRepositoryIT.java b/server/src/internalClusterTest/java/org/opensearch/snapshots/CorruptedBlobStoreRepositoryIT.java index a07b245db2b21..483d698f3c9a4 100644 --- a/server/src/internalClusterTest/java/org/opensearch/snapshots/CorruptedBlobStoreRepositoryIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/snapshots/CorruptedBlobStoreRepositoryIT.java @@ -42,7 +42,7 @@ import org.opensearch.cluster.metadata.RepositoriesMetadata; import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.ByteSizeUnit; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.repositories.IndexId; import org.opensearch.repositories.RepositoriesService; import org.opensearch.repositories.Repository; diff --git a/server/src/internalClusterTest/java/org/opensearch/snapshots/MultiClusterRepoAccessIT.java b/server/src/internalClusterTest/java/org/opensearch/snapshots/MultiClusterRepoAccessIT.java index 13aee8b8e18a6..4aabe96bcbe60 100644 --- a/server/src/internalClusterTest/java/org/opensearch/snapshots/MultiClusterRepoAccessIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/snapshots/MultiClusterRepoAccessIT.java @@ -33,7 +33,7 @@ import org.opensearch.common.network.NetworkModule; import org.opensearch.common.settings.Settings; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.Environment; import org.opensearch.repositories.RepositoryException; import org.opensearch.snapshots.mockstore.MockRepository; diff --git a/server/src/internalClusterTest/java/org/opensearch/snapshots/SnapshotStatusApisIT.java b/server/src/internalClusterTest/java/org/opensearch/snapshots/SnapshotStatusApisIT.java index b6fa4fbc2fc96..69b947588bea0 100644 --- a/server/src/internalClusterTest/java/org/opensearch/snapshots/SnapshotStatusApisIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/snapshots/SnapshotStatusApisIT.java @@ -49,7 +49,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.ByteSizeUnit; import org.opensearch.common.unit.TimeValue; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.repositories.blobstore.BlobStoreRepository; import org.opensearch.threadpool.ThreadPool; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/analyze/TransportAnalyzeAction.java b/server/src/main/java/org/opensearch/action/admin/indices/analyze/TransportAnalyzeAction.java index e5efe9055592d..2700d38686833 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/analyze/TransportAnalyzeAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/analyze/TransportAnalyzeAction.java @@ -51,7 +51,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.common.io.stream.Writeable; import org.opensearch.common.settings.Settings; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.IndexService; import org.opensearch.index.IndexSettings; import org.opensearch.index.analysis.AnalysisRegistry; diff --git a/server/src/main/java/org/opensearch/bootstrap/Bootstrap.java b/server/src/main/java/org/opensearch/bootstrap/Bootstrap.java index 8c4a550a9b5f5..25b6c002afc47 100644 --- a/server/src/main/java/org/opensearch/bootstrap/Bootstrap.java +++ b/server/src/main/java/org/opensearch/bootstrap/Bootstrap.java @@ -56,7 +56,7 @@ import org.opensearch.common.settings.SecureString; import org.opensearch.common.settings.Settings; import org.opensearch.common.transport.BoundTransportAddress; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.Environment; import org.opensearch.monitor.jvm.JvmInfo; import org.opensearch.monitor.os.OsProbe; diff --git a/server/src/main/java/org/opensearch/bootstrap/Spawner.java b/server/src/main/java/org/opensearch/bootstrap/Spawner.java index e2df60af6c1d1..3a94523966e21 100644 --- a/server/src/main/java/org/opensearch/bootstrap/Spawner.java +++ b/server/src/main/java/org/opensearch/bootstrap/Spawner.java @@ -33,7 +33,7 @@ package org.opensearch.bootstrap; import org.apache.lucene.util.Constants; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.Environment; import org.opensearch.plugins.Platforms; import org.opensearch.plugins.PluginInfo; diff --git a/server/src/main/java/org/opensearch/bootstrap/SystemCallFilter.java b/server/src/main/java/org/opensearch/bootstrap/SystemCallFilter.java index 5792452e84f7a..6347c37a7c7a5 100644 --- a/server/src/main/java/org/opensearch/bootstrap/SystemCallFilter.java +++ b/server/src/main/java/org/opensearch/bootstrap/SystemCallFilter.java @@ -43,7 +43,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.lucene.util.Constants; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import java.io.IOException; import java.nio.ByteBuffer; diff --git a/server/src/main/java/org/opensearch/cluster/coordination/PublicationTransportHandler.java b/server/src/main/java/org/opensearch/cluster/coordination/PublicationTransportHandler.java index 8ef8124799bf0..77f3b89f950ce 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/PublicationTransportHandler.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/PublicationTransportHandler.java @@ -53,7 +53,7 @@ import org.opensearch.common.io.stream.OutputStreamStreamOutput; import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.BytesTransportRequest; import org.opensearch.transport.TransportChannel; diff --git a/server/src/main/java/org/opensearch/cluster/metadata/MetadataMappingService.java b/server/src/main/java/org/opensearch/cluster/metadata/MetadataMappingService.java index deb4dfd2581bf..665bdf0c4e2ff 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/MetadataMappingService.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/MetadataMappingService.java @@ -52,7 +52,7 @@ import org.opensearch.common.compress.CompressedXContent; import org.opensearch.common.inject.Inject; import org.opensearch.common.unit.TimeValue; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.Index; import org.opensearch.index.IndexService; import org.opensearch.index.mapper.DocumentMapper; diff --git a/server/src/main/java/org/opensearch/common/blobstore/fs/FsBlobContainer.java b/server/src/main/java/org/opensearch/common/blobstore/fs/FsBlobContainer.java index 940192d77630b..394855671688a 100644 --- a/server/src/main/java/org/opensearch/common/blobstore/fs/FsBlobContainer.java +++ b/server/src/main/java/org/opensearch/common/blobstore/fs/FsBlobContainer.java @@ -40,7 +40,7 @@ import org.opensearch.common.blobstore.support.AbstractBlobContainer; import org.opensearch.common.blobstore.support.PlainBlobMetadata; import org.opensearch.common.io.Streams; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import java.io.FileNotFoundException; import java.io.IOException; @@ -227,7 +227,7 @@ public void writeBlobAtomic(final String blobName, final InputStream inputStream private void writeToPath(InputStream inputStream, Path tempBlobPath, long blobSize) throws IOException { try (OutputStream outputStream = Files.newOutputStream(tempBlobPath, StandardOpenOption.CREATE_NEW)) { final int bufferSize = blobStore.bufferSizeInBytes(); - org.opensearch.core.internal.io.Streams.copy( + org.opensearch.common.util.io.Streams.copy( inputStream, outputStream, new byte[blobSize < bufferSize ? Math.toIntExact(blobSize) : bufferSize] diff --git a/server/src/main/java/org/opensearch/common/bytes/RecyclingBytesStreamOutput.java b/server/src/main/java/org/opensearch/common/bytes/RecyclingBytesStreamOutput.java index 28c3f4c9d5349..7f477a4ec6a53 100644 --- a/server/src/main/java/org/opensearch/common/bytes/RecyclingBytesStreamOutput.java +++ b/server/src/main/java/org/opensearch/common/bytes/RecyclingBytesStreamOutput.java @@ -39,7 +39,7 @@ import org.opensearch.common.io.stream.StreamOutput; import org.opensearch.common.util.BigArrays; import org.opensearch.common.util.ByteArray; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/opensearch/common/io/FileSystemUtils.java b/server/src/main/java/org/opensearch/common/io/FileSystemUtils.java index e65c430783013..383393d15b7de 100644 --- a/server/src/main/java/org/opensearch/common/io/FileSystemUtils.java +++ b/server/src/main/java/org/opensearch/common/io/FileSystemUtils.java @@ -34,7 +34,7 @@ import org.apache.logging.log4j.Logger; import org.apache.lucene.util.Constants; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.common.Strings; import org.opensearch.common.SuppressForbidden; diff --git a/server/src/main/java/org/opensearch/common/io/Streams.java b/server/src/main/java/org/opensearch/common/io/Streams.java index b4dab5ecb7e54..00e9c84e4c2aa 100644 --- a/server/src/main/java/org/opensearch/common/io/Streams.java +++ b/server/src/main/java/org/opensearch/common/io/Streams.java @@ -198,7 +198,7 @@ public static int readFully(InputStream reader, byte[] dest, int offset, int len * Fully consumes the input stream, throwing the bytes away. Returns the number of bytes consumed. */ public static long consumeFully(InputStream inputStream) throws IOException { - return org.opensearch.core.internal.io.Streams.copy(inputStream, NULL_OUTPUT_STREAM); + return org.opensearch.common.util.io.Streams.copy(inputStream, NULL_OUTPUT_STREAM); } public static List readAllLines(InputStream input) throws IOException { @@ -244,7 +244,7 @@ public static BytesStream flushOnCloseStream(BytesStream os) { */ public static BytesReference readFully(InputStream in) throws IOException { BytesStreamOutput out = new BytesStreamOutput(); - org.opensearch.core.internal.io.Streams.copy(in, out); + org.opensearch.common.util.io.Streams.copy(in, out); return out.bytes(); } diff --git a/server/src/main/java/org/opensearch/common/lease/Releasables.java b/server/src/main/java/org/opensearch/common/lease/Releasables.java index 5e885d239f884..31bfa9a2dd7ab 100644 --- a/server/src/main/java/org/opensearch/common/lease/Releasables.java +++ b/server/src/main/java/org/opensearch/common/lease/Releasables.java @@ -33,7 +33,7 @@ package org.opensearch.common.lease; import org.opensearch.common.Nullable; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/server/src/main/java/org/opensearch/common/network/CloseableChannel.java b/server/src/main/java/org/opensearch/common/network/CloseableChannel.java index a849e0403a007..704b616bcabc9 100644 --- a/server/src/main/java/org/opensearch/common/network/CloseableChannel.java +++ b/server/src/main/java/org/opensearch/common/network/CloseableChannel.java @@ -35,7 +35,7 @@ import org.opensearch.action.ActionFuture; import org.opensearch.action.ActionListener; import org.opensearch.action.support.PlainActionFuture; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import java.io.Closeable; import java.io.IOException; diff --git a/server/src/main/java/org/opensearch/common/settings/Settings.java b/server/src/main/java/org/opensearch/common/settings/Settings.java index fe4d4b02c05e7..ecb6f844831eb 100644 --- a/server/src/main/java/org/opensearch/common/settings/Settings.java +++ b/server/src/main/java/org/opensearch/common/settings/Settings.java @@ -56,9 +56,8 @@ import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.ToXContentFragment; import org.opensearch.core.xcontent.XContentBuilder; -import org.opensearch.core.xcontent.MediaType; import org.opensearch.core.xcontent.XContentParser; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import java.io.IOException; import java.io.InputStream; diff --git a/server/src/main/java/org/opensearch/discovery/HandshakingTransportAddressConnector.java b/server/src/main/java/org/opensearch/discovery/HandshakingTransportAddressConnector.java index 8c0073cbbf245..90ca19e9369f4 100644 --- a/server/src/main/java/org/opensearch/discovery/HandshakingTransportAddressConnector.java +++ b/server/src/main/java/org/opensearch/discovery/HandshakingTransportAddressConnector.java @@ -46,7 +46,7 @@ import org.opensearch.common.transport.TransportAddress; import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.concurrent.AbstractRunnable; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.discovery.PeerFinder.TransportAddressConnector; import org.opensearch.transport.ConnectTransportException; import org.opensearch.transport.ConnectionProfile; diff --git a/server/src/main/java/org/opensearch/env/NodeEnvironment.java b/server/src/main/java/org/opensearch/env/NodeEnvironment.java index ef3e8aa7e5583..1b43be128b052 100644 --- a/server/src/main/java/org/opensearch/env/NodeEnvironment.java +++ b/server/src/main/java/org/opensearch/env/NodeEnvironment.java @@ -65,7 +65,7 @@ import org.opensearch.common.unit.ByteSizeValue; import org.opensearch.common.unit.TimeValue; import org.opensearch.core.xcontent.NamedXContentRegistry; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.gateway.MetadataStateFormat; import org.opensearch.gateway.PersistedClusterStateService; import org.opensearch.index.Index; diff --git a/server/src/main/java/org/opensearch/env/NodeRepurposeCommand.java b/server/src/main/java/org/opensearch/env/NodeRepurposeCommand.java index 35f2eead82159..f505a27a5624c 100644 --- a/server/src/main/java/org/opensearch/env/NodeRepurposeCommand.java +++ b/server/src/main/java/org/opensearch/env/NodeRepurposeCommand.java @@ -43,7 +43,7 @@ import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.common.settings.Settings; import org.opensearch.common.util.set.Sets; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.gateway.MetadataStateFormat; import org.opensearch.gateway.PersistedClusterStateService; diff --git a/server/src/main/java/org/opensearch/gateway/GatewayMetaState.java b/server/src/main/java/org/opensearch/gateway/GatewayMetaState.java index ea550fc6ac3e8..dcc3794320975 100644 --- a/server/src/main/java/org/opensearch/gateway/GatewayMetaState.java +++ b/server/src/main/java/org/opensearch/gateway/GatewayMetaState.java @@ -60,7 +60,7 @@ import org.opensearch.common.util.concurrent.AbstractRunnable; import org.opensearch.common.util.concurrent.OpenSearchExecutors; import org.opensearch.common.util.concurrent.OpenSearchThreadPoolExecutor; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.NodeMetadata; import org.opensearch.node.Node; import org.opensearch.plugins.MetadataUpgrader; diff --git a/server/src/main/java/org/opensearch/gateway/MetadataStateFormat.java b/server/src/main/java/org/opensearch/gateway/MetadataStateFormat.java index 6093be7ee663d..9943f04c964e1 100644 --- a/server/src/main/java/org/opensearch/gateway/MetadataStateFormat.java +++ b/server/src/main/java/org/opensearch/gateway/MetadataStateFormat.java @@ -54,7 +54,7 @@ import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.common.xcontent.XContentType; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import java.io.FileNotFoundException; import java.io.IOException; diff --git a/server/src/main/java/org/opensearch/gateway/PersistedClusterStateService.java b/server/src/main/java/org/opensearch/gateway/PersistedClusterStateService.java index 74c0c2b998a19..d874b4a9375b8 100644 --- a/server/src/main/java/org/opensearch/gateway/PersistedClusterStateService.java +++ b/server/src/main/java/org/opensearch/gateway/PersistedClusterStateService.java @@ -86,7 +86,7 @@ import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.NodeEnvironment; import org.opensearch.env.NodeMetadata; import org.opensearch.index.Index; diff --git a/server/src/main/java/org/opensearch/index/IndexModule.java b/server/src/main/java/org/opensearch/index/IndexModule.java index 5e8f95acdfe39..a4ba510d013bd 100644 --- a/server/src/main/java/org/opensearch/index/IndexModule.java +++ b/server/src/main/java/org/opensearch/index/IndexModule.java @@ -55,7 +55,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.util.BigArrays; import org.opensearch.core.xcontent.NamedXContentRegistry; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.NodeEnvironment; import org.opensearch.index.analysis.AnalysisRegistry; import org.opensearch.index.analysis.IndexAnalyzers; diff --git a/server/src/main/java/org/opensearch/index/IndexService.java b/server/src/main/java/org/opensearch/index/IndexService.java index 696ec62f3b512..eacb07f2e5c9c 100644 --- a/server/src/main/java/org/opensearch/index/IndexService.java +++ b/server/src/main/java/org/opensearch/index/IndexService.java @@ -58,7 +58,7 @@ import org.opensearch.common.util.concurrent.AbstractAsyncTask; import org.opensearch.common.util.concurrent.AbstractRunnable; import org.opensearch.core.xcontent.NamedXContentRegistry; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.NodeEnvironment; import org.opensearch.env.ShardLock; import org.opensearch.env.ShardLockObtainFailedException; diff --git a/server/src/main/java/org/opensearch/index/analysis/AnalysisRegistry.java b/server/src/main/java/org/opensearch/index/analysis/AnalysisRegistry.java index 4a7dc238a8c5d..cfdf416b2d533 100644 --- a/server/src/main/java/org/opensearch/index/analysis/AnalysisRegistry.java +++ b/server/src/main/java/org/opensearch/index/analysis/AnalysisRegistry.java @@ -39,7 +39,7 @@ import org.opensearch.Version; import org.opensearch.cluster.metadata.IndexMetadata; import org.opensearch.common.settings.Settings; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.Environment; import org.opensearch.index.IndexSettings; import org.opensearch.index.mapper.TextFieldMapper; diff --git a/server/src/main/java/org/opensearch/index/analysis/IndexAnalyzers.java b/server/src/main/java/org/opensearch/index/analysis/IndexAnalyzers.java index 07be53d668b5e..4d72ee48cf33a 100644 --- a/server/src/main/java/org/opensearch/index/analysis/IndexAnalyzers.java +++ b/server/src/main/java/org/opensearch/index/analysis/IndexAnalyzers.java @@ -31,7 +31,7 @@ package org.opensearch.index.analysis; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import java.io.Closeable; import java.io.IOException; diff --git a/server/src/main/java/org/opensearch/index/analysis/PreBuiltAnalyzerProviderFactory.java b/server/src/main/java/org/opensearch/index/analysis/PreBuiltAnalyzerProviderFactory.java index 6202f0a679c83..1dafd4c5f6ca6 100644 --- a/server/src/main/java/org/opensearch/index/analysis/PreBuiltAnalyzerProviderFactory.java +++ b/server/src/main/java/org/opensearch/index/analysis/PreBuiltAnalyzerProviderFactory.java @@ -35,7 +35,7 @@ import org.apache.lucene.analysis.Analyzer; import org.opensearch.Version; import org.opensearch.common.settings.Settings; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.Environment; import org.opensearch.index.IndexSettings; import org.opensearch.indices.analysis.PreBuiltAnalyzers; diff --git a/server/src/main/java/org/opensearch/index/cache/IndexCache.java b/server/src/main/java/org/opensearch/index/cache/IndexCache.java index 0423a0bfd2706..90462e9919970 100644 --- a/server/src/main/java/org/opensearch/index/cache/IndexCache.java +++ b/server/src/main/java/org/opensearch/index/cache/IndexCache.java @@ -32,7 +32,7 @@ package org.opensearch.index.cache; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.AbstractIndexComponent; import org.opensearch.index.IndexSettings; import org.opensearch.index.cache.bitset.BitsetFilterCache; diff --git a/server/src/main/java/org/opensearch/index/engine/InternalEngine.java b/server/src/main/java/org/opensearch/index/engine/InternalEngine.java index 1c56f22c0d6d2..a6fa86e379ebf 100644 --- a/server/src/main/java/org/opensearch/index/engine/InternalEngine.java +++ b/server/src/main/java/org/opensearch/index/engine/InternalEngine.java @@ -86,7 +86,7 @@ import org.opensearch.common.util.concurrent.AbstractRunnable; import org.opensearch.common.util.concurrent.KeyedLock; import org.opensearch.common.util.concurrent.ReleasableLock; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.IndexSettings; import org.opensearch.index.VersionType; import org.opensearch.index.fieldvisitor.IdOnlyFieldVisitor; diff --git a/server/src/main/java/org/opensearch/index/engine/LuceneChangesSnapshot.java b/server/src/main/java/org/opensearch/index/engine/LuceneChangesSnapshot.java index 098115bf676a8..d6995eab90fdb 100644 --- a/server/src/main/java/org/opensearch/index/engine/LuceneChangesSnapshot.java +++ b/server/src/main/java/org/opensearch/index/engine/LuceneChangesSnapshot.java @@ -50,7 +50,7 @@ import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.lucene.Lucene; import org.opensearch.common.lucene.search.Queries; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.fieldvisitor.FieldsVisitor; import org.opensearch.index.mapper.SeqNoFieldMapper; import org.opensearch.index.mapper.SourceFieldMapper; diff --git a/server/src/main/java/org/opensearch/index/engine/NRTReplicationEngine.java b/server/src/main/java/org/opensearch/index/engine/NRTReplicationEngine.java index 0ee58ab3cae28..a9bdcd1a64668 100644 --- a/server/src/main/java/org/opensearch/index/engine/NRTReplicationEngine.java +++ b/server/src/main/java/org/opensearch/index/engine/NRTReplicationEngine.java @@ -19,7 +19,7 @@ import org.opensearch.common.unit.ByteSizeValue; import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.concurrent.ReleasableLock; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.seqno.LocalCheckpointTracker; import org.opensearch.index.seqno.SeqNoStats; import org.opensearch.index.seqno.SequenceNumbers; diff --git a/server/src/main/java/org/opensearch/index/engine/ReadOnlyEngine.java b/server/src/main/java/org/opensearch/index/engine/ReadOnlyEngine.java index fbd3349240743..73ec658f573c2 100644 --- a/server/src/main/java/org/opensearch/index/engine/ReadOnlyEngine.java +++ b/server/src/main/java/org/opensearch/index/engine/ReadOnlyEngine.java @@ -43,7 +43,7 @@ import org.opensearch.common.concurrent.GatedCloseable; import org.opensearch.common.lucene.Lucene; import org.opensearch.common.lucene.index.OpenSearchDirectoryReader; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.seqno.SeqNoStats; import org.opensearch.index.seqno.SequenceNumbers; import org.opensearch.index.store.Store; diff --git a/server/src/main/java/org/opensearch/index/search/QueryStringQueryParser.java b/server/src/main/java/org/opensearch/index/search/QueryStringQueryParser.java index 9a121fe55a7e7..7d6cbc0064535 100644 --- a/server/src/main/java/org/opensearch/index/search/QueryStringQueryParser.java +++ b/server/src/main/java/org/opensearch/index/search/QueryStringQueryParser.java @@ -59,7 +59,7 @@ import org.opensearch.common.lucene.search.Queries; import org.opensearch.common.regex.Regex; import org.opensearch.common.unit.Fuzziness; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.IndexSettings; import org.opensearch.index.mapper.DateFieldMapper.DateFieldType; import org.opensearch.index.mapper.FieldNamesFieldMapper; diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShard.java b/server/src/main/java/org/opensearch/index/shard/IndexShard.java index 2aacc51c4f4c8..2629b2c954015 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShard.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShard.java @@ -99,7 +99,7 @@ import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.common.util.set.Sets; import org.opensearch.common.xcontent.XContentHelper; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.gateway.WriteStateException; import org.opensearch.index.Index; import org.opensearch.index.IndexModule; diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShardOperationPermits.java b/server/src/main/java/org/opensearch/index/shard/IndexShardOperationPermits.java index 23d3a30185ce1..b6af2030d7fb6 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShardOperationPermits.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShardOperationPermits.java @@ -43,7 +43,7 @@ import org.opensearch.common.util.concurrent.AbstractRunnable; import org.opensearch.common.util.concurrent.RunOnce; import org.opensearch.common.util.concurrent.ThreadContext.StoredContext; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.threadpool.ThreadPool; import java.io.Closeable; diff --git a/server/src/main/java/org/opensearch/index/shard/PrimaryReplicaSyncer.java b/server/src/main/java/org/opensearch/index/shard/PrimaryReplicaSyncer.java index a96e8015ccb27..5786c25031647 100644 --- a/server/src/main/java/org/opensearch/index/shard/PrimaryReplicaSyncer.java +++ b/server/src/main/java/org/opensearch/index/shard/PrimaryReplicaSyncer.java @@ -49,7 +49,7 @@ import org.opensearch.common.util.concurrent.AbstractRunnable; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.xcontent.XContentBuilder; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.seqno.SequenceNumbers; import org.opensearch.index.translog.Translog; import org.opensearch.tasks.Task; diff --git a/server/src/main/java/org/opensearch/index/shard/ShardPath.java b/server/src/main/java/org/opensearch/index/shard/ShardPath.java index 66b7b4c7f46c5..39486ec00a36a 100644 --- a/server/src/main/java/org/opensearch/index/shard/ShardPath.java +++ b/server/src/main/java/org/opensearch/index/shard/ShardPath.java @@ -33,7 +33,7 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.util.Strings; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.cluster.metadata.IndexMetadata; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.env.NodeEnvironment; diff --git a/server/src/main/java/org/opensearch/index/snapshots/blobstore/SlicedInputStream.java b/server/src/main/java/org/opensearch/index/snapshots/blobstore/SlicedInputStream.java index ae2e33d41c6ce..298b101a86299 100644 --- a/server/src/main/java/org/opensearch/index/snapshots/blobstore/SlicedInputStream.java +++ b/server/src/main/java/org/opensearch/index/snapshots/blobstore/SlicedInputStream.java @@ -31,7 +31,7 @@ package org.opensearch.index.snapshots.blobstore; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import java.io.IOException; import java.io.InputStream; diff --git a/server/src/main/java/org/opensearch/index/store/FsDirectoryFactory.java b/server/src/main/java/org/opensearch/index/store/FsDirectoryFactory.java index 88c7e12632863..3b5b4040954c9 100644 --- a/server/src/main/java/org/opensearch/index/store/FsDirectoryFactory.java +++ b/server/src/main/java/org/opensearch/index/store/FsDirectoryFactory.java @@ -45,7 +45,7 @@ import org.apache.lucene.store.SimpleFSLockFactory; import org.opensearch.common.settings.Setting; import org.opensearch.common.settings.Setting.Property; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.IndexModule; import org.opensearch.index.IndexSettings; import org.opensearch.index.shard.ShardPath; diff --git a/server/src/main/java/org/opensearch/index/store/Store.java b/server/src/main/java/org/opensearch/index/store/Store.java index 69de85cd23820..3a07ccf40831f 100644 --- a/server/src/main/java/org/opensearch/index/store/Store.java +++ b/server/src/main/java/org/opensearch/index/store/Store.java @@ -82,7 +82,7 @@ import org.opensearch.common.util.concurrent.AbstractRefCounted; import org.opensearch.common.util.concurrent.RefCounted; import org.opensearch.common.util.iterable.Iterables; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.NodeEnvironment; import org.opensearch.env.ShardLock; import org.opensearch.env.ShardLockObtainFailedException; diff --git a/server/src/main/java/org/opensearch/index/translog/InternalTranslogManager.java b/server/src/main/java/org/opensearch/index/translog/InternalTranslogManager.java index 679b9d7f2f88b..0eb133eb464d2 100644 --- a/server/src/main/java/org/opensearch/index/translog/InternalTranslogManager.java +++ b/server/src/main/java/org/opensearch/index/translog/InternalTranslogManager.java @@ -13,7 +13,7 @@ import org.apache.logging.log4j.message.ParameterizedMessage; import org.apache.lucene.store.AlreadyClosedException; import org.opensearch.common.util.concurrent.ReleasableLock; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.engine.LifecycleAware; import org.opensearch.index.seqno.LocalCheckpointTracker; import org.opensearch.index.shard.ShardId; diff --git a/server/src/main/java/org/opensearch/index/translog/LocalTranslog.java b/server/src/main/java/org/opensearch/index/translog/LocalTranslog.java index 404132f45f7cb..22dba3973cfc1 100644 --- a/server/src/main/java/org/opensearch/index/translog/LocalTranslog.java +++ b/server/src/main/java/org/opensearch/index/translog/LocalTranslog.java @@ -9,7 +9,7 @@ package org.opensearch.index.translog; import org.opensearch.common.util.concurrent.ReleasableLock; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import java.io.IOException; import java.nio.file.Files; diff --git a/server/src/main/java/org/opensearch/index/translog/RemoteFsTranslog.java b/server/src/main/java/org/opensearch/index/translog/RemoteFsTranslog.java index 5180469d83e1c..2230f13ad8c61 100644 --- a/server/src/main/java/org/opensearch/index/translog/RemoteFsTranslog.java +++ b/server/src/main/java/org/opensearch/index/translog/RemoteFsTranslog.java @@ -13,7 +13,7 @@ import org.opensearch.common.lease.Releasable; import org.opensearch.common.lease.Releasables; import org.opensearch.common.util.concurrent.ReleasableLock; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.shard.ShardId; import org.opensearch.index.translog.transfer.BlobStoreTransferService; import org.opensearch.index.translog.transfer.FileTransferTracker; diff --git a/server/src/main/java/org/opensearch/index/translog/Translog.java b/server/src/main/java/org/opensearch/index/translog/Translog.java index f9ddb946b7e59..ba4d87ce84f07 100644 --- a/server/src/main/java/org/opensearch/index/translog/Translog.java +++ b/server/src/main/java/org/opensearch/index/translog/Translog.java @@ -48,7 +48,7 @@ import org.opensearch.common.lucene.uid.Versions; import org.opensearch.common.util.BigArrays; import org.opensearch.common.util.concurrent.ReleasableLock; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.IndexSettings; import org.opensearch.index.VersionType; import org.opensearch.index.engine.Engine; diff --git a/server/src/main/java/org/opensearch/index/translog/TranslogReader.java b/server/src/main/java/org/opensearch/index/translog/TranslogReader.java index 205229949da77..c4a4fb7a460a0 100644 --- a/server/src/main/java/org/opensearch/index/translog/TranslogReader.java +++ b/server/src/main/java/org/opensearch/index/translog/TranslogReader.java @@ -34,7 +34,7 @@ import org.apache.lucene.store.AlreadyClosedException; import org.opensearch.common.io.Channels; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.seqno.SequenceNumbers; import java.io.Closeable; diff --git a/server/src/main/java/org/opensearch/index/translog/TranslogWriter.java b/server/src/main/java/org/opensearch/index/translog/TranslogWriter.java index 3c3d7402dff70..3e2c7e448fdad 100644 --- a/server/src/main/java/org/opensearch/index/translog/TranslogWriter.java +++ b/server/src/main/java/org/opensearch/index/translog/TranslogWriter.java @@ -50,7 +50,7 @@ import org.opensearch.common.unit.ByteSizeValue; import org.opensearch.common.util.BigArrays; import org.opensearch.common.util.concurrent.ReleasableLock; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.seqno.SequenceNumbers; import org.opensearch.index.shard.ShardId; diff --git a/server/src/main/java/org/opensearch/index/translog/TruncateTranslogAction.java b/server/src/main/java/org/opensearch/index/translog/TruncateTranslogAction.java index ae45710a428fd..ef948cfade815 100644 --- a/server/src/main/java/org/opensearch/index/translog/TruncateTranslogAction.java +++ b/server/src/main/java/org/opensearch/index/translog/TruncateTranslogAction.java @@ -46,7 +46,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.util.BigArrays; import org.opensearch.core.xcontent.NamedXContentRegistry; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.IndexNotFoundException; import org.opensearch.index.IndexSettings; import org.opensearch.index.seqno.SequenceNumbers; diff --git a/server/src/main/java/org/opensearch/index/translog/transfer/FileSnapshot.java b/server/src/main/java/org/opensearch/index/translog/transfer/FileSnapshot.java index dabde2c032c69..239ef7c3c9300 100644 --- a/server/src/main/java/org/opensearch/index/translog/transfer/FileSnapshot.java +++ b/server/src/main/java/org/opensearch/index/translog/transfer/FileSnapshot.java @@ -11,7 +11,7 @@ import org.opensearch.common.Nullable; import org.opensearch.common.lucene.store.ByteArrayIndexInput; import org.opensearch.common.lucene.store.InputStreamIndexInput; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import java.io.BufferedInputStream; import java.io.Closeable; diff --git a/server/src/main/java/org/opensearch/indices/IndicesService.java b/server/src/main/java/org/opensearch/indices/IndicesService.java index d82df07ca0a0f..9c83a33a37712 100644 --- a/server/src/main/java/org/opensearch/indices/IndicesService.java +++ b/server/src/main/java/org/opensearch/indices/IndicesService.java @@ -90,7 +90,7 @@ import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.common.xcontent.XContentType; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.NodeEnvironment; import org.opensearch.env.ShardLock; import org.opensearch.env.ShardLockObtainFailedException; diff --git a/server/src/main/java/org/opensearch/indices/analysis/HunspellService.java b/server/src/main/java/org/opensearch/indices/analysis/HunspellService.java index 1832de5a6f6d7..ad56d6c9a6312 100644 --- a/server/src/main/java/org/opensearch/indices/analysis/HunspellService.java +++ b/server/src/main/java/org/opensearch/indices/analysis/HunspellService.java @@ -38,7 +38,7 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.NIOFSDirectory; import org.opensearch.OpenSearchException; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.common.io.FileSystemUtils; import org.opensearch.common.settings.Setting; import org.opensearch.common.settings.Setting.Property; diff --git a/server/src/main/java/org/opensearch/indices/recovery/MultiChunkTransfer.java b/server/src/main/java/org/opensearch/indices/recovery/MultiChunkTransfer.java index 188b648449685..86e021bb6bfff 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/MultiChunkTransfer.java +++ b/server/src/main/java/org/opensearch/indices/recovery/MultiChunkTransfer.java @@ -39,7 +39,7 @@ import org.opensearch.common.collect.Tuple; import org.opensearch.common.util.concurrent.AsyncIOProcessor; import org.opensearch.common.util.concurrent.ThreadContext; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.seqno.LocalCheckpointTracker; import java.io.Closeable; diff --git a/server/src/main/java/org/opensearch/indices/recovery/RecoverySourceHandler.java b/server/src/main/java/org/opensearch/indices/recovery/RecoverySourceHandler.java index 212b5c8bc3d96..052b86c901093 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RecoverySourceHandler.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RecoverySourceHandler.java @@ -57,7 +57,7 @@ import org.opensearch.common.util.concurrent.FutureUtils; import org.opensearch.common.util.concurrent.ListenableFuture; import org.opensearch.common.util.concurrent.OpenSearchExecutors; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.engine.RecoveryEngineException; import org.opensearch.index.seqno.RetentionLease; import org.opensearch.index.seqno.RetentionLeaseNotFoundException; diff --git a/server/src/main/java/org/opensearch/indices/replication/SegmentFileTransferHandler.java b/server/src/main/java/org/opensearch/indices/replication/SegmentFileTransferHandler.java index e95c2c6470b4b..5411b6b2c9068 100644 --- a/server/src/main/java/org/opensearch/indices/replication/SegmentFileTransferHandler.java +++ b/server/src/main/java/org/opensearch/indices/replication/SegmentFileTransferHandler.java @@ -22,7 +22,7 @@ import org.opensearch.common.lease.Releasable; import org.opensearch.common.lucene.store.InputStreamIndexInput; import org.opensearch.common.util.CancellableThreads; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.shard.IndexShard; import org.opensearch.index.store.Store; import org.opensearch.index.store.StoreFileMetadata; diff --git a/server/src/main/java/org/opensearch/indices/replication/SegmentReplicationSourceHandler.java b/server/src/main/java/org/opensearch/indices/replication/SegmentReplicationSourceHandler.java index f9720991338c2..9aa16dc40ab06 100644 --- a/server/src/main/java/org/opensearch/indices/replication/SegmentReplicationSourceHandler.java +++ b/server/src/main/java/org/opensearch/indices/replication/SegmentReplicationSourceHandler.java @@ -19,7 +19,7 @@ import org.opensearch.common.util.CancellableThreads; import org.opensearch.common.util.concurrent.ListenableFuture; import org.opensearch.common.util.concurrent.OpenSearchExecutors; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.shard.IndexShard; import org.opensearch.index.store.StoreFileMetadata; import org.opensearch.indices.recovery.DelayRecoveryException; diff --git a/server/src/main/java/org/opensearch/monitor/fs/FsHealthService.java b/server/src/main/java/org/opensearch/monitor/fs/FsHealthService.java index 5863f3396b2ce..85a44aa905e08 100644 --- a/server/src/main/java/org/opensearch/monitor/fs/FsHealthService.java +++ b/server/src/main/java/org/opensearch/monitor/fs/FsHealthService.java @@ -43,7 +43,7 @@ import org.opensearch.common.settings.Setting; import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.NodeEnvironment; import org.opensearch.monitor.NodeHealthService; import org.opensearch.monitor.StatusInfo; diff --git a/server/src/main/java/org/opensearch/node/Node.java b/server/src/main/java/org/opensearch/node/Node.java index 980faf865be00..91d43675bea75 100644 --- a/server/src/main/java/org/opensearch/node/Node.java +++ b/server/src/main/java/org/opensearch/node/Node.java @@ -121,7 +121,7 @@ import org.opensearch.common.util.BigArrays; import org.opensearch.common.util.PageCacheRecycler; import org.opensearch.core.xcontent.NamedXContentRegistry; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.discovery.Discovery; import org.opensearch.discovery.DiscoveryModule; import org.opensearch.env.Environment; diff --git a/server/src/main/java/org/opensearch/node/NodeService.java b/server/src/main/java/org/opensearch/node/NodeService.java index b4446085243df..045a531deeb30 100644 --- a/server/src/main/java/org/opensearch/node/NodeService.java +++ b/server/src/main/java/org/opensearch/node/NodeService.java @@ -33,7 +33,7 @@ package org.opensearch.node; import org.opensearch.cluster.routing.WeightedRoutingStats; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.Build; import org.opensearch.Version; import org.opensearch.action.admin.cluster.node.info.NodeInfo; diff --git a/server/src/main/java/org/opensearch/plugins/PluginSecurity.java b/server/src/main/java/org/opensearch/plugins/PluginSecurity.java index e783a53dcb82f..e7d92016d4082 100644 --- a/server/src/main/java/org/opensearch/plugins/PluginSecurity.java +++ b/server/src/main/java/org/opensearch/plugins/PluginSecurity.java @@ -36,7 +36,7 @@ import org.opensearch.cli.Terminal; import org.opensearch.cli.Terminal.Verbosity; import org.opensearch.cli.UserException; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import java.io.IOException; import java.nio.file.Files; diff --git a/server/src/main/java/org/opensearch/repositories/RepositoriesService.java b/server/src/main/java/org/opensearch/repositories/RepositoriesService.java index 32bdb8b665520..c438abedfd37c 100644 --- a/server/src/main/java/org/opensearch/repositories/RepositoriesService.java +++ b/server/src/main/java/org/opensearch/repositories/RepositoriesService.java @@ -63,7 +63,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.concurrent.ConcurrentCollections; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.repositories.blobstore.MeteredBlobStoreRepository; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; diff --git a/server/src/main/java/org/opensearch/rest/RestController.java b/server/src/main/java/org/opensearch/rest/RestController.java index fc23613c9913b..2554a1f376d4b 100644 --- a/server/src/main/java/org/opensearch/rest/RestController.java +++ b/server/src/main/java/org/opensearch/rest/RestController.java @@ -48,7 +48,7 @@ import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentType; -import org.opensearch.core.internal.io.Streams; +import org.opensearch.common.util.io.Streams; import org.opensearch.http.HttpServerTransport; import org.opensearch.indices.breaker.CircuitBreakerService; import org.opensearch.usage.UsageService; diff --git a/server/src/main/java/org/opensearch/script/ScriptService.java b/server/src/main/java/org/opensearch/script/ScriptService.java index 0eeb6b38e5b27..a7de3e2f354d3 100644 --- a/server/src/main/java/org/opensearch/script/ScriptService.java +++ b/server/src/main/java/org/opensearch/script/ScriptService.java @@ -53,7 +53,7 @@ import org.opensearch.common.settings.Setting.Property; import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import java.io.Closeable; import java.io.IOException; diff --git a/server/src/main/java/org/opensearch/search/SearchService.java b/server/src/main/java/org/opensearch/search/SearchService.java index 3911bd094b594..cc1ee60dbb6bf 100644 --- a/server/src/main/java/org/opensearch/search/SearchService.java +++ b/server/src/main/java/org/opensearch/search/SearchService.java @@ -70,7 +70,7 @@ import org.opensearch.common.util.concurrent.ConcurrentCollections; import org.opensearch.common.util.concurrent.ConcurrentMapLong; import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.Index; import org.opensearch.index.IndexNotFoundException; import org.opensearch.index.IndexService; diff --git a/server/src/main/java/org/opensearch/search/suggest/phrase/DirectCandidateGenerator.java b/server/src/main/java/org/opensearch/search/suggest/phrase/DirectCandidateGenerator.java index e9131015996d9..6335629f61cf1 100644 --- a/server/src/main/java/org/opensearch/search/suggest/phrase/DirectCandidateGenerator.java +++ b/server/src/main/java/org/opensearch/search/suggest/phrase/DirectCandidateGenerator.java @@ -49,7 +49,7 @@ import org.apache.lucene.util.BytesRefBuilder; import org.apache.lucene.util.CharsRef; import org.apache.lucene.util.CharsRefBuilder; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import java.io.CharArrayReader; import java.io.IOException; diff --git a/server/src/main/java/org/opensearch/snapshots/SnapshotShardsService.java b/server/src/main/java/org/opensearch/snapshots/SnapshotShardsService.java index 86dbc31245b11..1aeda91629d4f 100644 --- a/server/src/main/java/org/opensearch/snapshots/SnapshotShardsService.java +++ b/server/src/main/java/org/opensearch/snapshots/SnapshotShardsService.java @@ -53,7 +53,7 @@ import org.opensearch.common.concurrent.GatedCloseable; import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.settings.Settings; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.engine.Engine; import org.opensearch.index.seqno.SequenceNumbers; import org.opensearch.index.shard.IndexEventListener; diff --git a/server/src/main/java/org/opensearch/tasks/TaskResultsService.java b/server/src/main/java/org/opensearch/tasks/TaskResultsService.java index c38cd6d65e7d2..1feb115cb585a 100644 --- a/server/src/main/java/org/opensearch/tasks/TaskResultsService.java +++ b/server/src/main/java/org/opensearch/tasks/TaskResultsService.java @@ -58,7 +58,7 @@ import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; -import org.opensearch.core.internal.io.Streams; +import org.opensearch.common.util.io.Streams; import org.opensearch.threadpool.ThreadPool; import java.io.ByteArrayOutputStream; diff --git a/server/src/main/java/org/opensearch/transport/ClusterConnectionManager.java b/server/src/main/java/org/opensearch/transport/ClusterConnectionManager.java index 5616980254adf..1a4854cfad8db 100644 --- a/server/src/main/java/org/opensearch/transport/ClusterConnectionManager.java +++ b/server/src/main/java/org/opensearch/transport/ClusterConnectionManager.java @@ -41,7 +41,7 @@ import org.opensearch.common.util.concurrent.OpenSearchExecutors; import org.opensearch.common.util.concurrent.ListenableFuture; import org.opensearch.common.util.concurrent.RunOnce; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import java.util.Collections; import java.util.Iterator; diff --git a/server/src/main/java/org/opensearch/transport/CompressibleBytesOutputStream.java b/server/src/main/java/org/opensearch/transport/CompressibleBytesOutputStream.java index 5c11694431fc5..6877d9679eb81 100644 --- a/server/src/main/java/org/opensearch/transport/CompressibleBytesOutputStream.java +++ b/server/src/main/java/org/opensearch/transport/CompressibleBytesOutputStream.java @@ -32,7 +32,7 @@ package org.opensearch.transport; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.compress.CompressorFactory; import org.opensearch.common.io.Streams; diff --git a/server/src/main/java/org/opensearch/transport/InboundDecoder.java b/server/src/main/java/org/opensearch/transport/InboundDecoder.java index e2c35ee7aefb8..cbc583aec762c 100644 --- a/server/src/main/java/org/opensearch/transport/InboundDecoder.java +++ b/server/src/main/java/org/opensearch/transport/InboundDecoder.java @@ -38,7 +38,7 @@ import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.lease.Releasable; import org.opensearch.common.util.PageCacheRecycler; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import java.io.IOException; import java.util.function.Consumer; diff --git a/server/src/main/java/org/opensearch/transport/InboundMessage.java b/server/src/main/java/org/opensearch/transport/InboundMessage.java index 815f77779d139..1809b000f705c 100644 --- a/server/src/main/java/org/opensearch/transport/InboundMessage.java +++ b/server/src/main/java/org/opensearch/transport/InboundMessage.java @@ -36,7 +36,7 @@ import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.lease.Releasable; import org.opensearch.common.lease.Releasables; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import java.io.IOException; diff --git a/server/src/main/java/org/opensearch/transport/OutboundHandler.java b/server/src/main/java/org/opensearch/transport/OutboundHandler.java index e890929cfc29f..785faec543023 100644 --- a/server/src/main/java/org/opensearch/transport/OutboundHandler.java +++ b/server/src/main/java/org/opensearch/transport/OutboundHandler.java @@ -49,7 +49,7 @@ import org.opensearch.common.transport.TransportAddress; import org.opensearch.common.util.BigArrays; import org.opensearch.common.util.concurrent.ThreadContext; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.threadpool.ThreadPool; import java.io.IOException; diff --git a/server/src/main/java/org/opensearch/transport/RemoteClusterConnection.java b/server/src/main/java/org/opensearch/transport/RemoteClusterConnection.java index 906513ca62249..7d6fe07666096 100644 --- a/server/src/main/java/org/opensearch/transport/RemoteClusterConnection.java +++ b/server/src/main/java/org/opensearch/transport/RemoteClusterConnection.java @@ -42,7 +42,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.concurrent.ThreadContext; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.threadpool.ThreadPool; import java.io.Closeable; diff --git a/server/src/main/java/org/opensearch/transport/RemoteClusterService.java b/server/src/main/java/org/opensearch/transport/RemoteClusterService.java index d39f80ea6b383..838367baf8a2e 100644 --- a/server/src/main/java/org/opensearch/transport/RemoteClusterService.java +++ b/server/src/main/java/org/opensearch/transport/RemoteClusterService.java @@ -49,7 +49,7 @@ import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.concurrent.ConcurrentCollections; import org.opensearch.common.util.concurrent.CountDown; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.threadpool.ThreadPool; import java.io.Closeable; diff --git a/server/src/main/java/org/opensearch/transport/SniffConnectionStrategy.java b/server/src/main/java/org/opensearch/transport/SniffConnectionStrategy.java index 8f2d2f37653d7..cbac3250d898e 100644 --- a/server/src/main/java/org/opensearch/transport/SniffConnectionStrategy.java +++ b/server/src/main/java/org/opensearch/transport/SniffConnectionStrategy.java @@ -54,7 +54,7 @@ import org.opensearch.common.transport.TransportAddress; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.core.xcontent.XContentBuilder; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.threadpool.ThreadPool; import java.io.IOException; diff --git a/server/src/main/java/org/opensearch/transport/TransportLogger.java b/server/src/main/java/org/opensearch/transport/TransportLogger.java index 96eb3e8bf5fa4..c97b35a150e91 100644 --- a/server/src/main/java/org/opensearch/transport/TransportLogger.java +++ b/server/src/main/java/org/opensearch/transport/TransportLogger.java @@ -39,7 +39,7 @@ import org.opensearch.common.io.stream.InputStreamStreamInput; import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.util.concurrent.ThreadContext; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import java.io.IOException; diff --git a/server/src/main/java/org/opensearch/transport/TransportService.java b/server/src/main/java/org/opensearch/transport/TransportService.java index f397d22a4e681..804dfab928dd4 100644 --- a/server/src/main/java/org/opensearch/transport/TransportService.java +++ b/server/src/main/java/org/opensearch/transport/TransportService.java @@ -58,7 +58,7 @@ import org.opensearch.common.util.concurrent.AbstractRunnable; import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.common.util.concurrent.ThreadContext; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.node.NodeClosedException; import org.opensearch.node.ReportingService; import org.opensearch.tasks.Task; diff --git a/server/src/test/java/org/opensearch/action/support/replication/BroadcastReplicationTests.java b/server/src/test/java/org/opensearch/action/support/replication/BroadcastReplicationTests.java index 74810fa045790..f653f98840a56 100644 --- a/server/src/test/java/org/opensearch/action/support/replication/BroadcastReplicationTests.java +++ b/server/src/test/java/org/opensearch/action/support/replication/BroadcastReplicationTests.java @@ -56,7 +56,7 @@ import org.opensearch.common.util.PageCacheRecycler; import org.opensearch.common.util.concurrent.ConcurrentCollections; import org.opensearch.common.util.concurrent.ThreadContext; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.shard.ShardId; import org.opensearch.indices.breaker.CircuitBreakerService; import org.opensearch.indices.breaker.NoneCircuitBreakerService; diff --git a/server/src/test/java/org/opensearch/cluster/routing/OperationRoutingTests.java b/server/src/test/java/org/opensearch/cluster/routing/OperationRoutingTests.java index ffdb2d39fb817..e9cbb42369a19 100644 --- a/server/src/test/java/org/opensearch/cluster/routing/OperationRoutingTests.java +++ b/server/src/test/java/org/opensearch/cluster/routing/OperationRoutingTests.java @@ -44,7 +44,7 @@ import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.Index; import org.opensearch.index.shard.ShardId; import org.opensearch.node.ResponseCollectorService; diff --git a/server/src/test/java/org/opensearch/common/blobstore/fs/FsBlobContainerTests.java b/server/src/test/java/org/opensearch/common/blobstore/fs/FsBlobContainerTests.java index 83f5c0445e21d..6c36368bfe446 100644 --- a/server/src/test/java/org/opensearch/common/blobstore/fs/FsBlobContainerTests.java +++ b/server/src/test/java/org/opensearch/common/blobstore/fs/FsBlobContainerTests.java @@ -38,7 +38,7 @@ import org.opensearch.common.io.PathUtils; import org.opensearch.common.io.PathUtilsForTesting; import org.opensearch.common.io.Streams; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.test.OpenSearchTestCase; import org.junit.After; import org.junit.Before; diff --git a/server/src/test/java/org/opensearch/common/io/StreamsTests.java b/server/src/test/java/org/opensearch/common/io/StreamsTests.java index f28d1b1762ca2..c52ce9703cc21 100644 --- a/server/src/test/java/org/opensearch/common/io/StreamsTests.java +++ b/server/src/test/java/org/opensearch/common/io/StreamsTests.java @@ -104,7 +104,7 @@ public void testLimitInputStream() throws IOException { final int limit = randomIntBetween(0, bytes.length); final BytesArray stuffArray = new BytesArray(bytes); final ByteArrayOutputStream out = new ByteArrayOutputStream(bytes.length); - final long count = org.opensearch.core.internal.io.Streams.copy(Streams.limitStream(stuffArray.streamInput(), limit), out); + final long count = org.opensearch.common.util.io.Streams.copy(Streams.limitStream(stuffArray.streamInput(), limit), out); assertEquals(limit, count); assertThat(Arrays.equals(out.toByteArray(), Arrays.copyOf(bytes, limit)), equalTo(true)); } diff --git a/server/src/test/java/org/opensearch/common/lucene/LuceneTests.java b/server/src/test/java/org/opensearch/common/lucene/LuceneTests.java index e7756cbd96734..f61338af2ba8a 100644 --- a/server/src/test/java/org/opensearch/common/lucene/LuceneTests.java +++ b/server/src/test/java/org/opensearch/common/lucene/LuceneTests.java @@ -82,7 +82,7 @@ import org.opensearch.Version; import org.opensearch.common.collect.Tuple; import org.opensearch.common.io.stream.NamedWriteableRegistry; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.fielddata.IndexFieldData; import org.opensearch.index.fielddata.fieldcomparator.BytesRefFieldComparatorSource; import org.opensearch.index.fielddata.fieldcomparator.DoubleValuesComparatorSource; diff --git a/server/src/test/java/org/opensearch/common/lucene/index/FreqTermsEnumTests.java b/server/src/test/java/org/opensearch/common/lucene/index/FreqTermsEnumTests.java index 025da248565fc..60f39208d008a 100644 --- a/server/src/test/java/org/opensearch/common/lucene/index/FreqTermsEnumTests.java +++ b/server/src/test/java/org/opensearch/common/lucene/index/FreqTermsEnumTests.java @@ -48,7 +48,7 @@ import org.apache.lucene.search.Query; import org.apache.lucene.store.Directory; import org.apache.lucene.util.BytesRef; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.common.lucene.search.Queries; import org.opensearch.common.util.BigArrays; import org.opensearch.test.OpenSearchTestCase; diff --git a/server/src/test/java/org/opensearch/common/lucene/index/OpenSearchDirectoryReaderTests.java b/server/src/test/java/org/opensearch/common/lucene/index/OpenSearchDirectoryReaderTests.java index 1a2e23d43b579..cf4cc5cd56f68 100644 --- a/server/src/test/java/org/opensearch/common/lucene/index/OpenSearchDirectoryReaderTests.java +++ b/server/src/test/java/org/opensearch/common/lucene/index/OpenSearchDirectoryReaderTests.java @@ -41,7 +41,7 @@ import org.apache.lucene.index.NoMergePolicy; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.shard.ShardId; import org.opensearch.test.OpenSearchTestCase; diff --git a/server/src/test/java/org/opensearch/common/util/concurrent/AbstractAsyncTaskTests.java b/server/src/test/java/org/opensearch/common/util/concurrent/AbstractAsyncTaskTests.java index b62b830de5036..e56a1793c06e6 100644 --- a/server/src/test/java/org/opensearch/common/util/concurrent/AbstractAsyncTaskTests.java +++ b/server/src/test/java/org/opensearch/common/util/concurrent/AbstractAsyncTaskTests.java @@ -33,7 +33,7 @@ import org.opensearch.common.Randomness; import org.opensearch.common.unit.TimeValue; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.threadpool.TestThreadPool; import org.opensearch.threadpool.ThreadPool; diff --git a/server/src/test/java/org/opensearch/discovery/DiscoveryModuleTests.java b/server/src/test/java/org/opensearch/discovery/DiscoveryModuleTests.java index 1be312194d336..2a2e95e529c7e 100644 --- a/server/src/test/java/org/opensearch/discovery/DiscoveryModuleTests.java +++ b/server/src/test/java/org/opensearch/discovery/DiscoveryModuleTests.java @@ -43,7 +43,7 @@ import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Settings; import org.opensearch.common.util.concurrent.ThreadContext; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.gateway.GatewayMetaState; import org.opensearch.plugins.DiscoveryPlugin; import org.opensearch.test.OpenSearchTestCase; diff --git a/server/src/test/java/org/opensearch/discovery/SeedHostsResolverTests.java b/server/src/test/java/org/opensearch/discovery/SeedHostsResolverTests.java index 53e7f59460e47..60800ee6b64eb 100644 --- a/server/src/test/java/org/opensearch/discovery/SeedHostsResolverTests.java +++ b/server/src/test/java/org/opensearch/discovery/SeedHostsResolverTests.java @@ -46,7 +46,7 @@ import org.opensearch.common.util.PageCacheRecycler; import org.opensearch.common.util.concurrent.OpenSearchExecutors; import org.opensearch.common.util.concurrent.FutureUtils; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.indices.breaker.NoneCircuitBreakerService; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.threadpool.TestThreadPool; diff --git a/server/src/test/java/org/opensearch/env/NodeEnvironmentTests.java b/server/src/test/java/org/opensearch/env/NodeEnvironmentTests.java index 8e997ae6d37ae..4c07fc2619e7f 100644 --- a/server/src/test/java/org/opensearch/env/NodeEnvironmentTests.java +++ b/server/src/test/java/org/opensearch/env/NodeEnvironmentTests.java @@ -43,7 +43,7 @@ import org.opensearch.common.unit.ByteSizeValue; import org.opensearch.common.util.concurrent.AbstractRunnable; import org.opensearch.common.util.set.Sets; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.gateway.MetadataStateFormat; import org.opensearch.index.Index; import org.opensearch.index.IndexSettings; diff --git a/server/src/test/java/org/opensearch/gateway/GatewayMetaStatePersistedStateTests.java b/server/src/test/java/org/opensearch/gateway/GatewayMetaStatePersistedStateTests.java index cc9a7a70b99f4..830a8a9ad8ab7 100644 --- a/server/src/test/java/org/opensearch/gateway/GatewayMetaStatePersistedStateTests.java +++ b/server/src/test/java/org/opensearch/gateway/GatewayMetaStatePersistedStateTests.java @@ -54,7 +54,7 @@ import org.opensearch.common.util.MockBigArrays; import org.opensearch.common.util.MockPageCacheRecycler; import org.opensearch.common.util.set.Sets; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.Environment; import org.opensearch.env.NodeEnvironment; import org.opensearch.env.TestEnvironment; diff --git a/server/src/test/java/org/opensearch/gateway/PersistedClusterStateServiceTests.java b/server/src/test/java/org/opensearch/gateway/PersistedClusterStateServiceTests.java index d7b8712a46f66..2b8cec86db5a2 100644 --- a/server/src/test/java/org/opensearch/gateway/PersistedClusterStateServiceTests.java +++ b/server/src/test/java/org/opensearch/gateway/PersistedClusterStateServiceTests.java @@ -56,7 +56,7 @@ import org.opensearch.common.util.BigArrays; import org.opensearch.common.util.MockBigArrays; import org.opensearch.common.util.MockPageCacheRecycler; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.Environment; import org.opensearch.env.NodeEnvironment; import org.opensearch.env.NodeMetadata; diff --git a/server/src/test/java/org/opensearch/index/IndexModuleTests.java b/server/src/test/java/org/opensearch/index/IndexModuleTests.java index 4fe09f83e5147..d9d87196ca289 100644 --- a/server/src/test/java/org/opensearch/index/IndexModuleTests.java +++ b/server/src/test/java/org/opensearch/index/IndexModuleTests.java @@ -65,7 +65,7 @@ import org.opensearch.common.util.PageCacheRecycler; import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.common.util.concurrent.ThreadContext; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.Environment; import org.opensearch.env.NodeEnvironment; import org.opensearch.env.ShardLock; diff --git a/server/src/test/java/org/opensearch/index/cache/bitset/BitSetFilterCacheTests.java b/server/src/test/java/org/opensearch/index/cache/bitset/BitSetFilterCacheTests.java index 1f5833ef37fb3..38b5bf8d81f66 100644 --- a/server/src/test/java/org/opensearch/index/cache/bitset/BitSetFilterCacheTests.java +++ b/server/src/test/java/org/opensearch/index/cache/bitset/BitSetFilterCacheTests.java @@ -52,7 +52,7 @@ import org.apache.lucene.util.BitSet; import org.opensearch.common.lucene.index.OpenSearchDirectoryReader; import org.opensearch.common.settings.Settings; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.IndexSettings; import org.opensearch.index.shard.ShardId; import org.opensearch.test.OpenSearchTestCase; diff --git a/server/src/test/java/org/opensearch/index/engine/CompletionStatsCacheTests.java b/server/src/test/java/org/opensearch/index/engine/CompletionStatsCacheTests.java index 74ce2d5bba186..b746d0ba8a56d 100644 --- a/server/src/test/java/org/opensearch/index/engine/CompletionStatsCacheTests.java +++ b/server/src/test/java/org/opensearch/index/engine/CompletionStatsCacheTests.java @@ -43,7 +43,7 @@ import org.apache.lucene.search.suggest.document.SuggestField; import org.apache.lucene.store.Directory; import org.opensearch.OpenSearchException; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.search.suggest.completion.CompletionStats; import org.opensearch.test.OpenSearchTestCase; diff --git a/server/src/test/java/org/opensearch/index/engine/InternalEngineTests.java b/server/src/test/java/org/opensearch/index/engine/InternalEngineTests.java index cc1aaa02853e2..e2adb8de0fe7a 100644 --- a/server/src/test/java/org/opensearch/index/engine/InternalEngineTests.java +++ b/server/src/test/java/org/opensearch/index/engine/InternalEngineTests.java @@ -118,7 +118,7 @@ import org.opensearch.common.util.concurrent.ConcurrentCollections; import org.opensearch.common.util.concurrent.ReleasableLock; import org.opensearch.common.xcontent.XContentType; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.IndexSettings; import org.opensearch.index.VersionType; import org.opensearch.index.codec.CodecService; diff --git a/server/src/test/java/org/opensearch/index/engine/LuceneChangesSnapshotTests.java b/server/src/test/java/org/opensearch/index/engine/LuceneChangesSnapshotTests.java index d1a3097005e6c..b9b0e64d8811f 100644 --- a/server/src/test/java/org/opensearch/index/engine/LuceneChangesSnapshotTests.java +++ b/server/src/test/java/org/opensearch/index/engine/LuceneChangesSnapshotTests.java @@ -33,7 +33,7 @@ package org.opensearch.index.engine; import org.opensearch.common.settings.Settings; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.IndexSettings; import org.opensearch.index.mapper.MapperService; import org.opensearch.index.mapper.ParsedDocument; diff --git a/server/src/test/java/org/opensearch/index/engine/NoOpEngineTests.java b/server/src/test/java/org/opensearch/index/engine/NoOpEngineTests.java index e53a3b09a5eb6..b9fe69c282471 100644 --- a/server/src/test/java/org/opensearch/index/engine/NoOpEngineTests.java +++ b/server/src/test/java/org/opensearch/index/engine/NoOpEngineTests.java @@ -46,7 +46,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.ByteSizeValue; import org.opensearch.common.unit.TimeValue; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.IndexSettings; import org.opensearch.index.mapper.ParsedDocument; import org.opensearch.index.seqno.ReplicationTracker; diff --git a/server/src/test/java/org/opensearch/index/engine/ReadOnlyEngineTests.java b/server/src/test/java/org/opensearch/index/engine/ReadOnlyEngineTests.java index 2ce7c62cbdfbd..fed07e3805642 100644 --- a/server/src/test/java/org/opensearch/index/engine/ReadOnlyEngineTests.java +++ b/server/src/test/java/org/opensearch/index/engine/ReadOnlyEngineTests.java @@ -42,7 +42,7 @@ import org.opensearch.common.lucene.index.OpenSearchDirectoryReader; import org.opensearch.common.settings.Settings; import org.opensearch.common.util.FeatureFlags; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.IndexModule; import org.opensearch.index.IndexSettings; import org.opensearch.index.mapper.ParsedDocument; diff --git a/server/src/test/java/org/opensearch/index/fielddata/plain/HalfFloatFielddataTests.java b/server/src/test/java/org/opensearch/index/fielddata/plain/HalfFloatFielddataTests.java index be631cc311b2a..62c475c88045a 100644 --- a/server/src/test/java/org/opensearch/index/fielddata/plain/HalfFloatFielddataTests.java +++ b/server/src/test/java/org/opensearch/index/fielddata/plain/HalfFloatFielddataTests.java @@ -39,7 +39,7 @@ import org.apache.lucene.index.IndexableField; import org.apache.lucene.index.LeafReader; import org.apache.lucene.store.Directory; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.apache.lucene.tests.util.TestUtil; import org.opensearch.index.fielddata.FieldData; import org.opensearch.index.fielddata.SortedNumericDoubleValues; diff --git a/server/src/test/java/org/opensearch/index/mapper/DateFieldTypeTests.java b/server/src/test/java/org/opensearch/index/mapper/DateFieldTypeTests.java index 2300d3cceab65..d360a2a767e8a 100644 --- a/server/src/test/java/org/opensearch/index/mapper/DateFieldTypeTests.java +++ b/server/src/test/java/org/opensearch/index/mapper/DateFieldTypeTests.java @@ -52,7 +52,7 @@ import org.opensearch.common.time.DateFormatters; import org.opensearch.common.time.DateMathParser; import org.opensearch.common.util.BigArrays; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.IndexSettings; import org.opensearch.index.fielddata.IndexNumericFieldData; import org.opensearch.index.fielddata.LeafNumericFieldData; diff --git a/server/src/test/java/org/opensearch/index/mapper/NumberFieldTypeTests.java b/server/src/test/java/org/opensearch/index/mapper/NumberFieldTypeTests.java index 863e29abaedf7..d43d009f57566 100644 --- a/server/src/test/java/org/opensearch/index/mapper/NumberFieldTypeTests.java +++ b/server/src/test/java/org/opensearch/index/mapper/NumberFieldTypeTests.java @@ -59,7 +59,7 @@ import org.opensearch.common.util.BigArrays; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentType; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.IndexSettings; import org.opensearch.index.fielddata.IndexNumericFieldData; import org.opensearch.index.mapper.MappedFieldType.Relation; diff --git a/server/src/test/java/org/opensearch/index/seqno/GlobalCheckpointSyncActionTests.java b/server/src/test/java/org/opensearch/index/seqno/GlobalCheckpointSyncActionTests.java index 75063d76ff8dc..241059867f5fd 100644 --- a/server/src/test/java/org/opensearch/index/seqno/GlobalCheckpointSyncActionTests.java +++ b/server/src/test/java/org/opensearch/index/seqno/GlobalCheckpointSyncActionTests.java @@ -38,7 +38,7 @@ import org.opensearch.cluster.action.shard.ShardStateAction; import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.settings.Settings; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.Index; import org.opensearch.index.IndexService; import org.opensearch.index.shard.IndexShard; diff --git a/server/src/test/java/org/opensearch/index/seqno/RetentionLeaseBackgroundSyncActionTests.java b/server/src/test/java/org/opensearch/index/seqno/RetentionLeaseBackgroundSyncActionTests.java index 2e058b6dab560..b65662a53ea91 100644 --- a/server/src/test/java/org/opensearch/index/seqno/RetentionLeaseBackgroundSyncActionTests.java +++ b/server/src/test/java/org/opensearch/index/seqno/RetentionLeaseBackgroundSyncActionTests.java @@ -42,7 +42,7 @@ import org.opensearch.cluster.action.shard.ShardStateAction; import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.settings.Settings; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.gateway.WriteStateException; import org.opensearch.index.Index; import org.opensearch.index.IndexService; diff --git a/server/src/test/java/org/opensearch/index/seqno/RetentionLeaseSyncActionTests.java b/server/src/test/java/org/opensearch/index/seqno/RetentionLeaseSyncActionTests.java index b07b740fe3744..579b8ce1c5aa6 100644 --- a/server/src/test/java/org/opensearch/index/seqno/RetentionLeaseSyncActionTests.java +++ b/server/src/test/java/org/opensearch/index/seqno/RetentionLeaseSyncActionTests.java @@ -41,7 +41,7 @@ import org.opensearch.cluster.action.shard.ShardStateAction; import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.settings.Settings; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.Index; import org.opensearch.index.IndexService; import org.opensearch.index.IndexingPressureService; diff --git a/server/src/test/java/org/opensearch/index/shard/IndexReaderWrapperTests.java b/server/src/test/java/org/opensearch/index/shard/IndexReaderWrapperTests.java index 6b58633d5cd2e..f030c3cb21c62 100644 --- a/server/src/test/java/org/opensearch/index/shard/IndexReaderWrapperTests.java +++ b/server/src/test/java/org/opensearch/index/shard/IndexReaderWrapperTests.java @@ -48,7 +48,7 @@ import org.apache.lucene.store.Directory; import org.opensearch.common.CheckedFunction; import org.opensearch.common.lucene.index.OpenSearchDirectoryReader; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.engine.Engine; import org.opensearch.test.OpenSearchTestCase; diff --git a/server/src/test/java/org/opensearch/index/shard/RefreshListenersTests.java b/server/src/test/java/org/opensearch/index/shard/RefreshListenersTests.java index dbb0207b4f1b7..9bb36bc32639a 100644 --- a/server/src/test/java/org/opensearch/index/shard/RefreshListenersTests.java +++ b/server/src/test/java/org/opensearch/index/shard/RefreshListenersTests.java @@ -52,7 +52,7 @@ import org.opensearch.common.util.BigArrays; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.common.xcontent.XContentType; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.Index; import org.opensearch.index.IndexSettings; import org.opensearch.index.codec.CodecService; diff --git a/server/src/test/java/org/opensearch/index/shard/ShardUtilsTests.java b/server/src/test/java/org/opensearch/index/shard/ShardUtilsTests.java index 25a385f157b5c..fa30fbbac9a0d 100644 --- a/server/src/test/java/org/opensearch/index/shard/ShardUtilsTests.java +++ b/server/src/test/java/org/opensearch/index/shard/ShardUtilsTests.java @@ -39,7 +39,7 @@ import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.tests.store.BaseDirectoryWrapper; import org.opensearch.common.lucene.index.OpenSearchDirectoryReader; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.test.OpenSearchTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/opensearch/index/shard/StoreRecoveryTests.java b/server/src/test/java/org/opensearch/index/shard/StoreRecoveryTests.java index 64b6490ace1c7..1f384285bd633 100644 --- a/server/src/test/java/org/opensearch/index/shard/StoreRecoveryTests.java +++ b/server/src/test/java/org/opensearch/index/shard/StoreRecoveryTests.java @@ -56,7 +56,7 @@ import org.opensearch.cluster.metadata.IndexMetadata; import org.opensearch.cluster.routing.OperationRouting; import org.opensearch.common.settings.Settings; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.engine.Engine; import org.opensearch.index.mapper.IdFieldMapper; import org.opensearch.index.mapper.Uid; diff --git a/server/src/test/java/org/opensearch/index/store/StoreTests.java b/server/src/test/java/org/opensearch/index/store/StoreTests.java index 3bcc244bf7fc5..b810aa7d197f2 100644 --- a/server/src/test/java/org/opensearch/index/store/StoreTests.java +++ b/server/src/test/java/org/opensearch/index/store/StoreTests.java @@ -75,7 +75,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.FeatureFlags; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.ShardLock; import org.opensearch.index.Index; import org.opensearch.index.IndexModule; diff --git a/server/src/test/java/org/opensearch/index/translog/LocalTranslogTests.java b/server/src/test/java/org/opensearch/index/translog/LocalTranslogTests.java index 3fb40ab64cc52..6c1741d68cb05 100644 --- a/server/src/test/java/org/opensearch/index/translog/LocalTranslogTests.java +++ b/server/src/test/java/org/opensearch/index/translog/LocalTranslogTests.java @@ -72,7 +72,7 @@ import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.IndexSettings; import org.opensearch.index.VersionType; import org.opensearch.index.engine.Engine; diff --git a/server/src/test/java/org/opensearch/index/translog/RemoteFSTranslogTests.java b/server/src/test/java/org/opensearch/index/translog/RemoteFSTranslogTests.java index d5acf3efde6e6..0a6b6a95b74f9 100644 --- a/server/src/test/java/org/opensearch/index/translog/RemoteFSTranslogTests.java +++ b/server/src/test/java/org/opensearch/index/translog/RemoteFSTranslogTests.java @@ -36,7 +36,7 @@ import org.opensearch.common.util.concurrent.AbstractRunnable; import org.opensearch.common.util.concurrent.ConcurrentCollections; import org.opensearch.core.xcontent.NamedXContentRegistry; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.Environment; import org.opensearch.env.TestEnvironment; import org.opensearch.index.IndexSettings; diff --git a/server/src/test/java/org/opensearch/index/translog/TestTranslog.java b/server/src/test/java/org/opensearch/index/translog/TestTranslog.java index 3545f2dbf5ffc..73a3a1c646d5b 100644 --- a/server/src/test/java/org/opensearch/index/translog/TestTranslog.java +++ b/server/src/test/java/org/opensearch/index/translog/TestTranslog.java @@ -37,7 +37,7 @@ import org.apache.logging.log4j.Logger; import org.apache.lucene.tests.util.LuceneTestCase; import org.opensearch.common.io.stream.InputStreamStreamInput; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.test.OpenSearchTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/opensearch/index/translog/TranslogDeletionPolicyTests.java b/server/src/test/java/org/opensearch/index/translog/TranslogDeletionPolicyTests.java index e5a41fdc15da1..983a42880e34c 100644 --- a/server/src/test/java/org/opensearch/index/translog/TranslogDeletionPolicyTests.java +++ b/server/src/test/java/org/opensearch/index/translog/TranslogDeletionPolicyTests.java @@ -38,7 +38,7 @@ import org.opensearch.common.io.stream.BytesStreamOutput; import org.opensearch.common.lease.Releasable; import org.opensearch.common.util.BigArrays; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.shard.ShardId; import org.opensearch.test.OpenSearchTestCase; import org.mockito.Mockito; diff --git a/server/src/test/java/org/opensearch/index/translog/TranslogManagerTestCase.java b/server/src/test/java/org/opensearch/index/translog/TranslogManagerTestCase.java index 4c3948cbd7b5b..44e8d52b034de 100644 --- a/server/src/test/java/org/opensearch/index/translog/TranslogManagerTestCase.java +++ b/server/src/test/java/org/opensearch/index/translog/TranslogManagerTestCase.java @@ -24,7 +24,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.util.BigArrays; import org.opensearch.common.xcontent.XContentType; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.Index; import org.opensearch.index.IndexSettings; import org.opensearch.index.engine.Engine; diff --git a/server/src/test/java/org/opensearch/indices/IndicesQueryCacheTests.java b/server/src/test/java/org/opensearch/indices/IndicesQueryCacheTests.java index 24d8d51042548..b1a44d94aa0e1 100644 --- a/server/src/test/java/org/opensearch/indices/IndicesQueryCacheTests.java +++ b/server/src/test/java/org/opensearch/indices/IndicesQueryCacheTests.java @@ -51,7 +51,7 @@ import org.apache.lucene.search.Weight; import org.apache.lucene.store.Directory; import org.opensearch.common.lucene.index.OpenSearchDirectoryReader; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.common.settings.Settings; import org.opensearch.index.cache.query.QueryCacheStats; import org.opensearch.index.shard.ShardId; diff --git a/server/src/test/java/org/opensearch/indices/IndicesRequestCacheTests.java b/server/src/test/java/org/opensearch/indices/IndicesRequestCacheTests.java index 8342524b264aa..d10b99f42e0df 100644 --- a/server/src/test/java/org/opensearch/indices/IndicesRequestCacheTests.java +++ b/server/src/test/java/org/opensearch/indices/IndicesRequestCacheTests.java @@ -54,7 +54,7 @@ import org.opensearch.common.unit.ByteSizeValue; import org.opensearch.common.xcontent.XContentHelper; import org.opensearch.common.xcontent.XContentType; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.cache.request.ShardRequestCache; import org.opensearch.index.query.TermQueryBuilder; import org.opensearch.index.shard.ShardId; diff --git a/server/src/test/java/org/opensearch/indices/recovery/LocalStorePeerRecoverySourceHandlerTests.java b/server/src/test/java/org/opensearch/indices/recovery/LocalStorePeerRecoverySourceHandlerTests.java index 307cb854f000a..ae59798d0695f 100644 --- a/server/src/test/java/org/opensearch/indices/recovery/LocalStorePeerRecoverySourceHandlerTests.java +++ b/server/src/test/java/org/opensearch/indices/recovery/LocalStorePeerRecoverySourceHandlerTests.java @@ -72,7 +72,7 @@ import org.opensearch.common.util.CancellableThreads; import org.opensearch.common.util.concurrent.ConcurrentCollections; import org.opensearch.common.xcontent.XContentType; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.IndexSettings; import org.opensearch.index.engine.Engine; import org.opensearch.index.engine.RecoveryEngineException; diff --git a/server/src/test/java/org/opensearch/indices/recovery/PeerRecoveryTargetServiceTests.java b/server/src/test/java/org/opensearch/indices/recovery/PeerRecoveryTargetServiceTests.java index ff4058f953642..991215711f039 100644 --- a/server/src/test/java/org/opensearch/indices/recovery/PeerRecoveryTargetServiceTests.java +++ b/server/src/test/java/org/opensearch/indices/recovery/PeerRecoveryTargetServiceTests.java @@ -48,7 +48,7 @@ import org.opensearch.common.bytes.BytesArray; import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.XContentType; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.engine.EngineConfigFactory; import org.opensearch.index.engine.NoOpEngine; import org.opensearch.index.mapper.SourceToParse; diff --git a/server/src/test/java/org/opensearch/indices/replication/PrimaryShardReplicationSourceTests.java b/server/src/test/java/org/opensearch/indices/replication/PrimaryShardReplicationSourceTests.java index d925956bd95ef..10b747b822819 100644 --- a/server/src/test/java/org/opensearch/indices/replication/PrimaryShardReplicationSourceTests.java +++ b/server/src/test/java/org/opensearch/indices/replication/PrimaryShardReplicationSourceTests.java @@ -17,7 +17,7 @@ import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Settings; import org.opensearch.common.util.CancellableThreads; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.shard.IndexShard; import org.opensearch.index.shard.IndexShardTestCase; import org.opensearch.index.store.Store; diff --git a/server/src/test/java/org/opensearch/indices/replication/SegmentFileTransferHandlerTests.java b/server/src/test/java/org/opensearch/indices/replication/SegmentFileTransferHandlerTests.java index 0400d73da4503..8fc7b8b6f4908 100644 --- a/server/src/test/java/org/opensearch/indices/replication/SegmentFileTransferHandlerTests.java +++ b/server/src/test/java/org/opensearch/indices/replication/SegmentFileTransferHandlerTests.java @@ -16,7 +16,7 @@ import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.util.CancellableThreads; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.shard.IndexShard; import org.opensearch.index.shard.IndexShardTestCase; import org.opensearch.index.store.Store; diff --git a/server/src/test/java/org/opensearch/indices/replication/checkpoint/PublishCheckpointActionTests.java b/server/src/test/java/org/opensearch/indices/replication/checkpoint/PublishCheckpointActionTests.java index 2c05fbc9328e5..8a67292703da0 100644 --- a/server/src/test/java/org/opensearch/indices/replication/checkpoint/PublishCheckpointActionTests.java +++ b/server/src/test/java/org/opensearch/indices/replication/checkpoint/PublishCheckpointActionTests.java @@ -17,7 +17,7 @@ import org.opensearch.cluster.action.shard.ShardStateAction; import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.settings.Settings; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.Index; import org.opensearch.index.IndexService; import org.opensearch.index.shard.IndexShard; diff --git a/server/src/test/java/org/opensearch/repositories/blobstore/BlobStoreRepositoryRestoreTests.java b/server/src/test/java/org/opensearch/repositories/blobstore/BlobStoreRepositoryRestoreTests.java index 81a4a4eace608..63b144dae9c93 100644 --- a/server/src/test/java/org/opensearch/repositories/blobstore/BlobStoreRepositoryRestoreTests.java +++ b/server/src/test/java/org/opensearch/repositories/blobstore/BlobStoreRepositoryRestoreTests.java @@ -45,7 +45,7 @@ import org.opensearch.common.UUIDs; import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Settings; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.Environment; import org.opensearch.env.TestEnvironment; import org.opensearch.index.engine.EngineConfigFactory; diff --git a/server/src/test/java/org/opensearch/rest/RestControllerTests.java b/server/src/test/java/org/opensearch/rest/RestControllerTests.java index 57ea5e2928cb3..ace7762989411 100644 --- a/server/src/test/java/org/opensearch/rest/RestControllerTests.java +++ b/server/src/test/java/org/opensearch/rest/RestControllerTests.java @@ -46,7 +46,7 @@ import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.common.xcontent.XContentType; import org.opensearch.common.xcontent.yaml.YamlXContent; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.http.HttpInfo; import org.opensearch.http.HttpRequest; import org.opensearch.http.HttpResponse; diff --git a/server/src/test/java/org/opensearch/search/SearchCancellationTests.java b/server/src/test/java/org/opensearch/search/SearchCancellationTests.java index f479f3a1b99f1..db807e31d0238 100644 --- a/server/src/test/java/org/opensearch/search/SearchCancellationTests.java +++ b/server/src/test/java/org/opensearch/search/SearchCancellationTests.java @@ -48,7 +48,7 @@ import org.apache.lucene.tests.util.TestUtil; import org.apache.lucene.util.automaton.CompiledAutomaton; import org.apache.lucene.util.automaton.RegExp; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.search.internal.ContextIndexSearcher; import org.opensearch.tasks.TaskCancelledException; import org.opensearch.test.OpenSearchTestCase; diff --git a/server/src/test/java/org/opensearch/search/internal/ContextIndexSearcherTests.java b/server/src/test/java/org/opensearch/search/internal/ContextIndexSearcherTests.java index eb7dde4b0b2ce..82dcbd6f69aa4 100644 --- a/server/src/test/java/org/opensearch/search/internal/ContextIndexSearcherTests.java +++ b/server/src/test/java/org/opensearch/search/internal/ContextIndexSearcherTests.java @@ -77,7 +77,7 @@ import org.opensearch.common.lucene.index.OpenSearchDirectoryReader; import org.opensearch.common.lucene.index.SequentialStoredFieldsLeafReader; import org.opensearch.common.settings.Settings; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.IndexSettings; import org.opensearch.index.cache.bitset.BitsetFilterCache; import org.opensearch.index.shard.ShardId; diff --git a/server/src/test/java/org/opensearch/search/profile/query/QueryProfilerTests.java b/server/src/test/java/org/opensearch/search/profile/query/QueryProfilerTests.java index 7f4dcdaed2aa1..da2a70514a716 100644 --- a/server/src/test/java/org/opensearch/search/profile/query/QueryProfilerTests.java +++ b/server/src/test/java/org/opensearch/search/profile/query/QueryProfilerTests.java @@ -58,7 +58,7 @@ import org.apache.lucene.search.Weight; import org.apache.lucene.store.Directory; import org.apache.lucene.tests.util.TestUtil; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.search.internal.ContextIndexSearcher; import org.opensearch.search.profile.ProfileResult; import org.opensearch.test.OpenSearchTestCase; diff --git a/server/src/test/java/org/opensearch/transport/InboundPipelineTests.java b/server/src/test/java/org/opensearch/transport/InboundPipelineTests.java index 43de41bff69d4..7be191e00d968 100644 --- a/server/src/test/java/org/opensearch/transport/InboundPipelineTests.java +++ b/server/src/test/java/org/opensearch/transport/InboundPipelineTests.java @@ -47,7 +47,7 @@ import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.PageCacheRecycler; import org.opensearch.common.util.concurrent.ThreadContext; -import org.opensearch.core.internal.io.Streams; +import org.opensearch.common.util.io.Streams; import org.opensearch.test.OpenSearchTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/opensearch/transport/OutboundHandlerTests.java b/server/src/test/java/org/opensearch/transport/OutboundHandlerTests.java index c4a25f7d80be7..1cc115bf65a00 100644 --- a/server/src/test/java/org/opensearch/transport/OutboundHandlerTests.java +++ b/server/src/test/java/org/opensearch/transport/OutboundHandlerTests.java @@ -48,7 +48,7 @@ import org.opensearch.common.util.BigArrays; import org.opensearch.common.util.PageCacheRecycler; import org.opensearch.common.util.concurrent.ThreadContext; -import org.opensearch.core.internal.io.Streams; +import org.opensearch.common.util.io.Streams; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.threadpool.TestThreadPool; import org.opensearch.threadpool.ThreadPool; diff --git a/server/src/test/java/org/opensearch/transport/RemoteClusterConnectionTests.java b/server/src/test/java/org/opensearch/transport/RemoteClusterConnectionTests.java index fdbb3280e4278..86b40b3f84536 100644 --- a/server/src/test/java/org/opensearch/transport/RemoteClusterConnectionTests.java +++ b/server/src/test/java/org/opensearch/transport/RemoteClusterConnectionTests.java @@ -60,7 +60,7 @@ import org.opensearch.common.unit.TimeValue; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentFactory; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.IndexNotFoundException; import org.opensearch.search.SearchHit; import org.opensearch.search.SearchHits; diff --git a/server/src/test/java/org/opensearch/transport/RemoteClusterServiceTests.java b/server/src/test/java/org/opensearch/transport/RemoteClusterServiceTests.java index b8dd17da45acb..dea42684d2e21 100644 --- a/server/src/test/java/org/opensearch/transport/RemoteClusterServiceTests.java +++ b/server/src/test/java/org/opensearch/transport/RemoteClusterServiceTests.java @@ -43,7 +43,7 @@ import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.transport.MockTransportService; import org.opensearch.threadpool.TestThreadPool; diff --git a/server/src/test/java/org/opensearch/transport/TransportActionProxyTests.java b/server/src/test/java/org/opensearch/transport/TransportActionProxyTests.java index 0488f249cb09e..2bbbab1b2ccbd 100644 --- a/server/src/test/java/org/opensearch/transport/TransportActionProxyTests.java +++ b/server/src/test/java/org/opensearch/transport/TransportActionProxyTests.java @@ -38,7 +38,7 @@ import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.io.stream.StreamOutput; import org.opensearch.common.settings.Settings; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.transport.MockTransportService; import org.opensearch.threadpool.TestThreadPool; diff --git a/server/src/test/java/org/opensearch/watcher/FileWatcherTests.java b/server/src/test/java/org/opensearch/watcher/FileWatcherTests.java index 74c9cd91b72f0..3e90784a15ab9 100644 --- a/server/src/test/java/org/opensearch/watcher/FileWatcherTests.java +++ b/server/src/test/java/org/opensearch/watcher/FileWatcherTests.java @@ -31,7 +31,7 @@ package org.opensearch.watcher; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.apache.lucene.tests.util.LuceneTestCase; import org.opensearch.test.OpenSearchTestCase; diff --git a/test/framework/src/main/java/org/opensearch/index/engine/EngineTestCase.java b/test/framework/src/main/java/org/opensearch/index/engine/EngineTestCase.java index 24e5af1ba960f..9370a2a211725 100644 --- a/test/framework/src/main/java/org/opensearch/index/engine/EngineTestCase.java +++ b/test/framework/src/main/java/org/opensearch/index/engine/EngineTestCase.java @@ -87,7 +87,7 @@ import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.Index; import org.opensearch.index.IndexSettings; import org.opensearch.index.MapperTestUtils; diff --git a/test/framework/src/main/java/org/opensearch/index/shard/IndexShardTestCase.java b/test/framework/src/main/java/org/opensearch/index/shard/IndexShardTestCase.java index f21cc44d94243..7b81bd45cc8b6 100644 --- a/test/framework/src/main/java/org/opensearch/index/shard/IndexShardTestCase.java +++ b/test/framework/src/main/java/org/opensearch/index/shard/IndexShardTestCase.java @@ -73,7 +73,7 @@ import org.opensearch.common.unit.ByteSizeValue; import org.opensearch.common.util.BigArrays; import org.opensearch.common.xcontent.XContentType; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.NodeEnvironment; import org.opensearch.index.Index; import org.opensearch.index.IndexSettings; diff --git a/test/framework/src/main/java/org/opensearch/test/AbstractBuilderTestCase.java b/test/framework/src/main/java/org/opensearch/test/AbstractBuilderTestCase.java index 3eb56c9451c97..99659e06102b3 100644 --- a/test/framework/src/main/java/org/opensearch/test/AbstractBuilderTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/AbstractBuilderTestCase.java @@ -57,7 +57,7 @@ import org.opensearch.common.settings.SettingsModule; import org.opensearch.common.util.BigArrays; import org.opensearch.core.xcontent.NamedXContentRegistry; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.Environment; import org.opensearch.env.TestEnvironment; import org.opensearch.index.Index; diff --git a/test/framework/src/main/java/org/opensearch/test/AbstractMultiClustersTestCase.java b/test/framework/src/main/java/org/opensearch/test/AbstractMultiClustersTestCase.java index 69d30beaa8e16..f50603a7d8e1e 100644 --- a/test/framework/src/main/java/org/opensearch/test/AbstractMultiClustersTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/AbstractMultiClustersTestCase.java @@ -37,7 +37,7 @@ import org.opensearch.client.Client; import org.opensearch.common.network.NetworkModule; import org.opensearch.common.settings.Settings; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.plugins.Plugin; import org.opensearch.test.transport.MockTransportService; import org.opensearch.transport.RemoteClusterAware; diff --git a/test/framework/src/main/java/org/opensearch/test/InternalTestCluster.java b/test/framework/src/main/java/org/opensearch/test/InternalTestCluster.java index f9ae36a1a55e6..121003f66fc94 100644 --- a/test/framework/src/main/java/org/opensearch/test/InternalTestCluster.java +++ b/test/framework/src/main/java/org/opensearch/test/InternalTestCluster.java @@ -87,7 +87,7 @@ import org.opensearch.common.util.concurrent.FutureUtils; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.common.util.set.Sets; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.Environment; import org.opensearch.env.NodeEnvironment; import org.opensearch.env.ShardLockObtainFailedException; diff --git a/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java b/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java index a93de8a9b4ce9..2cdcd70869069 100644 --- a/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java @@ -119,7 +119,7 @@ import org.opensearch.core.xcontent.XContentParser; import org.opensearch.common.xcontent.XContentType; import org.opensearch.common.xcontent.smile.SmileXContent; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.Environment; import org.opensearch.env.TestEnvironment; import org.opensearch.http.HttpInfo; diff --git a/test/framework/src/main/java/org/opensearch/test/OpenSearchSingleNodeTestCase.java b/test/framework/src/main/java/org/opensearch/test/OpenSearchSingleNodeTestCase.java index c8f475ba96edd..3d03c3d4b04c9 100644 --- a/test/framework/src/main/java/org/opensearch/test/OpenSearchSingleNodeTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/OpenSearchSingleNodeTestCase.java @@ -52,7 +52,7 @@ import org.opensearch.common.util.concurrent.OpenSearchExecutors; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.XContentBuilder; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.env.Environment; import org.opensearch.env.NodeEnvironment; import org.opensearch.index.Index; diff --git a/test/framework/src/main/java/org/opensearch/test/StreamsUtils.java b/test/framework/src/main/java/org/opensearch/test/StreamsUtils.java index 6579815deeb48..644274b135b7e 100644 --- a/test/framework/src/main/java/org/opensearch/test/StreamsUtils.java +++ b/test/framework/src/main/java/org/opensearch/test/StreamsUtils.java @@ -34,7 +34,7 @@ import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.io.stream.BytesStreamOutput; -import org.opensearch.core.internal.io.Streams; +import org.opensearch.common.util.io.Streams; import java.io.FileNotFoundException; import java.io.IOException; diff --git a/test/framework/src/main/java/org/opensearch/test/rest/OpenSearchRestTestCase.java b/test/framework/src/main/java/org/opensearch/test/rest/OpenSearchRestTestCase.java index 70dfba204ff9e..a5d2e6793f397 100644 --- a/test/framework/src/main/java/org/opensearch/test/rest/OpenSearchRestTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/rest/OpenSearchRestTestCase.java @@ -73,7 +73,7 @@ import org.opensearch.common.xcontent.XContentType; import org.opensearch.common.xcontent.json.JsonXContent; import org.opensearch.common.xcontent.support.XContentMapValues; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.index.IndexSettings; import org.opensearch.index.seqno.ReplicationTracker; import org.opensearch.rest.RestStatus; diff --git a/test/framework/src/main/java/org/opensearch/test/rest/yaml/OpenSearchClientYamlSuiteTestCase.java b/test/framework/src/main/java/org/opensearch/test/rest/yaml/OpenSearchClientYamlSuiteTestCase.java index d9771e86ccba3..43482cf0f6656 100644 --- a/test/framework/src/main/java/org/opensearch/test/rest/yaml/OpenSearchClientYamlSuiteTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/rest/yaml/OpenSearchClientYamlSuiteTestCase.java @@ -51,7 +51,7 @@ import org.opensearch.common.io.PathUtils; import org.opensearch.common.xcontent.XContentType; import org.opensearch.core.xcontent.NamedXContentRegistry; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.test.rest.OpenSearchRestTestCase; import org.opensearch.test.rest.yaml.restspec.ClientYamlSuiteRestApi; import org.opensearch.test.rest.yaml.restspec.ClientYamlSuiteRestSpec; diff --git a/test/framework/src/main/java/org/opensearch/test/transport/MockTransportService.java b/test/framework/src/main/java/org/opensearch/test/transport/MockTransportService.java index 0324ef34c4958..cff363cabf5a3 100644 --- a/test/framework/src/main/java/org/opensearch/test/transport/MockTransportService.java +++ b/test/framework/src/main/java/org/opensearch/test/transport/MockTransportService.java @@ -52,7 +52,7 @@ import org.opensearch.common.util.MockPageCacheRecycler; import org.opensearch.common.util.concurrent.AbstractRunnable; import org.opensearch.common.util.concurrent.RunOnce; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.indices.breaker.NoneCircuitBreakerService; import org.opensearch.node.Node; import org.opensearch.plugins.Plugin; diff --git a/test/framework/src/main/java/org/opensearch/transport/AbstractSimpleTransportTestCase.java b/test/framework/src/main/java/org/opensearch/transport/AbstractSimpleTransportTestCase.java index 106d2ae15917f..fed14d6bbc1ba 100644 --- a/test/framework/src/main/java/org/opensearch/transport/AbstractSimpleTransportTestCase.java +++ b/test/framework/src/main/java/org/opensearch/transport/AbstractSimpleTransportTestCase.java @@ -63,7 +63,7 @@ import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.concurrent.AbstractRunnable; import org.opensearch.common.util.concurrent.ConcurrentCollections; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.node.Node; import org.opensearch.tasks.Task; import org.opensearch.test.OpenSearchTestCase; diff --git a/test/framework/src/main/java/org/opensearch/transport/nio/MockNioTransport.java b/test/framework/src/main/java/org/opensearch/transport/nio/MockNioTransport.java index 261097a9d648a..a1f7f5fd2c901 100644 --- a/test/framework/src/main/java/org/opensearch/transport/nio/MockNioTransport.java +++ b/test/framework/src/main/java/org/opensearch/transport/nio/MockNioTransport.java @@ -52,7 +52,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.PageCacheRecycler; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.indices.breaker.CircuitBreakerService; import org.opensearch.nio.BytesChannelContext; import org.opensearch.nio.BytesWriteHandler; diff --git a/test/framework/src/test/java/org/opensearch/test/test/InternalTestClusterTests.java b/test/framework/src/test/java/org/opensearch/test/test/InternalTestClusterTests.java index b802b48960f61..d68cedac29674 100644 --- a/test/framework/src/test/java/org/opensearch/test/test/InternalTestClusterTests.java +++ b/test/framework/src/test/java/org/opensearch/test/test/InternalTestClusterTests.java @@ -38,7 +38,7 @@ import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.network.NetworkModule; import org.opensearch.common.settings.Settings; -import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.common.util.io.IOUtils; import org.opensearch.discovery.DiscoveryModule; import org.opensearch.discovery.SettingsBasedSeedHostsProvider; import org.opensearch.env.Environment;