@Override public Properties getKeyspaceProperties(String keyspace) throws ConnectionException { KeyspaceDefinition ksDef = this.describeKeyspace(keyspace); if (ksDef == null) throw new NotFoundException(String.format("Keyspace '%s' not found", keyspace)); Properties props = new Properties(); ThriftKeyspaceDefinitionImpl thriftKsDef = (ThriftKeyspaceDefinitionImpl)ksDef; try { for (Entry<Object, Object> prop : thriftKsDef.getProperties().entrySet()) { props.setProperty((String)prop.getKey(), (String) prop.getValue()); } } catch (Exception e) { LOG.error(String.format("Error fetching properties for keyspace '%s'", keyspace)); } return props; }
@Override public OperationResult<R> getOperationResult(ResultSet resultSet) { R result = null; try { result = parseResultSet(resultSet); } catch (NotFoundException e) { e.printStackTrace(); } tracer.success(); OperationResult<R> opResult = new CqlOperationResultImpl<R>(resultSet, result); opResult.setAttemptsCount(retry.getAttemptCount()); return opResult; } };
@Override public Properties getKeyspaceProperties(String keyspace) throws ConnectionException { KeyspaceDefinition ksDef = this.describeKeyspace(keyspace); if (ksDef == null) throw new NotFoundException(String.format("Keyspace '%s' not found", keyspace)); Properties props = new Properties(); ThriftKeyspaceDefinitionImpl thriftKsDef = (ThriftKeyspaceDefinitionImpl)ksDef; try { for (Entry<Object, Object> prop : thriftKsDef.getProperties().entrySet()) { props.setProperty((String)prop.getKey(), (String) prop.getValue()); } } catch (Exception e) { LOG.error(String.format("Error fetching properties for keyspace '%s'", keyspace)); } return props; }
@Override public Properties getColumnFamilyProperties(String keyspace, String columnFamily) throws ConnectionException { KeyspaceDefinition ksDef = this.describeKeyspace(keyspace); ColumnFamilyDefinition cfDef = ksDef.getColumnFamily(columnFamily); if (cfDef == null) throw new NotFoundException(String.format("Column family '%s' in keyspace '%s' not found", columnFamily, keyspace)); Properties props = new Properties(); ThriftColumnFamilyDefinitionImpl thriftCfDef = (ThriftColumnFamilyDefinitionImpl)cfDef; try { for (Entry<Object, Object> prop : thriftCfDef.getProperties().entrySet()) { props.setProperty((String)prop.getKey(), (String) prop.getValue()); } } catch (Exception e) { LOG.error("Error processing column family properties"); } return props; }
@Override public Partitioner getPartitioner() throws ConnectionException { if (partitioner == null) { synchronized(this) { if (partitioner == null) { String partitionerName = this.describePartitioner(); try { partitioner = config.getPartitioner(partitionerName); LOG.info(String.format("Detected partitioner %s for keyspace %s", partitionerName, ksName)); } catch (Exception e) { throw new NotFoundException("Unable to determine partitioner " + partitionerName, e); } } } } return partitioner; }
public String readUniqueColumn() throws Exception { String column = null; for (Entry<String, Long> entry : lock.readLockColumns().entrySet()) { if (entry.getValue() == 0) { if (column == null) { column = entry.getKey().substring(lock.getPrefix().length()); } else { throw new IllegalStateException("Key has multiple locks"); } } } if (column == null) throw new NotFoundException("Unique column not found for " + lock.getKey()); return column; }
@Override public Properties getColumnFamilyProperties(String keyspace, String columnFamily) throws ConnectionException { KeyspaceDefinition ksDef = this.describeKeyspace(keyspace); ColumnFamilyDefinition cfDef = ksDef.getColumnFamily(columnFamily); if (cfDef == null) throw new NotFoundException(String.format("Column family '%s' in keyspace '%s' not found", columnFamily, keyspace)); Properties props = new Properties(); ThriftColumnFamilyDefinitionImpl thriftCfDef = (ThriftColumnFamilyDefinitionImpl)cfDef; try { for (Entry<Object, Object> prop : thriftCfDef.getProperties().entrySet()) { props.setProperty((String)prop.getKey(), (String) prop.getValue()); } } catch (Exception e) { LOG.error("Error processing column family properties"); } return props; }
public String readUniqueColumn() throws Exception { String column = null; for (Entry<String, Long> entry : lock.readLockColumns().entrySet()) { if (entry.getValue() == 0) { if (column == null) { column = entry.getKey().substring(lock.getPrefix().length()); } else { throw new IllegalStateException("Key has multiple locks"); } } } if (column == null) throw new NotFoundException("Unique column not found for " + lock.getKey()); return column; }
@Override public Partitioner getPartitioner() throws ConnectionException { if (partitioner == null) { synchronized(this) { if (partitioner == null) { String partitionerName = this.describePartitioner(); try { partitioner = config.getPartitioner(partitionerName); LOG.info(String.format("Detected partitioner %s for keyspace %s", partitionerName, ksName)); } catch (Exception e) { throw new NotFoundException("Unable to determine partitioner " + partitionerName, e); } } } } return partitioner; }
@Override public Properties getKeyspaceProperties() throws ConnectionException { KeyspaceDefinition ksDef = this.describeKeyspace(); if (ksDef == null) throw new NotFoundException(String.format("Keyspace '%s' not found", getKeyspaceName())); Properties props = new Properties(); ThriftKeyspaceDefinitionImpl thriftKsDef = (ThriftKeyspaceDefinitionImpl)ksDef; try { for (Entry<Object, Object> prop : thriftKsDef.getProperties().entrySet()) { props.setProperty((String)prop.getKey(), (String) prop.getValue()); } } catch (Exception e) { LOG.error(String.format("Error fetching properties for keyspace '%s'", getKeyspaceName())); } return props; }
@Override public Properties getKeyspaceProperties() throws ConnectionException { KeyspaceDefinition ksDef = this.describeKeyspace(); if (ksDef == null) throw new NotFoundException(String.format("Keyspace '%s' not found", getKeyspaceName())); Properties props = new Properties(); ThriftKeyspaceDefinitionImpl thriftKsDef = (ThriftKeyspaceDefinitionImpl)ksDef; try { for (Entry<Object, Object> prop : thriftKsDef.getProperties().entrySet()) { props.setProperty((String)prop.getKey(), (String) prop.getValue()); } } catch (Exception e) { LOG.error(String.format("Error fetching properties for keyspace '%s'", getKeyspaceName())); } return props; }
@Override public Properties getColumnFamilyProperties(String columnFamily) throws ConnectionException { KeyspaceDefinition ksDef = this.describeKeyspace(); ColumnFamilyDefinition cfDef = ksDef.getColumnFamily(columnFamily); if (cfDef == null) throw new NotFoundException(String.format("Column family '%s' in keyspace '%s' not found", columnFamily, getKeyspaceName())); Properties props = new Properties(); ThriftColumnFamilyDefinitionImpl thriftCfDef = (ThriftColumnFamilyDefinitionImpl)cfDef; try { for (Entry<Object, Object> prop : thriftCfDef.getProperties().entrySet()) { props.setProperty((String)prop.getKey(), (String) prop.getValue()); } } catch (Exception e) { LOG.error("Error processing column family properties"); } return props; } }
@Override public Properties getColumnFamilyProperties(String columnFamily) throws ConnectionException { KeyspaceDefinition ksDef = this.describeKeyspace(); ColumnFamilyDefinition cfDef = ksDef.getColumnFamily(columnFamily); if (cfDef == null) throw new NotFoundException(String.format("Column family '%s' in keyspace '%s' not found", columnFamily, getKeyspaceName())); Properties props = new Properties(); ThriftColumnFamilyDefinitionImpl thriftCfDef = (ThriftColumnFamilyDefinitionImpl)cfDef; try { for (Entry<Object, Object> prop : thriftCfDef.getProperties().entrySet()) { props.setProperty((String)prop.getKey(), (String) prop.getValue()); } } catch (Exception e) { LOG.error("Error processing column family properties"); } return props; } }
@Override public Properties getColumnFamilyProperties(String columnFamily) throws ConnectionException { KeyspaceDefinition ksDef = this.describeKeyspace(); ColumnFamilyDefinition cfDef = ksDef.getColumnFamily(columnFamily); if (cfDef == null) throw new NotFoundException(String.format("Column family '%s' in keyspace '%s' not found", columnFamily, getKeyspaceName())); try { return cfDef.getProperties(); } catch (Exception e) { throw new RuntimeException(); } }
break; if (!retry.allowRetry()) throw new NotFoundException("File doesn't exists or isn't ready to be read: " + objectName);
break; if (!retry.allowRetry()) throw new NotFoundException("File doesn't exists or isn't ready to be read: " + objectName);
throw new NotFoundException(this.key.toString() + " has no uniquness lock");
throw new NotFoundException(this.key.toString() + " has no uniquness lock");