Package com.netflix.astyanax.connectionpool.exceptions

Examples of com.netflix.astyanax.connectionpool.exceptions.NotFoundException


  @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();
    }
View Full Code Here


                    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;
View Full Code Here

    @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()) {
View Full Code Here

    @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()) {
View Full Code Here

    @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()) {
View Full Code Here

    @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()) {
View Full Code Here

    @Override
    public ObjectMetadata readMetadata(String objectName) throws Exception, NotFoundException {
        ColumnList<String> columns = keyspace.prepareQuery(cf).getKey(objectName).execute().getResult();

        if (columns.isEmpty()) {
            throw new NotFoundException(objectName);
        }

        return new ObjectMetadata().setObjectSize(columns.getLongValue(getColumnName(Columns.OBJECTSIZE), null))
                .setChunkSize(columns.getIntegerValue(getColumnName(Columns.CHUNKSIZE), null))
                .setChunkCount(columns.getIntegerValue(getColumnName(Columns.CHUNKCOUNT), null))
View Full Code Here

    @Override
    public void deleteObject(String objectName, Integer chunkCount) throws Exception, NotFoundException {
        if (chunkCount == null) {
            ObjectMetadata attr = readMetadata(objectName);
            if (attr.getChunkCount() == null)
                throw new NotFoundException("Object not found :" + objectName);
            chunkCount = attr.getChunkCount();
        }

        MutationBatch m = keyspace.prepareMutationBatch().withRetryPolicy(retryPolicy);
View Full Code Here

                try {
                    attributes = provider.readMetadata(objectName);
                    if (attributes.isValidForRead())
                        break;
                    if (!retry.allowRetry())
                        throw new NotFoundException("File doesn't exists or isn't ready to be read: " + objectName);
                }
                catch (Exception e) {
                    LOG.warn(e.getMessage());
                    if (!retry.allowRetry())
                        throw e;
View Full Code Here

                }
            }
        }
       
        if (column == null)
            throw new NotFoundException("Unique column not found for " + lock.getKey());
        return column;
       
    }
View Full Code Here

TOP

Related Classes of com.netflix.astyanax.connectionpool.exceptions.NotFoundException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.