public abstract class ReplicationInformerBase<T> extends Object implements IReplicationInformerBase<T>
Modifier and Type | Class and Description |
---|---|
protected static class |
ReplicationInformerBase.FailureCounter |
static class |
ReplicationInformerBase.OperationResult<T> |
Modifier and Type | Field and Description |
---|---|
protected Convention |
conventions |
protected List<EventHandler<ReplicationInformer.FailoverStatusChangedEventArgs>> |
failoverStatusChanged |
protected Map<String,ReplicationInformerBase.FailureCounter> |
failureCounts |
protected boolean |
firstTime |
protected Date |
lastReplicationUpdate |
protected static ILog |
log |
protected static AtomicInteger |
readStripingBase |
protected Thread |
refreshReplicationInformationTask |
protected List<OperationMetadata> |
replicationDestinations |
protected Object |
replicationLock |
Modifier | Constructor and Description |
---|---|
protected |
ReplicationInformerBase(Convention conventions,
HttpJsonRequestFactory requestFactory,
int delayTime) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
refreshReplicationInformation
close
protected static ILog log
protected boolean firstTime
protected Convention conventions
protected Date lastReplicationUpdate
protected final Object replicationLock
protected static AtomicInteger readStripingBase
protected List<OperationMetadata> replicationDestinations
protected final Map<String,ReplicationInformerBase.FailureCounter> failureCounts
protected Thread refreshReplicationInformationTask
protected List<EventHandler<ReplicationInformer.FailoverStatusChangedEventArgs>> failoverStatusChanged
protected ReplicationInformerBase(Convention conventions, HttpJsonRequestFactory requestFactory, int delayTime)
public abstract void clearReplicationInformationLocalCache(T client)
IReplicationInformerBase
clearReplicationInformationLocalCache
in interface IReplicationInformerBase<T>
public int getDelayTimeInMiliSec()
getDelayTimeInMiliSec
in interface IReplicationInformerBase<T>
public void setDelayTimeInMiliSec(int delayTimeInMiliSec)
setDelayTimeInMiliSec
in interface IReplicationInformerBase<T>
public void addFailoverStatusChanged(EventHandler<ReplicationInformer.FailoverStatusChangedEventArgs> event)
addFailoverStatusChanged
in interface IReplicationInformerBase<T>
public void removeFailoverStatusChanged(EventHandler<ReplicationInformer.FailoverStatusChangedEventArgs> event)
removeFailoverStatusChanged
in interface IReplicationInformerBase<T>
public List<OperationMetadata> getReplicationDestinations()
getReplicationDestinations
in interface IReplicationInformerBase<T>
public List<OperationMetadata> getReplicationDestinationsUrls()
getReplicationDestinationsUrls
in interface IReplicationInformerBase<T>
public AtomicLong getFailureCount(String operationUrl)
IReplicationInformerBase
getFailureCount
in interface IReplicationInformerBase<T>
public Date getFailureLastCheck(String operationUrl)
IReplicationInformerBase
getFailureLastCheck
in interface IReplicationInformerBase<T>
protected boolean shouldExecuteUsing(OperationMetadata operationMetadata, OperationMetadata primaryOperation, int currentRequest, HttpMethods method, boolean primary, Exception error)
protected ReplicationInformerBase.FailureCounter getHolder(String operationUrl)
protected static boolean isInvalidDestinationsDocument(JsonDocument document)
protected void resetFailureCount(String operationUrl)
public int getReadStripingBase(boolean increment)
getReadStripingBase
in interface IReplicationInformerBase<T>
public <S> S executeWithReplication(HttpMethods method, String primaryUrl, OperationCredentials primaryCredentials, int currentRequest, int currentReadStripingBase, Function1<OperationMetadata,S> operation)
executeWithReplication
in interface IReplicationInformerBase<T>
protected <S> ReplicationInformerBase.OperationResult<S> tryOperation(Function1<OperationMetadata,S> operation, OperationMetadata operationMetadata, OperationMetadata primaryOperationMetadata, boolean avoidThrowing)
public boolean isHttpStatus(Exception e, int... httpStatusCode)
isHttpStatus
in interface IReplicationInformerBase<T>
public boolean isServerDown(Exception e, Reference<Boolean> timeout)
isServerDown
in interface IReplicationInformerBase<T>
public void dispose() throws InterruptedException
InterruptedException
public void forceCheck(String primaryUrl, boolean shouldForceCheck)
forceCheck
in interface IReplicationInformerBase<T>
Copyright © 2016. All Rights Reserved.