Search in sources :

Example 11 with LuceneServerClient

use of com.yelp.nrtsearch.server.grpc.LuceneServerClient in project nrtsearch by Yelp.

the class DeleteDocumentsCommand method call.

@Override
public Integer call() throws Exception {
    LuceneServerClient client = baseCmd.getClient();
    try {
        Path filePath = Paths.get(getFileName());
        client.delete(filePath);
    } finally {
        client.shutdown();
    }
    return 0;
}
Also used : Path(java.nio.file.Path) LuceneServerClient(com.yelp.nrtsearch.server.grpc.LuceneServerClient)

Example 12 with LuceneServerClient

use of com.yelp.nrtsearch.server.grpc.LuceneServerClient in project nrtsearch by Yelp.

the class ForceMergeDeletesCommand method call.

@Override
public Integer call() throws Exception {
    LuceneServerClient client = baseCmd.getClient();
    try {
        ForceMergeDeletesResponse response = client.getBlockingStub().forceMergeDeletes(ForceMergeDeletesRequest.newBuilder().setIndexName(getIndexName()).setDoWait(getDoWait()).build());
        logger.info("Force merge deletes response: {}", response.getStatus());
    } finally {
        client.shutdown();
    }
    return 0;
}
Also used : LuceneServerClient(com.yelp.nrtsearch.server.grpc.LuceneServerClient) ForceMergeDeletesResponse(com.yelp.nrtsearch.server.grpc.ForceMergeDeletesResponse)

Aggregations

LuceneServerClient (com.yelp.nrtsearch.server.grpc.LuceneServerClient)12 Path (java.nio.file.Path)7 ReplicationServerClient (com.yelp.nrtsearch.server.grpc.ReplicationServerClient)3 SearcherVersion (com.yelp.nrtsearch.server.grpc.SearcherVersion)3 Gson (com.google.gson.Gson)1 AddDocumentRequest (com.yelp.nrtsearch.server.grpc.AddDocumentRequest)1 ForceMergeDeletesResponse (com.yelp.nrtsearch.server.grpc.ForceMergeDeletesResponse)1 ForceMergeResponse (com.yelp.nrtsearch.server.grpc.ForceMergeResponse)1 LuceneServerClientBuilder (com.yelp.nrtsearch.server.grpc.LuceneServerClientBuilder)1 OneSuggestLookupResponse (com.yelp.nrtsearch.server.grpc.OneSuggestLookupResponse)1 StartIndexRequest (com.yelp.nrtsearch.server.grpc.StartIndexRequest)1 SuggestLookupRequest (com.yelp.nrtsearch.server.grpc.SuggestLookupRequest)1 SuggestLookupResponse (com.yelp.nrtsearch.server.grpc.SuggestLookupResponse)1 StatusRuntimeException (io.grpc.StatusRuntimeException)1 Reader (java.io.Reader)1 CompletableFuture (java.util.concurrent.CompletableFuture)1 ExecutionException (java.util.concurrent.ExecutionException)1 ExecutorService (java.util.concurrent.ExecutorService)1 Future (java.util.concurrent.Future)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1