Get the hbase rowkey of some bean id.
342998
public static byte[] getRowKey(final BeanId id, final UniqueIds uids) {
        final byte[] iid = uids.getUiid().getId(id.getInstanceId());
        final byte[] sid = uids.getUsid().getId(id.getSchemaName());
        final byte[] rowkey = new byte[sid.length + iid.length];
        System.arraycopy(sid, 0, rowkey, 0, sid.length);
        System.arraycopy(iid, 0, rowkey, sid.length, iid.length);
        return rowkey;
    }
30607
public String get(final String key, final String columnName) throws HectorException {
    ColumnQuery<String, String, String> q = HFactory.createColumnQuery(keyspace,
        serializer, serializer, serializer);
    QueryResult<HColumn<String, String>> r = q.setKey(key).
        setName(columnName).
        setColumnFamily(columnFamilyName).
        execute();
    HColumn<String, String> c = r.get();
    return c != null ? c.getValue() : null;
  }
685090
public <T> T queryColumns(K key, List<N> columns,
      ColumnFamilyRowMapper<K, N, T> mapper) {
    HSlicePredicate<N> predicate = new HSlicePredicate<N>(topSerializer);
    predicate.setColumnNames(columns);        
    return doExecuteSlice(key, predicate, mapper);
  }
985872
public V get(K key) {
        return get(key.hashCode() / SIZE_ROW, key.hashCode() % SIZE_ROW);
    }
603038
private String getRow(String rowKey) {
        try {
            return cache.get(rowKey);
        } catch (Exception e) {
            if (e.getCause() instanceof RowNotFoundException) {
                return null;
            }
            throw new RuntimeException(e);
        }
    }
1042822
@Override
    public <E> List<E> getColumnsById(String schemaName, String joinTableName, String joinColumnName,
            String inverseJoinColumnName, Object parentId, Class columnJavaType)
    {
        return handler.getForeignKeysFromJoinTable(schemaName, joinTableName, parentId, inverseJoinColumnName);
    }
618366
public static long getId(final byte[] rowkey) {
        return (rowkey[0] & 0xFFL) << 40 | (rowkey[1] & 0xFFL) << 32 | (rowkey[2] & 0xFFL) << 24
                | (rowkey[3] & 0xFFL) << 16 | (rowkey[4] & 0xFFL) << 8 | (rowkey[5] & 0xFFL) << 0;
    }
1048333
public UIContext getRowContext(final Object rowBean, final int rowIndex) {
		RepeaterModel model = getOrCreateComponentModel();
		Object rowId = getRowId(rowBean);

		if (model.rowContextMap == null) {
			model.rowContextMap = new HashMap<>();
		}

		SubUIContext rowContext = model.rowContextMap.get(rowId);

		if (rowContext == null) {
			int seq = model.rowContextIdSequence++;

			// Just for the first row, check rowId has implemented equals/hashcode. Assumes each row will use the same
			// row id class.
			if (seq == 0) {
				try {
					if (rowId.getClass() != rowId.getClass().getMethod("equals", Object.class).
							getDeclaringClass()
							|| rowId.getClass() != rowId.getClass().getMethod("hashCode").
							getDeclaringClass()) {
						LOG.warn("Row id class ["
								+ rowId.getClass().getName()
								+ "] has not implemented equals or hashcode. This can cause errors when matching a row context. "
								+ "Implement equals/hashcode on the row bean or refer to setRowIdBeanProperty method on WRepeater.");
					}
				} catch (Exception e) {
					LOG.info(
							"Error checking equals and hashcode implementation on the row id. " + e.
							getMessage(), e);
				}
			}

			// Get the row render id name (used in naming context for each row)
			String renderId = getRowIdName(rowBean, rowId);
			if (renderId == null) {
				// Just use the context id as the row naming context
				rowContext = new SubUIContext(this, seq);
			} else {
				// Check ID is properly formed
				// Must only contain letters, digits and or underscores
				Matcher matcher = ROW_ID_CONTEXT_NAME_PATTERN.matcher(renderId);
				if (!matcher.matches()) {
					throw new IllegalArgumentException(
							"Row idName ["
							+ renderId
							+ "] must start with a letter and followed by letters, digits and or underscores.");
				}
				rowContext = new SubUIContext(this, seq, renderId);
			}
			rowContext.setRowId(rowId);
			model.rowContextMap.put(rowId, rowContext);
		}

		rowContext.setRowIndex(rowIndex); // just incase it has changed
		return rowContext;
	}
225954
public BeanId getBeanId() {
        final byte[] rowkey = getRowKey();
        final byte[] sid = new byte[] { rowkey[0], rowkey[1] };
        final byte[] iid = new byte[] { rowkey[2], rowkey[3], rowkey[4], rowkey[5] };
        final String schemaName = uids.getUsid().getName(sid);
        final String instanceId = uids.getUiid().getName(iid);

        if (Strings.isNullOrEmpty(schemaName)) {
            throw new IllegalStateException("Could not lookup schema name from sid "
                    + Arrays.toString(sid));
        }
        if (Strings.isNullOrEmpty(instanceId)) {
            throw new IllegalStateException("Could not lookup instance id from iid "
                    + Arrays.toString(iid));
        }
        return BeanId.create(instanceId, schemaName);
    }
