Beispiel #1
0
  public RowMutation dropFromSchema(long timestamp) {
    RowMutation rm = new RowMutation(Table.SYSTEM_TABLE, SystemTable.getSchemaKSKey(name));
    rm.delete(new QueryPath(SystemTable.SCHEMA_KEYSPACES_CF), timestamp);
    rm.delete(new QueryPath(SystemTable.SCHEMA_COLUMNFAMILIES_CF), timestamp);
    rm.delete(new QueryPath(SystemTable.SCHEMA_COLUMNS_CF), timestamp);

    return rm;
  }
Beispiel #2
0
  public RowMutation toSchema(long timestamp) {
    RowMutation rm = new RowMutation(Table.SYSTEM_TABLE, SystemTable.getSchemaKSKey(name));
    ColumnFamily cf = rm.addOrGet(SystemTable.SCHEMA_KEYSPACES_CF);

    cf.addColumn(Column.create(name, timestamp, "name"));
    cf.addColumn(Column.create(durableWrites, timestamp, "durable_writes"));
    cf.addColumn(Column.create(strategyClass.getName(), timestamp, "strategy_class"));
    cf.addColumn(Column.create(json(strategyOptions), timestamp, "strategy_options"));

    for (CFMetaData cfm : cfMetaData.values()) cfm.toSchema(rm, timestamp);

    return rm;
  }