當前位置: 首頁>>代碼示例>>Java>>正文


Java Row.getMap方法代碼示例

本文整理匯總了Java中com.datastax.driver.core.Row.getMap方法的典型用法代碼示例。如果您正苦於以下問題:Java Row.getMap方法的具體用法?Java Row.getMap怎麽用?Java Row.getMap使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.datastax.driver.core.Row的用法示例。


在下文中一共展示了Row.getMap方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getColValue

import com.datastax.driver.core.Row; //導入方法依賴的package包/類
public Object getColValue(Row row, String colName, DataType colType){	
	switch(colType.getName()){
	case VARCHAR: 
		return row.getString(colName);
	case UUID: 
		return row.getUUID(colName);
	case VARINT: 
		return row.getVarint(colName);
	case BIGINT: 
		return row.getLong(colName);
	case INT: 
		return row.getInt(colName);
	case FLOAT: 
		return row.getFloat(colName);	
	case DOUBLE: 
		return row.getDouble(colName);
	case BOOLEAN: 
		return row.getBool(colName);
	case MAP: 
		return row.getMap(colName, String.class, String.class);
	default: 
		return null;
	}
}
 
開發者ID:att,項目名稱:music,代碼行數:25,代碼來源:MusicDataStore.java

示例2: readRow

import com.datastax.driver.core.Row; //導入方法依賴的package包/類
private Object readRow(final Row row, final String name, final DataType colType) {
		switch (colType.getName()) {
		case BIGINT:
			return row.getLong(name);
		case BOOLEAN:
			return row.getBool(name);
		case DOUBLE:
			return row.getDouble(name);
		case FLOAT:
			return row.getFloat(name);
		case INT:
			return row.getInt(name);
		case MAP:
			return row.getMap(name, String.class, String.class);
		case UUID:
			return row.getUUID(name);
		case TEXT:
		case VARCHAR:
			return row.getString(name);
		case VARINT:
			return row.getVarint(name);
// These are not supported right now....
// ASCII
// BLOB
// COUNTER
// CUSTOM
// DECIMAL
// INET
// LIST
// SET
// TIMESTAMP
// TIMEUUID
// TUPLE
// UDT
		default:
			return null;
		}
	}
 
開發者ID:att,項目名稱:music,代碼行數:39,代碼來源:MusicClient.java

示例3: mapGenerations

import com.datastax.driver.core.Row; //導入方法依賴的package包/類
private static void mapGenerations(Row row, GCEventImpl gcEvent, boolean checkContains) {
    Map<Generation, Capacity> capacityByGeneration = Collections.emptyMap();
    if (gcEvent.generations().size() > 1 && (!checkContains || (row.getColumnDefinitions().contains("gen_cap_before") &&
            row.getColumnDefinitions().contains("gen_cap_after") && row.getColumnDefinitions().contains("gen_cap_total")))) {
        capacityByGeneration = new IdentityHashMap<>(3);
        Map<Integer, Long> before = checkContains ? row.getMap("gen_cap_before", Integer.class, Long.class) :
                row.getMap(8, Integer.class, Long.class);
        Map<Integer, Long> after = checkContains ? row.getMap("gen_cap_after", Integer.class, Long.class) :
                row.getMap(9, Integer.class, Long.class);
        Map<Integer, Long> total = checkContains ? row.getMap("gen_cap_total", Integer.class, Long.class) :
                row.getMap(10, Integer.class, Long.class);

        for (Generation g : gcEvent.generations()) {
            capacityByGeneration.put(g, Capacity.of(
                    before.getOrDefault(g.type(), 0L),
                    after.getOrDefault(g.type(), 0L),
                    total.getOrDefault(g.type(), 0L)));
        }
    }

    gcEvent.capacityByGeneration(capacityByGeneration);
}
 
開發者ID:dmart28,項目名稱:gcplot,代碼行數:23,代碼來源:Mapper.java

示例4: createEvent

import com.datastax.driver.core.Row; //導入方法依賴的package包/類
private void createEvent(Row row, String aggregateType, VersionedName versionedName, TupleSchema tupleSchema) {
    Map<String, String> parameterData = row.getMap(PARAMETERS, String.class, String.class);
    Tuple parameters = tupleSchema.deserialise(deserialiser, parameterData);

    Event event = Event.of(
            AggregateId.of(aggregateType, row.getString(AGGREGATE_ID)),
            StreamTimestamp.of(row.getString(STREAM_ID), row.getDate(EVENT_TIMESTAMP).toInstant()),
            row.getUUID(PROCESSING_ID),
            versionedName,
            parameters,
            row.getInt(CHARACTERISTICS));

    eventCollector.accept(event);
}
 
開發者ID:opencredo,項目名稱:concursus,代碼行數:15,代碼來源:EventTranslator.java

示例5: getMap

import com.datastax.driver.core.Row; //導入方法依賴的package包/類
private static Map<String, String> getMap(Row row, String column) {
    if (row.getColumnDefinitions().contains(column)) {
        return row.getMap(column, String.class, String.class);
    }
    return null;
}
 
開發者ID:xm-online,項目名稱:xm-ms-timeline,代碼行數:7,代碼來源:TimelineMapper.java


注:本文中的com.datastax.driver.core.Row.getMap方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。