523846
def get_rows( self, key ):
        """"""
        if key not in self.roots:
            self.get_root( key )
        if key == 'location':
            return self.location_rows 
        else:
            return self.rows
966608
public final List findByRowKeys(Class entityClass, List<String> relationNames, boolean isWrapReq,
        EntityMetadata metadata, Object... rowIds) {
        List entities = null;

        MetamodelImpl metaModel =
            (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(metadata.getPersistenceUnit());

        EntityType entityType = metaModel.entity(metadata.getEntityClazz());

        List<AbstractManagedType> subManagedType = ((AbstractManagedType) entityType).getSubManagedType();

        try {
            if (!subManagedType.isEmpty()) {
                for (AbstractManagedType subEntity : subManagedType) {
                    EntityMetadata subEntityMetadata =
                        KunderaMetadataManager.getEntityMetadata(kunderaMetadata, subEntity.getJavaType());
                    entities = getDataHandler().fromThriftRow(entityClass, subEntityMetadata,
                        subEntityMetadata.getRelationNames(), isWrapReq, getConsistencyLevel(), rowIds);

                    if (entities != null && !entities.isEmpty()) {
                        break;
                    }
                }
            } else {
                entities = getDataHandler().fromThriftRow(entityClass, metadata, relationNames, isWrapReq,
                    getConsistencyLevel(), rowIds);
            }
        } catch (Exception e) {
            log.error("Error while retrieving records for entity {}, row keys {}", entityClass, rowIds);
            throw new KunderaException(e);
        }
        return entities;
    }
645543
public BeanO getBean(ContainerTx tx, BeanId id)
    {
        return id.getActivationStrategy().atGet(tx, id);
    }
1335296
private String _read(String rowKey) throws RowNotFoundException {
        Row row = CqlUtils.executeOne(sessionHelper.getSession(), cqlGetMetadata,
                ConsistencyLevel.LOCAL_ONE, rowKey);
        String jsonString = row != null ? row.getString(CqlTemplate.COL_METADATA_METADATA) : null;
        if (jsonString != null) {
            return jsonString;
        }
        throw new RowNotFoundException(rowKey);
    }
1249502
@Override
    public <E> List<E> getColumnsById(String schemaName, String tableName, String pKeyColumnName, String columnName,
            Object pKeyColumnValue, Class columnJavaType)
    {
        // fetch list ADDRESS_ID for given PERSON_ID
        QueryBuilder filterBuilder = new TermQueryBuilder(pKeyColumnName, pKeyColumnValue);

        SearchResponse response = txClient.prepareSearch(schemaName.toLowerCase()).setTypes(tableName)
                .setPostFilter(filterBuilder).addField(columnName).execute().actionGet();

        SearchHits hits = response.getHits();

        List columns = new ArrayList();
        for (SearchHit hit : hits.getHits())
        {
            Map<String, SearchHitField> fields = hit.getFields();
            columns.add(fields.get(columnName).getValue());
        }

        return columns;
    }
1068881
def incr(self, key, incr_by=1):
        """"""
        return self.database.hincrby(self.key, key, incr_by)
422364
public Object getValueForCell(final FacesContext context, final String rowKey, final int col) {
        // if we have a local value, use it
        // note: can't check for null, as null may be the submitted value
        final SheetRowColIndex index = new SheetRowColIndex(rowKey, col);
        if (localValues.containsKey(index)) {
            return localValues.get(index);
        }

        setRowVar(context, rowKey);
        final SheetColumn column = getColumns().get(col);
        return column.getValueExpression("value").getValue(context.getELContext());
    }
28674
@Override
    public <E> List<E> getForeignKeysFromJoinTable(String schemaName, String joinTableName, Object rowKey,
            String inverseJoinColumnName)
    {
        List<E> foreignKeys = new ArrayList<E>();
        Table hTable = null;
        String tableName = HBaseUtils.getHTableName(schemaName, joinTableName);
        try
        {
            hTable = gethTable(tableName);
            List<HBaseDataWrapper> results = hbaseReader.loadData(hTable, rowKey, null, null, joinTableName,
                    getFilter(joinTableName), null);
            if (results != null && !results.isEmpty())
            {
                HBaseDataWrapper data = results.get(0);
                Map<String, byte[]> hbaseValues = data.getColumns();
                Set<String> columnNames = hbaseValues.keySet();
                for (String columnName : columnNames)
                {
                    if (columnName.startsWith(HBaseUtils.getColumnDataKey(joinTableName, inverseJoinColumnName)))
                    {
                        byte[] columnValue = data.getColumnValue(columnName);
                        String hbaseColumnValue = Bytes.toString(columnValue);
                        foreignKeys.add((E) hbaseColumnValue);
                    }
                }
            }
        }
        catch (IOException e)
        {
            return foreignKeys;
        }
        finally
        {
            try
            {
                if (hTable != null)
                {
                    closeHTable(hTable);
                }
            }
            catch (IOException e)
            {
                logger.error("Error in closing hTable, caused by: ", e);
            }
        }
        return foreignKeys;
    }