Examples of ColumnDef


Examples of org.apache.cassandra.thrift.ColumnDef

        }
    }

    public ColumnDef toThrift()
    {
        ColumnDef cd = new ColumnDef();

        cd.setName(ByteBufferUtil.clone(name));
        cd.setValidation_class(validator.toString());

        cd.setIndex_type(index_type == null
                            ? null
                            : IndexType.valueOf(index_type.name()));
        cd.setIndex_name(index_name == null ? null : index_name);
        cd.setIndex_options(index_options == null ? null : Maps.newHashMap(index_options));

        return cd;
    }
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnDef

            // column name format <cf>:<column name>:<attribute name>
            String[] components = columns.getComparator().getString(column.name()).split(":");
            assert components.length == 3;

            ColumnDef columnDef = contenders.get(components[1]);

            if (columnDef == null)
            {
                columnDef = new ColumnDef();
                contenders.put(components[1], columnDef);
            }

            ColumnDef._Fields field = ColumnDef._Fields.findByName(components[2]);
            columnDef.setFieldValue(field, deserializeValue(column.value(), getValueClass(ColumnDef.class, field.getFieldName())));
        }

        List<ColumnDef> columnDefs = new ArrayList<ColumnDef>();

        for (ColumnDef columnDef : contenders.values())
        {
            if (columnDef.isSetName() && columnDef.isSetValidation_class())
                columnDefs.add(columnDef);
        }

        return columnDefs;
    }
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnDef

                    {
                        case KEY_ALIAS:
                        case COLUMN_ALIAS:
                            throw new InvalidRequestException(String.format("Cannot drop PRIMARY KEY part %s", columnName));
                        case COLUMN_METADATA:
                            ColumnDef toDelete = null;
                            for (ColumnDef columnDef : thriftDef.column_metadata)
                            {
                                if (columnDef.name.equals(columnName.key))
                                    toDelete = columnDef;
                            }
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnDef

        thriftCfDef.default_validation_class = cfDef.default_validation_class;
        thriftCfDef.comment = cfDef.comment;
        thriftCfDef.column_metadata = new ArrayList<ColumnDef>();
        for (ColumnDef columnDef : columnDefs)
        {
            ColumnDef c = new ColumnDef();
            c.name = ByteBufferUtil.clone(columnDef.name);
            c.validation_class = columnDef.getValidation_class();
            c.index_name = columnDef.getIndex_name();
            c.index_type = IndexType.KEYS;
            thriftCfDef.column_metadata.add(c);
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnDef

        return result;
    }

    public ColumnDef toThrift()
    {
        ColumnDef cd = new ColumnDef();

        cd.setName(ByteBufferUtil.clone(name));
        cd.setValidation_class(validator.toString());

        cd.setIndex_type(index_type == null
                            ? null
                            : IndexType.valueOf(index_type.name()));
        cd.setIndex_name(index_name == null ? null : index_name);
        cd.setIndex_options(index_options == null ? null : Maps.newHashMap(index_options));

        return cd;
    }
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnDef

        return result;
    }

    public ColumnDef toThrift()
    {
        ColumnDef cd = new ColumnDef();

        cd.setName(ByteBufferUtil.clone(name));
        cd.setValidation_class(validator.toString());

        cd.setIndex_type(index_type == null
                            ? null
                            : IndexType.valueOf(index_type.name()));
        cd.setIndex_name(index_name == null ? null : index_name);
        cd.setIndex_options(index_options == null ? null : Maps.newHashMap(index_options));

        return cd;
    }
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnDef

            Tuple tuple = TupleFactory.getInstance().newTuple(cfDef.column_metadata.size());
            Iterator<ColumnDef> itera = cfDef.column_metadata.iterator();
            int i = 0;
            while (itera.hasNext())
            {
                ColumnDef cdef = itera.next();
                ByteBuffer columnValue = row.getBytesUnsafe(ByteBufferUtil.string(cdef.name.duplicate()));
                if (columnValue != null)
                {
                    Cell cell = new BufferCell(CellNames.simpleDense(cdef.name), columnValue);
                    AbstractType<?> validator = getValidatorMap(cfDef).get(cdef.name);
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnDef

    }
    return l;
  }

  private ColumnDef toThrift() {
    ColumnDef d = new ColumnDef();
    d.setIndex_name(indexName);
    d.setIndex_type(indexTypeToThrift(indexType));
    d.setName(name);
    d.setValidation_class(validationClass);
    return d;
  }
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnDef

        return thriftDefs;
    }

    public ColumnDef toThrift()
    {
        ColumnDef cd = new ColumnDef();

        cd.setName(ByteBufferUtil.clone(name));
        cd.setValidation_class(validator.toString());
        cd.setIndex_type(indexType == null ? null : IndexType.valueOf(indexType.name()));
        cd.setIndex_name(indexName == null ? null : indexName);
        cd.setIndex_options(indexOptions == null ? null : Maps.newHashMap(indexOptions));

        return cd;
    }
View Full Code Here

Examples of org.apache.cassandra.thrift.ColumnDef

        thriftCfDef.default_validation_class = cfDef.default_validation_class;
        thriftCfDef.comment = cfDef.comment;
        thriftCfDef.column_metadata = new ArrayList<ColumnDef>();
        for (ColumnDef columnDef : columnDefs)
        {
            ColumnDef c = new ColumnDef();
            c.name = ByteBufferUtil.clone(columnDef.name);
            c.validation_class = columnDef.getValidation_class();
            c.index_name = columnDef.getIndex_name();
            c.index_type = IndexType.KEYS;
            thriftCfDef.column_metadata.add(c);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.