Package com.netflix.astyanax.ddl.impl

Examples of com.netflix.astyanax.ddl.impl.SchemaChangeResponseImpl


       
      // Check if keyspace exists
      ResultSet result = session.execute("select * from system.local where keyspace_name = '" + keyspaceName + "'");
      List<Row> rows = result.all();
      if (rows != null && rows.isEmpty()) {
        return new OperationResultImpl<SchemaChangeResult>(Host.NO_HOST, new SchemaChangeResponseImpl().setSchemaId("no-op"), 0);
      }

      try {
        return createKeyspace.call();
      } catch (ConnectionException e) {
View Full Code Here


       
        OperationResult<KeyspaceDefinition> opResult = this.internalDescribeKeyspace();
         
        if (opResult != null && opResult.getResult() != null) {
            return new OperationResultImpl<SchemaChangeResult>(opResult.getHost(),
                        new SchemaChangeResponseImpl().setSchemaId("no-op"),
                        opResult.getLatency());

          } else {
            shouldCreateKeyspace = true;
          }
View Full Code Here

                        new AbstractKeyspaceOperationImpl<SchemaChangeResult>(
                                tracerFactory.newTracer(CassandraOperationType.DROP_COLUMN_FAMILY), getKeyspaceName()) {
                            @Override
                            public SchemaChangeResult internalExecute(Client client, ConnectionContext context) throws Exception {
                                precheckSchemaAgreement(client);
                                return new SchemaChangeResponseImpl()
                                    .setSchemaId(client.system_drop_column_family(columnFamilyName));
                            }
                        }, RunOnce.get());
    }
View Full Code Here

                        new AbstractKeyspaceOperationImpl<SchemaChangeResult>(
                                tracerFactory.newTracer(CassandraOperationType.DROP_KEYSPACE), getKeyspaceName()) {
                            @Override
                            public SchemaChangeResult internalExecute(Client client, ConnectionContext context) throws Exception {
                                precheckSchemaAgreement(client);
                                return new SchemaChangeResponseImpl()
                                    .setSchemaId(client.system_drop_keyspace(getKeyspaceName()));
                            }
                        }, RunOnce.get());
    }
View Full Code Here

                        new AbstractOperationImpl<SchemaChangeResult>(
                                tracerFactory.newTracer(CassandraOperationType.UPDATE_KEYSPACE)) {
                            @Override
                            public SchemaChangeResult internalExecute(Client client, ConnectionContext context) throws Exception {
                                precheckSchemaAgreement(client);
                                return new SchemaChangeResponseImpl().setSchemaId(client.system_update_keyspace(ksDef));
                            }
                        }, RunOnce.get());
    }
View Full Code Here

                        new AbstractOperationImpl<SchemaChangeResult>(
                                tracerFactory.newTracer(CassandraOperationType.ADD_KEYSPACE)) {
                            @Override
                            public SchemaChangeResult internalExecute(Client client, ConnectionContext context) throws Exception {
                                precheckSchemaAgreement(client);
                                return new SchemaChangeResponseImpl().setSchemaId(client.system_add_keyspace(ksDef));
                            }
                        }, RunOnce.get());
    }
View Full Code Here

                                tracerFactory.newTracer(CassandraOperationType.ADD_COLUMN_FAMILY), getKeyspaceName()) {
                            @Override
                            public SchemaChangeResult internalExecute(Client client, ConnectionContext context) throws Exception {
                                precheckSchemaAgreement(client);
                                LOG.info(cfDef.toString());
                                return new SchemaChangeResponseImpl().setSchemaId(client.system_add_column_family(cfDef));
                            }
                        }, RunOnce.get());
    }
View Full Code Here

                        new AbstractKeyspaceOperationImpl<SchemaChangeResult>(
                                tracerFactory.newTracer(CassandraOperationType.ADD_COLUMN_FAMILY), getKeyspaceName()) {
                            @Override
                            public SchemaChangeResult internalExecute(Client client, ConnectionContext context) throws Exception {
                                precheckSchemaAgreement(client);
                                return new SchemaChangeResponseImpl().setSchemaId(client.system_update_column_family(cfDef));
                            }
                        }, RunOnce.get());
    }
View Full Code Here

                            public SchemaChangeResult internalExecute(Client client, ConnectionContext context) throws Exception {
                                ThriftColumnFamilyDefinitionImpl def = new ThriftColumnFamilyDefinitionImpl();
                                def.setFields(options);
                                def.setKeyspace(getKeyspaceName());
                               
                                return new SchemaChangeResponseImpl()
                                    .setSchemaId(client.system_update_column_family(def.getThriftColumnFamilyDefinition()));
                            }
                        }, RunOnce.get());
    }
View Full Code Here

                                tracerFactory.newTracer(CassandraOperationType.ADD_COLUMN_FAMILY), getKeyspaceName()) {
                            @Override
                            public SchemaChangeResult internalExecute(Client client, ConnectionContext context) throws Exception {
                                CfDef def = ThriftUtils.getThriftObjectFromProperties(CfDef.class, props);
                                def.setKeyspace(getKeyspaceName());
                                return new SchemaChangeResponseImpl().setSchemaId(client.system_update_column_family(def));
                            }
                        }, RunOnce.get());
    }
View Full Code Here

TOP

Related Classes of com.netflix.astyanax.ddl.impl.SchemaChangeResponseImpl

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.