com.indeed.proctor.consumer
Class AbstractGroups

java.lang.Object
  extended by com.indeed.proctor.consumer.AbstractGroups

public abstract class AbstractGroups
extends Object


Constructor Summary
protected AbstractGroups(ProctorResult proctorResult)
           
 
Method Summary
 void appendTestGroups(StringBuilder sb)
           
 void appendTestGroups(StringBuilder sb, char separator)
          Appends each group to the StringBuilder using the separator to delimit group names.
 StringBuilder buildTestGroupString()
           
 Map<String,Integer> getJavaScriptConfig()
          Generates a Map that be serialized to JSON and used with indeed.proctor.groups.init and indeed.proctor.groups.inGroup(tstName, bucketValue) When we create a generated JavaScript representation of indeed.proctor.AbstractGroups, this config can be updated for use in it's constructor.
protected  Payload getPayload(String testName)
          Return the Payload attached to the current active bucket for |test|.
 ProctorResult getProctorResult()
           
protected  TestBucket getTestBucketForBucket(String testName, Bucket<?> targetBucket)
          Return the TestBucket, as defined in the current test matrix, for the test called testName with bucket value targetBucket.getValue().
 Map<String,Integer> getTestVersions()
           
 Map<String,Integer> getTestVersions(Set<String> tests)
           
protected  int getValue(String testName, int defaultValue)
           
protected  boolean isBucketActive(String testName, int value)
           
protected  boolean isEmpty()
          Return a value indicating if the groups are empty and should be represented by an empty-string toString()
 String toLongString()
           
 String toString()
          To be called when logging ONLY
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractGroups

protected AbstractGroups(ProctorResult proctorResult)
Method Detail

getTestVersions

public Map<String,Integer> getTestVersions()

isBucketActive

protected boolean isBucketActive(String testName,
                                 int value)

getValue

protected int getValue(String testName,
                       int defaultValue)

getTestVersions

public Map<String,Integer> getTestVersions(Set<String> tests)

getPayload

protected Payload getPayload(String testName)
Return the Payload attached to the current active bucket for |test|. Always returns a payload so the client doesn't crash on a malformed test definition.


getTestBucketForBucket

@Nullable
protected TestBucket getTestBucketForBucket(String testName,
                                                     Bucket<?> targetBucket)
Return the TestBucket, as defined in the current test matrix, for the test called testName with bucket value targetBucket.getValue(). Can return null if it can't find any such bucket. This does a linear search over the list of defined buckets. There shouldn't be too many buckets in any test, so this should be fast enough.


toLongString

public String toLongString()

toString

public String toString()
To be called when logging ONLY

Overrides:
toString in class Object

buildTestGroupString

public StringBuilder buildTestGroupString()

appendTestGroups

public void appendTestGroups(StringBuilder sb)

isEmpty

protected boolean isEmpty()
Return a value indicating if the groups are empty and should be represented by an empty-string toString()

Returns:

appendTestGroups

public void appendTestGroups(StringBuilder sb,
                             char separator)
Appends each group to the StringBuilder using the separator to delimit group names. the separator should be appended for each group added to the string builder toString() buildTestGroupString() or appendTestGroups(StringBuilder)

Parameters:
sb -

getJavaScriptConfig

public Map<String,Integer> getJavaScriptConfig()
Generates a Map that be serialized to JSON and used with indeed.proctor.groups.init and indeed.proctor.groups.inGroup(tstName, bucketValue) When we create a generated JavaScript representation of indeed.proctor.AbstractGroups, this config can be updated for use in it's constructor.

Returns:

getProctorResult

public ProctorResult getProctorResult()


Copyright © 2014. All Rights Reserved.