test_class.declarator: indexTableName = "termIndex"
test_class.modifier: private final
test_class.original_string: private final String indexTableName = "termIndex";
test_class.type: String
test_class.var_name: indexTableName
test_class.declarator: rowId = "rowId"
test_class.modifier: private final
test_class.original_string: private final String rowId = "rowId";
test_class.type: String
test_class.var_name: rowId
test_class.declarator: rowIdBytes = rowId.getBytes()
test_class.modifier: private final
test_class.original_string: private final byte[] rowIdBytes = rowId.getBytes();
test_class.type: byte[]
test_class.var_name: rowIdBytes
test_class.declarator: colFam1 = "colFam_1"
test_class.modifier: private final
test_class.original_string: private final String colFam1 = "colFam_1";
test_class.type: String
test_class.var_name: colFam1
test_class.declarator: colQual1 = "colQual_1"
test_class.modifier: private final
test_class.original_string: private final String colQual1 = "colQual_1";
test_class.type: String
test_class.var_name: colQual1
test_class.declarator: value1 = "Steve vituperated Rodney"
test_class.modifier: private final
test_class.original_string: private final String value1 = "Steve vituperated Rodney";
test_class.type: String
test_class.var_name: value1
test_class.declarator: termIndex
test_class.modifier: private
test_class.original_string: private TermBasedIndex termIndex;
test_class.type: TermBasedIndex
test_class.var_name: termIndex
test_class.declarator: conf
test_class.modifier: private
test_class.original_string: private Configuration conf;
test_class.type: Configuration
test_class.var_name: conf
test_class.file: culvert-main/src/test/java/com/bah/culvert/data/index/TermBasedIndexTest.java
test_class.identifier: TermBasedIndexTest
test_case.body: @Test
    public void testGetSteve() {
      // Get steve back
      byte[] steveBytes = "steve".getBytes();
  
      // The end byte object should look like: steve\x01
      // This represents the next possible value which is allowable
      // since we pad the value with 6 null bytes.
      byte[] end = new byte[steveBytes.length + 1];
      System.arraycopy(steveBytes, 0, end, 0, steveBytes.length);
      end[end.length - 1] = 0x01;
  
      SeekingCurrentIterator indexIterator = termIndex.handleGet(steveBytes, end);
  
      // Test the returned data
      int count = 0;
      while (indexIterator.hasNext()) {
        Result result = indexIterator.next();
        count++;
  
        assertTrue(Bytes.compareTo(result.getRecordId(), rowIdBytes) == 0);
      }
  
      // Test if we have the expected number of results
      assertTrue(count == 1);
    }
