FamilyLayout layout = colMap.get(fijiColumn.getFamily()); if (null != layout) { if (layout.isMapType()) { columnsDef.add(fijiColumn); returnCols.add(fijiColumn); } else { Map<String, ColumnLayout> groupColMap = layout.getColumnMap(); if (fijiColumn.isFullyQualified()) { ColumnLayout groupColLayout = groupColMap.get(fijiColumn.getQualifier());
layout.getFamilyMap().get(columnRequest.getFamily()).getLocalityGroup().getId(); localityGroups.add(localityGroupId);
for (String familyName : familyLayout.getNames()) { if (null != familyMap.put(familyName, familyLayout)) { throw new InvalidLayoutException(String.format( if (familyLayout.isMapType()) { Preconditions.checkState( columnNames.add(FijiColumnName.create(familyLayout.getName(), null))); for (ColumnLayout columnLayout: familyLayout.getColumns()) { for (String columnName : columnLayout.getNames()) { final FijiColumnName column = FijiColumnName.create(familyLayout.getName(), columnName); if (null != columnMap.put(column, columnLayout)) { throw new InvalidLayoutException(String.format( FijiColumnName.create(familyLayout.getName(), columnLayout.getName())));
final FijiColumnName column = entry.getKey(); if (!column.isFullyQualified() && layout.getFamilyMap().get(column.getFamily()).isGroupType()) { groupFamilyEntries.add(entry);
final FamilyLayout fLayout = new FamilyLayout(familyDesc, refFLayout); families.add(fLayout); for (String familyName : fLayout.getNames()) { Preconditions.checkState(familyMap.put(familyName, fLayout) == null, "Duplicate family name: " + familyName); if (fLayout.getId() != null) { final String previous = idMap.put(fLayout.getId(), fLayout.getName()); Preconditions.checkState(previous == null, String.format("Duplicate family ID '%s' associated to '%s' and '%s'.", fLayout.getId(), fLayout.getName(), previous)); } else { unassigned.add(fLayout); Preconditions.checkState(fLayout.getId() == null); while (true) { final ColumnId fId = new ColumnId(nextFamilyId); if (!idMap.containsKey(fId)) { fLayout.setId(fId); idMap.put(fId, fLayout.getName()); break;
throw new InvalidLayoutException(String.format( "Invalid family '%s' with both map-type and columns", getName())); if ((mId != null) && !mId.equals(reference.getId())) { throw new InvalidLayoutException(String.format( "Descriptor for family '%s' has ID %s but reference ID is %s.", getName(), mId, reference.getId())); mId = reference.getId(); familyDesc.setId(mId.getId()); if (reference.isMapType() != this.isMapType()) { throw new InvalidLayoutException(String.format( "Invalid layout update for family '%s' from reference type %s to type %s.", getName(), reference.isMapType() ? "map" : "group", this.isMapType() ? "map" : "group")); if (this.isMapType()) { (null != reference) ? reference.getDesc().getMapSchema() : null; validateCellSchema(mLayoutVersion, mDesc.getMapSchema(), referenceSchema); ? HashBiMap.create(reference.getColumnIdNameMap().inverse()) : HashBiMap.<String, ColumnId>create(); throw new InvalidLayoutException(String.format( "Invalid renaming: cannot find reference family for column '%s:%s'.",
if (fLayout.isGroupType()) { for (String qualifier : fLayout.getColumnMap().keySet()) { final FijiColumnName fqFijiColumnName = FijiColumnName.create(fijiColumnName.getFamily(), qualifier); } else if (fLayout.isMapType()) {
final ColumnId lgid = flayout.getLocalityGroup().getId(); final ColumnId familyId = flayout.getId(); if (flayout.isMapType()) { final CellSchema cellSchema = flayout.getDesc().getMapSchema(); if (refFamilyLayout.isMapType()) { final CellSchema refCellSchema = refFamilyLayout.getDesc().getMapSchema(); flayout.getName(), null, validateCellSchema(refCellSchema, cellSchema))); } else if (refFamilyLayout.isGroupType()) { "Family: %s changed from group-type to map-type.", refFamilyLayout.getName())); } else { throw new InternalFijiError(String.format( "Family: %s is neither map-type nor group-type.", refFamilyLayout.getName())); flayout.getName(), null, validateCellSchema(null, cellSchema))); } else if (flayout.isGroupType()) { if (refFamilyLayout.isGroupType()) { for (ColumnLayout columnLayout : flayout.getColumns()) { final CellSchema cellSchema = columnLayout.getDesc().getColumnSchema();
if (family.getDesc().getMapSchema().getType() == SchemaType.COUNTER) { for (String key : row.getQualifiers(family.getName())) { FijiCell<Long> counter = row.getMostRecentCell(family.getName(), key); if (null != counter) { printCell(row.getEntityId(), counter, printStream); FijiCell<Long> counter = row.getMostRecentCell(family.getName(), key); if (null != counter) { printCell(row.getEntityId(), counter, printStream); row.getValues(family.getName()); for (String key : keyTimeseriesMap.keySet()) { for (Entry<Long, Object> timestampedCell : keyTimeseriesMap.get(key).entrySet()) { long timestamp = timestampedCell.getKey(); printCell(row.getEntityId(), timestamp, family.getName(), key, timestampedCell.getValue(), printStream); for (String key : entry.getValue()) { NavigableMap<Long, Object> timeseriesMap = row.getValues(family.getName(), key); for (Entry<Long, Object> timestampedCell : timeseriesMap.entrySet()) { long timestamp = timestampedCell.getKey(); printCell( row.getEntityId(), timestamp, family.getName(), key, timestampedCell.getValue(), printStream); String familyName = entry.getKey().getName(); for (ColumnLayout column : entry.getValue()) {
layout.getFamilyMap().get(column.getFamily()).getLocalityGroup().getId(); final CassandraTableName tableName = CassandraTableName.getLocalityGroupTableName(tableURI, localityGroupId);
colName, table.getURI()); Preconditions.checkArgument( table.getLayout().getFamilyMap().get(colName.getFamily()).isMapType(), "Couldn't create pager: " + "Can only generate version pagers from a column family data request for map families. "
final String familyName = familyLayout.getName(); final HBaseColumnName hbaseColumnName = mWriterLayoutCapsule.getColumnNameTranslator() .toHBaseColumnName(FijiColumnName.create(familyName));
String family = familyLayout.getName(); for (String qualifier : rowData.getQualifiers(family)) { FijiColumnName column = new FijiColumnName(family, qualifier);
if (family.isGroupType()) { family.getColumnMap().get(family.getColumnIdNameMap().get(qualifierID)); if (qualifier == null) { throw new NoSuchColumnException(String.format( "No column with ID %s in family %s of table %s.", qualifierID.getId(), family.getName(), mLayout.getName())); new FijiColumnName(family.getName(), qualifier.getName()); LOG.debug("Translated to Fiji group column {}.", fijiColumnName); return fijiColumnName; } else { assert family.isMapType(); final FijiColumnName fijiColumnName = new FijiColumnName(family.getName(), rawQualifier); LOG.debug("Translated to Fiji map column '{}'.", fijiColumnName); return fijiColumnName;
final ColumnId localityGroupId = familyLayout.getLocalityGroup().getId(); if (mTableName == null) { tableURI, familyLayout.getLocalityGroup().getId()); } else { Preconditions.checkArgument(mTableName.getLocalityGroupId().equals(localityGroupId), int ttl = familyLayout.getLocalityGroup().getDesc().getTtlSeconds();
if (layout.getFamilyMap().get(column.getFamily()).isMapType()) {
if (family.isGroupType()) { if (!family.getColumnMap().containsKey(qualifierName)) { throw new NoSuchColumnException(String.format( "No qualifier %s in family %s of table %s.", } else { assert family.isMapType(); final FijiColumnName fijiColumnName = new FijiColumnName(familyName, qualifierName); LOG.debug("Translated to Fiji map type column '{}'.", fijiColumnName);
CassandraTableName.getLocalityGroupTableName( tableURI, familyLayout.getLocalityGroup().getId()); int ttl = familyLayout.getLocalityGroup().getDesc().getTtlSeconds();