Class ReplicateHashTable

java.lang.Object
com.illumon.iris.db.v2.ReplicateHashTable

public class ReplicateHashTable
extends Object
This code replicator is designed to operate differently than the other replication in our system. It reads both the source and destination file, preserving custom code inside of the destination file. The source and destination files must provide annotations for their state column source, overflow column source, and empty state value. These are used to translate names, and also to determine the appropriate types for substitution. The source file has three kinds of structured comments that control behavior.
  • regions, denoted by // region name and // endregion name are snippets of code that change between the source and destination. You should edit the code within a region in either the source or destination file. Each region that exists in the source must exist in the destination (this is a sanity check to prevent you from overwriting your work). Regions must have unique names.
  • mixins, denoted by // mixin name and // mixin name are snippets of code that may not be useful in the destination class. Any mixins in the destination class will be overwritten! A mixin can be spread across multiple structured blocks, for example imports and a function definition may both use the same mixin name. Regions may exist inside a mixin. When mixins are excluded, the regions that exist within them are ignored.
  • substitutions, denoted by // @thing from literal are instructions to replace a particular literal with the appropriate type denoted by thing on the next line. Multiple substitutions may be separated using commas. The valid substitutions are:
    • StateChunkName, e.g. "LongChunk"
    • StateChunkIdentityName, e.g. "LongChunk" or "ObjectChunkIdentity"
    • StateChunkType, e.g. "LongChunk<Values>"
    • WritableStateChunkName, e.g. "WritableLongChunk"
    • WritableStateChunkType, e.g. "WritableLongChunk<Values>"
    • StateColumnSourceType, e.g. "LongArraySource"
    • StateColumnSourceConstructor, e.g. "LongArraySource()"
    • NullStateValue, e.g. "QueryConstants.NULL_LONG"
    • StateValueType, e.g. "long"
    • StateChunkTypeEnum, e.g. "Long"