test_case.class_method_signature: TermBasedIndexTest.testGetSteve()
test_case.full_signature: @Test public void testGetSteve()
test_case.identifier: testGetSteve
test_case.invocations: getBytes arraycopy handleGet hasNext next assertTrue compareTo getRecordId assertTrue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetSteve()
focal_class.declarator: LOG = LogFactory.getLog(TermBasedIndex.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Log LOG = LogFactory.getLog(TermBasedIndex.class);
focal_class.type: Log
focal_class.var_name: LOG
focal_class.declarator: TOKEN_REGEX_KEY = "culvert.index.term.token"
focal_class.modifier: private static final
focal_class.original_string: private static final String TOKEN_REGEX_KEY = "culvert.index.term.token";
focal_class.type: String
focal_class.var_name: TOKEN_REGEX_KEY
focal_class.declarator: SPLITABLE_TERM_KEY = "culvert.index.term.splitable"
focal_class.modifier: private static final
focal_class.original_string: private static final String SPLITABLE_TERM_KEY = "culvert.index.term.splitable";
focal_class.type: String
focal_class.var_name: SPLITABLE_TERM_KEY
focal_class.declarator: TO_LOWER_KEY = "culvert.index.term.lower"
focal_class.modifier: private static final
focal_class.original_string: private static final String TO_LOWER_KEY = "culvert.index.term.lower";
focal_class.type: String
focal_class.var_name: TO_LOWER_KEY
focal_class.declarator: DEFAULT_TOKEN_REGEX = "[^A-Za-z0-9]+"
focal_class.modifier: public static final
focal_class.original_string: public static final String DEFAULT_TOKEN_REGEX = "[^A-Za-z0-9]+";
focal_class.type: String
focal_class.var_name: DEFAULT_TOKEN_REGEX
focal_class.declarator: DEFAULT_IS_SPLITABLE = true
focal_class.modifier: private static final
focal_class.original_string: private static final boolean DEFAULT_IS_SPLITABLE = true;
focal_class.type: boolean
focal_class.var_name: DEFAULT_IS_SPLITABLE
focal_class.declarator: DEFAULT_IS_LOWER_CASED = true
focal_class.modifier: private static final
focal_class.original_string: private static final boolean DEFAULT_IS_LOWER_CASED = true;
focal_class.type: boolean
focal_class.var_name: DEFAULT_IS_LOWER_CASED
focal_class.declarator: NUM_RECORD_ID_LENGTH_BYTES = 4
focal_class.modifier: public static final
focal_class.original_string: public static final int NUM_RECORD_ID_LENGTH_BYTES = 4;
focal_class.type: int
focal_class.var_name: NUM_RECORD_ID_LENGTH_BYTES
focal_class.declarator: NUM_NULL_BYTES = 6
focal_class.modifier: public static final
focal_class.original_string: public static final int NUM_NULL_BYTES = 6;
focal_class.type: int
focal_class.var_name: NUM_NULL_BYTES
focal_class.declarator: NULL_BYTES_PADDING = new byte[NUM_NULL_BYTES]
focal_class.modifier: public static final
focal_class.original_string: public static final byte[] NULL_BYTES_PADDING = new byte[NUM_NULL_BYTES];
focal_class.type: byte[]
focal_class.var_name: NULL_BYTES_PADDING
focal_class.file: culvert-main/src/main/java/com/bah/culvert/data/index/TermBasedIndex.java
focal_class.identifier: TermBasedIndex
focal_class.class_method_signature: TermBasedIndex.TermBasedIndex()
focal_class.full_signature: public  TermBasedIndex()
focal_class.identifier: TermBasedIndex
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  TermBasedIndex()
focal_class.class_method_signature: TermBasedIndex.TermBasedIndex(String name, DatabaseAdapter database,
        String primaryTable, String indexTable, byte[] columnFamily,
        byte[] columnQualifier)
focal_class.full_signature: public  TermBasedIndex(String name, DatabaseAdapter database,
        String primaryTable, String indexTable, byte[] columnFamily,
        byte[] columnQualifier)
focal_class.identifier: TermBasedIndex
focal_class.modifiers: public
focal_class.parameters: (String name, DatabaseAdapter database,
        String primaryTable, String indexTable, byte[] columnFamily,
        byte[] columnQualifier)
focal_class.signature:  TermBasedIndex(String name, DatabaseAdapter database,
        String primaryTable, String indexTable, byte[] columnFamily,
        byte[] columnQualifier)
focal_class.class_method_signature: TermBasedIndex.TermBasedIndex(String name, DatabaseAdapter database,
        Configuration databaseConf, String primaryTable, String indexTable,
        byte[] columnFamily, byte[] columnQualifier, boolean isSplittable,
        String regex)
focal_class.full_signature: public  TermBasedIndex(String name, DatabaseAdapter database,
        Configuration databaseConf, String primaryTable, String indexTable,
        byte[] columnFamily, byte[] columnQualifier, boolean isSplittable,
        String regex)
focal_class.identifier: TermBasedIndex
focal_class.modifiers: public
focal_class.parameters: (String name, DatabaseAdapter database,
        Configuration databaseConf, String primaryTable, String indexTable,
        byte[] columnFamily, byte[] columnQualifier, boolean isSplittable,
        String regex)
focal_class.signature:  TermBasedIndex(String name, DatabaseAdapter database,
        Configuration databaseConf, String primaryTable, String indexTable,
        byte[] columnFamily, byte[] columnQualifier, boolean isSplittable,
        String regex)
focal_class.class_method_signature: TermBasedIndex.setTokenRegex(String regex, Configuration conf)
focal_class.full_signature: public static void setTokenRegex(String regex, Configuration conf)
focal_class.identifier: setTokenRegex
focal_class.modifiers: public static
focal_class.parameters: (String regex, Configuration conf)
focal_class.return: void
focal_class.signature: void setTokenRegex(String regex, Configuration conf)
focal_class.class_method_signature: TermBasedIndex.setSplitable(boolean isSplitable, Configuration conf)
focal_class.full_signature: public static void setSplitable(boolean isSplitable, Configuration conf)
focal_class.identifier: setSplitable
focal_class.modifiers: public static
focal_class.parameters: (boolean isSplitable, Configuration conf)
focal_class.return: void
focal_class.signature: void setSplitable(boolean isSplitable, Configuration conf)
focal_class.class_method_signature: TermBasedIndex.setToLower(boolean isLowerable, Configuration conf)
focal_class.full_signature: public static void setToLower(boolean isLowerable, Configuration conf)
focal_class.identifier: setToLower
focal_class.modifiers: public static
focal_class.parameters: (boolean isLowerable, Configuration conf)
focal_class.return: void
focal_class.signature: void setToLower(boolean isLowerable, Configuration conf)
focal_class.class_method_signature: TermBasedIndex.getTokenRegex()
focal_class.full_signature: public String getTokenRegex()
focal_class.identifier: getTokenRegex
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getTokenRegex()
focal_class.class_method_signature: TermBasedIndex.getSplitable()
focal_class.full_signature: public boolean getSplitable()
focal_class.identifier: getSplitable
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean getSplitable()
focal_class.class_method_signature: TermBasedIndex.getToLower()
focal_class.full_signature: public boolean getToLower()
focal_class.identifier: getToLower
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean getToLower()
focal_class.class_method_signature: TermBasedIndex.handlePut(Put put)
focal_class.full_signature: @Override public void handlePut(Put put)
focal_class.identifier: handlePut
focal_class.modifiers: @Override public
focal_class.parameters: (Put put)
focal_class.return: void
focal_class.signature: void handlePut(Put put)
focal_class.class_method_signature: TermBasedIndex.handleGet(byte[] indexRangeStart,
        byte[] indexRangeEnd)
focal_class.full_signature: @Override public SeekingCurrentIterator handleGet(byte[] indexRangeStart,
        byte[] indexRangeEnd)
focal_class.identifier: handleGet
focal_class.modifiers: @Override public
focal_class.parameters: (byte[] indexRangeStart,
        byte[] indexRangeEnd)
focal_class.return: SeekingCurrentIterator
focal_class.signature: SeekingCurrentIterator handleGet(byte[] indexRangeStart,
        byte[] indexRangeEnd)
focal_class.class_method_signature: TermBasedIndex.createTermList(CKeyValue keyValue)
focal_class.full_signature: private List<CKeyValue> createTermList(CKeyValue keyValue)
focal_class.identifier: createTermList
focal_class.modifiers: private
focal_class.parameters: (CKeyValue keyValue)
focal_class.return: List<CKeyValue>
focal_class.signature: List<CKeyValue> createTermList(CKeyValue keyValue)
focal_class.class_method_signature: TermBasedIndex.createIndexRowId(byte[] term, byte[] recordRowId)
focal_class.full_signature: private static byte[] createIndexRowId(byte[] term, byte[] recordRowId)
focal_class.identifier: createIndexRowId
focal_class.modifiers: private static
focal_class.parameters: (byte[] term, byte[] recordRowId)
focal_class.return: byte[]
focal_class.signature: byte[] createIndexRowId(byte[] term, byte[] recordRowId)
focal_class.class_method_signature: TermBasedIndex.parseIndexRowGetId(byte[] indexRowId)
focal_class.full_signature: private static byte[] parseIndexRowGetId(byte[] indexRowId)
focal_class.identifier: parseIndexRowGetId
focal_class.modifiers: private static
focal_class.parameters: (byte[] indexRowId)
focal_class.return: byte[]
focal_class.signature: byte[] parseIndexRowGetId(byte[] indexRowId)
focal_class.superclass: extends Index
focal_method.body: @Override
    public SeekingCurrentIterator handleGet(byte[] indexRangeStart,
        byte[] indexRangeEnd) {
  
      // Get the table adapter for this index
      TableAdapter indexTable = getIndexTable();
  
      // update the end key to lookup the term properly (and inclusively)
      byte[] end;
      if (indexRangeEnd.length != 0) {
        // need to increment the end so it is inclusive of the end of the range
        end = Arrays.copyOf(indexRangeEnd, indexRangeEnd.length + 1);
        end[end.length - 1] = 1;
      }
      // if it covers the entire range, then we don't need to do anything
      else
        end = indexRangeEnd;
  
      // do the get
      Get get = new Get(new CRange(indexRangeStart, end));
      return new TermBasedIndexIterator(indexTable.get(get));
    }
focal_method.class_method_signature: TermBasedIndex.handleGet(byte[] indexRangeStart,
        byte[] indexRangeEnd)
focal_method.full_signature: @Override public SeekingCurrentIterator handleGet(byte[] indexRangeStart,
        byte[] indexRangeEnd)
focal_method.identifier: handleGet
focal_method.invocations: getIndexTable copyOf get
focal_method.modifiers: @Override public
focal_method.parameters: (byte[] indexRangeStart,
        byte[] indexRangeEnd)
focal_method.return: SeekingCurrentIterator
focal_method.signature: SeekingCurrentIterator handleGet(byte[] indexRangeStart,
        byte[] indexRangeEnd)