本文整理了Java中com.datastax.driver.core.Row.getBool
方法的一些代码示例,展示了Row.getBool
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Row.getBool
方法的具体详情如下:
包路径:com.datastax.driver.core.Row
类名称:Row
方法名:getBool
[英]Returns the ith value of this row as a boolean.
[中]以布尔值形式返回此行的第i个值。
代码示例来源:origin: prestodb/presto
@Override
public boolean getBoolean(int i)
{
return currentRow.getBool(i);
}
代码示例来源:origin: prestodb/presto
return Long.toString(row.getLong(i));
case BOOLEAN:
return Boolean.toString(row.getBool(i));
case DOUBLE:
return Double.toString(row.getDouble(i));
代码示例来源:origin: apache/ignite
return row.isNull(col) ? null : row.getBool(col);
return row.getBool(col);
代码示例来源:origin: apache/nifi
return row.getBool(i);
代码示例来源:origin: prestodb/presto
return NullableValue.of(nativeType, row.getLong(i));
case BOOLEAN:
return NullableValue.of(nativeType, row.getBool(i));
case DOUBLE:
return NullableValue.of(nativeType, row.getDouble(i));
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
static KeyspaceMetadata build(Row row, VersionNumber cassandraVersion) {
if (cassandraVersion.getMajor() <= 2) {
String name = row.getString(KS_NAME);
boolean durableWrites = row.getBool(DURABLE_WRITES);
Map<String, String> replicationOptions;
replicationOptions = new HashMap<String, String>();
replicationOptions.put("class", row.getString(STRATEGY_CLASS));
replicationOptions.putAll(SimpleJSONParser.parseStringMap(row.getString(STRATEGY_OPTIONS)));
return new KeyspaceMetadata(name, durableWrites, replicationOptions, false);
} else {
String name = row.getString(KS_NAME);
boolean durableWrites = row.getBool(DURABLE_WRITES);
return new KeyspaceMetadata(
name, durableWrites, row.getMap(REPLICATION, String.class, String.class), false);
}
}
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
boolean includeAllColumns = row.getBool("include_all_columns");
String whereClause = row.getString("where_clause");
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
dseWorkloads.add(dseWorkload);
Boolean isDseGraph =
row.getColumnDefinitions().contains("graph") ? row.getBool("graph") : null;
dseGraphEnabled.add(isDseGraph);
String dseVersion =
代码示例来源:origin: Impetus/Kundera
retVal = row.getBool(columnName);
setFieldValue(entity, member, retVal);
break;
代码示例来源:origin: org.apache.cassandra/cassandra-all
@Override
public boolean getBool(String name)
{
return row.getBool(name);
}
代码示例来源:origin: org.apache.cassandra/cassandra-all
@Override
public boolean getBool(int i)
{
return row.getBool(i);
}
代码示例来源:origin: jsevellec/cassandra-unit
@Override
public boolean getBool(String name)
{
return row.getBool(name);
}
代码示例来源:origin: com.strapdata.cassandra/cassandra-all
@Override
public boolean getBool(int i)
{
return row.getBool(i);
}
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
@Test(groups = "short")
@CassandraVersion(
value = "2.0.9",
description = "This will only work with C* 2.0.9 (CASSANDRA-7337)")
public void casBatchTest() {
PreparedStatement st = session().prepare("INSERT INTO test (k, v) VALUES (?, ?) IF NOT EXISTS");
BatchStatement batch = new BatchStatement();
batch.add(new SimpleStatement("INSERT INTO test (k, v) VALUES (?, ?)", "key1", 0));
batch.add(st.bind("key1", 1));
batch.add(st.bind("key1", 2));
assertEquals(3, batch.size());
ResultSet rs = session().execute(batch);
Row r = rs.one();
assertTrue(!r.isNull("[applied]"));
assertEquals(r.getBool("[applied]"), true);
rs = session().execute(batch);
r = rs.one();
assertTrue(!r.isNull("[applied]"));
assertEquals(r.getBool("[applied]"), false);
}
}
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
boolean calledOnNullInput = row.getBool("called_on_null_input");
String language = row.getString("language");
DataType returnType;
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
is210OrHigher || isNullOrAbsent(row, REPLICATE_ON_WRITE)
? DEFAULT_REPLICATE_ON_WRITE
: row.getBool(REPLICATE_ON_WRITE);
this.gcGrace = row.getInt(GC_GRACE);
this.bfFpChance =
isNullOrAbsent(row, POPULATE_CACHE_ON_FLUSH)
? DEFAULT_POPULATE_CACHE_ON_FLUSH
: row.getBool(POPULATE_CACHE_ON_FLUSH);
this.memtableFlushPeriodMs =
is120 || isNullOrAbsent(row, MEMTABLE_FLUSH_PERIOD_MS)
else this.extensions = ImmutableMap.of();
if (is380OrHigher) this.cdc = isNullOrAbsent(row, CDC) ? DEFAULT_CDC : row.getBool(CDC);
else this.cdc = DEFAULT_CDC;
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
@Test(groups = "short")
@CassandraVersion(
value = "2.0.7",
description = "DELETE..IF EXISTS only supported in 2.0.7+ (CASSANDRA-5708)")
public void conditionalDeletesTest() throws Exception {
session()
.execute(String.format("INSERT INTO %s.test_int (k, a, b) VALUES (1, 1, 1)", keyspace));
Statement delete;
Row row;
delete = delete().from(keyspace, TABLE_INT).where(eq("k", 2)).ifExists();
row = session().execute(delete).one();
assertFalse(row.getBool("[applied]"));
delete = delete().from(keyspace, TABLE_INT).where(eq("k", 1)).ifExists();
row = session().execute(delete).one();
assertTrue(row.getBool("[applied]"));
session()
.execute(String.format("INSERT INTO %s.test_int (k, a, b) VALUES (1, 1, 1)", keyspace));
delete =
delete().from(keyspace, TABLE_INT).where(eq("k", 1)).onlyIf(eq("a", 1)).and(eq("b", 2));
row = session().execute(delete).one();
assertFalse(row.getBool("[applied]"));
delete =
delete().from(keyspace, TABLE_INT).where(eq("k", 1)).onlyIf(eq("a", 1)).and(eq("b", 1));
row = session().execute(delete).one();
assertTrue(row.getBool("[applied]"));
}
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
assertThat(rs.getColumnDefinitions()).hasSize(4);
Row row = rs.one();
assertThat(row.getBool("[applied]")).isFalse();
assertThat(row.getInt("a")).isEqualTo(5);
assertThat(row.getInt("b")).isEqualTo(5);
assertThat(rs.getColumnDefinitions()).hasSize(5);
row = rs.one();
assertThat(row.getBool("[applied]")).isFalse();
assertThat(row.getInt("a")).isEqualTo(5);
assertThat(row.getInt("b")).isEqualTo(5);
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
update = update(TABLE_INT).with(set("a", 2)).and(set("b", 2)).where(eq("k", 2)).ifExists();
row = session().execute(update).one();
assertFalse(row.getBool("[applied]"));
assertTrue(row.getBool("[applied]"));
.and(eq("b", 2));
row = session().execute(update).one();
assertFalse(row.getBool("[applied]"));
.and(eq("b", 2));
row = session().execute(update).one();
assertTrue(row.getBool("[applied]"));
.where(eq("k", 1));
row = session().execute(update).one();
assertFalse(row.getBool("[applied]"));
.where(eq("k", 1));
row = session().execute(update).one();
assertTrue(row.getBool("[applied]"));
代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core
boolean isDseGraph = row.getBool("graph");
host.setDseGraphEnabled(isDseGraph);
内容来源于网络,如有侵权,请联系作者删除!