本文整理匯總了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;
}