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


Java DataType.bigint方法代碼示例

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


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

示例1: currentRowField

import com.datastax.driver.core.DataType; //導入方法依賴的package包/類
/** Get a field for the current row from the underlying object.
 *
 * @param index Index of the field within the Row object
 * @param typeName Type of the field in this row
 */
private Object currentRowField(int index, SqlTypeName typeName) {
  DataType type = current.getColumnDefinitions().getType(index);
  if (type == DataType.ascii() || type == DataType.text() || type == DataType.varchar()) {
    return current.getString(index);
  } else if (type == DataType.cint() || type == DataType.varint()) {
    return current.getInt(index);
  } else if (type == DataType.bigint()) {
    return current.getLong(index);
  } else if (type == DataType.cdouble()) {
    return current.getDouble(index);
  } else if (type == DataType.cfloat()) {
    return current.getFloat(index);
  } else if (type == DataType.uuid() || type == DataType.timeuuid()) {
    return current.getUUID(index).toString();
  } else {
    return null;
  }
}
 
開發者ID:apache,項目名稱:calcite,代碼行數:24,代碼來源:CassandraEnumerator.java

示例2: getHecubaClientManagerWithLongKeys

import com.datastax.driver.core.DataType; //導入方法依賴的package包/類
public HecubaClientManager<Long> getHecubaClientManagerWithLongKeys(CassandraParamsBean parameters,
		HecubaConstants.CassandraClientImplementation cassandraManagerType) {
	switch (cassandraManagerType) {
	case ASTYANAX:
		return new AstyanaxBasedHecubaClientManager<>(parameters,
				com.netflix.astyanax.serializers.LongSerializer.get());
	case HECTOR:
		return new HectorBasedHecubaClientManager<>(parameters,
				me.prettyprint.cassandra.serializers.LongSerializer.get());
	case DATASTAX:
		return new DataStaxBasedHecubaClientManager<>(parameters, DataType.bigint());
	case DATASTAX_SHARED:
		return new DataStaxBasedSharedHecubaClientManager<>(parameters, DataType.bigint());
	default:
		throw new RuntimeException("Unhandled CassandraManagerType: " + cassandraManagerType);
	}
}
 
開發者ID:WizeCommerce,項目名稱:hecuba,代碼行數:18,代碼來源:HecubaObjectFactory.java

示例3: retrieveKeysBySecondaryIndex

import com.datastax.driver.core.DataType; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
@Override
public List<K> retrieveKeysBySecondaryIndex(String columnName, String columnValue) {
	final String query = "select * from " + secondaryIndexColumnFamily + " where "
			+ secondaryIndexKeyColumn + " = ?";
	CassandraResultSet<K, String> keysResultSet = read(query, DataType.ascii(), keyType,
			ImmutableMap.of("*", keyType), getSecondaryIndexKey(columnName, columnValue));
	List<K> keys = new ArrayList<>();
	if (keysResultSet.hasResults()) {
		for (String key : keysResultSet.getColumnNames()) {
			if (keyType == DataType.bigint()) {
				keys.add((K) NumberUtils.createLong(key));
			} else {
				keys.add((K) key);
			}
		}

		return keys;
	}

	return null;
}
 
開發者ID:WizeCommerce,項目名稱:hecuba,代碼行數:23,代碼來源:DataStaxBasedSharedHecubaClientManager.java

示例4: getDataType

import com.datastax.driver.core.DataType; //導入方法依賴的package包/類
private DataType getDataType() {
    int i = random.nextInt(3);

    switch (i) {
        case 0: return DataType.ascii();
        case 1: return DataType.bigint();
    }
    return null;
}
 
開發者ID:arnaudroger,項目名稱:SimpleFlatMapper,代碼行數:10,代碼來源:DatastaxMapperKeyComparatorTest.java

示例5: BigintCodec

import com.datastax.driver.core.DataType; //導入方法依賴的package包/類
private BigintCodec() {
  super(DataType.bigint());
}
 
開發者ID:thelastpickle,項目名稱:cassandra-reaper,代碼行數:4,代碼來源:DateTimeCodec.java

示例6: BigDecimalToBigintCodec

import com.datastax.driver.core.DataType; //導入方法依賴的package包/類
public BigDecimalToBigintCodec(Class<BigDecimal> javaClass) {
	super(DataType.bigint(), javaClass);
}
 
開發者ID:adejanovski,項目名稱:cassandra-jdbc-wrapper,代碼行數:4,代碼來源:BigDecimalToBigintCodec.java

示例7: LongToIntCodec

import com.datastax.driver.core.DataType; //導入方法依賴的package包/類
public LongToIntCodec(Class<Integer> javaClass) {
	super(DataType.bigint(), javaClass);
}
 
開發者ID:adejanovski,項目名稱:cassandra-jdbc-wrapper,代碼行數:4,代碼來源:LongToIntCodec.java

示例8: getRelDataType

import com.datastax.driver.core.DataType; //導入方法依賴的package包/類
RelProtoDataType getRelDataType(String columnFamily, boolean view) {
  List<ColumnMetadata> columns;
  if (view) {
    columns = getKeyspace().getMaterializedView(columnFamily).getColumns();
  } else {
    columns = getKeyspace().getTable(columnFamily).getColumns();
  }

  // Temporary type factory, just for the duration of this method. Allowable
  // because we're creating a proto-type, not a type; before being used, the
  // proto-type will be copied into a real type factory.
  final RelDataTypeFactory typeFactory =
      new SqlTypeFactoryImpl(RelDataTypeSystem.DEFAULT);
  final RelDataTypeFactory.Builder fieldInfo = typeFactory.builder();
  for (ColumnMetadata column : columns) {
    final String columnName = column.getName();
    final DataType type = column.getType();

    // TODO: This mapping of types can be done much better
    SqlTypeName typeName = SqlTypeName.ANY;
    if (type == DataType.uuid() || type == DataType.timeuuid()) {
      // We currently rely on this in CassandraFilter to detect UUID columns.
      // That is, these fixed length literals should be unquoted in CQL.
      typeName = SqlTypeName.CHAR;
    } else if (type == DataType.ascii() || type == DataType.text()
          || type == DataType.varchar()) {
      typeName = SqlTypeName.VARCHAR;
    } else if (type == DataType.cint() || type == DataType.varint()) {
      typeName = SqlTypeName.INTEGER;
    } else if (type == DataType.bigint()) {
      typeName = SqlTypeName.BIGINT;
    } else if (type == DataType.cdouble() || type == DataType.cfloat()
        || type == DataType.decimal()) {
      typeName = SqlTypeName.DOUBLE;
    }

    fieldInfo.add(columnName, typeFactory.createSqlType(typeName)).nullable(true);
  }

  return RelDataTypeImpl.proto(fieldInfo.build());
}
 
開發者ID:apache,項目名稱:calcite,代碼行數:42,代碼來源:CassandraSchema.java

示例9: getHecubaClientManager

import com.datastax.driver.core.DataType; //導入方法依賴的package包/類
public HecubaClientManager<Long> getHecubaClientManager(CassandraParamsBean params) {
	return new DataStaxBasedHecubaClientManager<>(params, DataType.bigint());
}
 
開發者ID:WizeCommerce,項目名稱:hecuba,代碼行數:4,代碼來源:DataStaxBasedCassandraManagerTest.java


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