Package org.apache.cassandra.db

Examples of org.apache.cassandra.db.IColumn


                    break;
                case VALUE_ALIAS:
                    // This should not happen for SPARSE
                    throw new AssertionError();
                case COLUMN_METADATA:
                    IColumn c = columns.get(name.name.key);
                    col = makeReturnColumn(selector, c);
                    break;
                default:
                    throw new AssertionError();
            }
View Full Code Here


            totalRead++;
            KeySlice ks = rows.get(i++);
            SortedMap<ByteBuffer, IColumn> map = new TreeMap<ByteBuffer, IColumn>(comparator);
            for (ColumnOrSuperColumn cosc : ks.columns)
            {
                IColumn column = unthriftify(cosc);
                map.put(column.name(), column);
            }
            return new Pair<ByteBuffer, SortedMap<ByteBuffer, IColumn>>(ks.key, map);
        }
View Full Code Here

                while (true)
                {
                    if (columns.hasNext())
                    {
                        ColumnOrSuperColumn cosc = columns.next();
                        IColumn column = unthriftify(cosc);
                        ImmutableSortedMap<ByteBuffer, IColumn> map = ImmutableSortedMap.of(column.name(), column);
                        return Pair.<ByteBuffer, SortedMap<ByteBuffer, IColumn>>create(currentRow.key, map);
                    }

                    if (!rows.hasNext())
                        return endOfData();
View Full Code Here

        StringBuilder json = new StringBuilder("{");
       
        Iterator<IColumn> iter = cols.iterator();
        while (iter.hasNext())
        {
            IColumn column = iter.next();
            json.append(asKey(comp.getString(column.name())));
            json.append(quote(FBUtilities.bytesToHex(column.value())));
            if (iter.hasNext())
                json.append(", ");
        }
       
        json.append(" }");
View Full Code Here

            json.append("{ ");

            Iterator<IColumn> iter = cf.getSortedColumns().iterator();
            while (iter.hasNext())
            {
                IColumn column = iter.next();
                json.append(asKey(comparator.getString(column.name())));
                json.append(serializeColumns(column.getSubColumns(), comparator));
                if (iter.hasNext())
                    json.append(", ");
            }
           
            json.append(" }");
View Full Code Here

        {
            Row row = rows.get(0);

            if (row.cf != null)
            {
                IColumn col = row.cf.getColumn(keyCol);

                if (col != null)
                {
                    Collection<IColumn> subCols = col.getSubColumns();

                    if (subCols != null && !subCols.isEmpty())
                    {
                        ByteBuffer idVal = col.getSubColumns().iterator().next().name();
                        Long id = Long.valueOf(ByteBufferUtil.string(idVal));

                        return id;
                    }
                }
View Full Code Here

                    } catch (InterruptedException e1)
                    {
                    }

                    // Read the columns back
                    IColumn supercol = null;
                    int attempts = 0;
                    while (supercol == null && attempts < CassandraUtils.retryAttempts)
                    {
                        try
                        {
                            List<Row> rows = CassandraUtils.robustRead(key, new QueryPath(
                                    CassandraUtils.schemaInfoColumnFamily), Arrays.asList(id), ConsistencyLevel.QUORUM);

                            if (rows == null || rows.size() == 0)
                            {
                                continue;
                            }

                            if (rows.size() == 1)
                            {
                                Row row = rows.get(0);

                                if (row.cf == null || row.cf.isMarkedForDelete())
                                {
                                    continue;
                                }

                                supercol = rows.get(0).cf.getColumn(id);
                            }
                        } catch (IOException e)
                        {
                            // let's try again...
                        }

                        attempts++;
                    }

                    if (supercol == null)
                        throw new IllegalStateException("just wrote " + offset + ", but didn't read it");

                    long minTtl = Long.MAX_VALUE;
                    ByteBuffer winningToken = null;

                    // See which ones we successfully reserved
                    for (IColumn c : supercol.getSubColumns())
                    {

                        // someone already took this id
                        if (!(c instanceof ExpiringColumn) && !(c instanceof DeletedColumn))
                        {
View Full Code Here

            totalRead++;
            KeySlice ks = rows.get(i++);
            SortedMap<ByteBuffer, IColumn> map = new TreeMap<ByteBuffer, IColumn>(comparator);
            for (ColumnOrSuperColumn cosc : ks.columns)
            {
                IColumn column = unthriftify(cosc);
                map.put(column.name(), column);
            }
            return new Pair<ByteBuffer, SortedMap<ByteBuffer, IColumn>>(ks.key, map);
        }
View Full Code Here

            totalRead++;
            KeySlice ks = rows.get(i++);
            SortedMap<ByteBuffer, IColumn> map = new TreeMap<ByteBuffer, IColumn>(comparator);
            for (ColumnOrSuperColumn cosc : ks.columns)
            {
                IColumn column = unthriftify(cosc);
                map.put(column.name(), column);
            }
            return new Pair<ByteBuffer, SortedMap<ByteBuffer, IColumn>>(ks.key, map);
        }
View Full Code Here

                while (true)
                {
                    if (columns.hasNext())
                    {
                        ColumnOrSuperColumn cosc = columns.next();
                        IColumn column = unthriftify(cosc);
                        ImmutableSortedMap<ByteBuffer, IColumn> map = ImmutableSortedMap.of(column.name(), column);
                        return Pair.<ByteBuffer, SortedMap<ByteBuffer, IColumn>>create(currentRow.key, map);
                    }

                    if (!rows.hasNext())
                        return endOfData();
View Full Code Here

TOP

Related Classes of org.apache.cassandra.db.IColumn

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.