Package com.indeed.proctor.common
Class AbstractProctorLoader
- java.lang.Object
-
- java.util.TimerTask
-
- com.indeed.util.core.DataLoadingTimerTask
-
- com.indeed.proctor.common.AbstractProctorLoader
-
- All Implemented Interfaces:
com.google.common.base.Supplier<Proctor>,com.indeed.util.core.HasDataLoadingVariables,java.lang.Runnable
- Direct Known Subclasses:
AbstractJsonProctorLoader,TestMatrixArtifactProctorLoader
public abstract class AbstractProctorLoader extends com.indeed.util.core.DataLoadingTimerTask implements com.google.common.base.Supplier<Proctor>
-
-
Field Summary
Fields Modifier and Type Field Description protected DynamicFiltersdynamicFiltersprotected java.util.Map<java.lang.String,TestSpecification>requiredTestsprotected static com.indeed.util.varexport.VarExporterVAR_EXPORTER
-
Constructor Summary
Constructors Constructor Description AbstractProctorLoader(java.lang.Class<?> cls, ProctorSpecification specification, javax.el.FunctionMapper functionMapper)AbstractProctorLoader(java.lang.Class<?> cls, ProctorSpecification specification, javax.el.FunctionMapper functionMapper, IdentifierValidator identifierValidator)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddLoadReporter(ProctorLoadReporter diffReporter)voidaddLoadReporter(java.util.List<ProctorLoadReporter> newReporters)protected ProvidedContextcreateProvidedContext(ProctorSpecification specification)ProctordoLoad()protected voidexportDynamicTests(java.util.Set<java.lang.String> dynamicTests)Proctorget()AuditgetLastAudit()java.lang.StringgetLastLoadErrorMessage()java.util.Set<java.lang.String>getLoggedDynamicTests()protected ProctorResultReportergetProctorResultReporter()user can override this function to provide a Proctor Result Reporter for monitoring determining Groups of proctor testsprotected java.util.Map<java.lang.String,java.lang.Object>getRuleVerificationContext()user can override this function to provide a context for rule verificationbooleanisLoadedDataSuccessfullyRecently()booleanload()protected voidlogDynamicTests(java.lang.String testName, java.lang.Exception exception)voidsetDiffReporter(AbstractProctorDiffReporter diffReporter)Deprecated.
-
-
-
Field Detail
-
VAR_EXPORTER
protected static final com.indeed.util.varexport.VarExporter VAR_EXPORTER
-
requiredTests
@Nullable protected final java.util.Map<java.lang.String,TestSpecification> requiredTests
-
dynamicFilters
protected final DynamicFilters dynamicFilters
-
-
Constructor Detail
-
AbstractProctorLoader
public AbstractProctorLoader(@Nonnull java.lang.Class<?> cls, @Nonnull ProctorSpecification specification, @Nonnull javax.el.FunctionMapper functionMapper)
-
AbstractProctorLoader
public AbstractProctorLoader(@Nonnull java.lang.Class<?> cls, @Nonnull ProctorSpecification specification, @Nonnull javax.el.FunctionMapper functionMapper, @Nonnull IdentifierValidator identifierValidator)- Parameters:
cls- name will be used as namespace for timerspecification- provides tests, context, dynamic filtersfunctionMapper- evaluates functions in allocation rulesidentifierValidator- validates for preventing unintended activation of tests
-
-
Method Detail
-
getRuleVerificationContext
protected java.util.Map<java.lang.String,java.lang.Object> getRuleVerificationContext()
user can override this function to provide a context for rule verification- Returns:
- a context for rule verification
-
createProvidedContext
protected ProvidedContext createProvidedContext(ProctorSpecification specification)
-
load
public boolean load()
- Specified by:
loadin classcom.indeed.util.core.DataLoadingTimerTask
-
doLoad
@CheckForNull public Proctor doLoad() throws java.io.IOException, MissingTestMatrixException
- Throws:
java.io.IOExceptionMissingTestMatrixException
-
getProctorResultReporter
protected ProctorResultReporter getProctorResultReporter()
user can override this function to provide a Proctor Result Reporter for monitoring determining Groups of proctor tests- Returns:
- a ProctorResultReporter
-
logDynamicTests
protected void logDynamicTests(java.lang.String testName, java.lang.Exception exception)
-
getLoggedDynamicTests
public java.util.Set<java.lang.String> getLoggedDynamicTests()
-
get
@CheckForNull public Proctor get()
- Specified by:
getin interfacecom.google.common.base.Supplier<Proctor>
-
getLastAudit
@CheckForNull public Audit getLastAudit()
-
getLastLoadErrorMessage
@CheckForNull public java.lang.String getLastLoadErrorMessage()
-
isLoadedDataSuccessfullyRecently
public boolean isLoadedDataSuccessfullyRecently()
- Returns:
- true if there was a success and it came after the last error
-
setDiffReporter
@Deprecated public void setDiffReporter(@Nonnull AbstractProctorDiffReporter diffReporter)Deprecated.this is used to provide custom reporting of changes in the tests, e.g. reporting to datadog- Parameters:
diffReporter- a reporter to report change of new proctor
-
addLoadReporter
public void addLoadReporter(@Nonnull ProctorLoadReporter diffReporter)
-
addLoadReporter
public void addLoadReporter(@Nonnull java.util.List<ProctorLoadReporter> newReporters)
-
exportDynamicTests
protected void exportDynamicTests(java.util.Set<java.lang.String> dynamicTests)
-
-