use of org.apache.cassandra.db.rows.RangeTombstoneMarker in project cassandra by apache.
the class JsonTransformer method serializePartition.
private void serializePartition(UnfilteredRowIterator partition) {
try {
json.writeStartObject();
json.writeFieldName("partition");
json.writeStartObject();
json.writeFieldName("key");
serializePartitionKey(partition.partitionKey());
json.writeNumberField("position", this.currentScanner.getCurrentPosition());
if (!partition.partitionLevelDeletion().isLive())
serializeDeletion(partition.partitionLevelDeletion());
json.writeEndObject();
if (partition.hasNext() || partition.staticRow() != null) {
json.writeFieldName("rows");
json.writeStartArray();
updatePosition();
if (!partition.staticRow().isEmpty())
serializeRow(partition.staticRow());
Unfiltered unfiltered;
updatePosition();
while (partition.hasNext()) {
unfiltered = partition.next();
if (unfiltered instanceof Row) {
serializeRow((Row) unfiltered);
} else if (unfiltered instanceof RangeTombstoneMarker) {
serializeTombstone((RangeTombstoneMarker) unfiltered);
}
updatePosition();
}
json.writeEndArray();
json.writeEndObject();
}
} catch (IOException e) {
String key = metadata.partitionKeyType.getString(partition.partitionKey().getKey());
logger.error("Fatal error parsing partition: {}", key, e);
}
}
Aggregations