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)
          Deprecated. Use getPayload(String, Bucket) instead
protected  Payload getPayload(String testName, Bucket<?> fallbackBucket)
           
 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,String> getTestVersions()
           
 Map<String,String> getTestVersions(Set<String> tests)
           
protected  int getValue(String testName, int defaultValue)
           
protected  boolean isBucketActive(String testName, int value)
          Deprecated. Use isBucketActive(String, int, int) instead
protected  boolean isBucketActive(String testName, int value, int defaultValue)
           
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,String> getTestVersions()

isBucketActive

protected boolean isBucketActive(String testName,
                                 int value)
Deprecated. Use isBucketActive(String, int, int) instead


isBucketActive

protected boolean isBucketActive(String testName,
                                 int value,
                                 int defaultValue)

getValue

protected int getValue(String testName,
                       int defaultValue)

getTestVersions

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

getPayload

@Nonnull
protected Payload getPayload(String testName)
Deprecated. Use getPayload(String, Bucket) instead

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.


getPayload

@Nonnull
protected Payload getPayload(String testName,
                                     @Nonnull
                                     Bucket<?> fallbackBucket)

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.