Determines the bucket id to the given <code>key</code>.
508874
@Override
    public int getBucketId(byte[] key) {
        int index = searchBucketIndex(key, 0, maxRangeValues.length - 1);
        return bucketIds[index];
    }
1227475
private Integer getKeyPartitionId(byte[] key) {
        Integer keyPartitionId = storeInstance.getNodesPartitionIdForKey(nodeId, key);

        Utils.notNull(keyPartitionId);
        return keyPartitionId;
    }
326647
protected void accountForFetchedKey(byte[] key) {
        fetched++;
        if (streamStats != null) {
            streamStats.reportStreamingFetch(operation);
        }

        if (recordsPerPartition <= 0) {
            return;
        }

        Integer keyPartitionId = getKeyPartitionId(key);
        Long partitionFetch = partitionFetches.get(keyPartitionId);
        Utils.notNull(partitionFetch);
        partitionFetch++;

        partitionFetches.put(keyPartitionId, partitionFetch);
        if (partitionFetch == recordsPerPartition) {
            if (partitionsToFetch.contains(keyPartitionId)) {
                partitionsToFetch.remove(keyPartitionId);
            } else {
                logger.warn("Partitions to fetch did not contain expected partition ID: "
                        + keyPartitionId);
            }
        } else if (partitionFetch > recordsPerPartition) {
            logger.warn("Partition fetch count larger than expected for partition ID "
                    + keyPartitionId + " : " + partitionFetch);
        }
    }
502162
public Integer getInteger(String key){
        try {
            return Integer.valueOf(resource.getString(key));
        } catch (MissingResourceException e) {
            return new Integer(-1);
        }
    }
429594
public int indexOfKey(Object key) {
        return key == null ? indexOfNull() : indexOf(key, key.hashCode());
    }
626691
def get_cache_key(bucket, name, args, kwargs):
    
    u = ''.join(map(str, (bucket, name, args, kwargs)))
    return 'native_tags.%s' % sha_constructor(u).hexdigest()
449173
private String getKey(String key) throws IllegalArgumentException {
    String checkKey =
        JobHistoryKeys.HADOOP2_TO_HADOOP1_MAPPING.containsKey(key) ? JobHistoryKeys.HADOOP2_TO_HADOOP1_MAPPING
            .get(key) : key;
    return (JobHistoryKeys.valueOf(checkKey).toString());
  }
815148
def entry(bucket, key):
    
    if key is None:
        return urlsafe_base64_encode('{0}'.format(bucket))
    else:
        return urlsafe_base64_encode('{0}:{1}'.format(bucket, key))
958575
public boolean containsKey(Key<?> key) {
    for (int i = 0; i < size; i++) {
      if (bytesEqual(key.asciiName(), name(i))) {
        return true;
      }
    }
    return false;
  }
320099
def get_default_bucket_key(buckets: List[Tuple[int, int]]) -> Tuple[int, int]:
    
    return max(buckets)
1113309
public FieldType getFieldTypeFromVarDataKey(Integer key)
   {
      FieldType result = null;
      for (Entry<FieldType, FieldMap.FieldItem> entry : m_map.entrySet())
      {
         if (entry.getValue().getFieldLocation() == FieldLocation.VAR_DATA && entry.getValue().getVarDataKey().equals(key))
         {
            result = entry.getKey();
            break;
         }
      }
      return result;
   }
635248
public boolean containsKey(Object key) {
	int k = checkKey(key);
	int index = Arrays.binarySearch(keyIndices, k);
	return index >= 0;
    }
1012646
public int getRegisteredResourceRequestCount(K key) {
        if(requestQueueMap.containsKey(key)) {
            Queue<AsyncResourceRequest<V>> requestQueue = getRequestQueueForExistingKey(key);
            // FYI: .size() is not constant time in the next call. ;)
            if(requestQueue != null) {
                return requestQueue.size();
            }
        }
        return 0;
    }
257236
@Override
  public String getOrCreateForKey(String key) {
    return uuidsByKey.computeIfAbsent(key, k -> Uuids.create());
  }
1241171
public static String encodedEntry(String bucket, String key) {
        String encodedEntry;
        if (key != null) {
            encodedEntry = UrlSafeBase64.encodeToString(bucket + ":" + key);
        } else {
            encodedEntry = UrlSafeBase64.encodeToString(bucket);
        }
        return encodedEntry;
    }
745799
@Override
    public Integer getInteger(final String key) {
        return retrieve(new Callable<Integer>() {
            @Override
            public Integer call() throws Exception {
                return configuration.getInt(key);
            }
        }, null);
    }
946024
def incr(self, key, by=1):
        
        pipe = self._client.pipeline(transaction=False)
        pipe.incr(self.get_key(key), by)
        if key not in self:
            pipe.hincrby(self._bucket_key, self.key_prefix, 1)
        result = pipe.execute()
        return result[0]