From e7bb6b6cfddc8d619f98a7208a2afd12c7131954 Mon Sep 17 00:00:00 2001 From: Sarthak Nandi Date: Fri, 4 Oct 2024 09:40:17 -0700 Subject: [PATCH] Correct imports after merge --- .../java/com/yelp/nrtsearch/server/grpc/LuceneServer.java | 3 --- .../nrtsearch/server/luceneserver/AddReplicaHandler.java | 5 +++-- .../nrtsearch/server/luceneserver/CopyFilesHandler.java | 5 +++-- .../server/luceneserver/GetNodesInfoHandler.java | 1 + .../nrtsearch/server/luceneserver/NewNRTPointHandler.java | 5 +++-- .../server/luceneserver/RecvCopyStateHandler.java | 7 ++++--- .../ReplicaCurrentSearchingVersionHandler.java | 8 ++++---- .../server/luceneserver/WriteNRTPointHandler.java | 3 ++- .../nrtsearch/server/luceneserver/handler/Handler.java | 2 +- .../server/luceneserver/handler/RecvRawFileHandler.java | 6 +++--- .../server/luceneserver/handler/RecvRawFileV2Handler.java | 6 +++--- .../server/luceneserver/handler/SendRawFileHandler.java | 2 +- 12 files changed, 28 insertions(+), 25 deletions(-) diff --git a/src/main/java/com/yelp/nrtsearch/server/grpc/LuceneServer.java b/src/main/java/com/yelp/nrtsearch/server/grpc/LuceneServer.java index 5eb364507..8c2a282eb 100644 --- a/src/main/java/com/yelp/nrtsearch/server/grpc/LuceneServer.java +++ b/src/main/java/com/yelp/nrtsearch/server/grpc/LuceneServer.java @@ -74,9 +74,6 @@ import com.yelp.nrtsearch.server.luceneserver.handler.StopIndexHandler; import com.yelp.nrtsearch.server.luceneserver.handler.UpdateFieldsHandler; import com.yelp.nrtsearch.server.luceneserver.highlights.HighlighterService; -import com.yelp.nrtsearch.server.luceneserver.index.IndexState; -import com.yelp.nrtsearch.server.luceneserver.index.IndexStateManager; -import com.yelp.nrtsearch.server.luceneserver.index.ShardState; import com.yelp.nrtsearch.server.luceneserver.index.handlers.LiveSettingsV2Handler; import com.yelp.nrtsearch.server.luceneserver.index.handlers.SettingsV2Handler; import com.yelp.nrtsearch.server.luceneserver.logging.HitsLoggerCreator; diff --git a/src/main/java/com/yelp/nrtsearch/server/luceneserver/AddReplicaHandler.java b/src/main/java/com/yelp/nrtsearch/server/luceneserver/AddReplicaHandler.java index cf0dce051..62aff8028 100644 --- a/src/main/java/com/yelp/nrtsearch/server/luceneserver/AddReplicaHandler.java +++ b/src/main/java/com/yelp/nrtsearch/server/luceneserver/AddReplicaHandler.java @@ -18,10 +18,11 @@ import com.yelp.nrtsearch.server.grpc.AddReplicaRequest; import com.yelp.nrtsearch.server.grpc.AddReplicaResponse; import com.yelp.nrtsearch.server.grpc.ReplicationServerClient; -import com.yelp.nrtsearch.server.luceneserver.index.IndexState; -import com.yelp.nrtsearch.server.luceneserver.index.ShardState; import com.yelp.nrtsearch.server.luceneserver.handler.Handler; +import com.yelp.nrtsearch.server.luceneserver.index.IndexState; import com.yelp.nrtsearch.server.luceneserver.index.IndexStateManager; +import com.yelp.nrtsearch.server.luceneserver.index.ShardState; +import com.yelp.nrtsearch.server.luceneserver.state.GlobalState; import io.grpc.Status; import io.grpc.StatusRuntimeException; import io.grpc.stub.StreamObserver; diff --git a/src/main/java/com/yelp/nrtsearch/server/luceneserver/CopyFilesHandler.java b/src/main/java/com/yelp/nrtsearch/server/luceneserver/CopyFilesHandler.java index 1390d8ccc..2aa72f945 100644 --- a/src/main/java/com/yelp/nrtsearch/server/luceneserver/CopyFilesHandler.java +++ b/src/main/java/com/yelp/nrtsearch/server/luceneserver/CopyFilesHandler.java @@ -18,11 +18,12 @@ import com.yelp.nrtsearch.server.grpc.CopyFiles; import com.yelp.nrtsearch.server.grpc.TransferStatus; import com.yelp.nrtsearch.server.grpc.TransferStatusCode; +import com.yelp.nrtsearch.server.luceneserver.handler.Handler; import com.yelp.nrtsearch.server.luceneserver.index.IndexState; +import com.yelp.nrtsearch.server.luceneserver.index.IndexStateManager; import com.yelp.nrtsearch.server.luceneserver.index.ShardState; import com.yelp.nrtsearch.server.luceneserver.nrt.NRTReplicaNode; -import com.yelp.nrtsearch.server.luceneserver.handler.Handler; -import com.yelp.nrtsearch.server.luceneserver.index.IndexStateManager; +import com.yelp.nrtsearch.server.luceneserver.state.GlobalState; import com.yelp.nrtsearch.server.monitoring.NrtMetrics; import io.grpc.Status; import io.grpc.StatusRuntimeException; diff --git a/src/main/java/com/yelp/nrtsearch/server/luceneserver/GetNodesInfoHandler.java b/src/main/java/com/yelp/nrtsearch/server/luceneserver/GetNodesInfoHandler.java index f031157e7..bfb909f25 100644 --- a/src/main/java/com/yelp/nrtsearch/server/luceneserver/GetNodesInfoHandler.java +++ b/src/main/java/com/yelp/nrtsearch/server/luceneserver/GetNodesInfoHandler.java @@ -22,6 +22,7 @@ import com.yelp.nrtsearch.server.luceneserver.index.IndexState; import com.yelp.nrtsearch.server.luceneserver.index.ShardState; import com.yelp.nrtsearch.server.luceneserver.nrt.NRTPrimaryNode; +import com.yelp.nrtsearch.server.luceneserver.state.GlobalState; import com.yelp.nrtsearch.server.utils.HostPort; import io.grpc.Status; import io.grpc.stub.StreamObserver; diff --git a/src/main/java/com/yelp/nrtsearch/server/luceneserver/NewNRTPointHandler.java b/src/main/java/com/yelp/nrtsearch/server/luceneserver/NewNRTPointHandler.java index 05052b575..c75bef62c 100644 --- a/src/main/java/com/yelp/nrtsearch/server/luceneserver/NewNRTPointHandler.java +++ b/src/main/java/com/yelp/nrtsearch/server/luceneserver/NewNRTPointHandler.java @@ -19,12 +19,13 @@ import com.yelp.nrtsearch.server.grpc.TransferStatus; import com.yelp.nrtsearch.server.grpc.TransferStatusCode; import com.yelp.nrtsearch.server.luceneserver.handler.Handler; +import com.yelp.nrtsearch.server.luceneserver.index.IndexState; import com.yelp.nrtsearch.server.luceneserver.index.IndexStateManager; +import com.yelp.nrtsearch.server.luceneserver.index.ShardState; +import com.yelp.nrtsearch.server.luceneserver.state.GlobalState; import io.grpc.Status; import io.grpc.StatusRuntimeException; import io.grpc.stub.StreamObserver; -import com.yelp.nrtsearch.server.luceneserver.index.IndexState; -import com.yelp.nrtsearch.server.luceneserver.index.ShardState; import java.io.IOException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/com/yelp/nrtsearch/server/luceneserver/RecvCopyStateHandler.java b/src/main/java/com/yelp/nrtsearch/server/luceneserver/RecvCopyStateHandler.java index 391a7c5db..84a53b117 100644 --- a/src/main/java/com/yelp/nrtsearch/server/luceneserver/RecvCopyStateHandler.java +++ b/src/main/java/com/yelp/nrtsearch/server/luceneserver/RecvCopyStateHandler.java @@ -21,13 +21,14 @@ import com.yelp.nrtsearch.server.grpc.FileMetadata; import com.yelp.nrtsearch.server.grpc.FilesMetadata; import com.yelp.nrtsearch.server.luceneserver.handler.Handler; +import com.yelp.nrtsearch.server.luceneserver.index.IndexState; import com.yelp.nrtsearch.server.luceneserver.index.IndexStateManager; +import com.yelp.nrtsearch.server.luceneserver.index.ShardState; +import com.yelp.nrtsearch.server.luceneserver.nrt.NRTPrimaryNode; +import com.yelp.nrtsearch.server.luceneserver.state.GlobalState; import io.grpc.Status; import io.grpc.StatusRuntimeException; import io.grpc.stub.StreamObserver; -import com.yelp.nrtsearch.server.luceneserver.index.IndexState; -import com.yelp.nrtsearch.server.luceneserver.index.ShardState; -import com.yelp.nrtsearch.server.luceneserver.nrt.NRTPrimaryNode; import java.io.IOException; import java.util.Map; import org.apache.lucene.replicator.nrt.FileMetaData; diff --git a/src/main/java/com/yelp/nrtsearch/server/luceneserver/ReplicaCurrentSearchingVersionHandler.java b/src/main/java/com/yelp/nrtsearch/server/luceneserver/ReplicaCurrentSearchingVersionHandler.java index f60b7827b..199ef1898 100644 --- a/src/main/java/com/yelp/nrtsearch/server/luceneserver/ReplicaCurrentSearchingVersionHandler.java +++ b/src/main/java/com/yelp/nrtsearch/server/luceneserver/ReplicaCurrentSearchingVersionHandler.java @@ -18,10 +18,11 @@ import com.yelp.nrtsearch.server.grpc.IndexName; import com.yelp.nrtsearch.server.grpc.SearcherVersion; import com.yelp.nrtsearch.server.luceneserver.handler.Handler; -import io.grpc.Status; -import io.grpc.stub.StreamObserver; import com.yelp.nrtsearch.server.luceneserver.index.IndexState; import com.yelp.nrtsearch.server.luceneserver.index.ShardState; +import com.yelp.nrtsearch.server.luceneserver.state.GlobalState; +import io.grpc.Status; +import io.grpc.stub.StreamObserver; import java.io.IOException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -59,8 +60,7 @@ public void handle(IndexName indexNameRequest, StreamObserver r } } - private SearcherVersion handle(IndexState indexState, IndexName indexNameRequest) - throws HandlerException { + private SearcherVersion handle(IndexState indexState, IndexName indexNameRequest) { ShardState shardState = indexState.getShard(0); if (!shardState.isReplica() || !shardState.isStarted()) { throw new IllegalArgumentException( diff --git a/src/main/java/com/yelp/nrtsearch/server/luceneserver/WriteNRTPointHandler.java b/src/main/java/com/yelp/nrtsearch/server/luceneserver/WriteNRTPointHandler.java index 5e01fd332..6570af8ef 100644 --- a/src/main/java/com/yelp/nrtsearch/server/luceneserver/WriteNRTPointHandler.java +++ b/src/main/java/com/yelp/nrtsearch/server/luceneserver/WriteNRTPointHandler.java @@ -19,10 +19,11 @@ import com.yelp.nrtsearch.server.grpc.ReplicationServerClient; import com.yelp.nrtsearch.server.grpc.SearcherVersion; import com.yelp.nrtsearch.server.luceneserver.handler.Handler; -import com.yelp.nrtsearch.server.luceneserver.index.IndexStateManager; import com.yelp.nrtsearch.server.luceneserver.index.IndexState; +import com.yelp.nrtsearch.server.luceneserver.index.IndexStateManager; import com.yelp.nrtsearch.server.luceneserver.index.ShardState; import com.yelp.nrtsearch.server.luceneserver.nrt.NRTPrimaryNode; +import com.yelp.nrtsearch.server.luceneserver.state.GlobalState; import io.grpc.Status; import io.grpc.StatusRuntimeException; import io.grpc.stub.StreamObserver; diff --git a/src/main/java/com/yelp/nrtsearch/server/luceneserver/handler/Handler.java b/src/main/java/com/yelp/nrtsearch/server/luceneserver/handler/Handler.java index 14b883895..2b0d55ee9 100644 --- a/src/main/java/com/yelp/nrtsearch/server/luceneserver/handler/Handler.java +++ b/src/main/java/com/yelp/nrtsearch/server/luceneserver/handler/Handler.java @@ -19,8 +19,8 @@ import com.google.protobuf.GeneratedMessageV3; import com.yelp.nrtsearch.server.grpc.LuceneServerStubBuilder; import com.yelp.nrtsearch.server.grpc.ReplicationServerClient; -import io.grpc.Status; import com.yelp.nrtsearch.server.luceneserver.state.GlobalState; +import io.grpc.Status; import io.grpc.stub.ServerCallStreamObserver; import io.grpc.stub.StreamObserver; import org.slf4j.Logger; diff --git a/src/main/java/com/yelp/nrtsearch/server/luceneserver/handler/RecvRawFileHandler.java b/src/main/java/com/yelp/nrtsearch/server/luceneserver/handler/RecvRawFileHandler.java index 43f197c0b..b3abb0c3d 100644 --- a/src/main/java/com/yelp/nrtsearch/server/luceneserver/handler/RecvRawFileHandler.java +++ b/src/main/java/com/yelp/nrtsearch/server/luceneserver/handler/RecvRawFileHandler.java @@ -18,10 +18,10 @@ import com.google.protobuf.ByteString; import com.yelp.nrtsearch.server.grpc.FileInfo; import com.yelp.nrtsearch.server.grpc.RawFileChunk; -import com.yelp.nrtsearch.server.luceneserver.GlobalState; -import com.yelp.nrtsearch.server.luceneserver.IndexState; -import com.yelp.nrtsearch.server.luceneserver.ShardState; +import com.yelp.nrtsearch.server.luceneserver.index.IndexState; import com.yelp.nrtsearch.server.luceneserver.index.IndexStateManager; +import com.yelp.nrtsearch.server.luceneserver.index.ShardState; +import com.yelp.nrtsearch.server.luceneserver.state.GlobalState; import io.grpc.Status; import io.grpc.StatusRuntimeException; import io.grpc.stub.StreamObserver; diff --git a/src/main/java/com/yelp/nrtsearch/server/luceneserver/handler/RecvRawFileV2Handler.java b/src/main/java/com/yelp/nrtsearch/server/luceneserver/handler/RecvRawFileV2Handler.java index 6d02af1e3..bfd98542b 100644 --- a/src/main/java/com/yelp/nrtsearch/server/luceneserver/handler/RecvRawFileV2Handler.java +++ b/src/main/java/com/yelp/nrtsearch/server/luceneserver/handler/RecvRawFileV2Handler.java @@ -18,10 +18,10 @@ import com.google.protobuf.ByteString; import com.yelp.nrtsearch.server.grpc.FileInfo; import com.yelp.nrtsearch.server.grpc.RawFileChunk; -import com.yelp.nrtsearch.server.luceneserver.GlobalState; -import com.yelp.nrtsearch.server.luceneserver.IndexState; -import com.yelp.nrtsearch.server.luceneserver.ShardState; +import com.yelp.nrtsearch.server.luceneserver.index.IndexState; import com.yelp.nrtsearch.server.luceneserver.index.IndexStateManager; +import com.yelp.nrtsearch.server.luceneserver.index.ShardState; +import com.yelp.nrtsearch.server.luceneserver.state.GlobalState; import io.grpc.stub.StreamObserver; import java.io.IOException; import org.apache.lucene.store.IOContext; diff --git a/src/main/java/com/yelp/nrtsearch/server/luceneserver/handler/SendRawFileHandler.java b/src/main/java/com/yelp/nrtsearch/server/luceneserver/handler/SendRawFileHandler.java index 6dd465012..15c2c4196 100644 --- a/src/main/java/com/yelp/nrtsearch/server/luceneserver/handler/SendRawFileHandler.java +++ b/src/main/java/com/yelp/nrtsearch/server/luceneserver/handler/SendRawFileHandler.java @@ -18,7 +18,7 @@ import com.yelp.nrtsearch.server.grpc.RawFileChunk; import com.yelp.nrtsearch.server.grpc.TransferStatus; import com.yelp.nrtsearch.server.grpc.TransferStatusCode; -import com.yelp.nrtsearch.server.luceneserver.GlobalState; +import com.yelp.nrtsearch.server.luceneserver.state.GlobalState; import io.grpc.stub.StreamObserver; import java.io.File; import java.io.FileOutputStream;