Skip to content

Commit

Permalink
[Refactor] Network and Transport common classes to Libraries (opensea…
Browse files Browse the repository at this point in the history
…rch-project#9073)

This commit refactors the following network and transport libraries to
the opensearch common and core libraries respectively:

* o.o.common.network.Cidrs -> :libs:opensearch-common
* o.o.common.network.InetAddresses -> :libs:opensearch-common
* o.o.common.network.NetworkAddress -> :libs:opensearch-common
* o.o.common.transport.NetworkExceptionHelper -> :libs:opensearch-common
* o.o.common.transport.PortsRange -> :libs:opensearch-common

* o.o.common.transport.TransportAddress -> :libs:opensearch-core
* o.o.common.transport.BoundTransportAddress -> :libs:opensearch-core
* o.o.transport.TransportMessage -> :libs:opensearch-core
* o.o.transport.TransportResponse -> :libs:opensearch-core

The purpose is to reduce the change surface area of the core APIs to
minimize impact to downstream consumers while moving toward establishing
a formal API for cloud native or serverless implementations.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
  • Loading branch information
nknize committed Aug 4, 2023
1 parent 38eeb77 commit 109d020
Show file tree
Hide file tree
Showing 12 changed files with 1 addition and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
package org.opensearch.core.common.transport;

import org.opensearch.common.network.InetAddresses;
import org.opensearch.common.io.stream.ProtobufWriteable;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
import org.opensearch.core.common.io.stream.Writeable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@
package org.opensearch.core.common.transport;

import org.opensearch.common.network.NetworkAddress;
import org.opensearch.common.io.stream.ProtobufWriteable;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
import org.opensearch.core.common.io.stream.Writeable;
import org.opensearch.common.network.NetworkAddress;
import org.opensearch.core.xcontent.ToXContentFragment;
import org.opensearch.core.xcontent.XContentBuilder;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import org.opensearch.core.common.io.stream.Writeable;
import org.opensearch.common.settings.Setting;
import org.opensearch.common.settings.Settings;
import org.opensearch.common.transport.ProtobufTransportAddress;
import org.opensearch.core.common.transport.TransportAddress;
import org.opensearch.core.xcontent.ToXContentFragment;
import org.opensearch.core.xcontent.XContentBuilder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@
import org.opensearch.core.common.transport.BoundTransportAddress;
import org.opensearch.common.transport.NetworkExceptionHelper;
import org.opensearch.common.transport.PortsRange;
import org.opensearch.common.transport.ProtobufBoundTransportAddress;
import org.opensearch.common.transport.ProtobufTransportAddress;
import org.opensearch.core.common.transport.TransportAddress;
import org.opensearch.core.common.unit.ByteSizeValue;
import org.opensearch.common.util.BigArrays;
Expand Down
4 changes: 0 additions & 4 deletions server/src/main/java/org/opensearch/node/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,8 @@
import org.opensearch.common.settings.SettingUpgrader;
import org.opensearch.common.settings.Settings;
import org.opensearch.common.settings.SettingsModule;
import org.opensearch.common.transport.BoundTransportAddress;
import org.opensearch.common.transport.TransportAddress;
import org.opensearch.common.transport.ProtobufBoundTransportAddress;
import org.opensearch.core.common.transport.BoundTransportAddress;
import org.opensearch.core.common.transport.TransportAddress;
import org.opensearch.core.common.transport.BoundTransportAddress;
import org.opensearch.common.unit.TimeValue;
import org.opensearch.common.util.BigArrays;
import org.opensearch.common.util.PageCacheRecycler;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@
import org.opensearch.core.common.io.stream.NamedWriteableRegistry;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.transport.TransportAddress;
import org.opensearch.common.lease.Releasable;
import org.opensearch.core.common.transport.TransportAddress;
import org.opensearch.common.unit.TimeValue;
import org.opensearch.common.util.concurrent.AbstractRunnable;
import org.opensearch.common.util.concurrent.ThreadContext;
Expand All @@ -64,6 +62,7 @@
import org.opensearch.server.proto.NodesStatsProto.NodesStats;
import org.opensearch.server.proto.NodesStatsRequestProto.NodesStatsRequest;
import org.opensearch.server.proto.MessageProto.OutboundInboundMessage;
import org.opensearch.core.transport.TransportResponse;
import org.opensearch.threadpool.ThreadPool;

import java.io.EOFException;
Expand Down
4 changes: 0 additions & 4 deletions server/src/main/java/org/opensearch/transport/Transport.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@
import org.opensearch.cluster.node.DiscoveryNode;
import org.opensearch.common.collect.MapBuilder;
import org.opensearch.common.lifecycle.LifecycleComponent;
// import org.opensearch.common.transport.ProtobufBoundTransportAddress;
// import org.opensearch.common.transport.ProtobufTransportAddress;
import org.opensearch.common.transport.ProtobufBoundTransportAddress;
import org.opensearch.common.transport.ProtobufTransportAddress;
import org.opensearch.core.common.transport.BoundTransportAddress;
import org.opensearch.core.common.transport.TransportAddress;
import org.opensearch.common.unit.TimeValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@
import org.opensearch.common.settings.Settings;
import org.opensearch.core.common.transport.BoundTransportAddress;
import org.opensearch.core.common.transport.TransportAddress;
import org.opensearch.core.common.transport.BoundTransportAddress;
import org.opensearch.core.common.transport.TransportAddress;
import org.opensearch.test.OpenSearchTestCase;
import org.opensearch.test.MockLogAppender;
import org.opensearch.test.junit.annotations.TestLogging;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@
import org.opensearch.common.util.concurrent.ThreadContext;
import org.opensearch.common.util.io.Streams;
import org.opensearch.core.transport.TransportResponse;
import org.opensearch.example.proto.ExampleProtoRequest;
import org.opensearch.example.proto.ExampleRequestProto.ExampleRequest;
import org.opensearch.test.OpenSearchTestCase;
import org.opensearch.threadpool.TestThreadPool;
import org.opensearch.threadpool.ThreadPool;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
package org.opensearch.test;

import org.opensearch.common.lifecycle.AbstractLifecycleComponent;
import org.opensearch.common.transport.ProtobufBoundTransportAddress;
import org.opensearch.common.transport.ProtobufTransportAddress;
import org.opensearch.core.common.transport.BoundTransportAddress;
import org.opensearch.core.common.transport.TransportAddress;
import org.opensearch.http.HttpInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@
import org.opensearch.action.ActionListener;
import org.opensearch.cluster.node.DiscoveryNode;
import org.opensearch.common.lifecycle.AbstractLifecycleComponent;
// import org.opensearch.common.transport.ProtobufBoundTransportAddress;
// import org.opensearch.common.transport.ProtobufTransportAddress;
import org.opensearch.core.common.transport.BoundTransportAddress;
import org.opensearch.common.transport.ProtobufBoundTransportAddress;
import org.opensearch.common.transport.ProtobufTransportAddress;
import org.opensearch.core.common.transport.TransportAddress;
import org.opensearch.transport.CloseableConnection;
import org.opensearch.transport.ConnectionProfile;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@
import org.opensearch.cluster.node.DiscoveryNode;
import org.opensearch.common.lifecycle.Lifecycle;
import org.opensearch.common.lifecycle.LifecycleListener;
import org.opensearch.common.transport.BoundTransportAddress;
import org.opensearch.common.transport.TransportAddress;
// import org.opensearch.common.transport.ProtobufBoundTransportAddress;
// import org.opensearch.common.transport.ProtobufTransportAddress;
import org.opensearch.common.transport.ProtobufBoundTransportAddress;
import org.opensearch.common.transport.ProtobufTransportAddress;
import org.opensearch.core.common.transport.BoundTransportAddress;
import org.opensearch.core.common.transport.TransportAddress;
import org.opensearch.tasks.Task;
Expand Down

0 comments on commit 109d020

Please sign in to comment.