Skip to content

Commit

Permalink
Moved all LuceneServer handlers into handler package (#744)
Browse files Browse the repository at this point in the history
  • Loading branch information
sarthakn7 authored Oct 3, 2024
1 parent a243ea5 commit 70156a1
Show file tree
Hide file tree
Showing 27 changed files with 70 additions and 82 deletions.
22 changes: 11 additions & 11 deletions src/main/java/com/yelp/nrtsearch/server/grpc/LuceneServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,45 +29,45 @@
import com.yelp.nrtsearch.LuceneServerModule;
import com.yelp.nrtsearch.server.config.LuceneServerConfiguration;
import com.yelp.nrtsearch.server.config.QueryCacheConfig;
import com.yelp.nrtsearch.server.luceneserver.AddDocumentHandler;
import com.yelp.nrtsearch.server.luceneserver.AddReplicaHandler;
import com.yelp.nrtsearch.server.luceneserver.CopyFilesHandler;
import com.yelp.nrtsearch.server.luceneserver.CreateSnapshotHandler;
import com.yelp.nrtsearch.server.luceneserver.DeleteAllDocumentsHandler;
import com.yelp.nrtsearch.server.luceneserver.DeleteByQueryHandler;
import com.yelp.nrtsearch.server.luceneserver.DeleteDocumentsHandler;
import com.yelp.nrtsearch.server.luceneserver.DeleteIndexHandler;
import com.yelp.nrtsearch.server.luceneserver.GetNodesInfoHandler;
import com.yelp.nrtsearch.server.luceneserver.GetStateHandler;
import com.yelp.nrtsearch.server.luceneserver.GlobalState;
import com.yelp.nrtsearch.server.luceneserver.IndexState;
import com.yelp.nrtsearch.server.luceneserver.LiveSettingsHandler;
import com.yelp.nrtsearch.server.luceneserver.NewNRTPointHandler;
import com.yelp.nrtsearch.server.luceneserver.RecvCopyStateHandler;
import com.yelp.nrtsearch.server.luceneserver.ReleaseSnapshotHandler;
import com.yelp.nrtsearch.server.luceneserver.ReplicaCurrentSearchingVersionHandler;
import com.yelp.nrtsearch.server.luceneserver.SearchHandler;
import com.yelp.nrtsearch.server.luceneserver.SettingsHandler;
import com.yelp.nrtsearch.server.luceneserver.ShardState;
import com.yelp.nrtsearch.server.luceneserver.WriteNRTPointHandler;
import com.yelp.nrtsearch.server.luceneserver.analysis.AnalyzerCreator;
import com.yelp.nrtsearch.server.luceneserver.custom.request.CustomRequestProcessor;
import com.yelp.nrtsearch.server.luceneserver.field.FieldDefCreator;
import com.yelp.nrtsearch.server.luceneserver.handler.AddDocumentHandler;
import com.yelp.nrtsearch.server.luceneserver.handler.BackupWarmingQueriesHandler;
import com.yelp.nrtsearch.server.luceneserver.handler.CommitHandler;
import com.yelp.nrtsearch.server.luceneserver.handler.CreateIndexHandler;
import com.yelp.nrtsearch.server.luceneserver.handler.CreateSnapshotHandler;
import com.yelp.nrtsearch.server.luceneserver.handler.CustomHandler;
import com.yelp.nrtsearch.server.luceneserver.handler.DeleteAllDocumentsHandler;
import com.yelp.nrtsearch.server.luceneserver.handler.DeleteByQueryHandler;
import com.yelp.nrtsearch.server.luceneserver.handler.DeleteDocumentsHandler;
import com.yelp.nrtsearch.server.luceneserver.handler.DeleteIndexHandler;
import com.yelp.nrtsearch.server.luceneserver.handler.ForceMergeDeletesHandler;
import com.yelp.nrtsearch.server.luceneserver.handler.ForceMergeHandler;
import com.yelp.nrtsearch.server.luceneserver.handler.GetAllSnapshotIndexGenHandler;
import com.yelp.nrtsearch.server.luceneserver.handler.GetStateHandler;
import com.yelp.nrtsearch.server.luceneserver.handler.GlobalStateHandler;
import com.yelp.nrtsearch.server.luceneserver.handler.IndicesHandler;
import com.yelp.nrtsearch.server.luceneserver.handler.LiveSettingsHandler;
import com.yelp.nrtsearch.server.luceneserver.handler.MetricsHandler;
import com.yelp.nrtsearch.server.luceneserver.handler.ReadyHandler;
import com.yelp.nrtsearch.server.luceneserver.handler.RefreshHandler;
import com.yelp.nrtsearch.server.luceneserver.handler.RegisterFieldsHandler;
import com.yelp.nrtsearch.server.luceneserver.handler.ReleaseSnapshotHandler;
import com.yelp.nrtsearch.server.luceneserver.handler.ReloadStateHandler;
import com.yelp.nrtsearch.server.luceneserver.handler.SearchHandler;
import com.yelp.nrtsearch.server.luceneserver.handler.SearchV2Handler;
import com.yelp.nrtsearch.server.luceneserver.handler.SettingsHandler;
import com.yelp.nrtsearch.server.luceneserver.handler.StartIndexHandler;
import com.yelp.nrtsearch.server.luceneserver.handler.StartIndexV2Handler;
import com.yelp.nrtsearch.server.luceneserver.handler.StatsHandler;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
import com.yelp.nrtsearch.server.grpc.DeadlineUtils;
import com.yelp.nrtsearch.server.grpc.IndexLiveSettings;
import com.yelp.nrtsearch.server.grpc.ReplicationServerClient;
import com.yelp.nrtsearch.server.luceneserver.SearchHandler.SearchHandlerException;
import com.yelp.nrtsearch.server.luceneserver.field.FieldDef;
import com.yelp.nrtsearch.server.luceneserver.field.IndexableFieldDef.FacetValueType;
import com.yelp.nrtsearch.server.luceneserver.field.properties.GlobalOrdinalable;
import com.yelp.nrtsearch.server.luceneserver.handler.SearchHandler.SearchHandlerException;
import com.yelp.nrtsearch.server.luceneserver.index.IndexStateManager;
import com.yelp.nrtsearch.server.luceneserver.index.NrtIndexWriter;
import com.yelp.nrtsearch.server.luceneserver.nrt.NrtDataManager;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

import com.yelp.nrtsearch.server.grpc.Field;
import com.yelp.nrtsearch.server.grpc.SearchResponse;
import com.yelp.nrtsearch.server.luceneserver.AddDocumentHandler;
import com.yelp.nrtsearch.server.luceneserver.IndexState;
import com.yelp.nrtsearch.server.luceneserver.doc.LoadedDocValues;
import com.yelp.nrtsearch.server.luceneserver.handler.AddDocumentHandler;
import com.yelp.nrtsearch.server.luceneserver.similarity.SimilarityCreator;
import com.yelp.nrtsearch.server.utils.StructValueTransformer;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
import com.google.protobuf.util.JsonFormat;
import com.yelp.nrtsearch.server.grpc.Field;
import com.yelp.nrtsearch.server.grpc.SearchResponse;
import com.yelp.nrtsearch.server.luceneserver.AddDocumentHandler;
import com.yelp.nrtsearch.server.luceneserver.IndexState;
import com.yelp.nrtsearch.server.luceneserver.doc.LoadedDocValues;
import com.yelp.nrtsearch.server.luceneserver.handler.AddDocumentHandler;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.yelp.nrtsearch.server.luceneserver;
package com.yelp.nrtsearch.server.luceneserver.handler;

import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
Expand All @@ -22,10 +22,12 @@
import com.yelp.nrtsearch.server.grpc.AddDocumentResponse;
import com.yelp.nrtsearch.server.grpc.DeadlineUtils;
import com.yelp.nrtsearch.server.grpc.FacetHierarchyPath;
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.field.FieldDef;
import com.yelp.nrtsearch.server.luceneserver.field.IdFieldDef;
import com.yelp.nrtsearch.server.luceneserver.field.IndexableFieldDef;
import com.yelp.nrtsearch.server.luceneserver.handler.Handler;
import io.grpc.Context;
import io.grpc.Status;
import io.grpc.stub.StreamObserver;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.yelp.nrtsearch.server.luceneserver;
package com.yelp.nrtsearch.server.luceneserver.handler;

import com.google.gson.JsonObject;
import com.yelp.nrtsearch.server.grpc.CreateSnapshotRequest;
import com.yelp.nrtsearch.server.grpc.CreateSnapshotResponse;
import com.yelp.nrtsearch.server.grpc.SnapshotId;
import com.yelp.nrtsearch.server.luceneserver.handler.Handler;
import com.yelp.nrtsearch.server.luceneserver.GlobalState;
import com.yelp.nrtsearch.server.luceneserver.IndexState;
import com.yelp.nrtsearch.server.luceneserver.ShardState;
import io.grpc.Status;
import io.grpc.stub.StreamObserver;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.yelp.nrtsearch.server.luceneserver;
package com.yelp.nrtsearch.server.luceneserver.handler;

import com.yelp.nrtsearch.server.grpc.*;
import com.yelp.nrtsearch.server.luceneserver.handler.Handler;
import com.yelp.nrtsearch.server.luceneserver.GlobalState;
import com.yelp.nrtsearch.server.luceneserver.IndexState;
import com.yelp.nrtsearch.server.luceneserver.ShardState;
import io.grpc.Status;
import io.grpc.stub.StreamObserver;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.yelp.nrtsearch.server.luceneserver;
package com.yelp.nrtsearch.server.luceneserver.handler;

import com.yelp.nrtsearch.server.grpc.AddDocumentResponse;
import com.yelp.nrtsearch.server.grpc.DeleteByQueryRequest;
import com.yelp.nrtsearch.server.luceneserver.handler.Handler;
import com.yelp.nrtsearch.server.luceneserver.GlobalState;
import com.yelp.nrtsearch.server.luceneserver.IndexState;
import com.yelp.nrtsearch.server.luceneserver.QueryNodeMapper;
import com.yelp.nrtsearch.server.luceneserver.ShardState;
import io.grpc.Status;
import io.grpc.stub.StreamObserver;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.yelp.nrtsearch.server.luceneserver;
package com.yelp.nrtsearch.server.luceneserver.handler;

import com.google.protobuf.ProtocolStringList;
import com.yelp.nrtsearch.server.grpc.AddDocumentRequest;
import com.yelp.nrtsearch.server.grpc.AddDocumentResponse;
import com.yelp.nrtsearch.server.luceneserver.handler.Handler;
import com.yelp.nrtsearch.server.luceneserver.GlobalState;
import com.yelp.nrtsearch.server.luceneserver.IndexState;
import com.yelp.nrtsearch.server.luceneserver.ShardState;
import io.grpc.Status;
import io.grpc.stub.StreamObserver;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.yelp.nrtsearch.server.luceneserver;
package com.yelp.nrtsearch.server.luceneserver.handler;

import com.yelp.nrtsearch.server.grpc.DeleteIndexRequest;
import com.yelp.nrtsearch.server.grpc.DeleteIndexResponse;
import com.yelp.nrtsearch.server.luceneserver.handler.Handler;
import com.yelp.nrtsearch.server.luceneserver.GlobalState;
import com.yelp.nrtsearch.server.luceneserver.IndexState;
import io.grpc.Status;
import io.grpc.stub.StreamObserver;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.yelp.nrtsearch.server.luceneserver;
package com.yelp.nrtsearch.server.luceneserver.handler;

import com.google.gson.JsonObject;
import com.yelp.nrtsearch.server.grpc.StateRequest;
import com.yelp.nrtsearch.server.grpc.StateResponse;
import com.yelp.nrtsearch.server.luceneserver.handler.Handler;
import com.yelp.nrtsearch.server.luceneserver.GlobalState;
import com.yelp.nrtsearch.server.luceneserver.IndexState;
import io.grpc.Status;
import io.grpc.stub.StreamObserver;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.yelp.nrtsearch.server.luceneserver;
package com.yelp.nrtsearch.server.luceneserver.handler;

import com.google.protobuf.DoubleValue;
import com.google.protobuf.Int32Value;
import com.google.protobuf.util.JsonFormat;
import com.yelp.nrtsearch.server.grpc.IndexLiveSettings;
import com.yelp.nrtsearch.server.grpc.LiveSettingsRequest;
import com.yelp.nrtsearch.server.grpc.LiveSettingsResponse;
import com.yelp.nrtsearch.server.luceneserver.handler.Handler;
import com.yelp.nrtsearch.server.luceneserver.GlobalState;
import com.yelp.nrtsearch.server.luceneserver.IndexState;
import com.yelp.nrtsearch.server.luceneserver.index.IndexStateManager;
import io.grpc.Status;
import io.grpc.stub.StreamObserver;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.yelp.nrtsearch.server.luceneserver;
package com.yelp.nrtsearch.server.luceneserver.handler;

import com.yelp.nrtsearch.server.grpc.ReleaseSnapshotRequest;
import com.yelp.nrtsearch.server.grpc.ReleaseSnapshotResponse;
import com.yelp.nrtsearch.server.luceneserver.handler.Handler;
import com.yelp.nrtsearch.server.luceneserver.GlobalState;
import com.yelp.nrtsearch.server.luceneserver.IndexState;
import com.yelp.nrtsearch.server.luceneserver.ShardState;
import io.grpc.Status;
import io.grpc.stub.StreamObserver;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.yelp.nrtsearch.server.luceneserver;
package com.yelp.nrtsearch.server.luceneserver.handler;

import com.google.common.collect.Lists;
import com.google.common.util.concurrent.MoreExecutors;
Expand All @@ -29,6 +29,10 @@
import com.yelp.nrtsearch.server.grpc.SearchResponse.Hit.FieldValue;
import com.yelp.nrtsearch.server.grpc.SearchResponse.SearchState;
import com.yelp.nrtsearch.server.grpc.TotalHits;
import com.yelp.nrtsearch.server.luceneserver.GlobalState;
import com.yelp.nrtsearch.server.luceneserver.IndexState;
import com.yelp.nrtsearch.server.luceneserver.MyIndexSearcher;
import com.yelp.nrtsearch.server.luceneserver.ShardState;
import com.yelp.nrtsearch.server.luceneserver.doc.LoadedDocValues;
import com.yelp.nrtsearch.server.luceneserver.facet.DrillSidewaysImpl;
import com.yelp.nrtsearch.server.luceneserver.facet.FacetTopDocs;
Expand All @@ -38,7 +42,6 @@
import com.yelp.nrtsearch.server.luceneserver.field.IndexableFieldDef;
import com.yelp.nrtsearch.server.luceneserver.field.RuntimeFieldDef;
import com.yelp.nrtsearch.server.luceneserver.field.VirtualFieldDef;
import com.yelp.nrtsearch.server.luceneserver.handler.Handler;
import com.yelp.nrtsearch.server.luceneserver.innerhit.InnerHitFetchTask;
import com.yelp.nrtsearch.server.luceneserver.rescore.RescoreTask;
import com.yelp.nrtsearch.server.luceneserver.script.RuntimeScript;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.yelp.nrtsearch.server.grpc.SearchRequest;
import com.yelp.nrtsearch.server.grpc.SearchResponse;
import com.yelp.nrtsearch.server.luceneserver.GlobalState;
import com.yelp.nrtsearch.server.luceneserver.SearchHandler;
import com.yelp.nrtsearch.server.utils.ProtoMessagePrinter;
import io.grpc.Status;
import io.grpc.StatusRuntimeException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.yelp.nrtsearch.server.luceneserver;
package com.yelp.nrtsearch.server.luceneserver.handler;

import com.google.protobuf.BoolValue;
import com.google.protobuf.DoubleValue;
Expand All @@ -23,7 +23,8 @@
import com.yelp.nrtsearch.server.grpc.IndexSettings;
import com.yelp.nrtsearch.server.grpc.SettingsRequest;
import com.yelp.nrtsearch.server.grpc.SettingsResponse;
import com.yelp.nrtsearch.server.luceneserver.handler.Handler;
import com.yelp.nrtsearch.server.luceneserver.GlobalState;
import com.yelp.nrtsearch.server.luceneserver.IndexState;
import com.yelp.nrtsearch.server.luceneserver.index.IndexStateManager;
import io.grpc.Status;
import io.grpc.stub.StreamObserver;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
import com.yelp.nrtsearch.server.luceneserver.DirectoryFactory;
import com.yelp.nrtsearch.server.luceneserver.GlobalState;
import com.yelp.nrtsearch.server.luceneserver.IndexState;
import com.yelp.nrtsearch.server.luceneserver.SearchHandler.SearchHandlerException;
import com.yelp.nrtsearch.server.luceneserver.ServerCodec;
import com.yelp.nrtsearch.server.luceneserver.ShardState;
import com.yelp.nrtsearch.server.luceneserver.field.FieldDef;
import com.yelp.nrtsearch.server.luceneserver.field.IdFieldDef;
import com.yelp.nrtsearch.server.luceneserver.field.properties.GlobalOrdinalable;
import com.yelp.nrtsearch.server.luceneserver.handler.SearchHandler.SearchHandlerException;
import com.yelp.nrtsearch.server.luceneserver.nrt.NrtDataManager;
import com.yelp.nrtsearch.server.luceneserver.search.sort.SortParser;
import com.yelp.nrtsearch.server.remote.RemoteBackend;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import com.yelp.nrtsearch.server.grpc.SearchResponse.Diagnostics.Builder;
import com.yelp.nrtsearch.server.grpc.SearchResponse.Hit;
import com.yelp.nrtsearch.server.grpc.TotalHits;
import com.yelp.nrtsearch.server.luceneserver.SearchHandler;
import com.yelp.nrtsearch.server.luceneserver.handler.SearchHandler;
import com.yelp.nrtsearch.server.luceneserver.search.FetchTasks.FetchTask;
import com.yelp.nrtsearch.server.luceneserver.search.SearchContext;
import com.yelp.nrtsearch.server.luceneserver.search.sort.SortParser;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
*/
package com.yelp.nrtsearch.server.luceneserver.rescore;

import com.yelp.nrtsearch.server.luceneserver.handler.SearchHandler;
import com.yelp.nrtsearch.server.luceneserver.search.SearchContext;
import java.io.IOException;
import org.apache.lucene.search.TopDocs;

/**
* A wrapper component for {@link RescoreOperation} and <i>int windowSize</i>. It has a public
* <i>rescore</i> method which is called by the {@link
* com.yelp.nrtsearch.server.luceneserver.SearchHandler} to rescore the first-pass hits.
* <i>rescore</i> method which is called by the {@link SearchHandler} to rescore the first-pass
* hits.
*/
public class RescoreTask {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
package com.yelp.nrtsearch.server.luceneserver.search;

import com.yelp.nrtsearch.server.luceneserver.field.FieldDef;
import com.yelp.nrtsearch.server.luceneserver.handler.SearchHandler;
import java.util.Map;
import org.apache.lucene.facet.taxonomy.SearcherTaxonomyManager.SearcherAndTaxonomy;

/**
* Interface to provided needed information to use {@link
* com.yelp.nrtsearch.server.luceneserver.SearchHandler.FillFieldsTask} to retrieve document fields.
* Interface to provided needed information to use {@link SearchHandler.FillFieldsTask} to retrieve
* document fields.
*/
public interface FieldFetchContext {

Expand Down
Loading

0 comments on commit 70156a1

Please sign in to comment.