本文整理汇总了Java中com.datastax.driver.core.Row.getBytes方法的典型用法代码示例。如果您正苦于以下问题:Java Row.getBytes方法的具体用法?Java Row.getBytes怎么用?Java Row.getBytes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.datastax.driver.core.Row
的用法示例。
在下文中一共展示了Row.getBytes方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: marshalRow
import com.datastax.driver.core.Row; //导入方法依赖的package包/类
/**
* Marshals a Cassandra row into a Document object.
*
* @param row Row to marshal.
* @return A document based on the provided row.
*/
public static Document marshalRow(Row row)
{
if (row == null)
{
return null;
}
Document d = new Document();
d.setUuid(row.getUUID(DocumentRepositoryImpl.Columns.ID));
ByteBuffer b = row.getBytes(DocumentRepositoryImpl.Columns.OBJECT);
if (b != null && b.hasArray())
{
byte[] result = new byte[b.remaining()];
b.get(result);
BSONObject o = BSON.decode(result);
d.setObject(o);
}
d.setCreatedAt(row.getDate(DocumentRepositoryImpl.Columns.CREATED_AT));
d.setUpdatedAt(row.getDate(DocumentRepositoryImpl.Columns.UPDATED_AT));
return d;
}
示例2: getValue
import com.datastax.driver.core.Row; //导入方法依赖的package包/类
private Object getValue(Row musicRow, String colname) {
ColumnDefinitions cdef = musicRow.getColumnDefinitions();
String type = cdef.getType(colname).getName().toString().toUpperCase();
switch (type) {
case "BIGINT":
return musicRow.getLong(colname);
case "BOOLEAN":
return musicRow.getBool(colname);
case "BLOB":
return musicRow.getBytes(colname);
case "DOUBLE":
return musicRow.getDouble(colname);
case "INT":
return musicRow.getInt(colname);
case "TIMESTAMP":
return musicRow.getTimestamp(colname);
default:
logger.error("UNEXPECTED COLUMN TYPE: columname="+colname+", columntype="+type);
// fall thru
case "VARCHAR":
return musicRow.getString(colname);
}
}
示例3: apply
import com.datastax.driver.core.Row; //导入方法依赖的package包/类
@Override public List<DependencyLink> apply(ResultSet rs) {
ImmutableList.Builder<DependencyLink> unmerged = ImmutableList.builder();
for (Row row : rs) {
ByteBuffer encodedDayOfDependencies = row.getBytes("links");
for (DependencyLink link : Codec.THRIFT.readDependencyLinks(encodedDayOfDependencies)) {
unmerged.add(link);
}
}
return DependencyLinker.merge(unmerged.build());
}
示例4: apply
import com.datastax.driver.core.Row; //导入方法依赖的package包/类
@Override public List<DependencyLink> apply(ResultSet rs) {
ImmutableList.Builder<DependencyLink> unmerged = ImmutableList.builder();
for (Row row : rs) {
ByteBuffer encodedDayOfDependencies = row.getBytes("dependencies");
for (DependencyLink link : Dependencies.fromThrift(encodedDayOfDependencies).links) {
unmerged.add(link);
}
}
return DependencyLinker.merge(unmerged.build());
}
示例5: load
import com.datastax.driver.core.Row; //导入方法依赖的package包/类
@Override
public Data load(Data data, Row row) {
data.id = row.getUUID(0);
data.yr_mon = row.getInt(1);
data.user = row.getString(2);
data.action = row.getString(3);
data.target = row.getString(4);
data.subject = row.getString(5);
data.memo = row.getString(6);
// data.detail = row.getMap(6, String.class, String.class);
data.reconstruct = row.getBytes(7);
return data;
}
示例6: load
import com.datastax.driver.core.Row; //导入方法依赖的package包/类
@Override
public Data load(Data data, Row row) {
data.id = row.getUUID(0);
data.target = row.getString(1);
data.memo = row.getString(2);
data.start = row.getDate(3);
data.expires = row.getDate(4);
data.construct = row.getBytes(5);
return data;
}