本文整理汇总了Java中com.datastax.driver.core.Row.getList方法的典型用法代码示例。如果您正苦于以下问题:Java Row.getList方法的具体用法?Java Row.getList怎么用?Java Row.getList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.datastax.driver.core.Row
的用法示例。
在下文中一共展示了Row.getList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getValueGroupChange
import com.datastax.driver.core.Row; //导入方法依赖的package包/类
private Set<ValueGroupChange> getValueGroupChange(final Row row) {
final String type = row.getString("vgchangetype");
if (type != null && Type.valueOf(type) != Type.NONE) {
final ValueGroup group =
new ValueGroup(row.getUUID("vgid"), row.getString("vgname"),
row.getList("vgdrivers", String.class),
new DateRange(row.get("vgstart", Instant.class), row.get("vgend", Instant.class)));
final String driver = row.getString("vgdrivername");
if (driver != null && !driver.isEmpty()) {
group.setNewRuleData(driver, row.getList("vgrulecodes", UUID.class));
}
return Collections.singleton(new ValueGroupChange(Type.valueOf(type), group));
}
return Collections.emptySet();
}
示例2: get
import com.datastax.driver.core.Row; //导入方法依赖的package包/类
/**
* Loads a {@link DecisionTreeRuleSet} from Cassandra using the defined keyspace.
*
* @return {@link Result} indicating if the load succeeded, storing any exception if the load failed.
*/
@Override
public Result<DecisionTreeRuleSet> get() {
try {
ResultSet resultSet = this.session.execute(CQL_GET_RULESET_FROM_RULESETNAME,
"DEFAULT", this.ruleSetName);
EhSupport.ensure(!resultSet.isExhausted(), "RuleSet %s does not exist in %s.", this.ruleSetName,
this.keyspace);
final Row resultsRow = resultSet.one();
final List<String> driverList = resultsRow.getList("drivers", String.class);
final DriverCache driverCache = new DriverCache();
resultSet = this.session.execute(CQL_GET_RULES_FOR_RULESET, this.ruleSetName);
final Builder<RuleSetBuilder, DecisionTreeRuleSet> ruleSetBuilder = RuleSetBuilder.creator(driverList);
ruleSetBuilder.with(RuleSetBuilder::setName, this.ruleSetName);
ruleSetBuilder.with(RuleSetBuilder::groups, getValueGroupsForRuleSet(this.ruleSetName));
ruleSetBuilder.with(RuleSetBuilder::setCache, driverCache);
resultSet.iterator().forEachRemaining(row -> ruleSetBuilder.with(RuleSetBuilder::rule, RuleBuilder.creator()
.with(RuleBuilder::cache, driverCache)
.with(RuleBuilder::setId, row.get("id", UUID.class))
.with(RuleBuilder::setCode, row.get("code", UUID.class))
.with(RuleBuilder::start, row.get("start", Instant.class))
.with(RuleBuilder::end, row.get("end", Instant.class))
.with(RuleBuilder::input, row.getList("drivers", String.class))
.with(RuleBuilder::output, row.getList("outputs", String.class))
));
final DecisionTreeRuleSet loadedRuleSet = ruleSetBuilder.build();
return Result.success(loadedRuleSet);
} catch (final Exception exception) {
return Result.failure(() -> exception);
}
}
示例3: marshalRow
import com.datastax.driver.core.Row; //导入方法依赖的package包/类
protected Index marshalRow(Row row)
{
if (row == null)
{
return null;
}
Index i = new Index();
i.setName(row.getString(Columns.NAME));
Table t = new Table();
t.setDatabaseByString(row.getString(Columns.DATABASE));
t.setName(row.getString(Columns.TABLE));
i.setTable(t);
i.isUnique(row.getBool(Columns.IS_UNIQUE));
List<String> fields = row.getList(Columns.FIELDS, String.class);
List<String> types = row.getList(Columns.FIELDS_TYPE, String.class);
ArrayList<IndexField> indexFields = new ArrayList<>(fields.size());
for (int j = 0; j < fields.size(); j++)
{
indexFields.add(new IndexField(fields.get(j), FieldDataType.valueOf(types.get(j))));
}
i.setFields(indexFields);
i.setIncludeOnly(row.getList(Columns.ONLY, String.class));
i.setActive(row.getBool(Columns.IS_ACTIVE));
i.setCreatedAt(row.getDate(Columns.CREATED_AT));
i.setUpdatedAt(row.getDate(Columns.UPDATED_AT));
return i;
}