mirror of https://github.com/apache/druid.git
ChangeRequestHttpSyncer: Don't wait 1ms when checking isInitialized(). (#14547)
The wait doesn't seem to serve a purpose, other than causing delays when checking isInitialized() for a large number of things that have not yet been initialized.
This commit is contained in:
parent
d63eff3b1b
commit
1fe61bc869
|
@ -346,13 +346,7 @@ public class WorkerHolder
|
|||
|
||||
public boolean isInitialized()
|
||||
{
|
||||
try {
|
||||
return syncer.isInitialized();
|
||||
}
|
||||
catch (InterruptedException ignored) {
|
||||
Thread.currentThread().interrupt();
|
||||
return false;
|
||||
}
|
||||
return syncer.isInitialized();
|
||||
}
|
||||
|
||||
public boolean isEnabled()
|
||||
|
|
|
@ -571,12 +571,7 @@ public class HttpServerInventoryView implements ServerInventoryView, FilteredSer
|
|||
|
||||
boolean isSyncedSuccessfullyAtleastOnce()
|
||||
{
|
||||
try {
|
||||
return syncer.isInitialized();
|
||||
}
|
||||
catch (InterruptedException ex) {
|
||||
throw new ISE(ex, "Interrupted while waiting for first sync with server[%s].", druidServer.getName());
|
||||
}
|
||||
return syncer.isInitialized();
|
||||
}
|
||||
|
||||
private ChangeRequestHttpSyncer.Listener<DataSegmentChangeRequest> createSyncListener()
|
||||
|
|
|
@ -172,11 +172,11 @@ public class ChangeRequestHttpSyncer<T>
|
|||
}
|
||||
|
||||
/**
|
||||
* Waits upto 1 millisecond for the first successful sync with this server.
|
||||
* Whether this server has been synced successfully at least once.
|
||||
*/
|
||||
public boolean isInitialized() throws InterruptedException
|
||||
public boolean isInitialized()
|
||||
{
|
||||
return initializationLatch.await(1, TimeUnit.MILLISECONDS);
|
||||
return initializationLatch.getCount() == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue