private CLevel() { db = org.apache.cassandra.db.ConsistencyLevel.valueOf(toString()); thrift = org.apache.cassandra.thrift.ConsistencyLevel.valueOf(toString()); astyanax = com.netflix.astyanax.model.ConsistencyLevel.valueOf("CL_" + toString()); }
/** * set consistency level. * * @param value the new consistencylevel */ private void setConsistencylevel(Object value) { if (value instanceof String) { this.cassandraClientBase.setConsistencyLevel(ConsistencyLevel.valueOf((String) value)); } else if (value instanceof ConsistencyLevel) { this.cassandraClientBase.setConsistencyLevel((ConsistencyLevel) value); } }
public ThriftOperation(CClient client, String writeConsistency, String readConsistency, String cfName, boolean isCounter) { this.client = client; this.wConsistecy = ConsistencyLevel.valueOf(writeConsistency); this.rConsistecy = ConsistencyLevel.valueOf(readConsistency); this.cfName = cfName; this.isCounter = isCounter; }
/** * Constructs an {@link AbstractRangeClient} for the given endpoints. * @param endpoints the possible endpoints to execute the mutations on */ public AbstractRangeClient(List<InetAddress> endpoints) { super("client-" + endpoints); this.endpoints = endpoints; }
/** * Constructs an {@link AbstractColumnFamilyRecordWriter.AbstractRangeClient} for the given endpoints. * * @param endpoints the possible endpoints to execute the mutations on */ public AbstractRangeClient(List<InetAddress> endpoints) { super("client-" + endpoints); this.endpoints = endpoints; }
/** * Command: CONSISTENCYLEVEL AS (ONE | QUORUM ...) * Tree: ^(NODE_CONSISTENCY_LEVEL AS (ONE | QUORUM ...)) * @param statement - tree representing current statement */ private void executeConsistencyLevelStatement(Tree statement) { if (!CliMain.isConnected()) return; String userSuppliedLevel = statement.getChild(0).getText().toUpperCase(); try { consistencyLevel = ConsistencyLevel.valueOf(userSuppliedLevel); } catch (IllegalArgumentException e) { String elements = "ONE, TWO, THREE, QUORUM, ALL, LOCAL_QUORUM, EACH_QUORUM, ANY"; sessionState.out.println(String.format("'%s' is invalid. Available: %s", userSuppliedLevel, elements)); return; } sessionState.out.println(String.format("Consistency level is set to '%s'.", consistencyLevel)); }
/** * set consistency level */ private void setConsistencylevel(Object value) { if (value instanceof String) { this.cassandraClientBase.setConsistencyLevel(ConsistencyLevel.valueOf((String) value)); } else if (value instanceof ConsistencyLevel) { this.cassandraClientBase.setConsistencyLevel((ConsistencyLevel) value); } }
@SuppressWarnings("unchecked") public static LogEntry fromJson(String json) throws CharacterCodingException { if(json == null || "".equals(json.trim())) { return null; } Map<String, Object> jsonObj = (Map<String, Object>) JSONValue.parse(json); ByteBuffer rowKey = ByteBufferUtil.bytes((String) jsonObj.get(LogEntryColumns.ROW.toString())); String keyspace = (String) jsonObj.get(LogEntryColumns.KS.toString()); String columnFamily = (String) jsonObj.get(LogEntryColumns.CF.toString()); String host = (String) jsonObj.get(LogEntryColumns.HOST.toString()); ConsistencyLevel consistencyLevel = ConsistencyLevel.valueOf((String)jsonObj.get(LogEntryColumns.CONSISTENCY_LEVEL.toString())); long timestamp = Long.parseLong((String) (jsonObj.get(LogEntryColumns.TIMESTAMP.toString()))); Collection<String> columnNames = (List<String>) (jsonObj.get(LogEntryColumns.COLUMN_NAMES.toString())); LogEntry result = new LogEntry(keyspace, rowKey, consistencyLevel, host, timestamp, columnNames); result.setStatus(LogEntryStatus.valueOf((String) (jsonObj.get(LogEntryColumns.STATUS.toString())))); result.setColumnFamily(columnFamily); return result; }
.valueOf(getProperties().getProperty(READ_CONSISTENCY_LEVEL_PROPERTY, READ_CONSISTENCY_LEVEL_PROPERTY_DEFAULT)); writeConsistencyLevel = ConsistencyLevel .valueOf(getProperties().getProperty(WRITE_CONSISTENCY_LEVEL_PROPERTY, WRITE_CONSISTENCY_LEVEL_PROPERTY_DEFAULT)); scanConsistencyLevel = ConsistencyLevel .valueOf(getProperties().getProperty(SCAN_CONSISTENCY_LEVEL_PROPERTY, SCAN_CONSISTENCY_LEVEL_PROPERTY_DEFAULT)); deleteConsistencyLevel = ConsistencyLevel .valueOf(getProperties().getProperty(DELETE_CONSISTENCY_LEVEL_PROPERTY, DELETE_CONSISTENCY_LEVEL_PROPERTY_DEFAULT));
private CLevel() { db = org.apache.cassandra.db.ConsistencyLevel.valueOf(toString()); thrift = org.apache.cassandra.thrift.ConsistencyLevel.valueOf(toString()); astyanax = com.netflix.astyanax.model.ConsistencyLevel.valueOf("CL_" + toString()); }
private CLevel() { db = org.apache.cassandra.db.ConsistencyLevel.valueOf(toString()); thrift = org.apache.cassandra.thrift.ConsistencyLevel.valueOf(toString()); astyanax = com.netflix.astyanax.model.ConsistencyLevel.valueOf("CL_" + toString()); }
connectionProps.setProperty(TAG_ACTIVE_CQL_VERSION, version); majorCqlVersion = getMajor(version); defaultConsistencyLevel = ConsistencyLevel.valueOf(props.getProperty(TAG_CONSISTENCY_LEVEL,ConsistencyLevel.ONE.name()));
batchSize = ConfigHelper.getRangeBatchSize(conf); cfName = ConfigHelper.getInputColumnFamily(conf); consistencyLevel = ConsistencyLevel.valueOf(ConfigHelper.getReadConsistencyLevel(conf)); keyspace = ConfigHelper.getInputKeyspace(conf);
: ConfigHelper.getInputSplitSize(conf); cfName = ConfigHelper.getInputColumnFamily(conf); consistencyLevel = ConsistencyLevel.valueOf(ConfigHelper.getReadConsistencyLevel(conf)); keyspace = ConfigHelper.getInputKeyspace(conf); columns = CqlConfigHelper.getInputcolumns(conf);
batchSize = ConfigHelper.getRangeBatchSize(conf); cfName = ConfigHelper.getInputColumnFamily(conf); consistencyLevel = ConsistencyLevel.valueOf(ConfigHelper.getReadConsistencyLevel(conf)); keyspace = ConfigHelper.getInputKeyspace(conf);