/** * Creates the index using thrift. * * @param tableInfo * the table info * @param cfDef * the cf def * @throws Exception * the exception */ private void createIndexUsingThrift(TableInfo tableInfo, CfDef cfDef) throws Exception { for (IndexInfo indexInfo : tableInfo.getColumnsToBeIndexed()) { for (ColumnDef columnDef : cfDef.getColumn_metadata()) { if (new String(columnDef.getName(), Constants.ENCODING).equals(indexInfo.getColumnName())) { columnDef.setIndex_type(CassandraIndexHelper.getIndexType(indexInfo.getIndexType())); // columnDef.setIndex_name(indexInfo.getIndexName()); } } } cassandra_client.system_update_column_family(cfDef); }
cassandra_client.system_update_column_family(cfDef);
columnFamilyDefToUpdate.setKey_validation_class(CassandraValidationClassMapper .getValidationClass(m.getIdAttribute().getJavaType(), isCql3Enabled(m))); api.system_update_column_family(columnFamilyDefToUpdate);
@Override public String execute(Cassandra.Client cassandra) throws HectorException { try { if (waitForSchemaAgreement) { waitForSchemaAgreement(cassandra); } String schemaId = cassandra.system_update_column_family(toThriftImplementation(cfdef).toThrift()); if (waitForSchemaAgreement) { waitForSchemaAgreement(cassandra); } return schemaId; } catch (Exception e) { throw xtrans.translate(e); } } };
@Override public String execute(Cassandra.Client cassandra) throws HectorException { try { if (waitForSchemaAgreement) { waitForSchemaAgreement(cassandra); } String schemaId = cassandra.system_update_column_family(toThriftImplementation(cfdef).toThrift()); if (waitForSchemaAgreement) { waitForSchemaAgreement(cassandra); } return schemaId; } catch (Exception e) { throw xtrans.translate(e); } } };
private void createIndexUsingThrift(TableInfo tableInfo, CfDef cfDef) throws Exception { for (IndexInfo indexInfo : tableInfo.getColumnsToBeIndexed()) { for (ColumnDef columnDef : cfDef.getColumn_metadata()) { if (new String(columnDef.getName(), Constants.ENCODING).equals(indexInfo.getColumnName())) { columnDef.setIndex_type(CassandraIndexHelper.getIndexType(indexInfo.getIndexType())); } } } cassandra_client.system_update_column_family(cfDef); }
@Override public SchemaChangeResult internalExecute(Client client, ConnectionContext context) throws Exception { precheckSchemaAgreement(client); return new SchemaChangeResponseImpl().setSchemaId(client.system_update_column_family(cfDef)); } }, RunOnce.get());
@Override public String system_update_column_family(CfDef cf_def) throws InvalidRequestException, SchemaDisagreementException, TException { return executeHandlingExceptions(() -> client.system_update_column_family(cf_def)); }
@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());
@Override public SchemaChangeResult internalExecute(Client client, ConnectionContext context) throws Exception { precheckSchemaAgreement(client); return new SchemaChangeResponseImpl().setSchemaId(client.system_update_column_family(cfDef)); } }, RunOnce.get());
@Override public String system_update_column_family(CfDef cf_def) throws InvalidRequestException, TException, SchemaDisagreementException { return client.system_update_column_family(cf_def); }
@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());
@Override 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());
@Override public String system_update_column_family(CfDef cf_def) throws InvalidRequestException, TException, SchemaDisagreementException { return client.system_update_column_family(cf_def); }
@Override public SchemaChangeResult internalExecute(Client client, ConnectionContext context) throws Exception { precheckSchemaAgreement(client); return new SchemaChangeResponseImpl().setSchemaId(client.system_update_column_family(def)); } });
@Override public SchemaChangeResult internalExecute(Client client, ConnectionContext context) throws Exception { precheckSchemaAgreement(client); return new SchemaChangeResponseImpl().setSchemaId(client.system_update_column_family(def)); } });
@Override 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());
@Override public String execute(Cassandra.Client cassandra) throws HectorException { try { if (waitForSchemaAgreement) { waitForSchemaAgreement(cassandra); } String schemaId = cassandra.system_update_column_family(toThriftImplementation(cfdef).toThrift()); if (waitForSchemaAgreement) { waitForSchemaAgreement(cassandra); } return schemaId; } catch (Exception e) { throw xtrans.translate(e); } } };
@Override public String system_update_column_family(CfDef cf_def) throws InvalidRequestException, SchemaDisagreementException, TException { return executeHandlingExceptions(() -> client.system_update_column_family(cf_def)); }
@Override public String system_update_column_family(CfDef cf_def) throws InvalidRequestException, TException, SchemaDisagreementException { return client.system_update_column_family(cf_def); }