Search in sources :

Example 11 with WriteOnly

use of io.cdap.cdap.api.annotation.WriteOnly in project cdap by caskdata.

the class IndexedObjectStore method write.

@WriteOnly
public void write(byte[] key, T object) {
    Row row = index.get(getPrefixedPrimaryKey(key));
    if (!row.isEmpty()) {
        Set<byte[]> columnsToDelete = row.getColumns().keySet();
        deleteSecondaryKeys(key, columnsToDelete.toArray(new byte[columnsToDelete.size()][]));
    }
    writeToObjectStore(key, object);
}
Also used : Row(io.cdap.cdap.api.dataset.table.Row) WriteOnly(io.cdap.cdap.api.annotation.WriteOnly)

Aggregations

WriteOnly (io.cdap.cdap.api.annotation.WriteOnly)11 Row (io.cdap.cdap.api.dataset.table.Row)5 Put (io.cdap.cdap.api.dataset.table.Put)4 DataSetException (io.cdap.cdap.api.dataset.DataSetException)3 IOException (java.io.IOException)3 TreeSet (java.util.TreeSet)2 PartitionDetail (io.cdap.cdap.api.dataset.lib.PartitionDetail)1 Map (java.util.Map)1 NavigableMap (java.util.NavigableMap)1 TreeMap (java.util.TreeMap)1 Location (org.apache.twill.filesystem.Location)1