Search in sources :

Example 1 with LuceneServerClient

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

the class WriteNRTPointCommand method call.

@Override
public Integer call() throws Exception {
    LuceneServerClient client = baseCmd.getClient();
    try {
        ReplicationServerClient replicationServerClient = new ReplicationServerClient(getHostName(), getPort());
        SearcherVersion searcherVersion = replicationServerClient.writeNRTPoint(getIndexName());
        logger.info("didRefresh: " + searcherVersion.getDidRefresh());
        logger.info("searcherVersion: " + searcherVersion.getVersion());
    } finally {
        client.shutdown();
    }
    return 0;
}
Also used : LuceneServerClient(com.yelp.nrtsearch.server.grpc.LuceneServerClient) SearcherVersion(com.yelp.nrtsearch.server.grpc.SearcherVersion) ReplicationServerClient(com.yelp.nrtsearch.server.grpc.ReplicationServerClient)

Example 2 with LuceneServerClient

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

the class GetCurrentSearcherVersion method call.

@Override
public Integer call() throws Exception {
    LuceneServerClient client = baseCmd.getClient();
    try {
        ReplicationServerClient replServerClient = new ReplicationServerClient(getHostName(), getPort());
        SearcherVersion searcherVersion = replServerClient.getCurrentSearcherVersion(getIndexName());
        logger.info("searcherVersion: " + searcherVersion.getVersion());
    } finally {
        client.shutdown();
    }
    return 0;
}
Also used : LuceneServerClient(com.yelp.nrtsearch.server.grpc.LuceneServerClient) SearcherVersion(com.yelp.nrtsearch.server.grpc.SearcherVersion) ReplicationServerClient(com.yelp.nrtsearch.server.grpc.ReplicationServerClient)

Example 3 with LuceneServerClient

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

the class RegisterFieldsCommand method call.

@Override
public Integer call() throws Exception {
    LuceneServerClient client = baseCmd.getClient();
    try {
        String jsonStr = Files.readString(Paths.get(getFileName()));
        client.registerFields(jsonStr);
    } finally {
        client.shutdown();
    }
    return 0;
}
Also used : LuceneServerClient(com.yelp.nrtsearch.server.grpc.LuceneServerClient)

Example 4 with LuceneServerClient

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

the class SettingsCommand method call.

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

Example 5 with LuceneServerClient

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

the class ForceMergeCommand method call.

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

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