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


Java Row.getBytes方法代码示例

本文整理汇总了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;
}
 
开发者ID:PearsonEducation,项目名称:Docussandra,代码行数:27,代码来源:DocumentPersistanceUtils.java

示例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);
	}
}
 
开发者ID:att,项目名称:music,代码行数:24,代码来源:CassandraMixin.java

示例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());
}
 
开发者ID:liaominghua,项目名称:zipkin,代码行数:11,代码来源:CassandraSpanStore.java

示例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());
}
 
开发者ID:liaominghua,项目名称:zipkin,代码行数:11,代码来源:CassandraSpanStore.java

示例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;
		}
 
开发者ID:att,项目名称:AAF,代码行数:14,代码来源:HistoryDAO.java

示例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;
       }
 
开发者ID:att,项目名称:AAF,代码行数:11,代码来源:FutureDAO.java


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