本文整理汇总了Java中com.datastax.driver.core.Row.getUUID方法的典型用法代码示例。如果您正苦于以下问题:Java Row.getUUID方法的具体用法?Java Row.getUUID怎么用?Java Row.getUUID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.datastax.driver.core.Row
的用法示例。
在下文中一共展示了Row.getUUID方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getValueGroupChange
import com.datastax.driver.core.Row; //导入方法依赖的package包/类
private Set<ValueGroupChange> getValueGroupChange(final Row row) {
final String type = row.getString("vgchangetype");
if (type != null && Type.valueOf(type) != Type.NONE) {
final ValueGroup group =
new ValueGroup(row.getUUID("vgid"), row.getString("vgname"),
row.getList("vgdrivers", String.class),
new DateRange(row.get("vgstart", Instant.class), row.get("vgend", Instant.class)));
final String driver = row.getString("vgdrivername");
if (driver != null && !driver.isEmpty()) {
group.setNewRuleData(driver, row.getList("vgrulecodes", UUID.class));
}
return Collections.singleton(new ValueGroupChange(Type.valueOf(type), group));
}
return Collections.emptySet();
}
示例2: 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;
}
}
示例3: 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;
}
}
示例4: load
import com.datastax.driver.core.Row; //导入方法依赖的package包/类
@Override
public Data load(Data data, Row row) {
data.id = row.getUUID(0);
data.ticket = row.getUUID(1);
data.user = row.getString(2);
data.approver = row.getString(3);
data.type = row.getString(4);
data.status = row.getString(5);
data.memo = row.getString(6);
data.operation = row.getString(7);
if(row.getColumnDefinitions().size()>8) {
// Rows reported in MicroSeconds
data.updated = new Date(row.getLong(8)/1000);
}
return data;
}
示例5: marshalRow
import com.datastax.driver.core.Row; //导入方法依赖的package包/类
protected IndexCreatedEvent marshalRow(Row row)
{
if (row == null)
{
return null;
}
//look up index here
Index index = new Index();
index.setName(row.getString(Columns.INDEX_NAME));
index.setTable(row.getString(Columns.DATABASE), row.getString(Columns.TABLE));
Index toUse;
try
{
toUse = indexRepo.read(index.getId());
} catch (ItemNotFoundException e)//this should only happen in tests that do not have full test data established; errors will be evident if this happens in the actual app
{
toUse = index;
}
IndexCreatedEvent i = new IndexCreatedEvent(row.getUUID(Columns.ID), row.getDate(Columns.STARTED_AT), row.getDate(Columns.UPDATED_AT), toUse, row.getLong(Columns.TOTAL_RECORDS), row.getLong(Columns.RECORDS_COMPLETED));
i.setFatalError(row.getString(Columns.FATAL_ERROR));
i.setErrors(row.getList(Columns.ERRORS, String.class));
i.calculateValues();
return i;
}
示例6: getChange
import com.datastax.driver.core.Row; //导入方法依赖的package包/类
public Result<ChangeSet> getChange(final String changeSetName) {
try {
final ResultSet resultSet = this.session.execute(CQL_GET_ACTIVE_CHANGE, changeSetName);
EhSupport.ensure(!resultSet.isExhausted(), "ChangeSet %s does not exist in %s.", changeSetName,
this.keyspace);
UUID changeSetId = null;
final Map<Change, List<Change>> changes = new HashMap<>();
for (final Row row : resultSet) {
changeSetId = row.getUUID("id");
final UUID changeid = row.getUUID("changeid");
final String rulesetname = row.getString("rulesetname");
final Instant activationTime = row.get("activationtime", Instant.class);
final DateRange changeRange = new DateRange(row.get("start", Instant.class),
row.get("end", Instant.class));
final Change newchange = new Change(changeid, rulesetname, activationTime, changeRange,
getAuditForChange(row), getRuleChangeForChange(row), getValueGroupChange(row));
final List<Change> internalChanges = changes.computeIfAbsent(newchange, value -> new ArrayList<>());
internalChanges.add(newchange);
}
return Result.success(new ChangeSet(changeSetId, changeSetName, mergeChangesIntoSet(changes)));
} catch (final Exception exception) {
return Result.failure(() -> exception);
}
}
示例7: 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;
}
示例8: 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;
}
示例9: processRequest
import com.datastax.driver.core.Row; //导入方法依赖的package包/类
@Override
protected void processRequest (final Request request) throws Exception {
// use the following request Object to process the request and set
// the response to be returned
RequestLoginEmail requestLoginEmail =
(RequestLoginEmail)request.getRequestJsonBody();
// select user's password and user_id
ResultSet resultSet =
EmailCreds.i().executeSyncSelect(requestLoginEmail.email);
// email isn't registered? -- in case authentication is disabled
if (resultSet.isExhausted() == true) {
throw new BadRequestException(
421,
3,
"Email ["
+ requestLoginEmail.email
+ "] isn't registered, request sent from device_token ["
+ requestLoginEmail.device_token
+ "]",
ExceptionClass.AUTHENTICATION);
}
// extract user_id
Row row = resultSet.one();
UUID userId = row.getUUID(EmailCreds.kUserIdColumnName);
// set user's id
request.setUserId(userId);
// generate new authentication tokens
OAuth2Tokens oAuth2Tokens = new OAuth2Tokens();
// insert into ig_auth.auth_codes
AuthCodes.i().executeSyncInsert(
userId,
requestLoginEmail.device_token,
oAuth2Tokens.getAuthorizationCode(),
oAuth2Tokens.getAccessToken(),
oAuth2Tokens.getRefreshToken(),
((int)Constants.kAuthCodeLifeTime.getAs(
TimeUnitType.SECOND).getValue() ) );
// set response
((ResponseLoginEmail)request.getResponseBody() ).set(
requestLoginEmail.request_tracking_id,
userId.toString(),
oAuth2Tokens.getAuthorizationCode() );
}
示例10: create
import com.datastax.driver.core.Row; //导入方法依赖的package包/类
@Override
public Future create(Row row) {
return new Future(row.getUUID(0),row.getString(1),row.getString(2),
row.getDate(3),row.getDate(4));
}
示例11: getChangeId
import com.datastax.driver.core.Row; //导入方法依赖的package包/类
@Override
protected UUID getChangeId(Row row) {
return row.getUUID(_changeIdIndex);
}
示例12: getChangeId
import com.datastax.driver.core.Row; //导入方法依赖的package包/类
private UUID getChangeId(Row row) {
return row.getUUID(CHANGE_ID_RESULT_SET_COLUMN);
}