def get()

in spark/hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/datasources/HBaseTableCatalog.scala [159:191]


  def get(key: String) = params.get(key)

  // Setup the start and length for each dimension of row key at runtime.
  def dynSetupRowKey(rowKey: Array[Byte]) {
    logDebug(s"length: ${rowKey.length}")
    if (row.varLength) {
      var start = 0
      row.fields.foreach {
        f =>
          logDebug(s"start: $start")
          f.start = start
          f.length = {
            // If the length is not defined
            if (f.length == -1) {
              f.dt match {
                case StringType =>
                  var pos = rowKey.indexOf(HBaseTableCatalog.delimiter, start)
                  if (pos == -1 || pos > rowKey.length) {
                    // this is at the last dimension
                    pos = rowKey.length
                  }
                  pos - start
                // We don't know the length, assume it extend to the end of the rowkey.
                case _ => rowKey.length - start
              }
            } else {
              f.length
            }
          }
          start += f.length
      }
    }
  }