本文整理了Java中org.apache.cassandra.cql3.QueryProcessor.resultify
方法的一些代码示例,展示了QueryProcessor.resultify
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueryProcessor.resultify
方法的具体详情如下:
包路径:org.apache.cassandra.cql3.QueryProcessor
类名称:QueryProcessor
方法名:resultify
暂无
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
public static UntypedResultSet resultify(Row serializedColumns)
{
String query = String.format("SELECT * FROM %s.%s", Keyspace.SYSTEM_KS, SystemKeyspace.SCHEMA_COLUMNS_CF);
return QueryProcessor.resultify(query, serializedColumns);
}
代码示例来源:origin: org.apache.cassandra/cassandra-all
public static UntypedResultSet resultify(String query, RowIterator partition)
{
return resultify(query, PartitionIterators.singletonIterator(partition));
}
代码示例来源:origin: jsevellec/cassandra-unit
public static UntypedResultSet resultify(String query, RowIterator partition)
{
return resultify(query, PartitionIterators.singletonIterator(partition));
}
代码示例来源:origin: com.strapdata.cassandra/cassandra-all
public static UntypedResultSet resultify(String query, RowIterator partition)
{
return resultify(query, PartitionIterators.singletonIterator(partition));
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
public static Map<ByteBuffer, UserType> fromSchema(Row row)
{
UntypedResultSet results = QueryProcessor.resultify("SELECT * FROM system." + SystemKeyspace.SCHEMA_USER_TYPES_CF, row);
Map<ByteBuffer, UserType> types = new HashMap<>(results.size());
for (UntypedResultSet.Row result : results)
{
UserType type = fromSchema(result);
types.put(type.name, type);
}
return types;
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
/**
* Deserialize ColumnFamilies from low-level schema representation, all of them belong to the same keyspace
*
* @return map containing name of the ColumnFamily and it's metadata for faster lookup
*/
public static Map<String, CFMetaData> deserializeColumnFamilies(Row row)
{
if (row.cf == null)
return Collections.emptyMap();
Map<String, CFMetaData> cfms = new HashMap<>();
UntypedResultSet results = QueryProcessor.resultify("SELECT * FROM system.schema_columnfamilies", row);
for (UntypedResultSet.Row result : results)
{
CFMetaData cfm = CFMetaData.fromSchema(result);
cfms.put(cfm.cfName, cfm);
}
return cfms;
}
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
private static CFMetaData fromSchema(Row row)
{
UntypedResultSet.Row result = QueryProcessor.resultify("SELECT * FROM system.schema_columnfamilies", row).one();
return fromSchema(result);
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
/**
* Deserialize triggers from storage-level representation.
*
* @param serializedTriggers storage-level partition containing the trigger definitions
* @return the list of processed TriggerDefinitions
*/
public static List<TriggerDefinition> fromSchema(Row serializedTriggers)
{
List<TriggerDefinition> triggers = new ArrayList<>();
String query = String.format("SELECT * FROM %s.%s", Keyspace.SYSTEM_KS, SystemKeyspace.SCHEMA_TRIGGERS_CF);
for (UntypedResultSet.Row row : QueryProcessor.resultify(query, serializedTriggers))
{
String name = row.getString(TRIGGER_NAME);
String classOption = row.getMap(TRIGGER_OPTIONS, UTF8Type.instance, UTF8Type.instance).get(CLASS);
triggers.add(new TriggerDefinition(name, classOption));
}
return triggers;
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
public static UntypedResultSet resultify(String query, List<Row> rows)
{
try
{
SelectStatement ss = (SelectStatement) getStatement(query, null).statement;
ResultSet cqlRows = ss.process(rows);
return UntypedResultSet.create(cqlRows);
}
catch (RequestValidationException e)
{
throw new AssertionError(e);
}
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
/**
* Deserialize only Keyspace attributes without nested ColumnFamilies
*
* @param row Keyspace attributes in serialized form
*
* @return deserialized keyspace without cf_defs
*/
public static KSMetaData fromSchema(Row row, Iterable<CFMetaData> cfms, UTMetaData userTypes)
{
UntypedResultSet.Row result = QueryProcessor.resultify("SELECT * FROM system.schema_keyspaces", row).one();
try
{
return new KSMetaData(result.getString("keyspace_name"),
AbstractReplicationStrategy.getClass(result.getString("strategy_class")),
fromJsonMap(result.getString("strategy_options")),
result.getBoolean("durable_writes"),
cfms,
userTypes);
}
catch (ConfigurationException e)
{
throw new RuntimeException(e);
}
}
内容来源于网络,如有侵权,请联系作者删除!