@Override public PlasmaType decodeType(byte[] bytes) { String[] tokens = Bytes.toString(bytes).split(ROOT_TYPE_DELIM); return (PlasmaType) PlasmaTypeHelper.INSTANCE.findTypeByPhysicalName(tokens[0], tokens[1]); }
protected PlasmaType findRootType(TableReader childTableReader, GraphColumnKeyFactory keyFactory, PlasmaType subType, CellValues childResult) throws IOException { byte[] typeQual = keyFactory.createColumnKey(subType, EntityMetaKey.TYPE); byte[] rootType = childResult.getColumnValue(childTableReader.getTableConfig() .getDataColumnFamilyNameBytes(), typeQual); if (rootType != null) { String[] tokens = Bytes.toString(rootType).split(GraphRow.ROOT_TYPE_DELIM); PlasmaType result = (PlasmaType) PlasmaTypeHelper.INSTANCE.findTypeByPhysicalName(tokens[0], tokens[1]); if (result == null) throw new GraphServiceException("no type found for '" + Bytes.toString(rootType) + "'"); return result; } return null; }
protected PlasmaType fetchRootType(TableReader childTableReader, GraphColumnKeyFactory keyFactory, PlasmaType subType, CellValues childResult) throws IOException { byte[] typeQual = keyFactory.createColumnKey(subType, EntityMetaKey.TYPE); byte[] rootType = childResult.getColumnValue(childTableReader.getTableConfig() .getDataColumnFamilyNameBytes(), typeQual); if (rootType == null) throw new GraphServiceException("expected column: " + Bytes.toString(typeQual) + " for row '" + childResult.getRowKey() + "' in table: " + childTableReader.getTableConfig().getName()); String[] tokens = Bytes.toString(rootType).split(GraphRow.ROOT_TYPE_DELIM); PlasmaType result = (PlasmaType) PlasmaTypeHelper.INSTANCE.findTypeByPhysicalName(tokens[0], tokens[1]); if (result == null) throw new GraphServiceException("no type found for '" + Bytes.toString(rootType) + "'"); return result; }