當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。