Replicator doesn't work
See original GitHub issueI have a project to run on Linux (Ubuntu 20.x). I am currently developing on Windows. I am using 4.8.0-beta00012 packages of “Lucene .Net”. I want to do a replication process. I made use of this document for this. I followed all the steps. But the replication process does not react. “client.InfoStream” is empty. What am I missing?
Thank you for your interest.
Server side: .Net Core 3.1 Web Api
Related Code:
in Startup.cs
#region LuceneReplicator
var replicationService = new ReplicationService(new Dictionary<string, IReplicator> { { ReplicationConsts.SHARD_NAME, new LocalReplicator() } }, ReplicationConsts.REPLICATION_ENDPOINT);
app.Map(ReplicationConsts.REPLICATION_ENDPOINT, builder =>
{
builder.Run(async context =>
{
await Task.Yield();
replicationService.Perform(context.Request, context.Response);
});
});
#endregion
Client side: .Net Core 3.1 Hosted Service (Worker)
Related Code:
public class ClientReplicator
{
private const string HANDLER_INDEX_DIR = "C:/LuceneIndexes/handler";
private const string WORKING_PATH_DIR = "C:/LuceneIndexes/clientWorkDir";
public async Task UpdateChecker()
{
await Task.Run(() =>
{
IReplicator replicator = new HttpReplicator("localhost", 5003, $"{ReplicationConsts.REPLICATION_ENDPOINT}/{ReplicationConsts.SHARD_NAME}");
var handlerIndexDir = FSDirectory.Open(Path.GetFullPath(HANDLER_INDEX_DIR));
var workingPath = Path.GetFullPath(WORKING_PATH_DIR);
var client = new ReplicationClient(replicator,
new IndexReplicationHandler(handlerIndexDir, () => Notify()), new PerSessionDirectoryFactory(workingPath));
//Now either start the Update Thread or do manual pulls periodically.
client.UpdateNow(); //Manual Pull
Console.WriteLine(client.InfoStream.ToString());
});
}
public static bool Notify()
{
Console.WriteLine("Update!");
return true;
}
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Tek Replicator Won't Work : r/ARK
I have a tek replicator with all the resources to craft stuff in it, it won't let me craft. I see it says...
Read more >Replicator does not show any engrams in the inventory
Replicator does not show any engrams in the inventory After the eggcellent adventures started, our crafting adventure stopped.
Read more >Replicator Issue Not opening :: ARK: Survival Evolved ...
At first i could once i put Element in it,but now them options have disapeared and the Replicator does not open as it...
Read more >Tek Replicator - ARK: Survival Evolved Wiki
The Tek Replicator is an end-game crafting station used to craft Tek Tier items. It can also be used to craft normal Engrams...
Read more >Unlock the Tek Replicator in ARK Genesis 2! - YouTube
This is only the case since patch 330.8 on PC (though this should work on console soon too). Support the Channel!
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes that will certainly be possible, but it’s up to you to implement the details. And there is very likely going to be some “Gotchas” you have to coin out along the way.
The obvious approach here would be to have a configuration which defines what indexes a node are master of and which indexes it should replicate from a different master.
First and foremost, you probably need to describe your scenario a bit more so we know what you are trying to achieve over all, as it stands there is a few things that goes against common recommendations. Also for what is described in https://github.com/apache/lucenenet/blob/master/src/Lucene.Net.Replicator/Http/replicator.md it really only provides the most basic example so that people can get started using the replicator.
I don’t know if this crude sample can help you: https://github.com/jeme/LuceneNet.ReplicatorSample It uses a class called DataIngestSimulator to simulate changes over time to each index. (An update to a random number of documents each 30 seconds).
When you say that the user can dynamically index, what do you exactly mean?.. Are you simply trying to provide the users with Real-time search, as in the user may update a document/an entity of some sort which you then want to index and make available right away? or are you referring to something else?
You should avoid recreating your Index writers unless they experience an error (e.g. OutOfMemmoryExceptions) and share them across all indexing, (That is one writer Per index in your case).