public static void validateCellName(CellName name, CellNameType type) throws InvalidRequestException { validateComposite(name, type); if (name.isEmpty()) throw new InvalidRequestException("Invalid empty value for clustering column of COMPACT TABLE"); }
private static void validateColumnNames(Iterable<CellName> columns) throws InvalidRequestException { for (CellName name : columns) { if (name.dataSize() > org.apache.cassandra.db.Cell.MAX_NAME_LENGTH) throw new InvalidRequestException(String.format("column name is too long (%s > %s)", name.dataSize(), org.apache.cassandra.db.Cell.MAX_NAME_LENGTH)); if (name.isEmpty()) throw new InvalidRequestException("zero-length column name"); } }
public void serialize(Cell cell, DataOutputPlus out) throws IOException { assert !cell.name().isEmpty(); type.cellSerializer().serialize(cell.name(), out); try { out.writeByte(cell.serializationFlags()); if (cell instanceof CounterCell) { out.writeLong(((CounterCell) cell).timestampOfLastDelete()); } else if (cell instanceof ExpiringCell) { out.writeInt(((ExpiringCell) cell).getTimeToLive()); out.writeInt(cell.getLocalDeletionTime()); } out.writeLong(cell.timestamp()); ByteBufferUtil.writeWithLength(cell.value(), out); } catch (IOException e) { throw new RuntimeException(e); } }
else if (cname.isEmpty())