Return the key for the current join or the value at the top of the
RecordReader heap.
499590
public K key() {
    if (jc.hasNext()) {
      return jc.key();
    }
    if (!q.isEmpty()) {
      return q.peek().key();
    }
    return null;
  }
946310
public int get(final int key)
    {
        int offset = endOfPositionField;

        final int position = position();
        while (offset < position)
        {
            if (statusVolatile(offset) == COMMITTED && key == key(offset))
            {
                return offset + SIZE_OF_RECORD_FRAME;
            }

            offset += slotSize;
        }

        return DID_NOT_CLAIM_RECORD;
    }
78595
def _get_object_key(self, p_object):
        """"""
        matched_key = None
        matched_index = None

        if hasattr(p_object, self._searchNames[0]):
            return getattr(p_object, self._searchNames[0])

        for x in xrange(len(self._searchNames)):
            key = self._searchNames[x]
            if hasattr(p_object, key):
                matched_key = key
                matched_index = x

        if matched_key is None:
            raise KeyError()

        if matched_index != 0 and self._searchOptimize:
            self._searchNames.insert(0, self._searchNames.pop(matched_index))

        return getattr(p_object, matched_key)
770057
def _get_key_location(self, key) -> (int, int):
        
        key = int(key)
        if key == 0:
            return 1, 0
        remainder = key % self.chunkSize
        addend = ChunkedFileStore.firstChunkIndex
        chunk_no = key - remainder + addend if remainder \
            else key - self.chunkSize + addend
        offset = remainder or self.chunkSize
        return chunk_no, offset
239559
public OMVRBTreeEntry<K, V> getHigherEntry(final K key) {
    final OMVRBTreeEntry<K, V> p = getEntry(key, true, PartialSearchMode.HIGHEST_BOUNDARY);

    if (p == null)
      return null;

    if (pageItemFound)
      // MATCH, RETURN THE NEXT ONE
      return next(p);
    else if (pageIndex < p.getSize())
      // NOT MATCHED, POSITION IS ALREADY TO THE NEXT ONE
      return p;

    return null;
  }
705484
def _get_val(record, keys):
    '''
    
    '''
    data = record
    for key in keys:
        if key in data:
            data = data[key]
        else:
            return None
    return data
638564
def _key(key=''):
    '''
    
    '''
    if not isinstance(key, datastore.Key):
        # Switchboard uses ':' to denote one thing (parent-child) and datastore
        # uses it for another, so replace ':' in the datastore version of the
        # key.
        safe_key = key.replace(':', '|')
        key = datastore.Key(os.path.join(NAMESPACE, safe_key))
    return key
1316107
def _get_context_key(self, **kwargs):
        
        return str(kwargs.get(self._resource.parent.id_name))
175416
def get_access_key(self):
        
        access_key = self.get_as_nullable_string("access_key")
        access_key = access_key if access_key != None else self.get_as_nullable_string("access_key")
        return access_key
1224174
def get_field_entry_key(node):
    # type: (Field) -> str
    """"""
    if node.alias:
        return node.alias.value
    return node.name.value
1066035
def related_records2marc(self, key, value):
    
    if value.get('relation_freetext'):
        return {
            'i': value.get('relation_freetext'),
            'w': get_recid_from_ref(value.get('record')),
        }
    elif value.get('relation') == 'successor':
        self.setdefault('78502', []).append({
            'i': 'superseded by',
            'w': get_recid_from_ref(value.get('record')),
        })
    elif value.get('relation') == 'predecessor':
        self.setdefault('78002', []).append({
            'i': 'supersedes',
            'w': get_recid_from_ref(value.get('record')),
        })
    else:
        raise NotImplementedError(u"Unhandled relation in related_records: {}".format(value.get('relation')))
1316925
def get(self, key: K) -> TOption[T]:
        
        return TOption(self[key]) if key in self else TOption(None)
796275
@Override
  public boolean nextKeyValue()
      throws IOException {
    // If there is no next value, return false. Set current key and value to null.
    // Different Hadoop recordreaders have different behavior for calling current key and value
    // after nextKeyValue returns false.
    if (!lineReader.nextKeyValue()) {
      logger.atFine().log("All values read: record reader read %s key, value pairs.", count);
      return false;
    }
    // Get the next line.
    currentKey.set(lineReader.getCurrentKey().get());
    Text lineValue = lineReader.getCurrentValue();
    currentValue = jsonParser.parse(lineValue.toString()).getAsJsonObject();
    // Increment count of key, value pairs.
    count++;
    return true;
  }
242333
protected Record locateRecord (int key)
    {
        int index = Math.abs(key)%_buckets.length;
        for (Record rec = _buckets[index]; rec != null; rec = rec.next) {
            if (rec.key == key) {
                return rec;
            }
        }
        return null;
    }
717174
def next(self):
        
        if self._current < len(self._record_list):
            rec = self._record_list[self._current]
            key = rec['name']
            self._current += 1
            return key
        else:
            raise StopIteration
1372943
public String getKey() {
        String dbkey = ThreadContext.getContext(dbName);
        if (dbkey == null) {
            Integer userid = ThreadContext.getShardKey();
            if (userid == null) {
                userid = 0;
                // throw new
                // RuntimeException("No userid contexted,so you can't know how to routing!!");
            }
            dbkey = router.getTargetDataSourceKey(userid, true);

            StackTraceElement[] elements = Thread.currentThread().getStackTrace();

            logTrace(dbkey, elements);

        }
        return dbkey;
    }
364
private String redisKey(ModelExt<?> m) {
		Table table = m.table();
		StringBuilder key = new StringBuilder();
		key.append(RECORDS);
		key.append(table.getName());
		key.append(":");
		//fetch primary keys' values
		String[] primaryKeys = table.getPrimaryKey();
		//format key
		for (int idx = 0; idx < primaryKeys.length; idx++) {
			Object primaryKeyVal = m.get(primaryKeys[idx]);
			if (null != primaryKeyVal) {
				if (idx > 0) {
					key.append("|");
				}
				key.append(primaryKeyVal);
			}
		}
		return key.toString();
	}