public class ChangeRequestHttpSyncer<T> extends Object
ChangeRequestHistory.
For example HttpServerInventoryView uses it to keep segment state in sync with data
nodes which expose the segment state via HTTP endpoint in SegmentListerResource.getSegments(long, long, long, javax.servlet.http.HttpServletRequest).| Modifier and Type | Class and Description |
|---|---|
static interface |
ChangeRequestHttpSyncer.Listener<T>
Concurrency guarantees: all calls to
ChangeRequestHttpSyncer.Listener.fullSync(java.util.List<T>) and ChangeRequestHttpSyncer.Listener.deltaSync(java.util.List<T>) (that is done within the executor) are linearizable. |
| Modifier and Type | Field and Description |
|---|---|
static long |
HTTP_TIMEOUT_EXTRA_MS |
| Constructor and Description |
|---|
ChangeRequestHttpSyncer(com.fasterxml.jackson.databind.ObjectMapper smileMapper,
HttpClient httpClient,
ScheduledExecutorService executor,
URL baseServerURL,
String baseRequestPath,
com.fasterxml.jackson.core.type.TypeReference<ChangeRequestsSnapshot<T>> responseTypeReferences,
long serverTimeoutMS,
long serverUnstabilityTimeout,
ChangeRequestHttpSyncer.Listener<T> listener) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitInitialization(long timeout,
TimeUnit timeUnit)
Wait for first fetch of segment listing from server.
|
Map<String,Object> |
getDebugInfo()
This method returns the debugging information for printing, must not be used for any other purpose.
|
long |
getServerHttpTimeout() |
boolean |
isOK()
Exposed for monitoring use to see if sync is working fine and not stopped due to any coding bugs.
|
void |
start() |
void |
stop() |
public static final long HTTP_TIMEOUT_EXTRA_MS
public ChangeRequestHttpSyncer(com.fasterxml.jackson.databind.ObjectMapper smileMapper,
HttpClient httpClient,
ScheduledExecutorService executor,
URL baseServerURL,
String baseRequestPath,
com.fasterxml.jackson.core.type.TypeReference<ChangeRequestsSnapshot<T>> responseTypeReferences,
long serverTimeoutMS,
long serverUnstabilityTimeout,
ChangeRequestHttpSyncer.Listener<T> listener)
public void start()
public void stop()
public boolean awaitInitialization(long timeout,
TimeUnit timeUnit)
throws InterruptedException
InterruptedExceptionpublic Map<String,Object> getDebugInfo()
public boolean isOK()
public long getServerHttpTimeout()
Copyright © 2011–2020 The Apache Software Foundation. All rights reserved.