当前位置: 首页>>代码示例>>Java>>正文


Java Row.getList方法代码示例

本文整理汇总了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();
}
 
开发者ID:jpmorganchase,项目名称:swblocks-decisiontree,代码行数:19,代码来源:CassandraLoader.java

示例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);
    }
}
 
开发者ID:jpmorganchase,项目名称:swblocks-decisiontree,代码行数:40,代码来源:CassandraLoader.java

示例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;
}
 
开发者ID:PearsonEducation,项目名称:Docussandra,代码行数:29,代码来源:IndexRepositoryImpl.java


注:本文中的com.datastax.driver.core.Row.getList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。